home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / animutil / pvquan / animdat / symtab.h < prev   
C/C++ Source or Header  |  1992-11-30  |  2KB  |  44 lines

  1. /*--------------------------------------------------------------*/
  2. /*            ANIMDAT 1.1                */
  3. /*        copyright 1992 - TODD SANKEY            */
  4. /*                                */
  5. /*  The author hereby grants permission for the use and sharing    */
  6. /* of both source code end executable versions of this software    */
  7. /* at no charge. This software is not for sale and no other    */
  8. /* shall charge for it without the expressed consent of the    */
  9. /* author.                            */
  10. /*                                */
  11. /*  The source code can be freely modified, but it must retain    */
  12. /* the original copyright notice, and the author must be    */
  13. /* notified of these changes if the altered code is to be    */
  14. /* distributed.                            */
  15. /*--------------------------------------------------------------*/
  16. /*------------------------------------------------------*/
  17. /* symtab.h    Routines for interfacing to a symbol    */
  18. /*        table organized as a binary tree.    */
  19. /*------------------------------------------------------*/
  20.  
  21. #ifndef symtab_h
  22. #define symtab_h
  23.  
  24. typedef enum {SYM_DOUBLE, SYM_FILE, SYM_STRING} sym_types;
  25.  
  26. typedef struct sym_s {
  27.             char        *name;
  28.             sym_types    sym_type;
  29.             char        update_flag;
  30.             void        *sym_info;
  31.             double        cur_val;
  32.             struct sym_s    *left;
  33.             struct sym_s    *right;
  34.             } sym, *sym_ptr;
  35.  
  36.  
  37. sym_ptr    search_symtab(sym_ptr symtab, char *name);
  38. sym_ptr    add_symbol(sym_ptr *symtab, char *name);
  39. void    traverse_symtab(sym_ptr symtab,void (*f)(sym_ptr symbol) );
  40. double    eval_symbol(char *name);
  41. void    print_symbol(FILE *ofile, char *name);
  42.  
  43. #endif
  44.