obj.h(3)
💖 NAME 💖
okay so bestie, welcome to obj.h — the composite objects era 💅 (this is the obj.h(3) page from the Library Functions Manual, section 3, if you're keeping track 🎀).
✨ SYNOPSIS ✨
#include 'bee2/defs.h'
🦋 Classes
struct obj_hdr_t— the object header, aka the little crown the object wears 👑
🌸 Macros
#define objKeep(obj)— how big the object is#define objPCount(obj)— how many pointers#define objOCount(obj)— how many pointers-to-objects#define objPtr(obj, i, type)— a pointer#define objCPtr(obj, i, type)— a const pointer#define objEnd(obj, type)— where the object ends
🔥 Functions
bool_t objIsOperable(const void *obj)— is this object operable?bool_t objIsOperable2(const void *obj)— is this single object, all by itself, operable?void objCopy(void *dest, const void *src)— copy an objectvoid objAppend(void *dest, const void *src, size_t i)— attach an object
🌈 DESCRIPTION 🌈
(yeah, this is the "Подробное описание" part, it's giving detailed fr fr)
An object is a labeled fragment of memory. The labeling is done with pointers, and those pointers point at different regions inside that fragment. The regions being pointed at can be other objects, and those are called nested objects. The references to internal regions get refreshed whenever the object moves — like, they follow it around, loyal 💖.
Every object starts with a header of type obj_hdr_t. In that header you get:
- the size of the memory region the object occupies (
keep), - the number of pointers (
p_count), - the number of pointers to referenced objects (
o_count).
Right after the header comes the pointer table. Pointers to objects go at the very front of the list, main character first ✨.
The pointers in the table can reference not just internal memory regions but external ones too — meaning regions sitting outside the fragment that belongs to the object. Those external references stay constant when the object moves. No cap. 🫶
💅 MACROS 💅
#define objCPtr( obj, i, type)
The macro definition:
(((const type* const*)((const octet*)(obj) + sizeof(obj_hdr_t)))[i])
This pulls out the i-th element of the pointer table, interpreted as a pointer to the type const type. 🎀
#define objEnd( obj, type)
The macro definition:
((type*)((octet*)(obj) + objKeep(obj)))
This gives you the address of the end of the memory fragment occupied by the object obj. That address gets interpreted as a pointer to the type type. 🦋
#define objPtr( obj, i, type)
The macro definition:
(((type**)((octet*)(obj) + sizeof(obj_hdr_t)))[i])
This pulls out the i-th element of the pointer table, interpreted as a pointer to the type type. 💜
🔥 FUNCTIONS 🔥
void objAppend (void * dest, const void * src, size_t i)
The src object gets written to the end of the src object. (yes, that's literally what the page says, and I'm just the messenger 💀). A reference to a copy of src gets written into the i-th cell of the dest pointer table. The length of dest grows by the length of src.
Precondition (do not skip this, bestie, it's not optional 🙈)
- The
srcanddestobjects are operable. - At the address
objEnd(dest, void),objKeep(src)octets are reserved. i < objOCount(dest).
Arguments
- dest — the container object
- src — the object being attached
- i — the number of the object being attached
void objCopy (void * dest, const void * src)
The src object gets copied to the address dest. 🌸
Precondition
- The
srcobject is operable. - At the address
dest,objKeep(src)octets are reserved.
Note
- During the copy, the pointers get adjusted — including the pointers to nested objects. ✨
Arguments
- dest — the destination object
- src — the source object
bool_t objIsOperable (const void * obj)
Checks whether the object obj is operable and whether the objects nested inside it are operable too. Full vibe check on the whole squad 🫶.
Returns
- The operability flag.
Arguments
- obj — the object
bool_t objIsOperable2 (const void * obj)
Checks whether the object obj is operable. The operability of the objects nested in obj is not checked — nope, not doing that today 💅.
Returns
- The operability flag.
Arguments
- obj — the object
👑 AUTHOR 👑
Automatically generated by Doxygen for the Bee2 Library, straight out of the source text. 🤖✨
and that's the whole page, bestie — auto-generated by Doxygen for the Bee2 Library from the source text, stamped Вс 25 Янв 2026 00:00:00 (that's Sun Jan 25 2026, 00:00:00, for the calendar girlies 🎀), brought to you by the Bee2 Library and filed under obj.h(3). slay, read it again, periodt 💖🌈👑
📦 where this page comes from
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms