mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-24 22:32:23 +00:00
28 lines
454 B
C
28 lines
454 B
C
|
#include "list.h"
|
||
|
|
||
|
struct example_list_struct {
|
||
|
struct *next;
|
||
|
int number;
|
||
|
};
|
||
|
|
||
|
LIST(example_list);
|
||
|
|
||
|
void
|
||
|
example_function(void)
|
||
|
{
|
||
|
struct example_list_struct *s;
|
||
|
struct example_list_struct element1, element2;
|
||
|
|
||
|
list_init(example_list);
|
||
|
|
||
|
list_add(example_list, &element1);
|
||
|
list_add(example_list, &element2);
|
||
|
|
||
|
for(s = list_head(example_list);
|
||
|
s != NULL;
|
||
|
s = s->next) {
|
||
|
printf("List element number %d\n", s->number);
|
||
|
}
|
||
|
|
||
|
}
|