mapcalc.h 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef MAPCALC_H
  2. #define MAPCALC_H
  3. typedef enum Styp /* Symbol Type */
  4. {
  5. st_none = 0,
  6. st_map,
  7. st_any,
  8. st_num,
  9. st_str,
  10. st_arg,
  11. st_pnt,
  12. st_nfunc,
  13. st_mfunc,
  14. st_pfunc,
  15. st_afunc
  16. } STYP;
  17. typedef struct Symbol
  18. {
  19. struct Symbol *next;
  20. char *name;
  21. STYP type; /* type as seen by the parser */
  22. STYP itype; /* when type == st_any or st_arg */
  23. union
  24. {
  25. double d; /* nummeric value (always double) */
  26. void *p; /* pointer value */
  27. } v;
  28. char *proto;
  29. STYP rettype; /* if function, return type */
  30. } SYMBOL;
  31. extern int parseerror;
  32. extern SYMBOL *symtab;
  33. extern void freesym(const void *elt);
  34. extern SYMBOL *delsym(SYMBOL * head);
  35. extern int cmpsymsym(const void *A, const void *B);
  36. extern int cmpsymname(const void *data, const void *elt);
  37. extern void symcpy(const void *Dst, const void *Src);
  38. extern SYMBOL *getsym(const char *name);
  39. extern SYMBOL *putsym(const char *name);
  40. extern SYMBOL *argapp(SYMBOL * head, SYMBOL * arg);
  41. #endif