home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume37
/
linkedlist
/
part02
/
list.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-04
|
3KB
|
100 lines
#define lBUBBLE 1 /* bubble sorting algorithm */
#define lHEAP 2 /* heap sorting algorithm */
#define lINSERT 3 /* insert sorting algorithm */
#define lQUICK 4 /* quick sorting algorithm */
#define lSELECTION 5 /* selection sorting algorithm */
/* Sorting defines by shane.s.brath@uwrf.edu */
#define lASCENDING 1
#define lDESCENDING -1
#define lSAME 1 /* compared nodes are the same */
#define l1LT2 2 /* first node is less than second node */
#define l2LT1 3 /* second node is less than first node */
#define lSUCCESS 0 /* function call ended successfully */
#define lSINGLY 1 /* singly linked list */
#define lDOUBLY 2 /* doubly linked list */
#define lCHAIN 3 /* chain linked list */
#define lCIRCULAR 4 /* circular linked list */
#define lFIRST 1 /* add at front of list */
/* get/find/delete first node */
#define lPREVIOUS 2 /* get/find previous node */
#define lBEFORE 3 /* add before current node */
#define lCURRENT 4 /* get/delete current node */
#define lAFTER 5 /* add after current node */
#define lNEXT 6 /* get/find next node */
#define lLAST 7 /* add at end of list */
/* get/find/delete last node */
#define lONE_NODE 10 /* add first node to list / delete last node */
#define lWRONG_SD -1 /* parameter 'sd' has wrong value */
#define lWRONG_CC -2 /* parameter 'cc' has wrong value */
#define lWRONG_WHERE -3 /* parameter 'where' has wrong value */
#define lWRONG_WHICH -4 /* parameter 'which' has wrong value */
#define lUNKNOWN_ID -5 /* list id is unknown */
#define lUNKNOWN_FUNC -6 /* function name is unknown */
#define lNO_LIST -7 /* there are no lists defined */
#define lEMPTY_LIST -8 /* list is empty */
#define lEOL -9 /* end of list reached */
#define lNOT_FOUND -10 /* node not found */
#define lNOT_DOUBLY -11 /* list is not doubly linked */
#define lSIZE_NE -12 /* size of expected data and node not equal */
#define lWRONG_INDEX -13 /* 'index' out of range */
#define lOPEN_ERROR -14 /* can't open dump-file */
#define lWRONG_ORDER -15 /* parameter 'order' has wrong value */
#define lWRONG_THEORY -16 /* parameter 'theory' has wrong value */
#define lFOUND 0 /* node found */
#ifdef MSDOS_OR_VAXC
#define lERROR_FILE "linklist.err"
#else
#define lERROR_FILE "=listError="
#endif
#ifdef ANSI
typedef int (*Func)();
typedef unsigned char Byte;
int lDef(int sd, int cc);
int lInfo(int id, int *sd, int *cc, int *n);
int lSort(int id, int order, int theory, Func func);
int lDump(int id, char *file);
int lUndump(char *file);
int lDel(int id);
int lDelAll(void);
int lInsNode(int id, int where, Byte *data, int size, int flag);
int lInfoNode(int id, int which, int *size, int *flag);
int lGetNode(int id, int which, Byte *data, int size);
int lFndNode(int id, int where, Func func, Byte *ptr, Byte *data, int size);
int lFndFlagNode(int id, int where, int flag, Byte *data, int size);
int lUpdNode(int id, Byte *data, int size, int flag);
int lDelNode(int id, int which);
int lInfoIndxNode(int id, int index, int *size, int *flag);
int lGetIndxNode(int id, int index, Byte *data, int size);
int lUpdIndxNode(int id, int index, Byte *data, int size, int flag);
int lDelIndxNode(int id, int index);
#else
int lDef();
int lInfo();
int lSort();
int lDump();
int lUndump();
int lDel();
int lDelAll();
int lInsNode();
int lInfoNode();
int lGetNode();
int lFndNode();
int lFndFlagNode();
int lUpdNode();
int lDelNode();
int lInfoIndxNode();
int lGetIndxNode();
int lUpdIndxNode();
int lDelIndxNode();
#endif