EVE 1.0
EVE environment
Collaboration diagram for EVE environment:

Macros

#define TRUE   true
 
#define FALSE   false
 
#define ARRAY_SIZE(arr)   (sizeof(arr) / sizeof((arr)[0]))
 
#define container_of(ptr, type, mem)   ((type*) (((char*)(ptr)) - offsetof(type, mem)))
 

Detailed Description

Macro Definition Documentation

#define TRUE   true

Same as true.

Definition at line 55 of file env.h.

#define FALSE   false

Same as false.

Definition at line 63 of file env.h.

#define ARRAY_SIZE (   arr)    (sizeof(arr) / sizeof((arr)[0]))

Canonical macro-based ARRAY_SIZE. Use with care for side effectes!

Definition at line 89 of file env.h.

#define container_of (   ptr,
  type,
  mem 
)    ((type*) (((char*)(ptr)) - offsetof(type, mem)))

Converts pointer to a member of a structure to the pointer to the structure.

Usage:

1 struct my_work_t {
2  struct work_t base_work;
3  int my_data;
4 };
5 void my_work_cb(struct work_t *work) {
6  struct my_work_t *my_work = container_of(work, struct my_work_t, base_work);
7  my_work->my_data++;
8 }
Parameters
ptrpointer to the member of the structure
typetype name of the structure
memname of the memeber of the structure
Returns
pointer to the structure

Definition at line 114 of file env.h.