32 lines
636 B
C
32 lines
636 B
C
|
|
#ifndef _UTILS_H
|
||
|
|
#define _UTILS_H
|
||
|
|
|
||
|
|
#ifdef __cpluscplus
|
||
|
|
extern "C"
|
||
|
|
{
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#define MIN(a, b) ((a) > (b) ? (a) : (b))
|
||
|
|
|
||
|
|
#define LOG_TAG_POLICY "POLICY"
|
||
|
|
#define LOG_TAG_UTILS "UTILS"
|
||
|
|
|
||
|
|
struct fixed_num_array
|
||
|
|
{
|
||
|
|
int elems[128];
|
||
|
|
int num;
|
||
|
|
int size;
|
||
|
|
};
|
||
|
|
|
||
|
|
void fixed_num_array_init(struct fixed_num_array *array);
|
||
|
|
void fixed_num_array_add_elem(struct fixed_num_array *array, int elem);
|
||
|
|
void fixed_num_array_del_elem(struct fixed_num_array *array, int elem);
|
||
|
|
int fixed_num_array_count_elem(struct fixed_num_array *array);
|
||
|
|
int fixed_num_array_index_elem(struct fixed_num_array *array, int index);
|
||
|
|
|
||
|
|
#ifdef __cpluscplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif
|