Added spec:commit task to commit changes to spec/ruby sources.
[rbx.git] / shotgun / lib / symbol.h
blobfb8663c1681eb6dfee26b1126b3f81fe468a121b
1 #ifndef RBS_SYMBOL_H
2 #define RBS_SYMBOL_H 1
4 OBJECT symtbl_new(STATE);
5 OBJECT symtbl_lookup(STATE, OBJECT self, OBJECT string);
6 OBJECT symtbl_lookup_cstr(STATE, OBJECT self, const char *str);
7 OBJECT symtbl_lookup_str_with_size(STATE, OBJECT self, const char *str, int size);
8 OBJECT symtbl_find_string(STATE, OBJECT self, OBJECT sym);
9 OBJECT symbol_to_string(STATE, OBJECT self);
11 #define symbol_from_cstr(st, str) symtbl_lookup_cstr(st, st->global->symbols, str)
12 #define SYM(str) symtbl_lookup_cstr(state, state->global->symbols, str)
14 static inline OBJECT symbol_from_index(STATE, size_t idx) {
15 return DATA_APPLY_TAG(idx, DATA_TAG_SYMBOL);
18 static inline size_t symbol_to_index(STATE, OBJECT self) {
19 return DATA_STRIP_TAG(self);
22 #endif