/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * Copyright (C) 2019 iopsys Software Solutions AB * Author: Amin Ben Ramdhane * */ #include #include #include #include #include #ifndef __DMMEMJSON_H #define __DMMEMJSON_H struct dmmemjson { struct list_head list; char mem[0]; }; void *__dmmallocjson(size_t size); void *__dmcallocjson(int n, size_t size); void *__dmreallocjson(void *n, size_t size); char *__dmstrdupjson(const char *s); int __dmasprintfjson(char **s, const char *format, ...); void dmfreejson(void *m); void dmcleanmemjson(); #define dmmallocjson(x) __dmmallocjson(x) #define dmcallocjson(n, x) __dmcallocjson(n, x) #define dmreallocjson(x, n) __dmreallocjson(x, n) #define dmstrdupjson(x) __dmstrdupjson(x) #define dmasprintfjson(s, format, ...) __dmasprintfjson(s, format, ## __VA_ARGS__) #endif //__DMMEMJSON_H