@@ -741,22 +741,24 @@ pub const type_info_t = extern struct {
741741
742742pub const event_id_record_t = opaque {};
743743
744- pub const event_record_t = extern struct {
745- any : ? * event_id_record_t ,
746- wildcard : ? * event_id_record_t ,
747- wildcard_pair : ? * event_id_record_t ,
748- event_ids : map_t ,
749- event : entity_t ,
750- };
751-
752- pub const observable_t = extern struct {
753- on_add : event_record_t ,
754- on_remove : event_record_t ,
755- on_set : event_record_t ,
756- on_wildcard : event_record_t ,
757- events : sparse_t ,
758- last_observer_id : u64 ,
759- };
744+ pub const event_record_t = anyopaque ;
745+ // pub const event_record_t = extern struct {
746+ // any: ?*event_id_record_t,
747+ // wildcard: ?*event_id_record_t,
748+ // wildcard_pair: ?*event_id_record_t,
749+ // event_ids: map_t,
750+ // event: entity_t,
751+ // };
752+
753+ pub const observable_t = anyopaque ;
754+ // pub const observable_t = extern struct {
755+ // on_add: event_record_t,
756+ // on_remove: event_record_t,
757+ // on_set: event_record_t,
758+ // on_wildcard: event_record_t,
759+ // events: sparse_t,
760+ // last_observer_id: u64,
761+ // };
760762
761763pub const table_range_t = extern struct {
762764 table : ? * table_t ,
@@ -875,7 +877,7 @@ pub const vec_t = extern struct {
875877 count : i32 ,
876878 size : i32 ,
877879 elem_size : if (flecs_is_sanitize ) size_t else void ,
878- type_name : if (flecs_is_sanitize ) [: * 0 ]const u8 else void ,
880+ type_name : if (flecs_is_sanitize ) [* : 0 ]const u8 else void ,
879881};
880882
881883pub const sparse_t = extern struct {
@@ -927,13 +929,16 @@ pub const bucket_t = extern struct {
927929 first : [* c ]bucket_entry_t ,
928930};
929931
930- pub const map_t = extern struct {
931- buckets : [* ]bucket_t ,
932- bucket_count : i32 ,
933- count : u26 ,
934- bucket_shift : u6 ,
935- allocator : * allocator_t ,
936- };
932+ pub const map_t = anyopaque ;
933+ // pub const map_t = extern struct {
934+ // buckets: [*]bucket_t,
935+ // bucket_count: i32,
936+ // x: packed struct {
937+ // count: u26,
938+ // bucket_shift: u6,
939+ // },
940+ // allocator: *allocator_t,
941+ // };
937942
938943pub const map_iter_t = extern struct {
939944 map : [* c ]const map_t ,
@@ -957,11 +962,6 @@ pub const switch_page_t = extern struct {
957962 values : vec_t ,
958963};
959964
960- pub const switch_t = extern struct {
961- hdrs : map_t ,
962- pages : vec_t ,
963- };
964-
965965//--------------------------------------------------------------------------------------------------
966966
967967pub const value_t = extern struct {
@@ -3152,12 +3152,6 @@ pub const os = struct {
31523152 }
31533153};
31543154
3155- //--------------------------------------------------------------------------------------------------
3156- //
3157- // ADDONS
3158- //
3159- //--------------------------------------------------------------------------------------------------
3160-
31613155// ecs_new_w_pair
31623156pub fn new_w_pair (world : * world_t , first : entity_t , second : entity_t ) entity_t {
31633157 const pair_id = make_pair (first , second );
@@ -3169,6 +3163,13 @@ pub fn delete_children(world: *world_t, parent: entity_t) void {
31693163 delete_with (world , make_pair (ChildOf , parent ));
31703164}
31713165
3166+
3167+ //--------------------------------------------------------------------------------------------------
3168+ //
3169+ // ADDONS
3170+ //
3171+ //--------------------------------------------------------------------------------------------------
3172+
31723173//--------------------------------------------------------------------------------------------------
31733174//
31743175// FLECS_MODULE
@@ -3183,13 +3184,177 @@ extern fn ecs_import_c(world: *world_t, module: module_action_t, module_name_c:
31833184pub const module_init = ecs_module_init ;
31843185extern fn ecs_module_init (world : * world_t , c_name : [* :0 ]const u8 , desc : * component_desc_t ) entity_t ;
31853186
3187+ //--------------------------------------------------------------------------------------------------
3188+ //
3189+ // FLECS_META
3190+ //
3191+ //--------------------------------------------------------------------------------------------------
3192+
3193+ pub extern fn FlecsMetaImport (world : * world_t ) void ;
3194+
3195+ pub const ecs_bool_t = bool ;
3196+ pub const ecs_char_t = i8 ;
3197+ pub const ecs_byte_t = u8 ;
3198+ pub const ecs_u8_t = u8 ;
3199+ pub const ecs_u16_t = u16 ;
3200+ pub const ecs_u32_t = u32 ;
3201+ pub const ecs_u64_t = u64 ;
3202+ pub const ecs_uptr_t = usize ;
3203+ pub const ecs_i8_t = i8 ;
3204+ pub const ecs_i16_t = i16 ;
3205+ pub const ecs_i32_t = i32 ;
3206+ pub const ecs_i64_t = i64 ;
3207+ pub const ecs_iptr_t = isize ;
3208+ pub const ecs_f32_t = f32 ;
3209+ pub const ecs_f64_t = f64 ;
3210+ pub const ecs_string_t = [* :0 ]u8 ;
3211+
3212+ pub extern const FLECS_IDecs_bool_tID_ : entity_t ;
3213+ pub extern const FLECS_IDecs_char_tID_ : entity_t ;
3214+ pub extern const FLECS_IDecs_byte_tID_ : entity_t ;
3215+ pub extern const FLECS_IDecs_u8_tID_ : entity_t ;
3216+ pub extern const FLECS_IDecs_u16_tID_ : entity_t ;
3217+ pub extern const FLECS_IDecs_u32_tID_ : entity_t ;
3218+ pub extern const FLECS_IDecs_u64_tID_ : entity_t ;
3219+ pub extern const FLECS_IDecs_uptr_tID_ : entity_t ;
3220+ pub extern const FLECS_IDecs_i8_tID_ : entity_t ;
3221+ pub extern const FLECS_IDecs_i16_tID_ : entity_t ;
3222+ pub extern const FLECS_IDecs_i32_tID_ : entity_t ;
3223+ pub extern const FLECS_IDecs_i64_tID_ : entity_t ;
3224+ pub extern const FLECS_IDecs_iptr_tID_ : entity_t ;
3225+ pub extern const FLECS_IDecs_f32_tID_ : entity_t ;
3226+ pub extern const FLECS_IDecs_f64_tID_ : entity_t ;
3227+ pub extern const FLECS_IDecs_string_tID_ : entity_t ;
3228+ pub extern const FLECS_IDecs_entity_tID_ : entity_t ;
3229+ pub extern const FLECS_IDecs_id_tID_ : entity_t ;
3230+
3231+ pub const ECS_MEMBER_DESC_CACHE_SIZE = 32 ;
3232+
3233+ pub const member_value_range_t = extern struct {
3234+ min : f64 = 0 ,
3235+ max : f64 = 0 ,
3236+ };
3237+
3238+ pub const member_t = extern struct {
3239+ name : [* :0 ]const u8 = "" ,
3240+ type : entity_t = 0 ,
3241+ count : i32 = 0 ,
3242+ offset : i32 = 0 ,
3243+ unit : entity_t = 0 ,
3244+ use_offset : bool = false ,
3245+ range : member_value_range_t = .{},
3246+ error_range : member_value_range_t = .{},
3247+ warning_range : member_value_range_t = .{},
3248+ size : size_t = 0 ,
3249+ member : entity_t = 0 ,
3250+ };
3251+
3252+ pub const struct_desc_t = extern struct {
3253+ entity : entity_t ,
3254+ members : [ECS_MEMBER_DESC_CACHE_SIZE ]member_t ,
3255+ };
3256+
3257+ pub const struct_init = ecs_struct_init ;
3258+ extern fn ecs_struct_init (world : * world_t , desc : struct_desc_t ) entity_t ;
3259+
3260+ //--------------------------------------------------------------------------------------------------
3261+ //
3262+ // FLECS_SCRIPT
3263+ //
3264+ //--------------------------------------------------------------------------------------------------
3265+
3266+ pub extern fn FlecsScriptImport (world : * world_t ) void ;
3267+
3268+ pub const script_t = extern struct {
3269+ world : * world_t ,
3270+ name : [* :0 ]const u8 ,
3271+ code : [* :0 ]const u8 ,
3272+ };
3273+
3274+ pub const script_var_t = extern struct {
3275+ name : [* :0 ]const u8 ,
3276+ value : value_t ,
3277+ type_info : * const type_info_t ,
3278+ sp : i32 ,
3279+ is_const : bool ,
3280+ };
3281+
3282+ pub const script_vars_t = anyopaque ;
3283+ // pub const script_vars_t = extern struct {
3284+ // parent: ?*script_vars_t,
3285+ // sp: i32,
3286+
3287+ // var_index: hashmap_t,
3288+ // vars: vec_t,
3289+
3290+ // world: *const world_t,
3291+ // stack: *stack_t,
3292+ // cursor: *stack_cursor_t,
3293+ // allocator: *allocator_t,
3294+ // };
3295+
3296+ pub const script_runtime_t = anyopaque ;
3297+
3298+ pub const script_eval_desc_t = extern struct {
3299+ vars : * script_vars_t ,
3300+ runtime : ? * script_runtime_t = null ,
3301+ };
3302+
3303+ pub const script_parse = ecs_script_parse ;
3304+ extern fn ecs_script_parse (world : * world_t , name : [* :0 ]const u8 , code : [* :0 ]const u8 , desc : ? * const script_eval_desc_t ) ? * script_t ;
3305+
3306+ pub const script_eval = ecs_script_eval ;
3307+ extern fn ecs_script_eval (script : * const script_t , desc : ? * const script_eval_desc_t ) c_int ;
3308+
3309+ pub const script_free = ecs_script_free ;
3310+ extern fn ecs_script_free (script : * script_t ) void ;
3311+
3312+ pub const script_run = ecs_script_run ;
3313+ extern fn ecs_script_run (world : * world_t , name : [* :0 ]const u8 , code : [* :0 ]const u8 , desc : ? * const script_eval_desc_t ) c_int ;
3314+
3315+ pub const script_runtime_new = ecs_script_runtime_new ;
3316+ extern fn ecs_script_runtime_new () * script_runtime_t ;
3317+
3318+ pub const script_runtime_free = ecs_script_runtime_free ;
3319+ extern fn ecs_script_runtime_free (runtime : * script_runtime_t ) void ;
3320+
3321+ pub const script_ast_to_buf = ecs_script_ast_to_buf ;
3322+ extern fn ecs_script_ast_to_buf (script : * script_t , buf : * strbuf_t , colors : bool ) void ;
3323+
3324+ pub const script_ast_to_str = ecs_script_ast_to_str ;
3325+ extern fn ecs_script_ast_to_str (script : * script_t , colors : bool ) void ;
3326+
3327+ // Vars
3328+
3329+ pub const script_vars_init = ecs_script_vars_init ;
3330+ extern fn ecs_script_vars_init (world : * world_t ) * script_vars_t ;
3331+
3332+ pub const script_vars_fini = ecs_script_vars_fini ;
3333+ extern fn ecs_script_vars_fini (vars : * script_vars_t ) void ;
3334+
3335+ pub const script_vars_push = ecs_script_vars_push ;
3336+ extern fn ecs_script_vars_push (vars : ? * script_vars_t ) * script_vars_t ;
3337+
3338+ pub const script_vars_pop = ecs_script_vars_pop ;
3339+ extern fn ecs_script_vars_pop (vars : * script_vars_t ) * script_vars_t ;
3340+
3341+ pub const script_vars_declare = ecs_script_vars_declare ;
3342+ extern fn ecs_script_vars_declare (vars : * script_vars_t , name : [* :0 ]const u8 ) ? * script_var_t ;
3343+
3344+ pub const script_vars_define_id = ecs_script_vars_define_id ;
3345+ extern fn ecs_script_vars_define_id (vars : * script_vars_t , name : [* :0 ]const u8 , @"type" : entity_t ) ? * script_var_t ;
3346+ pub fn script_vars_define (vars : * script_vars_t , name : [* :0 ]const u8 , T : type ) ? * script_var_t {
3347+ return script_vars_define_id (vars , name , id (T ));
3348+ }
3349+
31863350//--------------------------------------------------------------------------------------------------
31873351//
31883352// FLECS_STATS
31893353//
31903354//--------------------------------------------------------------------------------------------------
31913355
31923356pub extern fn FlecsStatsImport (world : * world_t ) void ;
3357+
31933358//--------------------------------------------------------------------------------------------------
31943359//
31953360// FLECS_REST
0 commit comments