Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Macros | Typedefs
array.h File Reference

Generic array template. More...

#include <assert.h>
#include <hicn/util/log.h>
#include <math.h>
#include <string.h>
Include dependency graph for array.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BUFSIZE   1024
 
#define TYPEDEF_ARRAY_H(NAME, T)
 
#define ARRAY_MAX_SIZE_LOG_INIT   0
 
#define TYPEDEF_ARRAY(NAME, T, CMP, SNPRINTF)
 

Typedefs

typedef int(* cmp_t) (const void *x, const void *y)
 

Detailed Description

Generic array template.

Macro Definition Documentation

◆ TYPEDEF_ARRAY_H

#define TYPEDEF_ARRAY_H (   NAME,
 
)
Value:
\
typedef struct { \
size_t size; \
size_t max_size_log; \
T * elements; \
} NAME ## _t; \
\
int NAME ## _initialize(NAME ## _t * array); \
\
int NAME ## _finalize(NAME ## _t * array); \
\
NAME ## _t * NAME ## _create(); \
\
void NAME ## _free(NAME ## _t * array); \
\
int NAME ## _add(NAME ## _t * array, T element); \
\
int NAME ## _remove_index(NAME ## _t * array, int index, T * element); \
\
int NAME ## _remove(NAME ## _t * array, const T search, T * element); \
\
int NAME ## _get(const NAME ## _t * array, const T search, T * element); \
\
int NAME ## _get_index(const NAME ## _t * array, int index, T * element); \
\
int NAME ## _get_elements(const NAME ## _t * array, T ** elements); \
\
size_t NAME ## _len(const NAME ## _t * array);