1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "sys-defines.h"
- #include "ode.h"
- #include "extern.h"
- struct sym *
- lookup (const char *nam)
- {
- struct sym *sp;
-
- for (sp = symtab; sp != NULL; sp = sp->sy_link)
- if (strncmp (sp->sy_name, nam, NAMMAX) == 0)
- return sp;
- sp = salloc();
- strncpy (sp->sy_name, nam, NAMMAX);
- return sp;
- }
- struct sym *
- salloc (void)
- {
- struct sym *sp;
-
- sp = (struct sym *)xmalloc(sizeof(struct sym));
- sp->sy_link = symtab;
- symtab = sp;
- sp->sy_expr = NULL;
- sp->sy_value = sp->sy_prime = 0.0;
- sp->sy_sserr = sp->sy_aberr = sp->sy_acerr = 0.0;
- sp->sy_flags = 0;
- return sp;
- }
- void
- sfree (struct sym *sp)
- {
- if (sp != NULL)
- free ((void *)sp);
- }
|