1: /* $Header$ */ 2: 3: /* 4: * Author: Peter J. Nicklin 5: */ 6: 7: /* 8: * slsinit() 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 "slslist.h" 13: 14: SLSLIST * 15: slsinit() 16: { 17: char *malloc(); /* memory allocator */ 18: SLSLIST *slslist; /* pointer to list head block */ 19: 20: if ((slslist = (SLSLIST *) malloc(sizeof(SLSLIST))) == NULL) 21: { 22: warn("out of memory"); 23: return(NULL); 24: } 25: slslist->nk = 0; 26: slslist->maxkey = slslist->maxstr = 0; 27: slslist->head = slslist->curblk = slslist->tail = NULL; 28: return(slslist); 29: }