summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/memdebug.c9
-rw-r--r--src/core/memdebug.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core/memdebug.c b/src/core/memdebug.c
index 765fe5d1..807d1c56 100644
--- a/src/core/memdebug.c
+++ b/src/core/memdebug.c
@@ -286,6 +286,15 @@ char *ig_strjoinv(const char *file, int line, const char *sepa, char **array)
return ret;
}
+char *ig_dirname(const char *file, int line, const char *fname)
+{
+ char *ret;
+
+ ret = g_dirname(fname);
+ data_add(ret, INT_MIN, file, line);
+ return ret;
+}
+
void ig_profile_line(void *key, MEM_REC *rec)
{
char *data;
diff --git a/src/core/memdebug.h b/src/core/memdebug.h
index 1cf187f1..16534741 100644
--- a/src/core/memdebug.h
+++ b/src/core/memdebug.h
@@ -15,6 +15,7 @@ void ig_free(void *p);
GString *ig_string_new(const char *file, int line, const char *str);
void ig_string_free(const char *file, int line, GString *str, int freeit);
char *ig_strjoinv(const char *file, int line, const char *sepa, char **array);
+char *ig_dirname(const char *file, int line, const char *fname);
#define g_malloc(a) ig_malloc(a, __FILE__, __LINE__)
#define g_malloc0(a) ig_malloc0(a, __FILE__, __LINE__)
@@ -28,4 +29,5 @@ char *ig_strjoinv(const char *file, int line, const char *sepa, char **array);
#define g_string_new(a) ig_string_new(__FILE__, __LINE__, a)
#define g_string_free(a, b) ig_string_free(__FILE__, __LINE__, a, b)
#define g_strjoinv(a,b) ig_strjoinv(__FILE__, __LINE__, a, b)
+#define g_dirname(a) ig_dirname(__FILE__, __LINE__, a)
#endif