diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-26 18:32:55 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-26 18:32:55 +0530 |
commit | d352dfca1246998fdf30be0be4198ef989fc44c4 (patch) | |
tree | 3f6face3e6cdaca43d3c43cf9775916c4bd3a218 /src/util.c | |
parent | 0fab8d3176e6adee1bb2e44e0386d3295a99261b (diff) |
util: add wrap_ptr()
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1,4 +1,5 @@ #include <ctype.h> +#include <stdlib.h> #include <string.h> #include <util.h> @@ -25,3 +26,11 @@ trim(char *s) { return rtrim(ltrim(s)); } + +ptr_wrapper_t * +wrap_ptr(void *ptr) +{ + ptr_wrapper_t *wrapper = malloc(sizeof(ptr_wrapper_t)); + wrapper->ptr = ptr; + return wrapper; +} |