Browse Source

* doxygen comments in common.h

master
Alex 'AdUser' Z 8 years ago
parent
commit
3f5886d1e7
  1. 20
      src/common.h

20
src/common.h

@ -1,3 +1,8 @@
/**
* @file
* Common include headers
*/
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
@ -14,18 +19,13 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
/** @defgroup MemoryMgmt Memory management macro
* @{*/
/** frees memory and sets pointer to zero */
#define FREE(ptr) \ #define FREE(ptr) \
free((ptr)); (ptr) = NULL; free((ptr)); (ptr) = NULL;
/** allocates memory, and checks is it really allocated */
#define CALLOC(ptr, nmemb, size) \ #define CALLOC(ptr, nmemb, size) \
assert(((ptr) = calloc((nmemb), (size))) != NULL); assert(((ptr) = calloc((nmemb), (size))) != NULL);
/** @} */
#define STRNDUP(ptr, str, len) \
assert(((ptr) = strndup((str), (len))) != NULL);
/*
extern int image_add(uint64_t, char *path);
extern int image_del(uint64_t);
extern int image_exists(uint64_t);
extern int image_search(uint64_t, simdb_rec_t **data, size_t limit);
*/

Loading…
Cancel
Save