.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BSON_CONTEXT_T" "3" "Apr 02, 2024" "1.26.2" "libbson" .sp BSON OID Generation Context .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include typedef enum { BSON_CONTEXT_NONE = 0, BSON_CONTEXT_DISABLE_PID_CACHE = (1 << 2), } bson_context_flags_t; typedef struct _bson_context_t bson_context_t; bson_context_t * bson_context_get_default (void) BSON_GNUC_CONST; bson_context_t * bson_context_new (bson_context_flags_t flags); void bson_context_destroy (bson_context_t *context); .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp The \fI\%bson_context_t\fP structure is context for generation of BSON Object IDs. This context allows overriding behavior of generating ObjectIDs. The flags \fBBSON_CONTEXT_NONE\fP, \fBBSON_CONTEXT_THREAD_SAFE\fP, and \fBBSON_CONTEXT_DISABLE_PID_CACHE\fP are the only ones used. The others have no effect. .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX #include int main (int argc, char *argv[]) { bson_context_t *ctx = NULL; bson_oid_t oid; /* use default context, via bson_context_get_default() */ bson_oid_init (&oid, NULL); /* specify a local context for additional control */ ctx = bson_context_new (BSON_CONTEXT_NONE); bson_oid_init (&oid, ctx); bson_context_destroy (ctx); return 0; } .EE .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .