void
database_struct_add(Eolian_Typedecl *tp)
{
- eina_hash_set(_structs, tp->full_name, tp);
- eina_hash_set(_structsf, tp->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(_structsf, tp->base.file), tp));
+ eina_hash_set(_state->unit.structs, tp->full_name, tp);
+ eina_hash_set(_state->structs_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(_state->structs_f, tp->base.file), tp));
database_decl_add(tp->full_name, EOLIAN_DECL_STRUCT, tp->base.file, tp);
}
eolian_typedecl_struct_get_by_name(const Eolian_Unit *unit EINA_UNUSED,
const char *name)
{
- if (!_structs) return NULL;
+ if (!_state) return NULL;
Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Typedecl *tp = eina_hash_find(_structs, shr);
+ Eolian_Typedecl *tp = eina_hash_find(_state->unit.structs, shr);
eina_stringshare_del(shr);
if (!tp) return NULL;
return tp;
eolian_typedecl_structs_get_by_file(const Eolian_Unit *unit EINA_UNUSED,
const char *fname)
{
- if (!_structsf) return NULL;
+ if (!_state) return NULL;
Eina_Stringshare *shr = eina_stringshare_add(fname);
- Eina_List *l = eina_hash_find(_structsf, shr);
+ Eina_List *l = eina_hash_find(_state->structs_f, shr);
eina_stringshare_del(shr);
if (!l) return NULL;
return eina_list_iterator_new(l);
EAPI Eina_Iterator *
eolian_typedecl_all_structs_get(const Eolian_Unit *unit EINA_UNUSED)
{
- return (_structs ? eina_hash_iterator_data_new(_structs) : NULL);
+ return (_state ? eina_hash_iterator_data_new(_state->unit.structs) : NULL);
}
EAPI Eina_Iterator *
if (!rt.succ)
return EINA_FALSE;
- eina_hash_foreach(_structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
+ eina_hash_foreach(_state->unit.structs, (Eina_Hash_Foreach)_typedecl_map_cb, &rt);
if (!rt.succ)
return EINA_FALSE;
#include "eolian_database.h"
#include "eolian_priv.h"
-Eina_Hash *_structs = NULL;
Eina_Hash *_enums = NULL;
Eina_Hash *_globals = NULL;
Eina_Hash *_constants = NULL;
-Eina_Hash *_structsf = NULL;
Eina_Hash *_enumsf = NULL;
Eina_Hash *_globalsf = NULL;
Eina_Hash *_constantsf = NULL;
{
if (_database_init_count > 0) return ++_database_init_count;
eina_init();
- _structs = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
_enums = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
_globals = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
_constants = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
- _structsf = eina_hash_stringshared_new(_hashlist_free);
_enumsf = eina_hash_stringshared_new(_hashlist_free);
_globalsf = eina_hash_stringshared_new(_hashlist_free);
_constantsf = eina_hash_stringshared_new(_hashlist_free);
if (_database_init_count == 0)
{
eolian_free(_state); _state = NULL;
- eina_hash_free(_structs ); _structs = NULL;
eina_hash_free(_enums ); _enums = NULL;
eina_hash_free(_globals ); _globals = NULL;
eina_hash_free(_constants ); _constants = NULL;
- eina_hash_free(_structsf ); _structsf = NULL;
eina_hash_free(_enumsf ); _enumsf = NULL;
eina_hash_free(_globalsf ); _globalsf = NULL;
eina_hash_free(_constantsf); _constantsf = NULL;
state->classes_f = eina_hash_stringshared_new(NULL);
state->aliases_f = eina_hash_stringshared_new(_hashlist_free);
+ state->structs_f = eina_hash_stringshared_new(_hashlist_free);
return state;
}
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_eolian_log_dom, __VA_ARGS__)
-extern Eina_Hash *_structs;
extern Eina_Hash *_enums;
extern Eina_Hash *_globals;
extern Eina_Hash *_constants;
-extern Eina_Hash *_structsf;
extern Eina_Hash *_enumsf;
extern Eina_Hash *_globalsf;
extern Eina_Hash *_constantsf;
Eina_Hash *classes_f;
Eina_Hash *aliases_f;
+ Eina_Hash *structs_f;
};
typedef struct _Eolian_Object