BSON_APPEND_TIMEVAL(3)
β¨ BSON_APPEND_TIMEVAL β¨
okay so bestie, this one's a libbson function and it's literally the glow-up for people who live in struct timeval land instead of millisecond land π
πΈ SYNOPSIS πΈ
#define BSON_APPEND_TIMEVAL(b, key, val) \
bson_append_timeval (b, key, (int) strlen (key), val)
bool
bson_append_timeval (bson_t *bson,
const char *key,
int key_length,
struct timeval *value);
π PARAMETERS π
bsonβ abson_t. that's the doc you're stuffing stuff into, main character energy π«Άkeyβ an ASCII C string holding the name of the field. like the little label on the thing π·οΈkey_lengthβ the length ofkeyin bytes, or-1if you want it to just figure out the length withstrlen(). lowkey the-1is the lazy-girl option and we respect it πvalueβ astruct timeval. yup, the whole struct, not some sad little number π
π¦ DESCRIPTION π¦
so bson_append_timeval() is a helper function β a lil bestie that does the translating for you β and what it takes is a struct timeval instead of milliseconds since the UNIX epoch. that's the whole vibe. no cap, that's it β¨
β RETURNS β
it returns true if the operation was applied successfully π
heads up though: the function will fail if appending the value growsbsonlarger thanINT32_MAX. so like, don't be out here trying to cram a whole universe into it, okay? π that's the limit, fr fr π
π AUTHOR π
MongoDB, Inc π
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page, bestie β you ate that π this was libbson version 2.5.6, dated Oct 09, 2026, signing off with a lil sparkle π§β¨π
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms