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;
|
|
|
|
|
2014-08-26 03:06:54 -07:00
|
|
|
/* a hash holding lists of deps */
|
|
|
|
extern Eina_Hash *_depclasses;
|
|
|
|
|
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;
|
|
|
|
|
2014-08-26 03:06:54 -07:00
|
|
|
typedef struct _Eolian_Dependency
|
|
|
|
{
|
|
|
|
Eolian_Object base;
|
|
|
|
Eina_Stringshare *filename;
|
|
|
|
Eina_Stringshare *name;
|
|
|
|
} Eolian_Dependency;
|
|
|
|
|
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;
|
|
|
|
Eina_Stringshare *description;
|
|
|
|
Eina_Stringshare *legacy_prefix;
|
|
|
|
Eina_Stringshare *eo_prefix;
|
|
|
|
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;
|
|
|
|
Eina_List *keys; /* list of Eolian_Function_Parameter */
|
|
|
|
Eina_List *params; /* list of Eolian_Function_Parameter */
|
|
|
|
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;
|
2014-10-19 01:17:39 -07:00
|
|
|
Eina_Stringshare *common_description;
|
2014-08-15 03:52:11 -07:00
|
|
|
Eina_Stringshare *get_description;
|
|
|
|
Eina_Stringshare *set_description;
|
|
|
|
Eina_Stringshare *get_return_comment;
|
|
|
|
Eina_Stringshare *set_return_comment;
|
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;
|
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;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Stringshare *description;
|
|
|
|
Eolian_Parameter_Dir param_dir;
|
|
|
|
Eina_Bool is_const_on_get :1; /* True if const in this the get property */
|
|
|
|
Eina_Bool is_const_on_set :1; /* True if const in this the set property */
|
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_Hash *fields;
|
|
|
|
Eina_List *field_list;
|
|
|
|
Eina_Stringshare *comment;
|
|
|
|
Eina_Stringshare *legacy;
|
|
|
|
Eina_Stringshare *freefunc;
|
2014-07-10 04:15:29 -07:00
|
|
|
Eina_Bool is_const :1;
|
|
|
|
Eina_Bool is_own :1;
|
2014-07-15 07:33:22 -07: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;
|
|
|
|
Eina_Stringshare *comment;
|
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;
|
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;
|
|
|
|
Eina_Stringshare *comment;
|
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
|
|
|
{
|
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;
|
|
|
|
Eina_Stringshare *comment;
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
Eina_Stringshare *comment;
|
2014-08-08 07:57:39 -07:00
|
|
|
Eina_Bool is_extern :1;
|
2014-08-08 07:19:52 -07:00
|
|
|
};
|
|
|
|
|
2014-02-16 01:41:38 -08:00
|
|
|
int database_init();
|
|
|
|
int database_shutdown();
|
2014-02-11 05:42:59 -08:00
|
|
|
|
2014-08-15 06:14:43 -07:00
|
|
|
char *database_class_to_filename(const char *cname);
|
2014-08-21 08:23:37 -07:00
|
|
|
Eina_Bool database_validate(void);
|
2014-09-01 07:35:50 -07:00
|
|
|
Eina_Bool database_class_name_validate(const char *class_name, const Eolian_Class **cl);
|
2014-08-15 06:14:43 -07:00
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
/* types */
|
2014-04-30 02:03:09 -07:00
|
|
|
|
2014-09-12 06:20:52 -07:00
|
|
|
void database_type_add(Eolian_Type *def);
|
|
|
|
void database_struct_add(Eolian_Type *tp);
|
|
|
|
void database_enum_add(Eolian_Type *tp);
|
2014-07-22 02:39:34 -07:00
|
|
|
void database_type_del(Eolian_Type *tp);
|
|
|
|
void database_typedef_del(Eolian_Type *tp);
|
2014-07-08 08:42:33 -07:00
|
|
|
|
2014-07-10 06:30:34 -07:00
|
|
|
void database_type_print(Eolian_Type *type);
|
|
|
|
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
|
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-09-12 12:51:37 -07:00
|
|
|
void database_implement_constructor_add(Eolian_Implement *impl, const Eolian_Class *klass);
|
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
|