.TH "corm_htok" 3 "corm" \" -*- nroff -*- .ad l .nh .SH NAME corm_htok \- HTOK v4 Native Binary Envelope API .PP \- Pack and unpack HTOK v4 binary containers directly in C\&. .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "void \fBcorm_htok_set_tok_decoder\fP (corm_htok_tok_decoder_fn fn)" .br .RI "Register an optional token decoder callback for HTOK token-packed fields\&. " .ti -1c .RI "int \fBcorm_htok_pack\fP (const char *json_str, size_t json_len, uint8_t **out_bytes, size_t *out_len)" .br .RI "Pack a JSON string representation of a memory envelope into HTOK v4 binary bytes\&. " .ti -1c .RI "int \fBcorm_htok_unpack\fP (const uint8_t *bytes, size_t len, char **out_json, size_t *out_json_len)" .br .RI "Unpack an HTOK v4 binary buffer into a clean JSON string representation\&. " .in -1c .SH "Detailed Description" .PP Pack and unpack HTOK v4 binary containers directly in C\&. .SH "Function Documentation" .PP .SS "int corm_htok_pack (const char * json_str, size_t json_len, uint8_t ** out_bytes, size_t * out_len)" .PP Pack a JSON string representation of a memory envelope into HTOK v4 binary bytes\&. .PP \fBParameters\fP .RS 4 \fIjson_str\fP Pointer to JSON string\&. .br \fIjson_len\fP Length of JSON string in bytes (or 0 for strlen)\&. .br \fIout_bytes\fP Output pointer receiving allocated binary buffer (caller frees with free())\&. .br \fIout_len\fP Output pointer receiving size in bytes of binary buffer\&. .RE .PP \fBReturns\fP .RS 4 0 on success, negative error code on failure\&. .RE .PP .SS "void corm_htok_set_tok_decoder (corm_htok_tok_decoder_fn fn)" .PP Register an optional token decoder callback for HTOK token-packed fields\&. When set, corm_htok_unpack passes TYPE_TOKENS fields to this decoder to recover the original UTF-8 text instead of passing the raw packed bytes\&. .SS "int corm_htok_unpack (const uint8_t * bytes, size_t len, char ** out_json, size_t * out_json_len)" .PP Unpack an HTOK v4 binary buffer into a clean JSON string representation\&. .PP \fBParameters\fP .RS 4 \fIbytes\fP Pointer to binary HTOK v4 data\&. .br \fIlen\fP Size of binary data in bytes\&. .br \fIout_json\fP Output pointer receiving allocated JSON string (caller frees with free())\&. .br \fIout_json_len\fP Output pointer receiving length of JSON string\&. .RE .PP \fBReturns\fP .RS 4 0 on success, negative error code on failure\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for corm from the source code\&.