summaryrefslogtreecommitdiffhomepage
path: root/src/utils.h
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-18 17:49:14 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-18 17:49:14 +0000
commitce4687fbf96c8edfbd10b5235f8fdd9c529fa744 (patch)
treeb5c9a01b6e90c4da4b09542c12fe7d7d16b75e48 /src/utils.h
parentdc18888c839a0db809e1adc4c6274457b7ea6f47 (diff)
Added the debuggin_strdup() function and the associated safestrdup()
macro. Also, added asserts to the other debugging_* functions.
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utils.h b/src/utils.h
index a24b23a..f3861e2 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1,4 +1,4 @@
-/* $Id: utils.h,v 1.15 2002-04-18 16:57:06 rjkaes Exp $
+/* $Id: utils.h,v 1.16 2002-04-18 17:49:14 rjkaes Exp $
*
* See 'utils.h' for a detailed description.
*
@@ -63,16 +63,20 @@ extern void *debugging_malloc(size_t size, const char *file,
extern void debugging_free(void *ptr, const char *file, unsigned long line);
extern void *debugging_realloc(void *ptr, size_t size, const char *file,
unsigned long line);
+extern char *debugging_strdup(const char* s, const char* file,
+ unsigned long line);
# define safecalloc(x, y) debugging_calloc(x, y, __FILE__, __LINE__)
# define safemalloc(x) debugging_malloc(x, __FILE__, __LINE__)
# define saferealloc(x, y) debugging_realloc(x, y, __FILE__, __LINE__)
# define safefree(x) debugging_free(x, __FILE__, __LINE__)
+# define safestrdup(x) debugging_strdup(x, __FILE__, __LINE__)
#else
# define safecalloc(x, y) calloc(x, y)
# define safemalloc(x) malloc(x)
# define saferealloc(x, y) realloc(x, y)
# define safefree(x) free(x)
+# define safestrdup(x) strdup(x)
#endif
#endif