File:  [CSRG BSD Unix] / 43BSDTahoe / new / spms / include / slist.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:58 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43tahoe
BSD 4.3tahoe

/* $Header: /var/lib/cvsd/repos/CSRG/43BSDTahoe/new/spms/include/slist.h,v 1.1.1.1 2018/04/24 16:12:58 root Exp $ */

/*
 * Singly-linked list definitions
 *
 * Author: Peter J. Nicklin
 */

/*
 * Singly-linked list macros
 */
#define SLNUM(slist)	(slist)->nk
/*
 * Singly-linked list block
 */
typedef struct slblk
	{
	char *key;			/* points to a key */
	struct slblk *next;		/* ptr to next list block */
	} SLBLK;
/*
 * Singly-linked list head block
 */
typedef struct slisthb
	{
	int nk;				/* number of keys in list */
	int maxkey;			/* length of longest key */
	SLBLK *head;			/* pointer to first list block */
	SLBLK *curblk;			/* pointer to current block */
	SLBLK *tail;			/* pointer to last list block */
	} SLIST;
/*
 * Functions defined for singly-linked list operations
 */
extern char *slappend();		/* append key */
extern char *slget();			/* get next key */
extern SLIST *slinit();			/* initialize list */
extern char *slinsert();		/* insert key */
extern int slpop();			/* pop key */
extern char *slprepend();		/* prepend key */
extern void slprint();			/* print list */
extern void slrewind();			/* rewind list */
extern void slrm();			/* remove list item */
extern int slsort();			/* sort list */
extern void slsplice();			/* splice two lists */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.