list.h

来自「一个编译器修改的例子」· C头文件 代码 · 共 42 行

H
42
字号
#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 + =
减小字号Ctrl + -
显示快捷键?