libcfe-tables  2.9.85
some useful C-functions
typedef.h
Go to the documentation of this file.
1 /* kate: indent-mode cstyle; tab-width 4; indent-width 4; */
2 #ifndef XTABLES_TYPEDEF_H
3 #define XTABLES_TYPEDEF_H
4 
5 #include <stdint.h>
6 #include <sys/types.h>
7 #include <cfe/cfe_value.h>
8 
9 #define TYPE_LEN 8
10 #define RECORD_INVALID (UINT32_MAX)
11 #define REC_MAX (RECORD_INVALID - 1)
12 #define REC_MIN 0
13 
14 typedef struct _table table_t;
15 typedef uint32_t rec_t;
16 
17 /* Types for core functions */
18 typedef table_t *(*table_init_t)(void);
19 typedef int (*table_compare_t)(void *, void *);
20 typedef rec_t (*table_get_record_number_by_pointer_t)(const table_t *, void *);
21 typedef void (*table_free_entry_t)(void *);
22 
23 /* Types for memory (de/re)allocation functions. */
24 typedef void *(*table_malloc_func_t)(const table_t *, size_t);
25 typedef void *(*table_realloc_func_t)(const table_t *, void *, size_t);
26 typedef void (*table_free_func_t)(const table_t *, void *);
27 
28 /* Type for the callback functions */
29 typedef void (*table_alter_t)(const table_t *, rec_t, void *user_data);
30 
31 /* Type for data retrive functions */
32 typedef cfe_value_t *(*table_get_function_t)(const table_t *, void *);
33 
34 #endif /* XTABLES_TYPEDEF_H */
int(* table_compare_t)(void *, void *)
Definition: typedef.h:19
void(* table_alter_t)(const table_t *, rec_t, void *user_data)
Definition: typedef.h:29
void(* table_free_func_t)(const table_t *, void *)
Definition: typedef.h:26
void(* table_free_entry_t)(void *)
Type specific function to free the memory used inside a record.
Definition: typedef.h:21
struct _table table_t
Table type.
Definition: typedef.h:14
uint32_t rec_t
Type to identify a record number.
Definition: typedef.h:15
rec_t(* table_get_record_number_by_pointer_t)(const table_t *, void *)
Type specific function to get the record number of a give record.
Definition: typedef.h:20