1: /* $Header$ */ 2: 3: /* 4: * Author: Peter J. Nicklin 5: */ 6: 7: /* 8: * slinit() returns a pointer to the head block of a new list, or null 9: * pointer if out of memory. 10: */ 11: #include "null.h" 12: #include "slist.h" 13: 14: SLIST * 15: slinit() 16: { 17: char *malloc(); /* memory allocator */ 18: SLIST *slist; /* pointer to list head block */ 19: 20: if ((slist = (SLIST *) malloc(sizeof(SLIST))) == NULL) 21: { 22: warn("out of memory"); 23: return(NULL); 24: } 25: slist->nk = 0; 26: slist->maxkey = 0; 27: slist->head = slist->curblk = slist->tail = NULL; 28: return(slist); 29: }