aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsclient/inbound.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmdsclient/inbound.h')
-rw-r--r--src/libmdsclient/inbound.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libmdsclient/inbound.h b/src/libmdsclient/inbound.h
index f0e3d20..87b96f4 100644
--- a/src/libmdsclient/inbound.h
+++ b/src/libmdsclient/inbound.h
@@ -76,6 +76,15 @@ typedef struct libmds_message
size_t buffer_off;
/**
+ * Zero unless the structure is flattend, otherwise
+ * the size of the object (semiinternal data)
+ *
+ * Flattened means that all pointers are subpointers
+ * of the object itself
+ */
+ size_t flattened;
+
+ /**
* 0 while reading headers, 1 while reading payload, and 2 when done (internal data)
*/
int stage;
@@ -108,6 +117,19 @@ __attribute__((nonnull))
void libmds_message_destroy(libmds_message_t* restrict this);
/**
+ * Release all resources in a message, should
+ * be done even if initialisation fails
+ *
+ * @param this The message
+ * @return The duplicate, you do not need to call `libmds_message_destroy`
+ * on it before you call `free` on it. However, you cannot use
+ * this is an `libmds_message_t` array (libmds_message_t*), only
+ * in an `libmds_message_t*` array (libmds_message_t**).
+ */
+__attribute__((nonnull, malloc, warn_unused_result))
+libmds_message_t* libmds_message_duplicate(libmds_message_t* restrict this);
+
+/**
* Read the next message from a file descriptor
*
* @param this Memory slot in which to store the new message