ZstrIOArg
Description
Explicit raw C-string I/O descriptor with allocator provenance.
This is used when a formatted I/O call needs to read into or rewrite a caller-owned zero-terminated string pointer whose storage may already be managed by a specific allocator.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in,out | Address of the char * / const char * variable. |
allocator |
in | Allocator responsible for any existing pointed-to storage. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:1395:
}
bool _write_ZstrAlloc(Str *o, FmtInfo *fmt_info, ZstrIOArg *arg) {
const char **value = NULL;- In
Io.c:2822:
}
const char *_read_ZstrAlloc(const char *i, FmtInfo *fmt_info, ZstrIOArg *arg) {
char **out = NULL;
char *previous = NULL;- In
Io.h:135:
void *value;
Allocator *allocator;
} ZstrIOArg;
#ifdef __cplusplus- In
Io.h:174:
#ifdef __cplusplus
# define ZstrIO(zstr, alloc_ptr) \
TO_TYPE_SPECIFIC_IO(ZstrAlloc, &LVAL(((ZstrIOArg) {.value = (void *)&(zstr), .allocator = (alloc_ptr)})))
#else
# define ZstrIO(zstr, alloc_ptr) \- In
Io.h:180:
.writer = (TypeSpecificWriter)_write_ZstrAlloc, \
.reader = (TypeSpecificReader)_read_ZstrAlloc, \
.data = &((ZstrIOArg) {.value = (void *)&(zstr), .allocator = (alloc_ptr)}), \
})
#endif- In
Io.h:573:
bool _write_i64(Str *o, FmtInfo *fmt_info, i64 *v);
bool _write_Zstr(Str *o, FmtInfo *fmt_info, const char **s);
bool _write_ZstrAlloc(Str *o, FmtInfo *fmt_info, ZstrIOArg *arg);
bool _write_UnsupportedType(Str *o, FmtInfo *fmt_info, const char **s);
bool _write_f32(Str *o, FmtInfo *fmt_info, f32 *v);- In
Io.h:591:
const char *_read_i64(const char *i, FmtInfo *fmt_info, i64 *v);
const char *_read_Zstr(const char *i, FmtInfo *fmt_info, const char **v);
const char *_read_ZstrAlloc(const char *i, FmtInfo *fmt_info, ZstrIOArg *arg);
const char *_read_UnsupportedType(const char *i, FmtInfo *fmt_info, const char **s);
const char *_read_f32(const char *i, FmtInfo *fmt_info, f32 *v);
Last updated on