aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.h
diff options
context:
space:
mode:
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-24 00:29:57 +0000
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-24 00:29:57 +0000
commitfadfd99bc0943f935b80bea6c638a38d3833c5d2 (patch)
tree506e17c43dfc10483b26cd6736863874c3d6f31b /epan/emem.h
parent7148cc61635f52943cc5b7a5037d50896fe6de01 (diff)
add some utility functions that use ep_alloc instead of g_malloc.
ep_memdup ep_strdup ep_strndup ep_strdup_printf git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15018 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/emem.h')
-rw-r--r--epan/emem.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/epan/emem.h b/epan/emem.h
index 9b728037b9..c40efd3100 100644
--- a/epan/emem.h
+++ b/epan/emem.h
@@ -41,8 +41,22 @@
* once when [t]ethereal is initialized to set up the required structures.
*/
void ep_init_chunk(void);
+
/* Allocate memory with a packet lifetime scope */
void *ep_alloc(size_t size);
+
+/* Duplicate a string with a packet lifetime scope */
+gchar* ep_strdup(const gchar* src);
+
+/* Duplicate at most n characters of a string with a packet lifetime scope */
+gchar* ep_strndup(const gchar* src, size_t len);
+
+/* Duplicate a buffer with a packet lifetime scope */
+guint8* ep_memdup(const guint8* src, size_t len);
+
+/* Create a formated string with a packet lifetime scope */
+gchar* ep_strdup_printf(const gchar* fmt, ...);
+
/* release all memory allocated in the previous packet dissector */
void ep_free_all(void);