|
|
1.1 ! root 1: #include <stdio.h> ! 2: #include "filehdr.h" ! 3: #include "ldfcn.h" ! 4: #include "lddef.h" ! 5: ! 6: LDLIST *_ldhead = NULL; ! 7: ! 8: ! 9: LDFILE * ! 10: allocldptr() ! 11: { ! 12: extern char *calloc(); ! 13: extern LDLIST *_ldhead; ! 14: LDLIST *ldptr, *ldindx; ! 15: static int last_fnum_ = 0; ! 16: ! 17: if ((ldptr = (LDLIST *)calloc(1, LDLSZ)) == NULL) ! 18: return (NULL); ! 19: ldptr->ld_next = NULL; ! 20: if (_ldhead == NULL) ! 21: _ldhead = ldptr; ! 22: else ! 23: { ! 24: for (ldindx = _ldhead; ! 25: ldindx->ld_next != NULL; ldindx = ldindx->ld_next) ! 26: { ! 27: } ! 28: ldindx->ld_next = ldptr; ! 29: } ! 30: ldptr->ld_item._fnum_ = ++last_fnum_; ! 31: return ((LDFILE *)ldptr); ! 32: } ! 33: ! 34: static char ID[] = "@(#) allocldptr.c: 1.2 2/16/83";
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.