aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.h
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2005-08-16 00:55:08 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2005-08-16 00:55:08 +0000
commit0de8a67599d520ec5126181f1da8ccfa9f4921ef (patch)
tree2ded7df1e7ff8da378718f5ae2fccddecdddcf9a /epan/emem.h
parent1c37d9592a801b23dd32b074dd3479f2d606c593 (diff)
more allocators se_alloc0() se_memdups() se_strdup() se_strndup() se_strdup_printf()
svn path=/trunk/; revision=15364
Diffstat (limited to 'epan/emem.h')
-rw-r--r--epan/emem.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/epan/emem.h b/epan/emem.h
index d2a9487328..f7919cf1ed 100644
--- a/epan/emem.h
+++ b/epan/emem.h
@@ -60,13 +60,14 @@ 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, ...);
-/* allocates with a packet lifetime scope a array of type made of num elements */
+/* allocates with a packet lifetime scope an array of type made of num elements */
#define ep_alloc_array(type,num) (type*)ep_alloc(sizeof(type)*(num))
/*
* Splits a string into a maximum of max_tokens pieces, using the given
* delimiter. If max_tokens is reached, the remainder of string is appended
- * to the last token.
+ * to the last token. Consecutive delimiters are treated as a single delimiter.
+ *
* the vector and all the strings are allocated with packet lifetime scope
*/
gchar** ep_strsplit(const gchar* string, const gchar* delimiter, int max_tokens);
@@ -96,6 +97,24 @@ void se_init_chunk(void);
/* Allocate memory with a capture lifetime scope */
void *se_alloc(size_t size);
+/* Allocate memory with a capture lifetime scope and fill it with zeros*/
+void* se_alloc0(size_t size);
+
+/* Duplicate a string with a capture lifetime scope */
+gchar* se_strdup(const gchar* src);
+
+/* Duplicate at most n characters of a string with a capture lifetime scope */
+gchar* se_strndup(const gchar* src, size_t len);
+
+/* Duplicate a buffer with a capture lifetime scope */
+guint8* se_memdup(const guint8* src, size_t len);
+
+/* Create a formated string with a capture lifetime scope */
+gchar* se_strdup_printf(const gchar* fmt, ...);
+
+/* allocates with a capture lifetime scope an array of type made of num elements */
+#define se_alloc_array(type,num) (type*)ep_alloc(sizeof(type)*(num))
+
/* release all memory allocated */
void se_free_all(void);