| 1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 12 |
|
|
| 13 |
|
#include "object.h" |
| 14 |
|
|
| 15 |
+ |
#include "otypes.h" |
| 16 |
|
|
| 17 |
+ |
|
| 18 |
|
extern int (*addobjnotify[])(); /* people to notify of new objects */ |
| 19 |
|
|
| 20 |
|
static struct ohtab { |
| 22 |
|
OBJECT *htab; /* table, if allocated */ |
| 23 |
|
} modtab = {100, NULL}, objtab = {1000, NULL}; /* modifiers and objects */ |
| 24 |
|
|
| 25 |
+ |
static int otndx(); |
| 26 |
|
|
| 27 |
+ |
|
| 28 |
|
#ifdef GETOBJ |
| 29 |
|
int |
| 30 |
|
object(oname) /* get an object number from its name */ |
| 80 |
|
if (*hsp > oldsiz) |
| 81 |
|
return(*hsp); |
| 82 |
|
return(oldsiz*2 + 1); /* not always prime */ |
| 79 |
– |
} |
| 80 |
– |
|
| 81 |
– |
|
| 82 |
– |
static int |
| 83 |
– |
shash(s) /* hash a string */ |
| 84 |
– |
register char *s; |
| 85 |
– |
{ |
| 86 |
– |
register int h = 0; |
| 87 |
– |
|
| 88 |
– |
while (*s) |
| 89 |
– |
h = (h<<1 & 0x7fff) ^ *s++; |
| 90 |
– |
return(h); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
|