TheAlgorithms-C/data_structures/list/list.h

25 lines
417 B
C
Raw Normal View History

2019-07-07 23:20:11 +03:00
#ifndef __LIST__
#define __LIST__
#define L List_T
typedef struct L *L;
struct L
{
2019-07-07 23:20:11 +03:00
void *val;
L next;
};
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);
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 */
extern L List_copy(L list);
extern int List_pop(L *list);
2019-07-07 23:20:11 +03:00
#undef L
#endif