17 #ifndef ION_SYMBOL_TABLE_H_
18 #define ION_SYMBOL_TABLE_H_
42 typedef enum _ION_SYMBOL_TABLE_TYPE {
47 } ION_SYMBOL_TABLE_TYPE;
49 #define ION_SYMBOL_IMPORT_LOCATION_IS_NULL(symbol) ION_STRING_IS_NULL(&(symbol)->import_location.name)
50 #define ION_SYMBOL_IS_NULL(symbol) (symbol == NULL || (ION_STRING_IS_NULL(&(symbol)->value) && ION_SYMBOL_IMPORT_LOCATION_IS_NULL(symbol) && (symbol)->sid == UNKNOWN_SID))
51 #define ION_SYMBOL_INIT(symbol) ION_STRING_INIT(&(symbol)->value); ION_STRING_INIT(&(symbol)->import_location.name); (symbol)->sid = UNKNOWN_SID
53 #define UNKNOWN_SID -1
58 #define ION_SYS_SYMBOL_SHARED_SYMBOL_TABLE "$ion_shared_symbol_table"
59 #define ION_SYS_STRLEN_SHARED_SYMBOL_TABLE 24
61 #define ION_SYS_SYMBOL_ION "$ion"
62 #define ION_SYS_SYMBOL_IVM "$ion_1_0"
63 #define ION_SYS_SYMBOL_ION_SYMBOL_TABLE "$ion_symbol_table"
64 #define ION_SYS_SYMBOL_NAME "name"
65 #define ION_SYS_SYMBOL_VERSION "version"
66 #define ION_SYS_SYMBOL_IMPORTS "imports"
67 #define ION_SYS_SYMBOL_SYMBOLS "symbols"
68 #define ION_SYS_SYMBOL_MAX_ID "max_id"
70 #define ION_SYS_SYMBOL_MAX_ID_UNDEFINED -1
72 #define ION_SYS_SID_ION 1
73 #define ION_SYS_SID_IVM 2
74 #define ION_SYS_SID_SYMBOL_TABLE 3
75 #define ION_SYS_SID_NAME 4
76 #define ION_SYS_SID_VERSION 5
77 #define ION_SYS_SID_IMPORTS 6
78 #define ION_SYS_SID_SYMBOLS 7
79 #define ION_SYS_SID_MAX_ID 8
80 #define ION_SYS_SID_SHARED_SYMBOL_TABLE 9
82 #define ION_SYS_STRLEN_ION 4
83 #define ION_SYS_STRLEN_IVM 8
84 #define ION_SYS_STRLEN_SYMBOL_TABLE 17
85 #define ION_SYS_STRLEN_NAME 4
86 #define ION_SYS_STRLEN_VERSION 7
87 #define ION_SYS_STRLEN_IMPORTS 7
88 #define ION_SYS_STRLEN_SYMBOLS 7
89 #define ION_SYS_STRLEN_MAX_ID 6
91 GLOBAL BYTE ION_SYMBOL_ION_BYTES[]
93 = {
'$',
'i',
'o',
'n', 0 }
96 GLOBAL BYTE ION_SYMBOL_VTM_BYTES[]
98 = {
'$',
'i',
'o',
'n',
'_',
'1',
'_',
'0', 0 }
101 GLOBAL BYTE ION_SYMBOL_SYMBOL_TABLE_BYTES[]
103 = {
'$',
'i',
'o',
'n',
'_',
's',
'y',
'm',
'b',
'o',
'l',
'_',
't',
'a',
'b',
'l',
'e', 0 }
106 GLOBAL BYTE ION_SYMBOL_NAME_BYTES[]
108 = {
'n',
'a',
'm',
'e', 0 }
111 GLOBAL BYTE ION_SYMBOL_VERSION_BYTES[]
113 = {
'v',
'e',
'r',
's',
'i',
'o',
'n', 0 }
116 GLOBAL BYTE ION_SYMBOL_IMPORTS_BYTES[]
118 = {
'i',
'm',
'p',
'o',
'r',
't',
's', 0 }
121 GLOBAL BYTE ION_SYMBOL_SYMBOLS_BYTES[]
123 = {
's',
'y',
'm',
'b',
'o',
'l',
's', 0 }
126 GLOBAL BYTE ION_SYMBOL_MAX_ID_BYTES[]
128 = {
'm',
'a',
'x',
'_',
'i',
'd', 0 }
132 GLOBAL BYTE ION_SYMBOL_SHARED_SYMBOL_TABLE_BYTES[]
134 = {
'$',
'i',
'o',
'n',
'_',
's',
'h',
'a',
'r',
'e',
'd',
'_',
's',
'y',
'm',
'b',
'o',
'l',
'_',
't',
'a',
'b',
'l',
'e', 0 }
158 ION_SYS_STRLEN_SYMBOL_TABLE,
159 ION_SYMBOL_SYMBOL_TABLE_BYTES
167 ION_SYMBOL_NAME_BYTES
174 ION_SYS_STRLEN_VERSION,
175 ION_SYMBOL_VERSION_BYTES
182 ION_SYS_STRLEN_IMPORTS,
183 ION_SYMBOL_IMPORTS_BYTES
190 ION_SYS_STRLEN_SYMBOLS,
191 ION_SYMBOL_SYMBOLS_BYTES
198 ION_SYS_STRLEN_MAX_ID,
199 ION_SYMBOL_MAX_ID_BYTES
206 ION_SYS_STRLEN_SHARED_SYMBOL_TABLE,
207 ION_SYMBOL_SHARED_SYMBOL_TABLE_BYTES
221 ION_SYS_SYMBOL_ION_SYMBOL_TABLE,
223 ION_SYS_SYMBOL_VERSION,
224 ION_SYS_SYMBOL_IMPORTS,
225 ION_SYS_SYMBOL_SYMBOLS,
226 ION_SYS_SYMBOL_MAX_ID,
227 ION_SYS_SYMBOL_SHARED_SYMBOL_TABLE,
289 ION_API_EXPORT iERR ion_symbol_table_lock (hSYMTAB hsymtab);
290 ION_API_EXPORT iERR ion_symbol_table_is_locked (hSYMTAB hsymtab, BOOL *p_is_locked);
291 ION_API_EXPORT iERR ion_symbol_table_get_type (hSYMTAB hsymtab, ION_SYMBOL_TABLE_TYPE *p_type);
293 ION_API_EXPORT iERR ion_symbol_table_get_name (hSYMTAB hsymtab,
iSTRING p_name);
294 ION_API_EXPORT iERR ion_symbol_table_get_version (hSYMTAB hsymtab, int32_t *p_version);
295 ION_API_EXPORT iERR ion_symbol_table_get_max_sid (hSYMTAB hsymtab, SID *p_max_id);
297 ION_API_EXPORT iERR ion_symbol_table_set_name (hSYMTAB hsymtab,
iSTRING name);
298 ION_API_EXPORT iERR ion_symbol_table_set_version (hSYMTAB hsymtab, int32_t version);
299 ION_API_EXPORT iERR ion_symbol_table_set_max_sid (hSYMTAB hsymtab, SID max_id);
301 ION_API_EXPORT iERR ion_symbol_table_get_imports (hSYMTAB hsymtab,
ION_COLLECTION **p_imports);
321 ION_API_EXPORT iERR ion_symbol_table_find_by_name (hSYMTAB hsymtab,
iSTRING name, SID *p_sid);
322 ION_API_EXPORT iERR ion_symbol_table_find_by_sid (hSYMTAB hsymtab, SID sid,
iSTRING *p_name);
323 ION_API_EXPORT iERR ion_symbol_table_is_symbol_known (hSYMTAB hsymtab, SID sid, BOOL *p_is_known);
325 ION_API_EXPORT iERR ion_symbol_table_get_symbol (hSYMTAB hsymtab, SID sid,
ION_SYMBOL **p_sym);
326 ION_API_EXPORT iERR ion_symbol_table_get_local_symbol (hSYMTAB hsymtab, SID sid,
ION_SYMBOL **p_sym);
328 ION_API_EXPORT iERR ion_symbol_table_add_symbol (hSYMTAB hsymtab,
iSTRING name, SID *p_sid);
349 ION_API_EXPORT
const char *ion_symbol_table_type_to_str (ION_SYMBOL_TABLE_TYPE t);
ION_API_EXPORT iERR ion_symbol_table_load(hREADER hreader, hOWNER owner, hSYMTAB *p_hsymtab)
ION_API_EXPORT iERR ion_symbol_is_equal(ION_SYMBOL *lhs, ION_SYMBOL *rhs, BOOL *is_equal)
ION_API_EXPORT iERR ion_symbol_table_open(hSYMTAB *p_hsymtab, hOWNER owner)
ION_API_EXPORT iERR ion_symbol_table_add_import(hSYMTAB hsymtab, ION_SYMBOL_TABLE_IMPORT_DESCRIPTOR *pimport, hCATALOG catalog)
ION_API_EXPORT iERR ion_symbol_table_clone(hSYMTAB hsymtab, hSYMTAB *p_hclone)
ION_API_EXPORT iERR ion_symbol_table_clone_with_owner(hSYMTAB hsymtab, hSYMTAB *p_hclone, hOWNER owner)
ION_API_EXPORT iERR ion_symbol_table_import_symbol_table(hSYMTAB hsymtab, hSYMTAB hsymtab_import)
GLOBAL char * SYSTEM_SYMBOLS[]
Definition: ion_symbol_table.h:231
ION_API_EXPORT iERR ion_symbol_table_close(hSYMTAB hsymtab)
ION_API_EXPORT iERR ion_symbol_table_unload(hSYMTAB hsymtab, hWRITER hwriter)
ION_API_EXPORT iERR ion_symbol_copy_to_owner(hOWNER owner, ION_SYMBOL *dst, ION_SYMBOL *src)
ION_API_EXPORT iERR ion_symbol_table_open_with_type(hSYMTAB *p_hsymtab, hOWNER owner, ION_SYMBOL_TABLE_TYPE type)
ION_API_EXPORT iERR ion_symbol_table_get_system_table(hSYMTAB *p_hsystem_table, int32_t version)
#define GLOBAL
Definition: ion_types.h:41
Definition: ion_collection.h:72
Definition: ion_string.h:40
Definition: ion_symbol_table.h:28
Definition: ion_symbol_table.h:34