diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2005-07-24 00:29:57 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2005-07-24 00:29:57 +0000 |
commit | d9c22732626fd6a54589abb83e5c9b4203ad8582 (patch) | |
tree | 506e17c43dfc10483b26cd6736863874c3d6f31b /epan/emem.h | |
parent | 38f827806af6f82573e4ef8a97b5d2805c341aad (diff) | |
download | wireshark-d9c22732626fd6a54589abb83e5c9b4203ad8582.tar.gz wireshark-d9c22732626fd6a54589abb83e5c9b4203ad8582.tar.bz2 wireshark-d9c22732626fd6a54589abb83e5c9b4203ad8582.zip |
add some utility functions that use ep_alloc instead of g_malloc.
ep_memdup
ep_strdup
ep_strndup
ep_strdup_printf
svn path=/trunk/; revision=15018
Diffstat (limited to 'epan/emem.h')
-rw-r--r-- | epan/emem.h | 14 |
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); |