31 #ifndef HAVE_UBJS_WRITER 32 #define HAVE_UBJS_WRITER 80 struct ubjs_writer_context
103 ubjs_writer_context *context);
Definitions of common types, ubjson markers and some utilities.
struct ubjs_prmtv ubjs_prmtv
Definition: ubjs_primitives.h:165
void(* ubjs_writer_context_would_write)(ubjs_writer_context *this, uint8_t *data, unsigned int length)
Callback when writer produced bytes out of a primitive.
Definition: ubjs_writer.h:60
struct ubjs_writer ubjs_writer
Writer itself.
Definition: ubjs_writer.h:49
ubjs_writer_context_would_write would_write
Definition: ubjs_writer.h:85
User-provided context - callbacks and userdata.
Definition: ubjs_writer.h:80
void * userdata
Definition: ubjs_writer.h:83
void(* ubjs_writer_context_would_print)(ubjs_writer_context *this, char *data, unsigned int length)
Callback when writer produced pretty-printed version of a primitive.
Definition: ubjs_writer.h:69
Wrappers over ubjson primitive types.
void(* ubjs_writer_context_free)(ubjs_writer_context *this)
Callback when writer is about to be free-d.
Definition: ubjs_writer.h:77
ubjs_result
Enum that defines the result of a method.
Definition: ubjs_common.h:73
UBJS_EXPORT ubjs_result ubjs_writer_free(ubjs_writer **pthis)
Frees the writer.
Definition: ubjs_writer_noncontainers.c:81
ubjs_writer_context_would_print would_print
Definition: ubjs_writer.h:87
UBJS_EXPORT ubjs_result ubjs_writer_write(ubjs_writer *this, ubjs_prmtv *object)
Writes a bytestream out of a primitive.
Definition: ubjs_writer_noncontainers.c:148
ubjs_writer_context_free free
Definition: ubjs_writer.h:89
UBJS_EXPORT ubjs_result ubjs_writer_print(ubjs_writer *this, ubjs_prmtv *object)
Pretty-prints out of a primitive.
Definition: ubjs_writer_noncontainers.c:173
UBJS_EXPORT ubjs_result ubjs_writer_new(ubjs_library *lib, ubjs_writer **pthis, ubjs_writer_context *context)
Creates new writer.
Definition: ubjs_writer_noncontainers.c:64
UBJS_EXPORT ubjs_result ubjs_writer_get_context(ubjs_writer *this, ubjs_writer_context **pcontext)
Gets user context from the writer.
Definition: ubjs_writer_noncontainers.c:99
struct ubjs_library ubjs_library
Library handle.
Definition: ubjs_common.h:203