📄 list.h
字号:
#ifndef LIST_H#define LIST_Htypedef struct list{ unsigned size, allocated; void **data;}List;extern List *global_declarations;List *new_list(void); /* Create a new list and allocate memory for it */void delete_list(List *); /* Deallocate a list. * NOTE: This does not deallocate the items in the list * since the list is unaware of the type of data it contains. */void list_append(List *, void *data); /* Append a _single_ data item to the list; the length of * the list is increased by one */void list_merge(List *, List *); /* Merge two lists. * This will move all items from the second list to * the first and then delete the second list. */void *list_index(const List *, unsigned index); /* Return the 'index'th item in the list * First item has index 0. */unsigned list_size(const List *); /* Return the number of items in the list */#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -