⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.c

📁 早期freebsd实现
💻 C
字号:
/*************************************************************************** * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE * * is provided to you without charge, and with no warranty.  You may give  * * away copies of JOVE, including sources, provided that this notice is    * * included in all the files.                                              * ***************************************************************************/#include "jove.h"#include "list.h"private List *list_new(){	List	*new;	new = (List *) emalloc(sizeof (List));	new->car = NULL;	return new;}/* push an object to the beginning of list */UnivPtrlist_push(list, element)register List	**list;UnivPtr element;{	List	*new;	new = list_new();	new->cdr = *list;	new->car = element;	*list = new;	return element;}UnivPtrlist_pop(list)List	**list;{	List	*cell;	UnivPtr	element;	if (*list == NULL)		return NULL;	cell = *list;	element = cell->car;	free((UnivPtr) cell);	*list = (*list)->cdr;	return element;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -