BSON_ITER_CODE(3)
π BSON_ITER_CODE(3) π
okay so this is a libbson manpage, bestie β it's giving "how do I get the code string out of a BSON iterator" and honestly it's so simple it's iconic β¨
πΈ SYNOPSIS πΈ
like, here's the whole vibe in code form:
#define BSON_ITER_HOLDS_CODE(iter) (bson_iter_type ((iter)) == BSON_TYPE_CODE)
const char *
bson_iter_code (const bson_iter_t *iter, uint32_t *length);
no cap, that macro is literally just a vibe check on the iterator type π«Ά
π PARAMETERS π
iterβ abson_iter_t. that's your iterator, your main character πlengthβ a location to stash the length of the UTF-8 encoded stringβ¦ orNULLif you literally don't care about the length. your call, queen π
π¦ DESCRIPTION π¦
so bson_iter_code() hands you back the contents of a BSON_TYPE_CODE field. that's it, that's the whole function π
the length of the string gets stashed in length β but only if length is non-NULL. if you passed NULL, she just doesn't bother. respect π
β οΈ the tea: it is invalid to call this function on a field that is not of typeBSON_TYPE_CODE. like, do not do that. check withBSON_ITER_HOLDS_CODE(iter)first, or you're gonna have a bad time ππ
β RETURNS β
a UTF-8 encoded string π§ and listen β this string should not be modified or freed. it's not yours, bestie, don't touch it, don't free it, just look at it and appreciate it πβ¨
π AUTHOR π
MongoDB, Inc β the icons themselves π
π COPYRIGHT π
2009-present, MongoDB, Inc. β periodt, protect the copyright π«Ά
okay that's the whole page, ily bestie, go forth and read those BSON_TYPE_CODE fields responsibly π
libbson 2.5.6 Β· Oct 09, 2026 β mwah, catch you on the next manpage ππ
π¦ 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