#include "alloc.h" #ifndef ALLOCSIZE #define ALLOCSIZE 10000 /* size of available space */ #endif static char allocbuf[ALLOCSIZE]; /* storage for alloc */ static char *allocp = allocbuf; /* next free position */ /* return pointer to n characters */ char * alloc (int n) { /* If it fits ... */ if (allocbuf + ALLOCSIZE - allocp >= n) { allocp += n; return allocp - n; /* old p */ } // If there's not enough room else return 0; } // alloc