File: mlist.h

package info (click to toggle)
glam2 1064-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 956 kB
  • sloc: ansic: 6,925; xml: 757; asm: 74; makefile: 54; sh: 11
file content (32 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/************ mlist.h - multiple linked list abstract data type.***********/
#if !defined(MLIST)
#define MLIST
#include "stdinc.h"
/************************** alphabet datatype *****************************/
typedef struct {
	long     M;			/* number of elements for lists */
	long     N;			/* number of lists */
	long	*first;			/* pointers to beginning of lists */
	long	*item;			/* items on lists */
	long	*next;			/* pointer to next element */
	long	free;			/* pinter to free list */
} multi_list_type;
typedef	multi_list_type *ml_type;

/******************************** PRIVATE **********************************/
void	mlist_error(char *s);

/******************************** PUBLIC ***********************************/
/**************************** mlist operations **************************/
ml_type	MkMList(long M, long N);
long     Add2MList(register long i, register long n, register ml_type L);
long     GetListMList(register long *list, register long n, 
        register ml_type L);
void	NilMList(ml_type L);


/***************************************************************************/
#define EmptyMList(n,L)		((L)->first[(n)]==0)

#endif