Link to home
Create AccountLog in
Avatar of ambuli
ambuliFlag for United States of America

asked on

Using sys/queue.h List macros

I have the following code in a.h file

typedef struct list_entry
{
        LIST_ENTRY(list_entry) chain;
        char *id;
        bool enabled;
} list_entry_t;

LIST_HEAD(list_head, list_entry) *the_list;

Open in new window


I want to pass the "the_list" as arguments to functions... what is the type of the_list here.

list_entry_t *find_entry(???,  const char *id)
{

}

Open in new window

Avatar of jkr
jkr
Flag of Germany image

Run your header file through the preprocessor only and examine the result, it will contain teh exact type of 'the_list'. This is done by using 'gcc -E <files>'.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of ambuli

ASKER

Thank you!