2014-02-11 05:42:59 -08:00
|
|
|
#ifndef __EOLIAN_DATABASE_H
|
|
|
|
#define __EOLIAN_DATABASE_H
|
|
|
|
|
|
|
|
#include <Eolian.h>
|
|
|
|
|
2014-02-19 04:09:36 -08:00
|
|
|
extern int _eolian_log_dom;
|
2014-07-07 08:46:12 -07:00
|
|
|
extern Eina_Prefix *_eolian_prefix;
|
2014-02-19 04:09:36 -08:00
|
|
|
|
|
|
|
#ifdef CRI
|
|
|
|
#undef CRI
|
|
|
|
#endif
|
|
|
|
#define CRI(...) EINA_LOG_DOM_CRIT(_eolian_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef ERR
|
|
|
|
#undef ERR
|
|
|
|
#endif
|
|
|
|
#define ERR(...) EINA_LOG_DOM_ERR(_eolian_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef WRN
|
|
|
|
#undef WRN
|
|
|
|
#endif
|
|
|
|
#define WRN(...) EINA_LOG_DOM_WARN(_eolian_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef INF
|
|
|
|
#undef INF
|
|
|
|
#endif
|
|
|
|
#define INF(...) EINA_LOG_DOM_INFO(_eolian_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef DBG
|
|
|
|
#undef DBG
|
|
|
|
#endif
|
|
|
|
#define DBG(...) EINA_LOG_DOM_DBG(_eolian_log_dom, __VA_ARGS__)
|
|
|
|
|
2014-07-30 03:57:11 -07:00
|
|
|
extern Eina_Hash *_classes;
|
2014-07-21 08:57:45 -07:00
|
|
|
extern Eina_Hash *_aliases;
|
2014-07-10 04:15:29 -07:00
|
|
|
extern Eina_Hash *_structs;
|
2014-08-11 06:56:50 -07:00
|
|
|
extern Eina_Hash *_enums;
|
2014-08-08 07:19:52 -07:00
|
|
|
extern Eina_Hash *_globals;
|
|
|
|
extern Eina_Hash *_constants;
|
2014-07-30 03:57:11 -07:00
|
|
|
extern Eina_Hash *_classesf;
|
2014-07-22 05:14:44 -07:00
|
|
|
extern Eina_Hash *_aliasesf;
|
|
|
|
extern Eina_Hash *_structsf;
|
2014-08-11 06:56:50 -07:00
|
|
|
extern Eina_Hash *_enumsf;
|
2014-08-08 07:19:52 -07:00
|
|
|
extern Eina_Hash *_globalsf;
|
|
|
|
extern Eina_Hash *_constantsf;
|
2014-07-10 04:15:29 -07:00
|
|
|
extern Eina_Hash *_filenames; /* Hash: filename without extension -> full path */
|
|
|
|
extern Eina_Hash *_tfilenames;
|
|
|
|
|
2015-05-15 07:10:58 -07:00
|
|
|
/* a hash holding all declarations, for redef checking etc */
|
|
|
|
extern Eina_Hash *_decls;
|
|
|
|
|
2015-05-19 07:26:53 -07:00
|
|
|
/* holds parsed/currently parsing eot files to keep track */
|
2015-05-22 09:14:38 -07:00
|
|
|
extern Eina_Hash *_parsedeos;
|
2015-05-20 07:41:07 -07:00
|
|
|
extern Eina_Hash *_parsingeos;
|
2015-05-19 07:26:53 -07:00
|
|
|
|
2015-09-23 09:17:50 -07:00
|
|
|
/* for deferred dependency parsing */
|
|
|
|
extern Eina_Hash *_defereos;
|
|
|
|
|
2014-08-04 06:29:13 -07:00
|
|
|
typedef struct _Eolian_Object
|
|
|
|
{
|
2014-08-06 08:30:42 -07:00
|
|
|
const char *file;
|
2014-08-04 06:29:13 -07:00
|
|
|
int line;
|
|
|
|
int column;
|
|
|
|
} Eolian_Object;
|
|
|
|
|
2015-06-03 07:06:26 -07:00
|
|
|
struct _Eolian_Documentation
|
2015-06-02 10:27:46 -07:00
|
|
|
{
|
|
|
|
Eolian_Object base;
|
|
|
|
Eina_Stringshare *summary;
|
|
|
|
Eina_Stringshare *description;
|
2015-06-08 07:55:02 -07:00
|
|
|
Eina_Stringshare *since;
|
2015-06-03 07:06:26 -07:00
|
|
|
};
|
2015-06-02 10:27:46 -07:00
|
|
|
|
2015-06-03 07:06:26 -07:00
|
|
|
struct _Eolian_Declaration
|
2015-05-15 07:10:58 -07:00
|
|
|
{
|
|
|
|
Eolian_Declaration_Type type;
|
|
|
|
Eina_Stringshare *name;
|
|
|
|
void *data;
|
2015-06-03 07:06:26 -07:00
|
|
|
};
|
2015-05-15 07:10:58 -07:00
|
|
|
|
2014-07-10 04:15:29 -07:00
|
|
|
struct _Eolian_Class
|
|
|
|
{
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *full_name;
|
|
|
|
Eina_List *namespaces; /* List Eina_Stringshare * */
|
|
|
|
Eina_Stringshare *name;
|
|
|
|
Eolian_Class_Type type;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *doc;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *legacy_prefix;
|
|
|
|
Eina_Stringshare *eo_prefix;
|
2016-05-17 09:14:47 -07:00
|
|
|
Eina_Stringshare *ev_prefix;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *data_type;
|
|
|
|
Eina_List *inherits; /* List Eina_Stringshare * */
|
|
|
|
Eina_List *properties; /* List prop_name -> Eolian_Function */
|
|
|
|
Eina_List *methods; /* List meth_name -> Eolian_Function */
|
|
|
|
Eina_List *implements; /* List implements name -> Eolian_Implement */
|
2014-09-01 07:35:50 -07:00
|
|
|
Eina_List *constructors; /* List constructors name -> Eolian_Constructor */
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_List *events; /* List event_name -> Eolian_Event */
|
|
|
|
Eina_Bool class_ctor_enable:1;
|
|
|
|
Eina_Bool class_dtor_enable:1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Eolian_Function
|
|
|
|
{
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
|
|
|
Eolian_Object set_base;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *name;
|
2015-05-20 09:42:00 -07:00
|
|
|
union { /* lists of Eolian_Function_Parameter */
|
|
|
|
Eina_List *params;
|
|
|
|
struct {
|
|
|
|
Eina_List *prop_values;
|
|
|
|
Eina_List *prop_values_get;
|
|
|
|
Eina_List *prop_values_set;
|
|
|
|
Eina_List *prop_keys;
|
|
|
|
Eina_List *prop_keys_get;
|
|
|
|
Eina_List *prop_keys_set;
|
|
|
|
};
|
|
|
|
};
|
2014-07-10 04:15:29 -07:00
|
|
|
Eolian_Function_Type type;
|
2014-08-13 03:53:33 -07:00
|
|
|
Eolian_Object_Scope scope;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eolian_Type *get_ret_type;
|
|
|
|
Eolian_Type *set_ret_type;
|
2014-08-07 07:15:07 -07:00
|
|
|
Eolian_Expression *get_ret_val;
|
|
|
|
Eolian_Expression *set_ret_val;
|
2014-09-05 08:04:08 -07:00
|
|
|
Eolian_Implement *get_impl;
|
|
|
|
Eolian_Implement *set_impl;
|
2014-08-15 03:52:11 -07:00
|
|
|
Eina_Stringshare *get_legacy;
|
|
|
|
Eina_Stringshare *set_legacy;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *common_doc;
|
|
|
|
Eolian_Documentation *get_doc;
|
|
|
|
Eolian_Documentation *set_doc;
|
|
|
|
Eolian_Documentation *get_return_doc;
|
|
|
|
Eolian_Documentation *set_return_doc;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */
|
|
|
|
Eina_Bool get_virtual_pure :1;
|
|
|
|
Eina_Bool set_virtual_pure :1;
|
2014-09-03 06:25:50 -07:00
|
|
|
Eina_Bool get_auto :1;
|
|
|
|
Eina_Bool set_auto :1;
|
|
|
|
Eina_Bool get_empty :1;
|
|
|
|
Eina_Bool set_empty :1;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Bool get_return_warn_unused :1; /* also used for methods */
|
|
|
|
Eina_Bool set_return_warn_unused :1;
|
2016-06-07 06:59:36 -07:00
|
|
|
Eina_Bool get_return_is_ref: 1;
|
|
|
|
Eina_Bool set_return_is_ref: 1;
|
2014-08-18 06:51:03 -07:00
|
|
|
Eina_Bool get_only_legacy: 1;
|
|
|
|
Eina_Bool set_only_legacy: 1;
|
2014-07-24 04:05:12 -07:00
|
|
|
Eina_Bool is_class :1;
|
2014-12-03 06:59:24 -08:00
|
|
|
Eina_Bool is_c_only :1;
|
2015-05-08 06:00:07 -07:00
|
|
|
Eina_Bool is_beta :1;
|
2014-09-12 12:51:37 -07:00
|
|
|
Eina_List *ctor_of;
|
2014-09-25 07:37:18 -07:00
|
|
|
Eolian_Class *klass;
|
2014-07-10 04:15:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Eolian_Function_Parameter
|
|
|
|
{
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *name;
|
|
|
|
Eolian_Type *type;
|
2014-09-02 02:47:38 -07:00
|
|
|
Eolian_Expression *value;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *doc;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eolian_Parameter_Dir param_dir;
|
2015-02-12 03:32:34 -08:00
|
|
|
Eina_Bool nonull :1; /* True if this argument cannot be NULL - deprecated */
|
|
|
|
Eina_Bool nullable :1; /* True if this argument is nullable */
|
|
|
|
Eina_Bool optional :1; /* True if this argument is optional */
|
2014-07-10 04:15:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Eolian_Type
|
|
|
|
{
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
2014-07-21 05:56:20 -07:00
|
|
|
Eolian_Type_Type type;
|
2014-11-27 09:20:21 -08:00
|
|
|
Eina_List *subtypes;
|
|
|
|
Eolian_Type *base_type;
|
|
|
|
Eina_Stringshare *name;
|
|
|
|
Eina_Stringshare *full_name;
|
|
|
|
Eina_List *namespaces;
|
|
|
|
Eina_Stringshare *freefunc;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Bool is_const :1;
|
|
|
|
Eina_Bool is_own :1;
|
|
|
|
};
|
|
|
|
|
2015-12-14 07:52:30 -08:00
|
|
|
struct _Eolian_Typedecl
|
2015-12-14 07:48:29 -08:00
|
|
|
{
|
|
|
|
Eolian_Object base;
|
2015-12-14 07:52:30 -08:00
|
|
|
Eolian_Typedecl_Type type;
|
2015-12-15 08:01:02 -08:00
|
|
|
Eolian_Type *base_type;
|
2015-12-14 07:48:29 -08:00
|
|
|
Eina_Stringshare *name;
|
|
|
|
Eina_Stringshare *full_name;
|
|
|
|
Eina_List *namespaces;
|
|
|
|
Eina_Hash *fields;
|
|
|
|
Eina_List *field_list;
|
|
|
|
Eolian_Documentation *doc;
|
|
|
|
Eina_Stringshare *legacy;
|
2016-02-11 07:34:26 -08:00
|
|
|
Eina_Stringshare *freefunc;
|
2015-12-14 07:48:29 -08:00
|
|
|
Eina_Bool is_extern :1;
|
|
|
|
};
|
|
|
|
|
2014-07-10 04:15:29 -07:00
|
|
|
struct _Eolian_Implement
|
|
|
|
{
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
2014-08-13 05:09:03 -07:00
|
|
|
const Eolian_Class *klass;
|
2014-09-04 07:15:38 -07:00
|
|
|
const Eolian_Function *foo_id;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *full_name;
|
2014-08-29 03:40:29 -07:00
|
|
|
Eina_Bool is_virtual :1;
|
|
|
|
Eina_Bool is_prop_get :1;
|
|
|
|
Eina_Bool is_prop_set :1;
|
2014-08-29 06:33:56 -07:00
|
|
|
Eina_Bool is_auto: 1;
|
|
|
|
Eina_Bool is_empty: 1;
|
2014-07-10 04:15:29 -07:00
|
|
|
};
|
|
|
|
|
2014-09-01 07:35:50 -07:00
|
|
|
struct _Eolian_Constructor
|
|
|
|
{
|
|
|
|
Eolian_Object base;
|
|
|
|
const Eolian_Class *klass;
|
|
|
|
Eina_Stringshare *full_name;
|
2014-11-20 07:21:44 -08:00
|
|
|
Eina_Bool is_optional: 1;
|
2014-09-01 07:35:50 -07:00
|
|
|
};
|
|
|
|
|
2014-07-10 04:15:29 -07:00
|
|
|
struct _Eolian_Event
|
|
|
|
{
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *name;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *doc;
|
2014-07-11 03:47:37 -07:00
|
|
|
Eolian_Type *type;
|
2014-09-25 06:58:53 -07:00
|
|
|
Eolian_Class *klass;
|
2014-08-13 03:53:33 -07:00
|
|
|
int scope;
|
2015-05-08 06:22:32 -07:00
|
|
|
Eina_Bool is_beta :1;
|
2016-02-02 09:55:01 -08:00
|
|
|
Eina_Bool is_hot :1;
|
2016-04-20 15:53:16 -07:00
|
|
|
Eina_Bool is_restart :1;
|
2014-07-10 04:15:29 -07:00
|
|
|
};
|
|
|
|
|
2014-08-22 08:56:41 -07:00
|
|
|
struct _Eolian_Struct_Type_Field
|
2014-07-10 06:19:06 -07:00
|
|
|
{
|
2014-08-22 08:56:41 -07:00
|
|
|
Eina_Stringshare *name;
|
2014-08-04 06:29:13 -07:00
|
|
|
Eolian_Object base;
|
2014-07-10 06:19:06 -07:00
|
|
|
Eolian_Type *type;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *doc;
|
2016-06-06 07:22:56 -07:00
|
|
|
Eina_Bool is_ref: 1;
|
2014-08-22 08:56:41 -07:00
|
|
|
};
|
2014-07-10 06:19:06 -07:00
|
|
|
|
2014-08-22 08:56:41 -07:00
|
|
|
struct _Eolian_Enum_Type_Field
|
2014-08-11 06:56:50 -07:00
|
|
|
{
|
2016-03-01 07:37:57 -08:00
|
|
|
Eolian_Typedecl *base_enum;
|
2014-08-22 08:56:41 -07:00
|
|
|
Eina_Stringshare *name;
|
2014-08-11 06:56:50 -07:00
|
|
|
Eolian_Object base;
|
|
|
|
Eolian_Expression *value;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *doc;
|
2015-05-13 09:56:18 -07:00
|
|
|
Eina_Bool is_public_value :1;
|
2014-08-22 08:56:41 -07:00
|
|
|
};
|
2014-08-11 06:56:50 -07:00
|
|
|
|
2014-07-17 09:16:31 -07:00
|
|
|
struct _Eolian_Expression
|
|
|
|
{
|
2014-08-06 08:30:42 -07:00
|
|
|
Eolian_Object base;
|
2014-07-17 09:16:31 -07:00
|
|
|
Eolian_Expression_Type type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Eolian_Binary_Operator binop;
|
|
|
|
Eolian_Expression *lhs;
|
|
|
|
Eolian_Expression *rhs;
|
|
|
|
};
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Eolian_Unary_Operator unop;
|
|
|
|
Eolian_Expression *expr;
|
|
|
|
};
|
2014-08-18 05:12:08 -07:00
|
|
|
Eolian_Value_Union value;
|
2014-07-17 09:16:31 -07:00
|
|
|
};
|
2015-05-13 09:56:18 -07:00
|
|
|
Eina_Bool weak_lhs :1;
|
|
|
|
Eina_Bool weak_rhs :1;
|
2014-07-17 09:16:31 -07:00
|
|
|
};
|
|
|
|
|
2014-08-08 07:19:52 -07:00
|
|
|
struct _Eolian_Variable
|
|
|
|
{
|
|
|
|
Eolian_Object base;
|
|
|
|
Eolian_Variable_Type type;
|
|
|
|
Eina_Stringshare *name;
|
|
|
|
Eina_Stringshare *full_name;
|
|
|
|
Eina_List *namespaces;
|
|
|
|
Eolian_Type *base_type;
|
|
|
|
Eolian_Expression *value;
|
2015-06-03 07:06:26 -07:00
|
|
|
Eolian_Documentation *doc;
|
2014-08-08 07:57:39 -07:00
|
|
|
Eina_Bool is_extern :1;
|
2014-08-08 07:19:52 -07:00
|
|
|
};
|
|
|
|
|
2015-11-26 08:25:06 -08:00
|
|
|
int database_init(void);
|
|
|
|
int database_shutdown(void);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-08-15 06:14:43 -07:00
|
|
|
char *database_class_to_filename(const char *cname);
|
2016-02-10 08:04:01 -08:00
|
|
|
Eina_Bool database_validate(Eina_Bool silent_types);
|
2016-05-06 04:56:16 -07:00
|
|
|
const Eolian_Class *database_object_class_fill(const char *class_name, const Eolian_Class **cl);
|
2014-08-15 06:14:43 -07:00
|
|
|
|
2015-06-01 06:32:19 -07:00
|
|
|
void database_decl_add(Eina_Stringshare *name, Eolian_Declaration_Type type,
|
|
|
|
Eina_Stringshare *file, void *ptr);
|
2015-05-15 07:10:58 -07:00
|
|
|
|
2015-06-03 07:35:13 -07:00
|
|
|
void database_doc_del(Eolian_Documentation *doc);
|
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* types */
|
2014-04-30 02:03:09 -07:00
|
|
|
|
2016-03-01 07:37:57 -08:00
|
|
|
void database_type_add(Eolian_Typedecl *def);
|
|
|
|
void database_struct_add(Eolian_Typedecl *tp);
|
|
|
|
void database_enum_add(Eolian_Typedecl *tp);
|
2014-07-22 02:39:34 -07:00
|
|
|
void database_type_del(Eolian_Type *tp);
|
2015-12-15 08:01:02 -08:00
|
|
|
void database_typedecl_del(Eolian_Typedecl *tp);
|
|
|
|
|
2016-06-06 07:22:56 -07:00
|
|
|
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name, Eina_Bool is_ref);
|
2016-06-06 07:50:15 -07:00
|
|
|
void database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-08-07 03:13:40 -07:00
|
|
|
/* expressions */
|
|
|
|
|
2014-08-18 05:12:08 -07:00
|
|
|
Eolian_Value database_expr_eval(const Eolian_Expression *expr, Eolian_Expression_Mask mask);
|
2014-08-07 07:15:07 -07:00
|
|
|
void database_expr_del(Eolian_Expression *expr);
|
2014-08-12 07:26:48 -07:00
|
|
|
void database_expr_print(Eolian_Expression *expr);
|
2014-08-07 03:13:40 -07:00
|
|
|
|
2014-08-08 07:19:52 -07:00
|
|
|
/* variables */
|
|
|
|
|
|
|
|
void database_var_del(Eolian_Variable *var);
|
2014-09-12 06:20:52 -07:00
|
|
|
void database_var_add(Eolian_Variable *var);
|
2014-08-08 07:19:52 -07:00
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* classes */
|
|
|
|
void database_class_del(Eolian_Class *cl);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* functions */
|
2014-07-10 04:15:29 -07:00
|
|
|
void database_function_del(Eolian_Function *fid);
|
2014-09-12 12:51:37 -07:00
|
|
|
void database_function_constructor_add(Eolian_Function *func, const Eolian_Class *klass);
|
2014-07-10 04:15:29 -07:00
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* func parameters */
|
|
|
|
void database_parameter_del(Eolian_Function_Parameter *pdesc);
|
2014-02-18 05:16:51 -08:00
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* implements */
|
2014-07-10 07:23:06 -07:00
|
|
|
void database_implement_del(Eolian_Implement *impl);
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-09-01 07:35:50 -07:00
|
|
|
/* constructors */
|
|
|
|
void database_constructor_del(Eolian_Constructor *ctor);
|
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* events */
|
|
|
|
void database_event_del(Eolian_Event *event);
|
2014-07-09 05:26:00 -07:00
|
|
|
|
2014-07-10 05:13:46 -07:00
|
|
|
|
2014-02-11 05:42:59 -08:00
|
|
|
#endif
|