31 #ifndef HAVE_UBJS_WRITER 32 #define HAVE_UBJS_WRITER 81 struct ubjs_writer_context
104 ubjs_writer_context *context);
Library handle, allocation callbacks, glues.
Definitions of common types, ubjson markers and some utilities.
struct ubjs_prmtv ubjs_prmtv
Definition: ubjs_primitives.h:166
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:61
Library handle.
Definition: ubjs_library.h:827
struct ubjs_writer ubjs_writer
Writer itself.
Definition: ubjs_writer.h:50
ubjs_writer_context_would_write would_write
Definition: ubjs_writer.h:86
User-provided context - callbacks and userdata.
Definition: ubjs_writer.h:81
void * userdata
Definition: ubjs_writer.h:84
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:70
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:78
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:78
ubjs_writer_context_would_print would_print
Definition: ubjs_writer.h:88
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:145
ubjs_writer_context_free free
Definition: ubjs_writer.h:90
UBJS_EXPORT ubjs_result ubjs_writer_print(ubjs_writer *this, ubjs_prmtv *object)
Pretty-prints out of a primitive.
Definition: ubjs_writer_noncontainers.c:170
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:61
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:96