1 /***************************************************************************
5 ----------------------------------------------------------------------------
7 FUNCTION: Header file for symbol table routines
9 ----------------------------------------------------------------------------
11 MODULE STATUS: production
13 ----------------------------------------------------------------------------
15 GENEALOGY: Created 930629 by E. B. Jackson
17 ----------------------------------------------------------------------------
19 DESIGNED BY: Bruce Jackson
25 ----------------------------------------------------------------------------
31 950227 Added header and declarations for ls_print_findsym_error(),
32 ls_get_double(), and ls_get_double() routines. EBJ
34 950302 Added structure for symbol description. EBJ
36 950306 Added ls_get_sym_val() and ls_set_sym_val() routines.
37 This is now the production version. EBJ
43 Revision 1.2 1998/01/22 02:59:34 curt
44 Changed #ifdef FILE_H to #ifdef _FILE_H
46 Revision 1.1 1997/05/29 00:10:00 curt
47 Initial Flight Gear revision.
49 * Revision 1.9 1995/03/07 12:52:33 bjax
50 * This production version now specified ls_get_sym_val() and ls_put_sym_val().
52 * Revision 1.6.1.2 1995/03/06 18:45:41 bjax
53 * Added def'n of ls_get_sym_val() and ls_set_sym_val(); changed symbol_rec
54 * Addr field from void * to char *.
57 * Revision 1.6.1.1 1995/03/03 01:17:44 bjax
58 * Experimental version with just ls_get_double and ls_set_double() routines.
60 * Revision 1.6 1995/02/27 19:50:49 bjax
61 * Added header and declarations for ls_print_findsym_error(),
62 * ls_get_double(), and ls_set_double(). EBJ
65 ----------------------------------------------------------------------------
69 ----------------------------------------------------------------------------
73 ----------------------------------------------------------------------------
77 ----------------------------------------------------------------------------
81 ----------------------------------------------------------------------------
85 --------------------------------------------------------------------------*/
93 #define SYM_NOT_LOADED -2
94 #define SYM_UNEXPECTED_ERR -1
96 #define SYM_OPEN_ERR 1
98 #define SYM_MOD_NOT_FOUND 3
99 #define SYM_VAR_NOT_FOUND 4
100 #define SYM_NOT_SCALAR 5
101 #define SYM_NOT_STATIC 6
102 #define SYM_MEMORY_ERR 7
103 #define SYM_UNMATCHED_PAREN 8
104 #define SYM_BAD_SYNTAX 9
105 #define SYM_INDEX_BOUNDS_ERR 10
107 typedef enum {Unknown, Char, UChar, SHint, USHint, Sint, Uint, Slng, Ulng, flt, dbl} vartype;
109 typedef char SYMBOL_NAME[64];
110 typedef vartype SYMBOL_TYPE;
116 SYMBOL_NAME Mod_Name;
117 SYMBOL_NAME Par_Name;
118 SYMBOL_TYPE Par_Type;
124 extern int ls_findsym( const char *modname, const char *varname,
125 char **addr, vartype *vtype );
127 extern void ls_print_findsym_error(int result,
131 extern double ls_get_double(vartype sym_type, void *addr );
133 extern void ls_set_double(vartype sym_type, void *addr, double value );
135 extern double ls_get_sym_val( symbol_rec *symrec, int *error );
137 /* This routine attempts to return the present value of the symbol
138 described in symbol_rec. If Addr is non-zero, the value of that
139 location, interpreted as type double, will be returned. If Addr
140 is zero, and Mod_Name and Par_Name are both not null strings,
141 the ls_findsym() routine is used to try to obtain the address
142 by looking at debugger symbol tables in the executable image, and
143 the value of the double contained at that address is returned,
144 and the symbol record is updated to contain the address of that
145 symbol. If an error is discovered, 'error' will be non-zero and
146 and error message is printed on stderr. */
148 extern void ls_set_sym_val( symbol_rec *symrec, double value );
150 /* This routine sets the value of a double at the location pointed
151 to by the symbol_rec's Addr field, if Addr is non-zero. If Addr
152 is zero, and Mod_Name and Par_Name are both not null strings,
153 the ls_findsym() routine is used to try to obtain the address
154 by looking at debugger symbol tables in the executable image, and
155 the value of the double contained at that address is returned,
156 and the symbol record is updated to contain the address of that
157 symbol. If an error is discovered, 'error' will be non-zero and
158 and error message is printed on stderr. */
161 #endif /* _LS_SYM_H */