Ravi Uday wrote:
[color=blue]
> Can anybody explain this..[/color]
Possibly..
[color=blue]
> #define LIST_DESTROY(a) list_destroy(a)
> #define LIST_ENQUEUE(a, b, c) list_enqueue(a,b,c)
> #define LIST_REMOVE(a, b, c) list_remove(a,b,c)
> etc...
>
>
> #define LIST_DESTROY(a) NULL
> #define LIST_ENQUEUE(a, b, c) NULL
> #define LIST_REMOVE(a, b, c) NULL
> #define LIST_HEAD_ELEMENT(a) NULL
> #define LIST_GET_DATA(a) NULL
> #define LIST_NEXT_ELEMENT(a) NULL
> #define LIST_EMPTY(a) NULL
>
> #define FOR_ALL_DATA_IN_LIST(__list, __element, __data) \
> for (__element = LIST_HEAD_ELEMENT(__list), \
> __data = LIST_GET_DATA(__element); \
> __element != NULL; \
> __element = LIST_NEXT_ELEMENT(__element), \
> __data = LIST_GET_DATA(__element))
>
>
> Though the name of the MACRO is self-explanatory what i dont understand is
> the second list of #define's - why are they defined as NULL[/color]
In divination mode, I'd say there's probably an #if or an #ifdef
somewhere, but I think this link may be helpful:
http://www.catb.org/~esr/faqs/smart-questions.html
HTH
rlc