version 1.7, 1998/08/21 04:25:02 |
version 1.8, 1999/09/26 20:47:28 |
|
|
static void eatsize __P((char **)); |
static void eatsize __P((char **)); |
|
|
static int maxmagic = 0; |
static int maxmagic = 0; |
|
static int alloc_incr = 256; |
|
|
static int apprentice_1 __P((char *, int)); |
static int apprentice_1 __P((char *, int)); |
|
|
|
|
struct magic *m; |
struct magic *m; |
char *t, *s; |
char *t, *s; |
|
|
#define ALLOC_INCR 20 |
|
if (nd+1 >= maxmagic){ |
if (nd+1 >= maxmagic){ |
struct magic *mtmp; |
struct magic *mtmp; |
|
|
maxmagic += ALLOC_INCR; |
maxmagic += alloc_incr; |
if ((mtmp = (struct magic *) realloc(magic, |
if ((mtmp = (struct magic *) realloc(magic, |
sizeof(struct magic) * |
sizeof(struct magic) * |
maxmagic)) == NULL) { |
maxmagic)) == NULL) { |
|
|
exit(1); |
exit(1); |
} |
} |
magic = mtmp; |
magic = mtmp; |
memset(&magic[*ndx], 0, sizeof(struct magic) * ALLOC_INCR); |
memset(&magic[*ndx], 0, sizeof(struct magic) * alloc_incr); |
|
alloc_incr *= 2; |
} |
} |
m = &magic[*ndx]; |
m = &magic[*ndx]; |
m->flag = 0; |
m->flag = 0; |