![]() |
Lucciefr
Lua code caving, injection and exploration framework
|
#include "msgpack.h"
Go to the source code of this file.
Macros | |
#define | msgpack_pack_string(pk, s) msgpack_pack_lstring(pk, s, s ? strlen(s) : 0) |
macro to pack NUL-terminated string, uses strlen() to retrieve length | |
#define | msgpack_pack_literal(pk, s) msgpack_pack_lstring(pk, "" s, sizeof(s)-1) |
macro to pack a (constant) string literal | |
#define | msgpack_object_from_string(object, s) msgpack_object_from_lstring(object, s, s ? strlen(s) : 0) |
macro to create object from NUL-terminated string, uses strlen() for length | |
#define | msgpack_object_from_literal(object, s) msgpack_object_from_lstring(object, "" s, sizeof(s)-1) |
macro to create msgpack object from (constant) string literal | |
Functions | |
int | msgpack_pack_lstring (msgpack_packer *pk, const char *str, size_t len) |
Pack string with a given length. More... | |
void | msgpack_object_from_lstring (msgpack_object *object, const char *str, size_t len) |
Create msgpack object from string (with given length). More... | |
size_t | msgpack_object_str_fwrite (msgpack_object_str str, FILE *stream) |
Write msgpack_object_str to a stream. More... | |
void msgpack_object_from_lstring | ( | msgpack_object * | object, |
const char * | str, | ||
size_t | len | ||
) |
Create msgpack object from string (with given length).
Also translates NULL
to a "nil" object.
str
pointer! size_t msgpack_object_str_fwrite | ( | msgpack_object_str | str, |
FILE * | stream | ||
) |
Write msgpack_object_str to a stream.
Since a string-type msgpack_object_str
isn't NUL-terminated, it's a bit awkward to output; maybe this helps.
int msgpack_pack_lstring | ( | msgpack_packer * | pk, |
const char * | str, | ||
size_t | len | ||
) |
Pack string with a given length.
msgpack-c has an awful syntax for string packing (requiring two calls for string length and actual content), work around that - by introducing a cleaner "string + length" interface.