Oh my jod

This commit is contained in:
Sasha Koshka
2023-11-07 03:13:13 -05:00
parent 20dca2d2e4
commit e57e93c8b6
2 changed files with 50 additions and 6 deletions

View File

@@ -9,14 +9,26 @@
variable length strings and files. */
typedef struct _XmdBuffer XmdBuffer;
/* XmdBufferNew creates a new buffer with the specified element size. */
XmdBuffer *XmdBufferNew (Cardinal size);
/* XmdBufferNew creates a new buffer that contains the specified type. */
#define XmdBufferNew(type) _XmdBufferNew(sizeof(type));
XmdBuffer *_XmdBufferNew (Cardinal size);
/* XmdBufferPush adds a new element to the buffer. */
void XmdBufferPush (XmdBuffer *buffer, void *element);
/* XmdBufferPop copies the last element into element, and removes it from the
buffer. */
void XmdBufferPop (XmdBuffer *buffer, void *element);
/* XmdBufferPoke sets a single element of the buffer. */
void XmdBufferPoke (XmdBuffer *buffer, Cardinal index, void *element);
/* XmdBufferPeek copies the value of a single element of the buffer into
element. */
void XmdBufferPeek (XmdBuffer *buffer, Cardinal index, void *element);
/* XmdBufferBreak frees the buffer without freeing its data. Its data is
returned and must be freed manually at some point. */
returned and must be freed manually using XtFree() at some point. */
void *XmdBufferBreak (XmdBuffer *buffer);
/* XmdBufferFree frees the buffer and any data associated with it. */