aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2014-04-25 01:19:57 +0200
committerTharre <tharre3@gmail.com>2014-04-25 02:31:00 +0200
commitdf54e75541786fb0d53b09706b35ed15b1cc493f (patch)
tree8af087c1658b14d6d4cbaa8629606153d4125e19 /src/util.h
parent4ad535e7700faab521df5dfb2761f8e9a408d2b1 (diff)
downloadredo-df54e75541786fb0d53b09706b35ed15b1cc493f.tar.gz
redo-df54e75541786fb0d53b09706b35ed15b1cc493f.tar.xz
redo-df54e75541786fb0d53b09706b35ed15b1cc493f.zip
safe_strdup() and variable progname in util.c
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util.h b/src/util.h
index abfb666..86310fc 100644
--- a/src/util.h
+++ b/src/util.h
@@ -4,19 +4,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include "../config.h"
-#define safe_malloc(size) safe_malloc_(size, __FILENAME__, __LINE__)
-#define safe_realloc(ptr, size) safe_realloc_(ptr, size, __FILENAME__, __LINE__)
-#define safe_fopen(path, mode) safe_fopen_(path, mode, __FILENAME__, __LINE__)
+
+#define _PROGNAME "redo"
+
+#define safe_malloc(size) safe_malloc_(size, _FILENAME, __LINE__)
+#define safe_realloc(ptr, size) safe_realloc_(ptr, size, _FILENAME, __LINE__)
+#define safe_fopen(path, mode) safe_fopen_(path, mode, _FILENAME, __LINE__)
+#define safe_strdup(str) safe_strdup_(str, _FILENAME, __LINE__)
extern void *safe_malloc_(size_t size, const char *file, unsigned int line);
extern void *safe_realloc_(void *ptr, size_t size, const char *file, unsigned int line);
+extern char *safe_strdup_(const char *str, const char *file, unsigned line);
extern FILE *safe_fopen_(const char *path, const char *mode,
const char *file, unsigned int line);
extern char *concat(size_t count, ...);
-extern char *ec_strdup(const char* str);
-extern char *strdup(const char *str);
extern char *xbasename(const char *path);
#endif