29 #define MONGO_INLINE static __inline__
31 #elif defined(__sun) && defined(__SUNPRO_C)
33 #define MONGO_INLINE static inline
36 #define MONGO_INLINE static
37 #ifdef MONGO_STATIC_BUILD
39 #elif defined(MONGO_DLL_BUILD)
40 #define MONGO_EXPORT __declspec(dllexport)
42 #define MONGO_EXPORT __declspec(dllimport)
47 #define MONGO_EXTERN_C_START extern "C" {
48 #define MONGO_EXTERN_C_END }
50 #define MONGO_EXTERN_C_START
51 #define MONGO_EXTERN_C_END
616 MONGO_EXPORT void bson_set_oid_fuzz(
int ( *func )(
void ) );
625 MONGO_EXPORT void bson_set_oid_inc(
int ( *func )(
void ) );
1083 extern void *( *bson_malloc_func )( size_t );
1084 extern void *( *bson_realloc_func )(
void *, size_t );
1155 MONGO_EXPORT double bson_int64_to_double( int64_t i64 );
const char const double d
void bson_builder_error(bson *b)
Invoke the error handler, but do not exit.
const char const char size_t len
const char bson_timestamp_t * ts
bson_fprintf_func bson_fprintf
A key or a string is not valid UTF-8.
int err
Bitfield representing errors or warnings on this buffer.
#define MONGO_EXTERN_C_END
Trying to expand a BSON object which does not own its data block.
double bson_iterator_double_raw(const bson_iterator *i)
Get the double value of the BSON object currently pointed to by the iterator.
void * bson_realloc(void *ptr, size_t size)
Changes the size of allocated memory and checks return value, exiting fatally if realloc() fails...
int bson_init_finished_data_with_copy(bson *b, const char *data)
Initialize a BSON object for reading and copy finalized BSON data from the provided char*...
BSON is valid and UTF-8 compliant.
void bson_numstr(char *str, int i)
const char bson_date_t millis
bson bson_bool_t copyData
#define MONGO_EXTERN_C_START
int dataSize
The number of bytes allocated to char *data.
bson_sprintf_func bson_sprintf
char * data
Pointer to a block of data in this BSON object.
Trying bson_append_finish_object() and not in sub.
int bson_init_size(bson *b, int size)
Initialize a BSON object for building and allocate a data buffer of a given size. ...
void bson_little_endian32(void *outp, const void *inp)
const char const bson_bool_t v
const char const bson_oid_t * oid
const char const bson * data
bson_bool_t ownsData
Whether destroying this object will deallocate its data block.
int(* bson_printf_func)(const char *,...)
int(* bson_fprintf_func)(FILE *, const char *,...)
void bson_big_endian64(void *outp, const void *inp)
bson_bool_t bson_iterator_bool_raw(const bson_iterator *i)
Get the bson_bool_t value of the BSON object currently pointed to by the iterator.
int stackPos
Index of current stack position.
int bson_iterator_string_len(const bson_iterator *i)
Get the string length of the BSON object currently pointed to by the iterator.
void(* bson_free_func)(void *)
const char * name_or_null
Warning: key starts with '$' character.
const char const char const char * opts
int stackSize
Number of elements in the current stack.
bson_bool_t finished
When finished, the BSON object can no longer be modified.
const char int int increment
const char const bson const bson bson * out
void bson_little_endian64(void *outp, const void *inp)
bson_printf_func bson_printf
void bson_fatal(int ok)
Exit fatally.
const char const char size_t size
int64_t bson_iterator_long_raw(const bson_iterator *i)
Get the long value of the BSON object currently pointed to by the iterator.
int bson_iterator_int_raw(const bson_iterator *i)
Get the int value of the BSON object currently pointed to by the iterator.
void(* bson_err_handler)(const char *errmsg)
void bson_big_endian32(void *outp, const void *inp)
int bson_init_unfinished_data(bson *b, char *data, int dataSize, bson_bool_t ownsData)
Initialize a BSON object for building, using the provided char* of the given size.
void bson_fatal_msg(int ok, const char *msg)
Exit fatally with an error message.
const char const bson * bson
const bson const char * name
bson_printf_func bson_errprintf
const char const char * code
const char const char * pattern
int bson_init_finished_data(bson *b, char *data, bson_bool_t ownsData)
Initialize a BSON object for reading and set its data pointer to the provided char*.
Trying to create a BSON object larger than INT_MAX.
int(* bson_sprintf_func)(char *, const char *,...)
void bson_incnumstr(char *str)
size_t * stackPtr
Pointer to the current stack.
int bson_ensure_space(bson *b, const size_t bytesNeeded)
Grow a bson object.
const char const bson_iterator * elem
char * cur
Pointer to the current position.
Trying to modify a finished BSON object.