bbfdm/dmmemjson.h
Amin Ben Ramdhane ff14c27fc3 clean up the source code
- remove unused variables
- fix coding style of most function (Indentation, Tabulation, ..)
- check the source code using cppcheck tool
- change sprintf by snprintf
2020-02-12 19:08:49 +01:00

37 lines
1 KiB
C

/*
* Copyright (C) 2019 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __DMMEMJSON_H
#define __DMMEMJSON_H
#include <libbbf_api/dmcommon.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