2019-07-07 23:20:11 +03:00
|
|
|
#ifndef __LIST__
|
|
|
|
#define __LIST__
|
|
|
|
|
|
|
|
#define L List_T
|
|
|
|
typedef struct L *L;
|
|
|
|
|
2020-05-29 23:23:24 +03:00
|
|
|
struct L
|
|
|
|
{
|
2019-07-07 23:20:11 +03:00
|
|
|
void *val;
|
|
|
|
L next;
|
|
|
|
};
|
|
|
|
|
2020-05-29 23:23:24 +03:00
|
|
|
extern L List_init(void);
|
|
|
|
extern L List_push(L list, void *val);
|
|
|
|
extern int List_length(L list);
|
2019-07-07 23:20:11 +03:00
|
|
|
extern void **List_toArray(L list);
|
2020-05-29 23:23:24 +03:00
|
|
|
extern L List_append(L list, L tail);
|
|
|
|
extern L List_list(L list, void *val, ...);
|
2019-07-07 23:20:11 +03:00
|
|
|
/* TODO */
|
2020-05-29 23:23:24 +03:00
|
|
|
extern L List_copy(L list);
|
|
|
|
extern int List_pop(L *list);
|
2019-07-07 23:20:11 +03:00
|
|
|
|
|
|
|
#undef L
|
|
|
|
#endif
|