summaryrefslogtreecommitdiff
path: root/include/ouroboros/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ouroboros/utils.h')
-rw-r--r--include/ouroboros/utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h
index 52873a7e..29fb4367 100644
--- a/include/ouroboros/utils.h
+++ b/include/ouroboros/utils.h
@@ -46,4 +46,14 @@ char * strdup(const char * src);
/* gets the application name */
char * path_strip(char * src);
+/* destroy a ** */
+#define freepp(type, ptr, len) \
+ do { \
+ if (len == 0) \
+ break; \
+ while (len > 0) \
+ free(((type **) ptr)[--len]); \
+ free(ptr); \
+ } while (0);
+
#endif /* OUROBOROS_UTILS_H */