17 |
|
#include "otypes.h" |
18 |
|
|
19 |
|
|
20 |
+ |
extern int (*addobjnotify[])(); /* people to notify of new objects */ |
21 |
+ |
|
22 |
|
FUN ofun[NUMOTYPE] = INIT_OTYPE; /* our object function table */ |
23 |
|
|
24 |
|
static struct ohtab { |
68 |
|
insertobject(obj) /* insert new object into our list */ |
69 |
|
register OBJECT obj; |
70 |
|
{ |
71 |
< |
register int ndx; |
71 |
> |
register int i; |
72 |
|
|
73 |
|
#ifdef GETOBJ |
74 |
< |
ndx = otndx(objptr(obj)->oname, &objtab); |
75 |
< |
objtab.htab[ndx] = obj; |
74 |
> |
i = otndx(objptr(obj)->oname, &objtab); |
75 |
> |
objtab.htab[i] = obj; |
76 |
|
#endif |
77 |
|
if (ismodifier(objptr(obj)->otype)) { |
78 |
< |
ndx = otndx(objptr(obj)->oname, &modtab); |
79 |
< |
modtab.htab[ndx] = obj; |
78 |
> |
i = otndx(objptr(obj)->oname, &modtab); |
79 |
> |
modtab.htab[i] = obj; |
80 |
|
} |
81 |
+ |
for (i = 0; addobjnotify[i] != NULL; i++) |
82 |
+ |
(*addobjnotify[i])(obj); |
83 |
|
} |
84 |
|
|
85 |
|
|
144 |
|
} |
145 |
|
/* look up object */ |
146 |
|
hval = shash(name); |
147 |
+ |
tryagain: |
148 |
|
for (i = 0; i < tab->hsiz; i++) { |
149 |
|
ndx = (hval + i*i) % tab->hsiz; |
150 |
|
if (tab->htab[ndx] == OVOID || |
161 |
|
tab->htab[i] = oldhtab[ndx]; |
162 |
|
} |
163 |
|
free((char *)oldhtab); |
164 |
< |
return(otndx(name, tab)); |
164 |
> |
goto tryagain; /* should happen only once! */ |
165 |
|
} |