1pub const FLECS_HI_COMPONENT_ID: u32 = 256;
4pub const FLECS_HI_ID_RECORD_ID: u32 = 1024;
5pub const FLECS_SPARSE_PAGE_BITS: u32 = 12;
6pub const FLECS_ENTITY_PAGE_BITS: u32 = 12;
7pub const FLECS_ID_DESC_MAX: u32 = 32;
8pub const FLECS_TERM_DESC_MAX: u32 = 16;
9pub const FLECS_EVENT_DESC_MAX: u32 = 8;
10pub const FLECS_VARIABLE_COUNT_MAX: u32 = 64;
11pub const FLECS_QUERY_SCOPE_NESTING_MAX: u32 = 8;
12pub const EcsWorldQuitWorkers: u32 = 1;
13pub const EcsWorldReadonly: u32 = 2;
14pub const EcsWorldInit: u32 = 4;
15pub const EcsWorldQuit: u32 = 8;
16pub const EcsWorldFini: u32 = 16;
17pub const EcsWorldMeasureFrameTime: u32 = 32;
18pub const EcsWorldMeasureSystemTime: u32 = 64;
19pub const EcsWorldMultiThreaded: u32 = 128;
20pub const EcsOsApiHighResolutionTimer: u32 = 1;
21pub const EcsOsApiLogWithColors: u32 = 2;
22pub const EcsOsApiLogWithTimeStamp: u32 = 4;
23pub const EcsOsApiLogWithTimeDelta: u32 = 8;
24pub const EcsEntityIsId: u32 = 2147483648;
25pub const EcsEntityIsTarget: u32 = 1073741824;
26pub const EcsEntityIsTraversable: u32 = 536870912;
27pub const EcsIdOnDeleteRemove: u32 = 1;
28pub const EcsIdOnDeleteDelete: u32 = 2;
29pub const EcsIdOnDeletePanic: u32 = 4;
30pub const EcsIdOnDeleteMask: u32 = 7;
31pub const EcsIdOnDeleteObjectRemove: u32 = 8;
32pub const EcsIdOnDeleteObjectDelete: u32 = 16;
33pub const EcsIdOnDeleteObjectPanic: u32 = 32;
34pub const EcsIdOnDeleteObjectMask: u32 = 56;
35pub const EcsIdExclusive: u32 = 64;
36pub const EcsIdDontInherit: u32 = 128;
37pub const EcsIdTraversable: u32 = 256;
38pub const EcsIdTag: u32 = 512;
39pub const EcsIdWith: u32 = 1024;
40pub const EcsIdUnion: u32 = 2048;
41pub const EcsIdAlwaysOverride: u32 = 4096;
42pub const EcsIdHasOnAdd: u32 = 65536;
43pub const EcsIdHasOnRemove: u32 = 131072;
44pub const EcsIdHasOnSet: u32 = 262144;
45pub const EcsIdHasUnSet: u32 = 524288;
46pub const EcsIdHasOnTableFill: u32 = 1048576;
47pub const EcsIdHasOnTableEmpty: u32 = 2097152;
48pub const EcsIdHasOnTableCreate: u32 = 4194304;
49pub const EcsIdHasOnTableDelete: u32 = 8388608;
50pub const EcsIdEventMask: u32 = 16711680;
51pub const EcsIdMarkedForDelete: u32 = 1073741824;
52pub const EcsIterIsValid: u32 = 1;
53pub const EcsIterNoData: u32 = 2;
54pub const EcsIterIsInstanced: u32 = 4;
55pub const EcsIterHasShared: u32 = 8;
56pub const EcsIterTableOnly: u32 = 16;
57pub const EcsIterEntityOptional: u32 = 32;
58pub const EcsIterNoResults: u32 = 64;
59pub const EcsIterIgnoreThis: u32 = 128;
60pub const EcsIterMatchVar: u32 = 256;
61pub const EcsIterHasCondSet: u32 = 1024;
62pub const EcsIterProfile: u32 = 2048;
63pub const EcsEventTableOnly: u32 = 16;
64pub const EcsEventNoOnSet: u32 = 65536;
65pub const EcsFilterMatchThis: u32 = 2;
66pub const EcsFilterMatchOnlyThis: u32 = 4;
67pub const EcsFilterMatchPrefab: u32 = 8;
68pub const EcsFilterMatchDisabled: u32 = 16;
69pub const EcsFilterMatchEmptyTables: u32 = 32;
70pub const EcsFilterMatchAnything: u32 = 64;
71pub const EcsFilterNoData: u32 = 128;
72pub const EcsFilterIsInstanced: u32 = 256;
73pub const EcsFilterPopulate: u32 = 512;
74pub const EcsFilterHasCondSet: u32 = 1024;
75pub const EcsFilterUnresolvedByName: u32 = 2048;
76pub const EcsFilterHasPred: u32 = 4096;
77pub const EcsFilterHasScopes: u32 = 8192;
78pub const EcsTableHasBuiltins: u32 = 2;
79pub const EcsTableIsPrefab: u32 = 4;
80pub const EcsTableHasIsA: u32 = 8;
81pub const EcsTableHasChildOf: u32 = 16;
82pub const EcsTableHasName: u32 = 32;
83pub const EcsTableHasPairs: u32 = 64;
84pub const EcsTableHasModule: u32 = 128;
85pub const EcsTableIsDisabled: u32 = 256;
86pub const EcsTableHasCtors: u32 = 512;
87pub const EcsTableHasDtors: u32 = 1024;
88pub const EcsTableHasCopy: u32 = 2048;
89pub const EcsTableHasMove: u32 = 4096;
90pub const EcsTableHasUnion: u32 = 8192;
91pub const EcsTableHasToggle: u32 = 16384;
92pub const EcsTableHasOverrides: u32 = 32768;
93pub const EcsTableHasOnAdd: u32 = 65536;
94pub const EcsTableHasOnRemove: u32 = 131072;
95pub const EcsTableHasOnSet: u32 = 262144;
96pub const EcsTableHasUnSet: u32 = 524288;
97pub const EcsTableHasOnTableFill: u32 = 1048576;
98pub const EcsTableHasOnTableEmpty: u32 = 2097152;
99pub const EcsTableHasOnTableCreate: u32 = 4194304;
100pub const EcsTableHasOnTableDelete: u32 = 8388608;
101pub const EcsTableHasTraversable: u32 = 33554432;
102pub const EcsTableHasTarget: u32 = 67108864;
103pub const EcsTableMarkedForDelete: u32 = 1073741824;
104pub const EcsTableHasLifecycle: u32 = 1536;
105pub const EcsTableIsComplex: u32 = 26112;
106pub const EcsTableHasAddActions: u32 = 336392;
107pub const EcsTableHasRemoveActions: u32 = 656392;
108pub const EcsQueryHasRefs: u32 = 2;
109pub const EcsQueryIsSubquery: u32 = 4;
110pub const EcsQueryIsOrphaned: u32 = 8;
111pub const EcsQueryHasOutTerms: u32 = 16;
112pub const EcsQueryHasNonThisOutTerms: u32 = 32;
113pub const EcsQueryHasMonitor: u32 = 64;
114pub const EcsQueryTrivialIter: u32 = 128;
115pub const EcsAperiodicEmptyTables: u32 = 2;
116pub const EcsAperiodicComponentMonitors: u32 = 4;
117pub const EcsAperiodicEmptyQueries: u32 = 16;
118pub const ecs_world_t_magic: u32 = 1701016439;
119pub const ecs_stage_t_magic: u32 = 1701016435;
120pub const ecs_query_t_magic: u32 = 1701016433;
121pub const ecs_rule_t_magic: u32 = 1701016437;
122pub const ecs_table_t_magic: u32 = 1701016436;
123pub const ecs_filter_t_magic: u32 = 1701016422;
124pub const ecs_trigger_t_magic: u32 = 1701016434;
125pub const ecs_observer_t_magic: u32 = 1701016418;
126pub const ECS_ROW_MASK: u32 = 268435455;
127pub const ECS_ROW_FLAGS_MASK: i32 = -268435456;
128pub const ECS_ID_FLAGS_MASK: i64 = -1152921504606846976;
129pub const ECS_ENTITY_MASK: u32 = 4294967295;
130pub const ECS_GENERATION_MASK: u64 = 281470681743360;
131pub const ECS_COMPONENT_MASK: u64 = 1152921504606846975;
132pub const EcsIterNextYield: u32 = 0;
133pub const EcsIterYield: i32 = -1;
134pub const EcsIterNext: u32 = 1;
135pub const FLECS_SPARSE_PAGE_SIZE: u32 = 4096;
136pub const ECS_STRBUF_ELEMENT_SIZE: u32 = 511;
137pub const ECS_STRBUF_MAX_LIST_DEPTH: u32 = 32;
138pub const EcsSelf: u32 = 2;
139pub const EcsUp: u32 = 4;
140pub const EcsDown: u32 = 8;
141pub const EcsTraverseAll: u32 = 16;
142pub const EcsCascade: u32 = 32;
143pub const EcsParent: u32 = 64;
144pub const EcsIsVariable: u32 = 128;
145pub const EcsIsEntity: u32 = 256;
146pub const EcsIsName: u32 = 512;
147pub const EcsFilter: u32 = 1024;
148pub const EcsTraverseFlags: u32 = 126;
149pub const EcsTermMatchAny: u32 = 1;
150pub const EcsTermMatchAnySrc: u32 = 2;
151pub const EcsTermSrcFirstEq: u32 = 4;
152pub const EcsTermSrcSecondEq: u32 = 8;
153pub const EcsTermTransitive: u32 = 16;
154pub const EcsTermReflexive: u32 = 32;
155pub const EcsTermIdInherited: u32 = 64;
156pub const EcsTermMatchDisabled: u32 = 128;
157pub const EcsTermMatchPrefab: u32 = 256;
158pub const flecs_iter_cache_ids: u32 = 1;
159pub const flecs_iter_cache_columns: u32 = 2;
160pub const flecs_iter_cache_sources: u32 = 4;
161pub const flecs_iter_cache_ptrs: u32 = 8;
162pub const flecs_iter_cache_match_indices: u32 = 16;
163pub const flecs_iter_cache_variables: u32 = 32;
164pub const flecs_iter_cache_all: u32 = 255;
165pub const ECS_MAX_RECURSION: u32 = 512;
166pub const ECS_MAX_TOKEN_SIZE: u32 = 256;
167pub const FLECS_ID0ID_: u32 = 0;
168pub const EcsFirstUserComponentId: u32 = 8;
169pub const EcsFirstUserEntityId: u32 = 384;
170pub const ECS_INVALID_OPERATION: u32 = 1;
171pub const ECS_INVALID_PARAMETER: u32 = 2;
172pub const ECS_CONSTRAINT_VIOLATED: u32 = 3;
173pub const ECS_OUT_OF_MEMORY: u32 = 4;
174pub const ECS_OUT_OF_RANGE: u32 = 5;
175pub const ECS_UNSUPPORTED: u32 = 6;
176pub const ECS_INTERNAL_ERROR: u32 = 7;
177pub const ECS_ALREADY_DEFINED: u32 = 8;
178pub const ECS_MISSING_OS_API: u32 = 9;
179pub const ECS_OPERATION_FAILED: u32 = 10;
180pub const ECS_INVALID_CONVERSION: u32 = 11;
181pub const ECS_ID_IN_USE: u32 = 12;
182pub const ECS_CYCLE_DETECTED: u32 = 13;
183pub const ECS_LEAK_DETECTED: u32 = 14;
184pub const ECS_DOUBLE_FREE: u32 = 15;
185pub const ECS_INCONSISTENT_NAME: u32 = 20;
186pub const ECS_NAME_IN_USE: u32 = 21;
187pub const ECS_NOT_A_COMPONENT: u32 = 22;
188pub const ECS_INVALID_COMPONENT_SIZE: u32 = 23;
189pub const ECS_INVALID_COMPONENT_ALIGNMENT: u32 = 24;
190pub const ECS_COMPONENT_NOT_REGISTERED: u32 = 25;
191pub const ECS_INCONSISTENT_COMPONENT_ID: u32 = 26;
192pub const ECS_INCONSISTENT_COMPONENT_ACTION: u32 = 27;
193pub const ECS_MODULE_UNDEFINED: u32 = 28;
194pub const ECS_MISSING_SYMBOL: u32 = 29;
195pub const ECS_ALREADY_IN_USE: u32 = 30;
196pub const ECS_ACCESS_VIOLATION: u32 = 40;
197pub const ECS_COLUMN_INDEX_OUT_OF_RANGE: u32 = 41;
198pub const ECS_COLUMN_IS_NOT_SHARED: u32 = 42;
199pub const ECS_COLUMN_IS_SHARED: u32 = 43;
200pub const ECS_COLUMN_TYPE_MISMATCH: u32 = 45;
201pub const ECS_INVALID_WHILE_READONLY: u32 = 70;
202pub const ECS_LOCKED_STORAGE: u32 = 71;
203pub const ECS_INVALID_FROM_WORKER: u32 = 72;
204pub const ECS_BLACK: &[u8; 8] = b"\x1B[1;30m\0";
205pub const ECS_RED: &[u8; 8] = b"\x1B[0;31m\0";
206pub const ECS_GREEN: &[u8; 8] = b"\x1B[0;32m\0";
207pub const ECS_YELLOW: &[u8; 8] = b"\x1B[0;33m\0";
208pub const ECS_BLUE: &[u8; 8] = b"\x1B[0;34m\0";
209pub const ECS_MAGENTA: &[u8; 8] = b"\x1B[0;35m\0";
210pub const ECS_CYAN: &[u8; 8] = b"\x1B[0;36m\0";
211pub const ECS_WHITE: &[u8; 8] = b"\x1B[1;37m\0";
212pub const ECS_GREY: &[u8; 8] = b"\x1B[0;37m\0";
213pub const ECS_NORMAL: &[u8; 8] = b"\x1B[0;49m\0";
214pub const ECS_BOLD: &[u8; 8] = b"\x1B[1;49m\0";
215pub const ECS_HTTP_HEADER_COUNT_MAX: u32 = 32;
216pub const ECS_HTTP_QUERY_PARAM_COUNT_MAX: u32 = 32;
217pub const ECS_REST_DEFAULT_PORT: u32 = 27750;
218pub const ECS_STAT_WINDOW: u32 = 60;
219pub const ECS_ALERT_MAX_SEVERITY_FILTERS: u32 = 4;
220pub const ECS_MEMBER_DESC_CACHE_SIZE: u32 = 32;
221pub const ECS_META_MAX_SCOPE_DEPTH: u32 = 32;
222pub type va_list = __builtin_va_list;
223#[doc = "Utility types to indicate usage as bitmask"]
224pub type ecs_flags8_t = u8;
225pub type ecs_flags16_t = u16;
226pub type ecs_flags32_t = u32;
227pub type ecs_flags64_t = u64;
228#[doc = "Keep unsigned integers out of the codebase as they do more harm than good"]
229pub type ecs_size_t = i32;
230#[doc = "A component column."]
231#[repr(C)]
232#[derive(Debug, Copy, Clone)]
233pub struct ecs_vec_t {
234 pub array: *mut ::std::os::raw::c_void,
235 pub count: i32,
236 pub size: i32,
237}
238extern "C" {
239 pub fn ecs_vec_init(
240 allocator: *mut ecs_allocator_t,
241 vec: *mut ecs_vec_t,
242 size: ecs_size_t,
243 elem_count: i32,
244 ) -> *mut ecs_vec_t;
245}
246extern "C" {
247 pub fn ecs_vec_init_if(vec: *mut ecs_vec_t, size: ecs_size_t);
248}
249extern "C" {
250 pub fn ecs_vec_fini(allocator: *mut ecs_allocator_t, vec: *mut ecs_vec_t, size: ecs_size_t);
251}
252extern "C" {
253 pub fn ecs_vec_reset(
254 allocator: *mut ecs_allocator_t,
255 vec: *mut ecs_vec_t,
256 size: ecs_size_t,
257 ) -> *mut ecs_vec_t;
258}
259extern "C" {
260 pub fn ecs_vec_clear(vec: *mut ecs_vec_t);
261}
262extern "C" {
263 pub fn ecs_vec_append(
264 allocator: *mut ecs_allocator_t,
265 vec: *mut ecs_vec_t,
266 size: ecs_size_t,
267 ) -> *mut ::std::os::raw::c_void;
268}
269extern "C" {
270 pub fn ecs_vec_remove(vec: *mut ecs_vec_t, size: ecs_size_t, elem: i32);
271}
272extern "C" {
273 pub fn ecs_vec_remove_last(vec: *mut ecs_vec_t);
274}
275extern "C" {
276 pub fn ecs_vec_copy(
277 allocator: *mut ecs_allocator_t,
278 vec: *const ecs_vec_t,
279 size: ecs_size_t,
280 ) -> ecs_vec_t;
281}
282extern "C" {
283 pub fn ecs_vec_reclaim(allocator: *mut ecs_allocator_t, vec: *mut ecs_vec_t, size: ecs_size_t);
284}
285extern "C" {
286 pub fn ecs_vec_set_size(
287 allocator: *mut ecs_allocator_t,
288 vec: *mut ecs_vec_t,
289 size: ecs_size_t,
290 elem_count: i32,
291 );
292}
293extern "C" {
294 pub fn ecs_vec_set_min_size(
295 allocator: *mut ecs_allocator_t,
296 vec: *mut ecs_vec_t,
297 size: ecs_size_t,
298 elem_count: i32,
299 );
300}
301extern "C" {
302 pub fn ecs_vec_set_min_count(
303 allocator: *mut ecs_allocator_t,
304 vec: *mut ecs_vec_t,
305 size: ecs_size_t,
306 elem_count: i32,
307 );
308}
309extern "C" {
310 pub fn ecs_vec_set_min_count_zeromem(
311 allocator: *mut ecs_allocator_t,
312 vec: *mut ecs_vec_t,
313 size: ecs_size_t,
314 elem_count: i32,
315 );
316}
317extern "C" {
318 pub fn ecs_vec_set_count(
319 allocator: *mut ecs_allocator_t,
320 vec: *mut ecs_vec_t,
321 size: ecs_size_t,
322 elem_count: i32,
323 );
324}
325extern "C" {
326 pub fn ecs_vec_grow(
327 allocator: *mut ecs_allocator_t,
328 vec: *mut ecs_vec_t,
329 size: ecs_size_t,
330 elem_count: i32,
331 ) -> *mut ::std::os::raw::c_void;
332}
333extern "C" {
334 pub fn ecs_vec_count(vec: *const ecs_vec_t) -> i32;
335}
336extern "C" {
337 pub fn ecs_vec_size(vec: *const ecs_vec_t) -> i32;
338}
339extern "C" {
340 pub fn ecs_vec_get(
341 vec: *const ecs_vec_t,
342 size: ecs_size_t,
343 index: i32,
344 ) -> *mut ::std::os::raw::c_void;
345}
346extern "C" {
347 pub fn ecs_vec_first(vec: *const ecs_vec_t) -> *mut ::std::os::raw::c_void;
348}
349extern "C" {
350 pub fn ecs_vec_last(vec: *const ecs_vec_t, size: ecs_size_t) -> *mut ::std::os::raw::c_void;
351}
352#[repr(C)]
353#[derive(Debug, Copy, Clone)]
354pub struct ecs_sparse_t {
355 #[doc = "Dense array with indices to sparse array. The\n dense array stores both alive and not alive\n sparse indices. The 'count' member keeps\n track of which indices are alive."]
356 pub dense: ecs_vec_t,
357 #[doc = "Chunks with sparse arrays & data"]
358 pub pages: ecs_vec_t,
359 #[doc = "Element size"]
360 pub size: ecs_size_t,
361 #[doc = "Number of alive entries"]
362 pub count: i32,
363 #[doc = "Local max index (if no global is set)"]
364 pub max_id: u64,
365 pub allocator: *mut ecs_allocator_t,
366 pub page_allocator: *mut ecs_block_allocator_t,
367}
368extern "C" {
369 #[doc = "Initialize sparse set"]
370 pub fn flecs_sparse_init(
371 sparse: *mut ecs_sparse_t,
372 allocator: *mut ecs_allocator_t,
373 page_allocator: *mut ecs_block_allocator_t,
374 elem_size: ecs_size_t,
375 );
376}
377extern "C" {
378 pub fn flecs_sparse_fini(sparse: *mut ecs_sparse_t);
379}
380extern "C" {
381 #[doc = "Remove all elements from sparse set"]
382 pub fn flecs_sparse_clear(sparse: *mut ecs_sparse_t);
383}
384extern "C" {
385 #[doc = "Add element to sparse set, this generates or recycles an id"]
386 pub fn flecs_sparse_add(
387 sparse: *mut ecs_sparse_t,
388 elem_size: ecs_size_t,
389 ) -> *mut ::std::os::raw::c_void;
390}
391extern "C" {
392 #[doc = "Get last issued id."]
393 pub fn flecs_sparse_last_id(sparse: *const ecs_sparse_t) -> u64;
394}
395extern "C" {
396 #[doc = "Generate or recycle a new id."]
397 pub fn flecs_sparse_new_id(sparse: *mut ecs_sparse_t) -> u64;
398}
399extern "C" {
400 #[doc = "Remove an element"]
401 pub fn flecs_sparse_remove(sparse: *mut ecs_sparse_t, elem_size: ecs_size_t, id: u64);
402}
403extern "C" {
404 #[doc = "Test if id is alive, which requires the generation count to match."]
405 pub fn flecs_sparse_is_alive(sparse: *const ecs_sparse_t, id: u64) -> bool;
406}
407extern "C" {
408 #[doc = "Get value from sparse set by dense id. This function is useful in\n combination with flecs_sparse_count for iterating all values in the set."]
409 pub fn flecs_sparse_get_dense(
410 sparse: *const ecs_sparse_t,
411 elem_size: ecs_size_t,
412 index: i32,
413 ) -> *mut ::std::os::raw::c_void;
414}
415extern "C" {
416 #[doc = "Get the number of alive elements in the sparse set."]
417 pub fn flecs_sparse_count(sparse: *const ecs_sparse_t) -> i32;
418}
419extern "C" {
420 #[doc = "Get element by (sparse) id. The returned pointer is stable for the duration\n of the sparse set, as it is stored in the sparse array."]
421 pub fn flecs_sparse_get(
422 sparse: *const ecs_sparse_t,
423 elem_size: ecs_size_t,
424 id: u64,
425 ) -> *mut ::std::os::raw::c_void;
426}
427extern "C" {
428 #[doc = "Same as flecs_sparse_get, but doesn't assert if id is not alive."]
429 pub fn flecs_sparse_try(
430 sparse: *const ecs_sparse_t,
431 elem_size: ecs_size_t,
432 id: u64,
433 ) -> *mut ::std::os::raw::c_void;
434}
435extern "C" {
436 #[doc = "Like get_sparse, but don't care whether element is alive or not."]
437 pub fn flecs_sparse_get_any(
438 sparse: *const ecs_sparse_t,
439 elem_size: ecs_size_t,
440 id: u64,
441 ) -> *mut ::std::os::raw::c_void;
442}
443extern "C" {
444 #[doc = "Get or create element by (sparse) id."]
445 pub fn flecs_sparse_ensure(
446 sparse: *mut ecs_sparse_t,
447 elem_size: ecs_size_t,
448 id: u64,
449 ) -> *mut ::std::os::raw::c_void;
450}
451extern "C" {
452 #[doc = "Fast version of ensure, no liveliness checking"]
453 pub fn flecs_sparse_ensure_fast(
454 sparse: *mut ecs_sparse_t,
455 elem_size: ecs_size_t,
456 id: u64,
457 ) -> *mut ::std::os::raw::c_void;
458}
459extern "C" {
460 #[doc = "Get pointer to ids (alive and not alive). Use with count() or size()."]
461 pub fn flecs_sparse_ids(sparse: *const ecs_sparse_t) -> *const u64;
462}
463extern "C" {
464 #[doc = "Publicly exposed APIs\n The flecs_ functions aren't exposed directly as this can cause some\n optimizers to not consider them for link time optimization."]
465 pub fn ecs_sparse_init(sparse: *mut ecs_sparse_t, elem_size: ecs_size_t);
466}
467extern "C" {
468 pub fn ecs_sparse_add(
469 sparse: *mut ecs_sparse_t,
470 elem_size: ecs_size_t,
471 ) -> *mut ::std::os::raw::c_void;
472}
473extern "C" {
474 pub fn ecs_sparse_last_id(sparse: *const ecs_sparse_t) -> u64;
475}
476extern "C" {
477 pub fn ecs_sparse_count(sparse: *const ecs_sparse_t) -> i32;
478}
479extern "C" {
480 #[doc = "Override the generation count for a specific id"]
481 pub fn flecs_sparse_set_generation(sparse: *mut ecs_sparse_t, id: u64);
482}
483extern "C" {
484 pub fn ecs_sparse_get_dense(
485 sparse: *const ecs_sparse_t,
486 elem_size: ecs_size_t,
487 index: i32,
488 ) -> *mut ::std::os::raw::c_void;
489}
490extern "C" {
491 pub fn ecs_sparse_get(
492 sparse: *const ecs_sparse_t,
493 elem_size: ecs_size_t,
494 id: u64,
495 ) -> *mut ::std::os::raw::c_void;
496}
497#[repr(C)]
498#[derive(Debug, Copy, Clone)]
499pub struct ecs_block_allocator_block_t {
500 pub memory: *mut ::std::os::raw::c_void,
501 pub next: *mut ecs_block_allocator_block_t,
502}
503#[repr(C)]
504#[derive(Debug, Copy, Clone)]
505pub struct ecs_block_allocator_chunk_header_t {
506 pub next: *mut ecs_block_allocator_chunk_header_t,
507}
508#[repr(C)]
509#[derive(Debug, Copy, Clone)]
510pub struct ecs_block_allocator_t {
511 pub head: *mut ecs_block_allocator_chunk_header_t,
512 pub block_head: *mut ecs_block_allocator_block_t,
513 pub block_tail: *mut ecs_block_allocator_block_t,
514 pub chunk_size: i32,
515 pub data_size: i32,
516 pub chunks_per_block: i32,
517 pub block_size: i32,
518 pub alloc_count: i32,
519}
520extern "C" {
521 pub fn flecs_ballocator_init(ba: *mut ecs_block_allocator_t, size: ecs_size_t);
522}
523extern "C" {
524 pub fn flecs_ballocator_new(size: ecs_size_t) -> *mut ecs_block_allocator_t;
525}
526extern "C" {
527 pub fn flecs_ballocator_fini(ba: *mut ecs_block_allocator_t);
528}
529extern "C" {
530 pub fn flecs_ballocator_free(ba: *mut ecs_block_allocator_t);
531}
532extern "C" {
533 pub fn flecs_balloc(allocator: *mut ecs_block_allocator_t) -> *mut ::std::os::raw::c_void;
534}
535extern "C" {
536 pub fn flecs_bcalloc(allocator: *mut ecs_block_allocator_t) -> *mut ::std::os::raw::c_void;
537}
538extern "C" {
539 pub fn flecs_bfree(allocator: *mut ecs_block_allocator_t, memory: *mut ::std::os::raw::c_void);
540}
541extern "C" {
542 pub fn flecs_brealloc(
543 dst: *mut ecs_block_allocator_t,
544 src: *mut ecs_block_allocator_t,
545 memory: *mut ::std::os::raw::c_void,
546 ) -> *mut ::std::os::raw::c_void;
547}
548extern "C" {
549 pub fn flecs_bdup(
550 ba: *mut ecs_block_allocator_t,
551 memory: *mut ::std::os::raw::c_void,
552 ) -> *mut ::std::os::raw::c_void;
553}
554pub type ecs_map_data_t = u64;
555pub type ecs_map_key_t = ecs_map_data_t;
556pub type ecs_map_val_t = ecs_map_data_t;
557#[doc = "Map type"]
558#[repr(C)]
559#[derive(Debug, Copy, Clone)]
560pub struct ecs_bucket_entry_t {
561 pub key: ecs_map_key_t,
562 pub value: ecs_map_val_t,
563 pub next: *mut ecs_bucket_entry_t,
564}
565#[repr(C)]
566#[derive(Debug, Copy, Clone)]
567pub struct ecs_bucket_t {
568 pub first: *mut ecs_bucket_entry_t,
569}
570#[repr(C)]
571#[derive(Debug, Copy, Clone)]
572pub struct ecs_map_t {
573 pub bucket_shift: u8,
574 pub shared_allocator: bool,
575 pub buckets: *mut ecs_bucket_t,
576 pub bucket_count: i32,
577 pub count: i32,
578 pub entry_allocator: *mut ecs_block_allocator_t,
579 pub allocator: *mut ecs_allocator_t,
580}
581#[repr(C)]
582#[derive(Debug, Copy, Clone)]
583pub struct ecs_map_iter_t {
584 pub map: *const ecs_map_t,
585 pub bucket: *mut ecs_bucket_t,
586 pub entry: *mut ecs_bucket_entry_t,
587 pub res: *mut ecs_map_data_t,
588}
589#[repr(C)]
590#[derive(Debug, Copy, Clone)]
591pub struct ecs_map_params_t {
592 pub allocator: *mut ecs_allocator_t,
593 pub entry_allocator: ecs_block_allocator_t,
594}
595extern "C" {
596 #[doc = "Function/macro postfixes meaning:\n _ptr: access ecs_map_val_t as void*\n _ref: access ecs_map_val_t* as T**\n _deref: dereferences a _ref\n _alloc: if _ptr is NULL, alloc\n _free: if _ptr is not NULL, free"]
597 pub fn ecs_map_params_init(params: *mut ecs_map_params_t, allocator: *mut ecs_allocator_t);
598}
599extern "C" {
600 pub fn ecs_map_params_fini(params: *mut ecs_map_params_t);
601}
602extern "C" {
603 #[doc = "Initialize new map."]
604 pub fn ecs_map_init(map: *mut ecs_map_t, allocator: *mut ecs_allocator_t);
605}
606extern "C" {
607 #[doc = "Initialize new map."]
608 pub fn ecs_map_init_w_params(map: *mut ecs_map_t, params: *mut ecs_map_params_t);
609}
610extern "C" {
611 #[doc = "Initialize new map if uninitialized, leave as is otherwise"]
612 pub fn ecs_map_init_if(map: *mut ecs_map_t, allocator: *mut ecs_allocator_t);
613}
614extern "C" {
615 pub fn ecs_map_init_w_params_if(result: *mut ecs_map_t, params: *mut ecs_map_params_t);
616}
617extern "C" {
618 #[doc = "Deinitialize map."]
619 pub fn ecs_map_fini(map: *mut ecs_map_t);
620}
621extern "C" {
622 #[doc = "Get element for key, returns NULL if they key doesn't exist."]
623 pub fn ecs_map_get(map: *const ecs_map_t, key: ecs_map_key_t) -> *mut ecs_map_val_t;
624}
625extern "C" {
626 #[doc = "Get element as pointer (auto-dereferences _ptr)"]
627 pub fn ecs_map_get_deref_(
628 map: *const ecs_map_t,
629 key: ecs_map_key_t,
630 ) -> *mut ::std::os::raw::c_void;
631}
632extern "C" {
633 #[doc = "Get or insert element for key."]
634 pub fn ecs_map_ensure(map: *mut ecs_map_t, key: ecs_map_key_t) -> *mut ecs_map_val_t;
635}
636extern "C" {
637 #[doc = "Get or insert pointer element for key, allocate if the pointer is NULL"]
638 pub fn ecs_map_ensure_alloc(
639 map: *mut ecs_map_t,
640 elem_size: ecs_size_t,
641 key: ecs_map_key_t,
642 ) -> *mut ::std::os::raw::c_void;
643}
644extern "C" {
645 #[doc = "Insert element for key."]
646 pub fn ecs_map_insert(map: *mut ecs_map_t, key: ecs_map_key_t, value: ecs_map_val_t);
647}
648extern "C" {
649 #[doc = "Insert pointer element for key, populate with new allocation."]
650 pub fn ecs_map_insert_alloc(
651 map: *mut ecs_map_t,
652 elem_size: ecs_size_t,
653 key: ecs_map_key_t,
654 ) -> *mut ::std::os::raw::c_void;
655}
656extern "C" {
657 #[doc = "Remove key from map."]
658 pub fn ecs_map_remove(map: *mut ecs_map_t, key: ecs_map_key_t) -> ecs_map_val_t;
659}
660extern "C" {
661 #[doc = "Remove pointer element, free if not NULL"]
662 pub fn ecs_map_remove_free(map: *mut ecs_map_t, key: ecs_map_key_t);
663}
664extern "C" {
665 #[doc = "Remove all elements from map."]
666 pub fn ecs_map_clear(map: *mut ecs_map_t);
667}
668extern "C" {
669 #[doc = "Return iterator to map contents."]
670 pub fn ecs_map_iter(map: *const ecs_map_t) -> ecs_map_iter_t;
671}
672extern "C" {
673 #[doc = "Obtain next element in map from iterator."]
674 pub fn ecs_map_next(iter: *mut ecs_map_iter_t) -> bool;
675}
676extern "C" {
677 #[doc = "Copy map."]
678 pub fn ecs_map_copy(dst: *mut ecs_map_t, src: *const ecs_map_t);
679}
680extern "C" {
681 pub static mut ecs_block_allocator_alloc_count: i64;
682}
683extern "C" {
684 pub static mut ecs_block_allocator_free_count: i64;
685}
686extern "C" {
687 pub static mut ecs_stack_allocator_alloc_count: i64;
688}
689extern "C" {
690 pub static mut ecs_stack_allocator_free_count: i64;
691}
692#[repr(C)]
693#[derive(Debug, Copy, Clone)]
694pub struct ecs_allocator_t {
695 pub chunks: ecs_block_allocator_t,
696 #[doc = "<size, block_allocator_t>"]
697 pub sizes: ecs_sparse_t,
698}
699extern "C" {
700 pub fn flecs_allocator_init(a: *mut ecs_allocator_t);
701}
702extern "C" {
703 pub fn flecs_allocator_fini(a: *mut ecs_allocator_t);
704}
705extern "C" {
706 pub fn flecs_allocator_get(
707 a: *mut ecs_allocator_t,
708 size: ecs_size_t,
709 ) -> *mut ecs_block_allocator_t;
710}
711extern "C" {
712 pub fn flecs_strdup(
713 a: *mut ecs_allocator_t,
714 str_: *const ::std::os::raw::c_char,
715 ) -> *mut ::std::os::raw::c_char;
716}
717extern "C" {
718 pub fn flecs_strfree(a: *mut ecs_allocator_t, str_: *mut ::std::os::raw::c_char);
719}
720extern "C" {
721 pub fn flecs_dup(
722 a: *mut ecs_allocator_t,
723 size: ecs_size_t,
724 src: *const ::std::os::raw::c_void,
725 ) -> *mut ::std::os::raw::c_void;
726}
727#[repr(C)]
728#[derive(Debug, Copy, Clone)]
729pub struct ecs_strbuf_element {
730 pub buffer_embedded: bool,
731 pub pos: i32,
732 pub buf: *mut ::std::os::raw::c_char,
733 pub next: *mut ecs_strbuf_element,
734}
735#[repr(C)]
736#[derive(Debug, Copy, Clone)]
737pub struct ecs_strbuf_element_embedded {
738 pub super_: ecs_strbuf_element,
739 pub buf: [::std::os::raw::c_char; 512usize],
740}
741#[repr(C)]
742#[derive(Debug, Copy, Clone)]
743pub struct ecs_strbuf_element_str {
744 pub super_: ecs_strbuf_element,
745 pub alloc_str: *mut ::std::os::raw::c_char,
746}
747#[repr(C)]
748#[derive(Debug, Copy, Clone)]
749pub struct ecs_strbuf_list_elem {
750 pub count: i32,
751 pub separator: *const ::std::os::raw::c_char,
752}
753#[repr(C)]
754#[derive(Debug, Copy, Clone)]
755pub struct ecs_strbuf_t {
756 #[doc = "When set by an application, append will write to this buffer"]
757 pub buf: *mut ::std::os::raw::c_char,
758 #[doc = "The maximum number of characters that may be printed"]
759 pub max: i32,
760 #[doc = "Size of elements minus current element"]
761 pub size: i32,
762 #[doc = "The number of elements in use"]
763 pub elementCount: i32,
764 #[doc = "Always allocate at least one element"]
765 pub firstElement: ecs_strbuf_element_embedded,
766 #[doc = "The current element being appended to"]
767 pub current: *mut ecs_strbuf_element,
768 #[doc = "Stack that keeps track of number of list elements, used for conditionally\n inserting a separator"]
769 pub list_stack: [ecs_strbuf_list_elem; 32usize],
770 pub list_sp: i32,
771 #[doc = "This is set to the output string after calling ecs_strbuf_get"]
772 pub content: *mut ::std::os::raw::c_char,
773 #[doc = "This is set to the output string length after calling ecs_strbuf_get"]
774 pub length: i32,
775}
776extern "C" {
777 #[doc = "Append format string to a buffer.\n Returns false when max is reached, true when there is still space"]
778 pub fn ecs_strbuf_append(
779 buffer: *mut ecs_strbuf_t,
780 fmt: *const ::std::os::raw::c_char,
781 ...
782 ) -> bool;
783}
784extern "C" {
785 #[doc = "Append format string with argument list to a buffer.\n Returns false when max is reached, true when there is still space"]
786 pub fn ecs_strbuf_vappend(
787 buffer: *mut ecs_strbuf_t,
788 fmt: *const ::std::os::raw::c_char,
789 args: va_list,
790 ) -> bool;
791}
792extern "C" {
793 #[doc = "Append string to buffer.\n Returns false when max is reached, true when there is still space"]
794 pub fn ecs_strbuf_appendstr(
795 buffer: *mut ecs_strbuf_t,
796 str_: *const ::std::os::raw::c_char,
797 ) -> bool;
798}
799extern "C" {
800 #[doc = "Append character to buffer.\n Returns false when max is reached, true when there is still space"]
801 pub fn ecs_strbuf_appendch(buffer: *mut ecs_strbuf_t, ch: ::std::os::raw::c_char) -> bool;
802}
803extern "C" {
804 #[doc = "Append int to buffer.\n Returns false when max is reached, true when there is still space"]
805 pub fn ecs_strbuf_appendint(buffer: *mut ecs_strbuf_t, v: i64) -> bool;
806}
807extern "C" {
808 #[doc = "Append float to buffer.\n Returns false when max is reached, true when there is still space"]
809 pub fn ecs_strbuf_appendflt(
810 buffer: *mut ecs_strbuf_t,
811 v: f64,
812 nan_delim: ::std::os::raw::c_char,
813 ) -> bool;
814}
815extern "C" {
816 #[doc = "Append boolean to buffer.\n Returns false when max is reached, true when there is still space"]
817 pub fn ecs_strbuf_appendbool(buffer: *mut ecs_strbuf_t, v: bool) -> bool;
818}
819extern "C" {
820 #[doc = "Append source buffer to destination buffer.\n Returns false when max is reached, true when there is still space"]
821 pub fn ecs_strbuf_mergebuff(
822 dst_buffer: *mut ecs_strbuf_t,
823 src_buffer: *mut ecs_strbuf_t,
824 ) -> bool;
825}
826extern "C" {
827 #[doc = "Append string to buffer, transfer ownership to buffer.\n Returns false when max is reached, true when there is still space"]
828 pub fn ecs_strbuf_appendstr_zerocpy(
829 buffer: *mut ecs_strbuf_t,
830 str_: *mut ::std::os::raw::c_char,
831 ) -> bool;
832}
833extern "C" {
834 #[doc = "Append string to buffer, transfer ownership to buffer.\n Returns false when max is reached, true when there is still space"]
835 pub fn ecs_strbuf_appendstr_zerocpyn(
836 buffer: *mut ecs_strbuf_t,
837 str_: *mut ::std::os::raw::c_char,
838 n: i32,
839 ) -> bool;
840}
841extern "C" {
842 #[doc = "Append string to buffer, do not free/modify string.\n Returns false when max is reached, true when there is still space"]
843 pub fn ecs_strbuf_appendstr_zerocpy_const(
844 buffer: *mut ecs_strbuf_t,
845 str_: *const ::std::os::raw::c_char,
846 ) -> bool;
847}
848extern "C" {
849 #[doc = "Append string to buffer, transfer ownership to buffer.\n Returns false when max is reached, true when there is still space"]
850 pub fn ecs_strbuf_appendstr_zerocpyn_const(
851 buffer: *mut ecs_strbuf_t,
852 str_: *const ::std::os::raw::c_char,
853 n: i32,
854 ) -> bool;
855}
856extern "C" {
857 #[doc = "Append n characters to buffer.\n Returns false when max is reached, true when there is still space"]
858 pub fn ecs_strbuf_appendstrn(
859 buffer: *mut ecs_strbuf_t,
860 str_: *const ::std::os::raw::c_char,
861 n: i32,
862 ) -> bool;
863}
864extern "C" {
865 #[doc = "Return result string"]
866 pub fn ecs_strbuf_get(buffer: *mut ecs_strbuf_t) -> *mut ::std::os::raw::c_char;
867}
868extern "C" {
869 #[doc = "Return small string from first element (appends \\0)"]
870 pub fn ecs_strbuf_get_small(buffer: *mut ecs_strbuf_t) -> *mut ::std::os::raw::c_char;
871}
872extern "C" {
873 #[doc = "Reset buffer without returning a string"]
874 pub fn ecs_strbuf_reset(buffer: *mut ecs_strbuf_t);
875}
876extern "C" {
877 #[doc = "Push a list"]
878 pub fn ecs_strbuf_list_push(
879 buffer: *mut ecs_strbuf_t,
880 list_open: *const ::std::os::raw::c_char,
881 separator: *const ::std::os::raw::c_char,
882 );
883}
884extern "C" {
885 #[doc = "Pop a new list"]
886 pub fn ecs_strbuf_list_pop(
887 buffer: *mut ecs_strbuf_t,
888 list_close: *const ::std::os::raw::c_char,
889 );
890}
891extern "C" {
892 #[doc = "Insert a new element in list"]
893 pub fn ecs_strbuf_list_next(buffer: *mut ecs_strbuf_t);
894}
895extern "C" {
896 #[doc = "Append character to as new element in list."]
897 pub fn ecs_strbuf_list_appendch(buffer: *mut ecs_strbuf_t, ch: ::std::os::raw::c_char) -> bool;
898}
899extern "C" {
900 #[doc = "Append formatted string as a new element in list"]
901 pub fn ecs_strbuf_list_append(
902 buffer: *mut ecs_strbuf_t,
903 fmt: *const ::std::os::raw::c_char,
904 ...
905 ) -> bool;
906}
907extern "C" {
908 #[doc = "Append string as a new element in list"]
909 pub fn ecs_strbuf_list_appendstr(
910 buffer: *mut ecs_strbuf_t,
911 str_: *const ::std::os::raw::c_char,
912 ) -> bool;
913}
914extern "C" {
915 #[doc = "Append string as a new element in list"]
916 pub fn ecs_strbuf_list_appendstrn(
917 buffer: *mut ecs_strbuf_t,
918 str_: *const ::std::os::raw::c_char,
919 n: i32,
920 ) -> bool;
921}
922extern "C" {
923 pub fn ecs_strbuf_written(buffer: *const ecs_strbuf_t) -> i32;
924}
925#[repr(C)]
926#[derive(Debug, Copy, Clone)]
927pub struct ecs_time_t {
928 pub sec: u32,
929 pub nanosec: u32,
930}
931extern "C" {
932 #[doc = "Allocation counters"]
933 pub static mut ecs_os_api_malloc_count: i64;
934}
935extern "C" {
936 pub static mut ecs_os_api_realloc_count: i64;
937}
938extern "C" {
939 pub static mut ecs_os_api_calloc_count: i64;
940}
941extern "C" {
942 pub static mut ecs_os_api_free_count: i64;
943}
944#[doc = "Use handle types that _at least_ can store pointers"]
945pub type ecs_os_thread_t = usize;
946pub type ecs_os_cond_t = usize;
947pub type ecs_os_mutex_t = usize;
948pub type ecs_os_dl_t = usize;
949pub type ecs_os_sock_t = usize;
950#[doc = "64 bit thread id"]
951pub type ecs_os_thread_id_t = u64;
952#[doc = "Generic function pointer type"]
953pub type ecs_os_proc_t = ::std::option::Option<unsafe extern "C" fn()>;
954#[doc = "OS API init"]
955pub type ecs_os_api_init_t = ::std::option::Option<unsafe extern "C" fn()>;
956#[doc = "OS API deinit"]
957pub type ecs_os_api_fini_t = ::std::option::Option<unsafe extern "C" fn()>;
958#[doc = "Memory management"]
959pub type ecs_os_api_malloc_t =
960 ::std::option::Option<unsafe extern "C" fn(size: ecs_size_t) -> *mut ::std::os::raw::c_void>;
961pub type ecs_os_api_free_t =
962 ::std::option::Option<unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void)>;
963pub type ecs_os_api_realloc_t = ::std::option::Option<
964 unsafe extern "C" fn(
965 ptr: *mut ::std::os::raw::c_void,
966 size: ecs_size_t,
967 ) -> *mut ::std::os::raw::c_void,
968>;
969pub type ecs_os_api_calloc_t =
970 ::std::option::Option<unsafe extern "C" fn(size: ecs_size_t) -> *mut ::std::os::raw::c_void>;
971pub type ecs_os_api_strdup_t = ::std::option::Option<
972 unsafe extern "C" fn(str_: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char,
973>;
974#[doc = "Threads"]
975pub type ecs_os_thread_callback_t = ::std::option::Option<
976 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
977>;
978pub type ecs_os_api_thread_new_t = ::std::option::Option<
979 unsafe extern "C" fn(
980 callback: ecs_os_thread_callback_t,
981 param: *mut ::std::os::raw::c_void,
982 ) -> ecs_os_thread_t,
983>;
984pub type ecs_os_api_thread_join_t = ::std::option::Option<
985 unsafe extern "C" fn(thread: ecs_os_thread_t) -> *mut ::std::os::raw::c_void,
986>;
987pub type ecs_os_api_thread_self_t =
988 ::std::option::Option<unsafe extern "C" fn() -> ecs_os_thread_id_t>;
989#[doc = "Tasks"]
990pub type ecs_os_api_task_new_t = ::std::option::Option<
991 unsafe extern "C" fn(
992 callback: ecs_os_thread_callback_t,
993 param: *mut ::std::os::raw::c_void,
994 ) -> ecs_os_thread_t,
995>;
996pub type ecs_os_api_task_join_t = ::std::option::Option<
997 unsafe extern "C" fn(thread: ecs_os_thread_t) -> *mut ::std::os::raw::c_void,
998>;
999#[doc = "Atomic increment / decrement"]
1000pub type ecs_os_api_ainc_t = ::std::option::Option<unsafe extern "C" fn(value: *mut i32) -> i32>;
1001pub type ecs_os_api_lainc_t = ::std::option::Option<unsafe extern "C" fn(value: *mut i64) -> i64>;
1002#[doc = "Mutex"]
1003pub type ecs_os_api_mutex_new_t = ::std::option::Option<unsafe extern "C" fn() -> ecs_os_mutex_t>;
1004pub type ecs_os_api_mutex_lock_t =
1005 ::std::option::Option<unsafe extern "C" fn(mutex: ecs_os_mutex_t)>;
1006pub type ecs_os_api_mutex_unlock_t =
1007 ::std::option::Option<unsafe extern "C" fn(mutex: ecs_os_mutex_t)>;
1008pub type ecs_os_api_mutex_free_t =
1009 ::std::option::Option<unsafe extern "C" fn(mutex: ecs_os_mutex_t)>;
1010#[doc = "Condition variable"]
1011pub type ecs_os_api_cond_new_t = ::std::option::Option<unsafe extern "C" fn() -> ecs_os_cond_t>;
1012pub type ecs_os_api_cond_free_t = ::std::option::Option<unsafe extern "C" fn(cond: ecs_os_cond_t)>;
1013pub type ecs_os_api_cond_signal_t =
1014 ::std::option::Option<unsafe extern "C" fn(cond: ecs_os_cond_t)>;
1015pub type ecs_os_api_cond_broadcast_t =
1016 ::std::option::Option<unsafe extern "C" fn(cond: ecs_os_cond_t)>;
1017pub type ecs_os_api_cond_wait_t =
1018 ::std::option::Option<unsafe extern "C" fn(cond: ecs_os_cond_t, mutex: ecs_os_mutex_t)>;
1019pub type ecs_os_api_sleep_t = ::std::option::Option<unsafe extern "C" fn(sec: i32, nanosec: i32)>;
1020pub type ecs_os_api_enable_high_timer_resolution_t =
1021 ::std::option::Option<unsafe extern "C" fn(enable: bool)>;
1022pub type ecs_os_api_get_time_t =
1023 ::std::option::Option<unsafe extern "C" fn(time_out: *mut ecs_time_t)>;
1024pub type ecs_os_api_now_t = ::std::option::Option<unsafe extern "C" fn() -> u64>;
1025#[doc = "Logging"]
1026pub type ecs_os_api_log_t = ::std::option::Option<
1027 unsafe extern "C" fn(
1028 level: i32,
1029 file: *const ::std::os::raw::c_char,
1030 line: i32,
1031 msg: *const ::std::os::raw::c_char,
1032 ),
1033>;
1034#[doc = "Application termination"]
1035pub type ecs_os_api_abort_t = ::std::option::Option<unsafe extern "C" fn()>;
1036#[doc = "Dynamic libraries"]
1037pub type ecs_os_api_dlopen_t = ::std::option::Option<
1038 unsafe extern "C" fn(libname: *const ::std::os::raw::c_char) -> ecs_os_dl_t,
1039>;
1040pub type ecs_os_api_dlproc_t = ::std::option::Option<
1041 unsafe extern "C" fn(
1042 lib: ecs_os_dl_t,
1043 procname: *const ::std::os::raw::c_char,
1044 ) -> ecs_os_proc_t,
1045>;
1046pub type ecs_os_api_dlclose_t = ::std::option::Option<unsafe extern "C" fn(lib: ecs_os_dl_t)>;
1047pub type ecs_os_api_module_to_path_t = ::std::option::Option<
1048 unsafe extern "C" fn(module_id: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char,
1049>;
1050#[doc = "Prefix members of struct with 'ecs_' as some system headers may define\n macros for functions like \"strdup\", \"log\" or \"_free\""]
1051#[repr(C)]
1052#[derive(Debug, Copy, Clone)]
1053pub struct ecs_os_api_t {
1054 #[doc = "API init / deinit"]
1055 pub init_: ecs_os_api_init_t,
1056 pub fini_: ecs_os_api_fini_t,
1057 #[doc = "Memory management"]
1058 pub malloc_: ecs_os_api_malloc_t,
1059 pub realloc_: ecs_os_api_realloc_t,
1060 pub calloc_: ecs_os_api_calloc_t,
1061 pub free_: ecs_os_api_free_t,
1062 #[doc = "Strings"]
1063 pub strdup_: ecs_os_api_strdup_t,
1064 #[doc = "Threads"]
1065 pub thread_new_: ecs_os_api_thread_new_t,
1066 pub thread_join_: ecs_os_api_thread_join_t,
1067 pub thread_self_: ecs_os_api_thread_self_t,
1068 #[doc = "Tasks"]
1069 pub task_new_: ecs_os_api_thread_new_t,
1070 pub task_join_: ecs_os_api_thread_join_t,
1071 #[doc = "Atomic incremenet / decrement"]
1072 pub ainc_: ecs_os_api_ainc_t,
1073 pub adec_: ecs_os_api_ainc_t,
1074 pub lainc_: ecs_os_api_lainc_t,
1075 pub ladec_: ecs_os_api_lainc_t,
1076 #[doc = "Mutex"]
1077 pub mutex_new_: ecs_os_api_mutex_new_t,
1078 pub mutex_free_: ecs_os_api_mutex_free_t,
1079 pub mutex_lock_: ecs_os_api_mutex_lock_t,
1080 pub mutex_unlock_: ecs_os_api_mutex_lock_t,
1081 #[doc = "Condition variable"]
1082 pub cond_new_: ecs_os_api_cond_new_t,
1083 pub cond_free_: ecs_os_api_cond_free_t,
1084 pub cond_signal_: ecs_os_api_cond_signal_t,
1085 pub cond_broadcast_: ecs_os_api_cond_broadcast_t,
1086 pub cond_wait_: ecs_os_api_cond_wait_t,
1087 #[doc = "Time"]
1088 pub sleep_: ecs_os_api_sleep_t,
1089 pub now_: ecs_os_api_now_t,
1090 pub get_time_: ecs_os_api_get_time_t,
1091 #[doc = "Logging function. The level should be interpreted as: */\n/* >0: Debug tracing. Only enabled in debug builds. */\n/* 0: Tracing. Enabled in debug/release builds. */\n/* -2: Warning. An issue occurred, but operation was successful. */\n/* -3: Error. An issue occurred, and operation was unsuccessful. */\n/* -4: Fatal. An issue occurred, and application must quit."]
1092 pub log_: ecs_os_api_log_t,
1093 #[doc = "Application termination"]
1094 pub abort_: ecs_os_api_abort_t,
1095 #[doc = "Dynamic library loading"]
1096 pub dlopen_: ecs_os_api_dlopen_t,
1097 pub dlproc_: ecs_os_api_dlproc_t,
1098 pub dlclose_: ecs_os_api_dlclose_t,
1099 #[doc = "Overridable function that translates from a logical module id to a\n shared library filename"]
1100 pub module_to_dl_: ecs_os_api_module_to_path_t,
1101 #[doc = "Overridable function that translates from a logical module id to a\n path that contains module-specif resources or assets"]
1102 pub module_to_etc_: ecs_os_api_module_to_path_t,
1103 #[doc = "Trace level"]
1104 pub log_level_: i32,
1105 #[doc = "Trace indentation"]
1106 pub log_indent_: i32,
1107 #[doc = "Last error code"]
1108 pub log_last_error_: i32,
1109 #[doc = "Last recorded timestamp"]
1110 pub log_last_timestamp_: i64,
1111 #[doc = "OS API flags"]
1112 pub flags_: ecs_flags32_t,
1113}
1114extern "C" {
1115 pub static mut ecs_os_api: ecs_os_api_t;
1116}
1117extern "C" {
1118 pub fn ecs_os_init();
1119}
1120extern "C" {
1121 pub fn ecs_os_fini();
1122}
1123extern "C" {
1124 pub fn ecs_os_set_api(os_api: *mut ecs_os_api_t);
1125}
1126extern "C" {
1127 pub fn ecs_os_get_api() -> ecs_os_api_t;
1128}
1129extern "C" {
1130 pub fn ecs_os_set_api_defaults();
1131}
1132extern "C" {
1133 #[doc = "Logging"]
1134 pub fn ecs_os_dbg(
1135 file: *const ::std::os::raw::c_char,
1136 line: i32,
1137 msg: *const ::std::os::raw::c_char,
1138 );
1139}
1140extern "C" {
1141 pub fn ecs_os_trace(
1142 file: *const ::std::os::raw::c_char,
1143 line: i32,
1144 msg: *const ::std::os::raw::c_char,
1145 );
1146}
1147extern "C" {
1148 pub fn ecs_os_warn(
1149 file: *const ::std::os::raw::c_char,
1150 line: i32,
1151 msg: *const ::std::os::raw::c_char,
1152 );
1153}
1154extern "C" {
1155 pub fn ecs_os_err(
1156 file: *const ::std::os::raw::c_char,
1157 line: i32,
1158 msg: *const ::std::os::raw::c_char,
1159 );
1160}
1161extern "C" {
1162 pub fn ecs_os_fatal(
1163 file: *const ::std::os::raw::c_char,
1164 line: i32,
1165 msg: *const ::std::os::raw::c_char,
1166 );
1167}
1168extern "C" {
1169 pub fn ecs_os_strerror(err: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
1170}
1171extern "C" {
1172 pub fn ecs_os_strset(
1173 str_: *mut *mut ::std::os::raw::c_char,
1174 value: *const ::std::os::raw::c_char,
1175 );
1176}
1177extern "C" {
1178 #[doc = "Sleep with floating point time"]
1179 pub fn ecs_sleepf(t: f64);
1180}
1181extern "C" {
1182 #[doc = "Measure time since provided timestamp"]
1183 pub fn ecs_time_measure(start: *mut ecs_time_t) -> f64;
1184}
1185extern "C" {
1186 #[doc = "Calculate difference between two timestamps"]
1187 pub fn ecs_time_sub(t1: ecs_time_t, t2: ecs_time_t) -> ecs_time_t;
1188}
1189extern "C" {
1190 #[doc = "Convert time value to a double"]
1191 pub fn ecs_time_to_double(t: ecs_time_t) -> f64;
1192}
1193extern "C" {
1194 pub fn ecs_os_memdup(
1195 src: *const ::std::os::raw::c_void,
1196 size: ecs_size_t,
1197 ) -> *mut ::std::os::raw::c_void;
1198}
1199extern "C" {
1200 #[doc = "Are heap functions available?"]
1201 pub fn ecs_os_has_heap() -> bool;
1202}
1203extern "C" {
1204 #[doc = "Are threading functions available?"]
1205 pub fn ecs_os_has_threading() -> bool;
1206}
1207extern "C" {
1208 #[doc = "Are task functions available?"]
1209 pub fn ecs_os_has_task_support() -> bool;
1210}
1211extern "C" {
1212 #[doc = "Are time functions available?"]
1213 pub fn ecs_os_has_time() -> bool;
1214}
1215extern "C" {
1216 #[doc = "Are logging functions available?"]
1217 pub fn ecs_os_has_logging() -> bool;
1218}
1219extern "C" {
1220 #[doc = "Are dynamic library functions available?"]
1221 pub fn ecs_os_has_dl() -> bool;
1222}
1223extern "C" {
1224 #[doc = "Are module path functions available?"]
1225 pub fn ecs_os_has_modules() -> bool;
1226}
1227#[doc = "Ids are the things that can be added to an entity.\n An id can be an entity or pair, and can have optional id flags."]
1228pub type ecs_id_t = u64;
1229#[doc = "An entity identifier.\n Entity ids consist out of a number unique to the entity in the lower 32 bits,\n and a counter used to track entity liveliness in the upper 32 bits. When an\n id is recycled, its generation count is increased. This causes recycled ids\n to be very large (>4 billion), which is normal."]
1230pub type ecs_entity_t = ecs_id_t;
1231#[doc = "A type is a list of (component) ids.\n Types are used to communicate the \"type\" of an entity. In most type systems a\n typeof operation returns a single type. In ECS however, an entity can have\n multiple components, which is why an ECS type consists of a vector of ids.\n\n The component ids of a type are sorted, which ensures that it doesn't matter\n in which order components are added to an entity. For example, if adding\n Position then Velocity would result in type \\[Position, Velocity\\], first\n adding Velocity then Position would also result in type \\[Position, Velocity\\].\n\n Entities are grouped together by type in the ECS storage in tables. The\n storage has exactly one table per unique type that is created by the\n application that stores all entities and components for that type. This is\n also referred to as an archetype."]
1232#[repr(C)]
1233#[derive(Debug, Copy, Clone)]
1234pub struct ecs_type_t {
1235 pub array: *mut ecs_id_t,
1236 pub count: i32,
1237}
1238#[repr(C)]
1239#[derive(Debug, Copy, Clone)]
1240pub struct ecs_world_t {
1241 _unused: [u8; 0],
1242}
1243#[repr(C)]
1244#[derive(Debug, Copy, Clone)]
1245pub struct ecs_table_t {
1246 _unused: [u8; 0],
1247}
1248#[repr(C)]
1249#[derive(Debug, Copy, Clone)]
1250pub struct ecs_query_t {
1251 _unused: [u8; 0],
1252}
1253#[repr(C)]
1254#[derive(Debug, Copy, Clone)]
1255pub struct ecs_rule_t {
1256 _unused: [u8; 0],
1257}
1258#[repr(C)]
1259#[derive(Debug, Copy, Clone)]
1260pub struct ecs_id_record_t {
1261 _unused: [u8; 0],
1262}
1263#[repr(C)]
1264#[derive(Debug, Copy, Clone)]
1265pub struct ecs_table_record_t {
1266 _unused: [u8; 0],
1267}
1268#[doc = "A poly object.\n A poly (short for polymorph) object is an object that has a variable list of\n capabilities, determined by a mixin table. This is the current list of types\n in the flecs API that can be used as an ecs_poly_t:\n\n - ecs_world_t\n - ecs_stage_t\n - ecs_query_t\n - ecs_filter_t\n - ecs_rule_t\n - (more to come)\n\n Functions that accept an ecs_poly_t argument can accept objects of these\n types. If the object does not have the requested mixin the API will throw an\n assert.\n\n The poly/mixin framework enables partially overlapping features to be\n implemented once, and enables objects of different types to interact with\n each other depending on what mixins they have, rather than their type\n (in some ways it's like a mini-ECS). Additionally, each poly object has a\n header that enables the API to do sanity checking on the input arguments."]
1269pub type ecs_poly_t = ::std::os::raw::c_void;
1270#[repr(C)]
1271#[derive(Debug, Copy, Clone)]
1272pub struct ecs_mixins_t {
1273 _unused: [u8; 0],
1274}
1275#[doc = "Header for ecs_poly_t objects."]
1276#[repr(C)]
1277#[derive(Debug, Copy, Clone)]
1278pub struct ecs_header_t {
1279 #[doc = "Magic number verifying it's a flecs object"]
1280 pub magic: i32,
1281 #[doc = "Magic number indicating which type of flecs object"]
1282 pub type_: i32,
1283 #[doc = "Table with offsets to (optional) mixins"]
1284 pub mixins: *mut ecs_mixins_t,
1285}
1286#[doc = "Function prototype for runnables (systems, observers).\n The run callback overrides the default behavior for iterating through the\n results of a runnable object.\n\n The default runnable iterates the iterator, and calls an iter_action (see\n below) for each returned result.\n\n @param it The iterator to be iterated by the runnable."]
1287pub type ecs_run_action_t = ::std::option::Option<unsafe extern "C" fn(it: *mut ecs_iter_t)>;
1288#[doc = "Function prototype for iterables.\n A system may invoke a callback multiple times, typically once for each\n matched table.\n\n @param it The iterator containing the data for the current match."]
1289pub type ecs_iter_action_t = ::std::option::Option<unsafe extern "C" fn(it: *mut ecs_iter_t)>;
1290#[doc = "Function prototype for creating an iterator from a poly.\n Used to create iterators from poly objects with the iterable mixin. When a\n filter is provided, an array of two iterators must be passed to the function.\n This allows the mixin implementation to create a chained iterator when\n necessary, which requires two iterator objects.\n\n @param world The world or stage for which to create the iterator.\n @param iterable An iterable poly object.\n @param it The iterator to create (out parameter)\n @param filter Optional term to filter results."]
1291pub type ecs_iter_init_action_t = ::std::option::Option<
1292 unsafe extern "C" fn(
1293 world: *const ecs_world_t,
1294 iterable: *const ecs_poly_t,
1295 it: *mut ecs_iter_t,
1296 filter: *mut ecs_term_t,
1297 ),
1298>;
1299#[doc = "Function prototype for iterating an iterator.\n Stored inside initialized iterators. This allows an application to * iterate\n an iterator without needing to know what created it.\n\n @param it The iterator to iterate.\n @return True if iterator has no more results, false if it does."]
1300pub type ecs_iter_next_action_t =
1301 ::std::option::Option<unsafe extern "C" fn(it: *mut ecs_iter_t) -> bool>;
1302#[doc = "Function prototype for freeing an iterator.\n Free iterator resources.\n\n @param it The iterator to free."]
1303pub type ecs_iter_fini_action_t = ::std::option::Option<unsafe extern "C" fn(it: *mut ecs_iter_t)>;
1304#[doc = "Callback used for comparing components"]
1305pub type ecs_order_by_action_t = ::std::option::Option<
1306 unsafe extern "C" fn(
1307 e1: ecs_entity_t,
1308 ptr1: *const ::std::os::raw::c_void,
1309 e2: ecs_entity_t,
1310 ptr2: *const ::std::os::raw::c_void,
1311 ) -> ::std::os::raw::c_int,
1312>;
1313#[doc = "Callback used for sorting the entire table of components"]
1314pub type ecs_sort_table_action_t = ::std::option::Option<
1315 unsafe extern "C" fn(
1316 world: *mut ecs_world_t,
1317 table: *mut ecs_table_t,
1318 entities: *mut ecs_entity_t,
1319 ptr: *mut ::std::os::raw::c_void,
1320 size: i32,
1321 lo: i32,
1322 hi: i32,
1323 order_by: ecs_order_by_action_t,
1324 ),
1325>;
1326#[doc = "Callback used for grouping tables in a query"]
1327pub type ecs_group_by_action_t = ::std::option::Option<
1328 unsafe extern "C" fn(
1329 world: *mut ecs_world_t,
1330 table: *mut ecs_table_t,
1331 group_id: ecs_id_t,
1332 ctx: *mut ::std::os::raw::c_void,
1333 ) -> u64,
1334>;
1335#[doc = "Callback invoked when a query creates a new group."]
1336pub type ecs_group_create_action_t = ::std::option::Option<
1337 unsafe extern "C" fn(
1338 world: *mut ecs_world_t,
1339 group_id: u64,
1340 group_by_ctx: *mut ::std::os::raw::c_void,
1341 ) -> *mut ::std::os::raw::c_void,
1342>;
1343#[doc = "Callback invoked when a query deletes an existing group."]
1344pub type ecs_group_delete_action_t = ::std::option::Option<
1345 unsafe extern "C" fn(
1346 world: *mut ecs_world_t,
1347 group_id: u64,
1348 group_ctx: *mut ::std::os::raw::c_void,
1349 group_by_ctx: *mut ::std::os::raw::c_void,
1350 ),
1351>;
1352#[doc = "Initialization action for modules"]
1353pub type ecs_module_action_t = ::std::option::Option<unsafe extern "C" fn(world: *mut ecs_world_t)>;
1354#[doc = "Action callback on world exit"]
1355pub type ecs_fini_action_t = ::std::option::Option<
1356 unsafe extern "C" fn(world: *mut ecs_world_t, ctx: *mut ::std::os::raw::c_void),
1357>;
1358#[doc = "Function to cleanup context data"]
1359pub type ecs_ctx_free_t =
1360 ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>;
1361#[doc = "Callback used for sorting values"]
1362pub type ecs_compare_action_t = ::std::option::Option<
1363 unsafe extern "C" fn(
1364 ptr1: *const ::std::os::raw::c_void,
1365 ptr2: *const ::std::os::raw::c_void,
1366 ) -> ::std::os::raw::c_int,
1367>;
1368#[doc = "Callback used for hashing values"]
1369pub type ecs_hash_value_action_t =
1370 ::std::option::Option<unsafe extern "C" fn(ptr: *const ::std::os::raw::c_void) -> u64>;
1371#[doc = "Constructor/destructor callback"]
1372pub type ecs_xtor_t = ::std::option::Option<
1373 unsafe extern "C" fn(
1374 ptr: *mut ::std::os::raw::c_void,
1375 count: i32,
1376 type_info: *const ecs_type_info_t,
1377 ),
1378>;
1379#[doc = "Copy is invoked when a component is copied into another component."]
1380pub type ecs_copy_t = ::std::option::Option<
1381 unsafe extern "C" fn(
1382 dst_ptr: *mut ::std::os::raw::c_void,
1383 src_ptr: *const ::std::os::raw::c_void,
1384 count: i32,
1385 type_info: *const ecs_type_info_t,
1386 ),
1387>;
1388#[doc = "Move is invoked when a component is moved to another component."]
1389pub type ecs_move_t = ::std::option::Option<
1390 unsafe extern "C" fn(
1391 dst_ptr: *mut ::std::os::raw::c_void,
1392 src_ptr: *mut ::std::os::raw::c_void,
1393 count: i32,
1394 type_info: *const ecs_type_info_t,
1395 ),
1396>;
1397#[doc = "Destructor function for poly objects"]
1398pub type ecs_poly_dtor_t = ::std::option::Option<unsafe extern "C" fn(poly: *mut ecs_poly_t)>;
1399#[doc = "Iterable mixin.\n Allows its container to be iterated."]
1400#[repr(C)]
1401#[derive(Debug, Copy, Clone)]
1402pub struct ecs_iterable_t {
1403 #[doc = "< Callback that creates iterator."]
1404 pub init: ecs_iter_init_action_t,
1405}
1406#[doc = "< InOut for regular terms, In for shared terms"]
1407pub const ecs_inout_kind_t_EcsInOutDefault: ecs_inout_kind_t = 0;
1408#[doc = "< Term is neither read nor written"]
1409pub const ecs_inout_kind_t_EcsInOutNone: ecs_inout_kind_t = 1;
1410#[doc = "< Term is both read and written"]
1411pub const ecs_inout_kind_t_EcsInOut: ecs_inout_kind_t = 2;
1412#[doc = "< Term is only read"]
1413pub const ecs_inout_kind_t_EcsIn: ecs_inout_kind_t = 3;
1414#[doc = "< Term is only written"]
1415pub const ecs_inout_kind_t_EcsOut: ecs_inout_kind_t = 4;
1416#[doc = "Specify read/write access for term"]
1417pub type ecs_inout_kind_t = ::std::os::raw::c_uint;
1418#[doc = "< The term must match"]
1419pub const ecs_oper_kind_t_EcsAnd: ecs_oper_kind_t = 0;
1420#[doc = "< One of the terms in an or chain must match"]
1421pub const ecs_oper_kind_t_EcsOr: ecs_oper_kind_t = 1;
1422#[doc = "< The term must not match"]
1423pub const ecs_oper_kind_t_EcsNot: ecs_oper_kind_t = 2;
1424#[doc = "< The term may match"]
1425pub const ecs_oper_kind_t_EcsOptional: ecs_oper_kind_t = 3;
1426#[doc = "< Term must match all components from term id"]
1427pub const ecs_oper_kind_t_EcsAndFrom: ecs_oper_kind_t = 4;
1428#[doc = "< Term must match at least one component from term id"]
1429pub const ecs_oper_kind_t_EcsOrFrom: ecs_oper_kind_t = 5;
1430#[doc = "< Term must match none of the components from term id"]
1431pub const ecs_oper_kind_t_EcsNotFrom: ecs_oper_kind_t = 6;
1432#[doc = "Specify operator for term"]
1433pub type ecs_oper_kind_t = ::std::os::raw::c_uint;
1434#[doc = "Type that describes a single identifier in a term"]
1435#[repr(C)]
1436#[derive(Debug, Copy, Clone)]
1437pub struct ecs_term_id_t {
1438 #[doc = "< Entity id. If left to 0 and flags does not\n specify whether id is an entity or a variable\n the id will be initialized to EcsThis.\n To explicitly set the id to 0, leave the id\n member to 0 and set EcsIsEntity in flags."]
1439 pub id: ecs_entity_t,
1440 #[doc = "< Name. This can be either the variable name\n (when the EcsIsVariable flag is set) or an\n entity name. When ecs_term_t::move is true,\n the API assumes ownership over the string and\n will free it when the term is destroyed."]
1441 pub name: *const ::std::os::raw::c_char,
1442 #[doc = "< Relationship to traverse when looking for the\n component. The relationship must have\n the Traversable property. Default is IsA."]
1443 pub trav: ecs_entity_t,
1444 #[doc = "< Term flags"]
1445 pub flags: ecs_flags32_t,
1446}
1447#[doc = "Type that describes a term (single element in a query)"]
1448#[repr(C)]
1449#[derive(Debug, Copy, Clone)]
1450pub struct ecs_term_t {
1451 #[doc = "< Component id to be matched by term. Can be\n set directly, or will be populated from the\n first/second members, which provide more\n flexibility."]
1452 pub id: ecs_id_t,
1453 #[doc = "< Source of term"]
1454 pub src: ecs_term_id_t,
1455 #[doc = "< Component or first element of pair"]
1456 pub first: ecs_term_id_t,
1457 #[doc = "< Second element of pair"]
1458 pub second: ecs_term_id_t,
1459 #[doc = "< Access to contents matched by term"]
1460 pub inout: ecs_inout_kind_t,
1461 #[doc = "< Operator of term"]
1462 pub oper: ecs_oper_kind_t,
1463 #[doc = "< Id flags of term id"]
1464 pub id_flags: ecs_id_t,
1465 #[doc = "< Name of term"]
1466 pub name: *mut ::std::os::raw::c_char,
1467 #[doc = "< Index of field for term in iterator"]
1468 pub field_index: i32,
1469 #[doc = "< Cached pointer to internal index"]
1470 pub idr: *mut ecs_id_record_t,
1471 #[doc = "< Flags that help eval, set by ecs_filter_init"]
1472 pub flags: ecs_flags16_t,
1473 #[doc = "< Used by internals"]
1474 pub move_: bool,
1475}
1476extern "C" {
1477 #[doc = "Use $this variable to initialize user-allocated filter object"]
1478 pub static mut ECS_FILTER_INIT: ecs_filter_t;
1479}
1480#[doc = "Filters alllow for ad-hoc quick filtering of entity tables."]
1481#[repr(C)]
1482#[derive(Debug, Copy, Clone)]
1483pub struct ecs_filter_t {
1484 pub hdr: ecs_header_t,
1485 #[doc = "< Array containing terms for filter"]
1486 pub terms: *mut ecs_term_t,
1487 #[doc = "< Number of elements in terms array"]
1488 pub term_count: i32,
1489 #[doc = "< Number of fields in iterator for filter"]
1490 pub field_count: i32,
1491 #[doc = "< Is filter object owned by filter"]
1492 pub owned: bool,
1493 #[doc = "< Is terms array owned by filter"]
1494 pub terms_owned: bool,
1495 #[doc = "< Filter flags"]
1496 pub flags: ecs_flags32_t,
1497 #[doc = "< Placeholder variable names array"]
1498 pub variable_names: [*mut ::std::os::raw::c_char; 1usize],
1499 #[doc = "< Field size (same for each result)"]
1500 pub sizes: *mut i32,
1501 #[doc = "< Entity associated with filter (optional)"]
1502 pub entity: ecs_entity_t,
1503 #[doc = "< Iterable mixin"]
1504 pub iterable: ecs_iterable_t,
1505 #[doc = "< Dtor mixin"]
1506 pub dtor: ecs_poly_dtor_t,
1507 #[doc = "< World mixin"]
1508 pub world: *mut ecs_world_t,
1509}
1510#[doc = "An observer reacts to events matching a filter"]
1511#[repr(C)]
1512#[derive(Debug, Copy, Clone)]
1513pub struct ecs_observer_t {
1514 pub hdr: ecs_header_t,
1515 #[doc = "< Query for observer"]
1516 pub filter: ecs_filter_t,
1517 #[doc = "Observer events"]
1518 pub events: [ecs_entity_t; 8usize],
1519 pub event_count: i32,
1520 #[doc = "< See ecs_observer_desc_t::callback"]
1521 pub callback: ecs_iter_action_t,
1522 #[doc = "< See ecs_observer_desc_t::run"]
1523 pub run: ecs_run_action_t,
1524 #[doc = "< Callback context"]
1525 pub ctx: *mut ::std::os::raw::c_void,
1526 #[doc = "< Binding context (for language bindings)"]
1527 pub binding_ctx: *mut ::std::os::raw::c_void,
1528 #[doc = "< Callback to free ctx"]
1529 pub ctx_free: ecs_ctx_free_t,
1530 #[doc = "< Callback to free binding_ctx"]
1531 pub binding_ctx_free: ecs_ctx_free_t,
1532 #[doc = "< Observable for observer"]
1533 pub observable: *mut ecs_observable_t,
1534 #[doc = "< Last handled event id"]
1535 pub last_event_id: *mut i32,
1536 pub last_event_id_storage: i32,
1537 #[doc = "< Id observer is registered with (single term observers only)"]
1538 pub register_id: ecs_id_t,
1539 #[doc = "< Index of the term in parent observer (single term observers only)"]
1540 pub term_index: i32,
1541 #[doc = "< If true, the observer only triggers when the\n filter did not match with the entity before\n the event happened."]
1542 pub is_monitor: bool,
1543 #[doc = "< If true, the observer triggers on more than one term"]
1544 pub is_multi: bool,
1545 #[doc = "Mixins"]
1546 pub dtor: ecs_poly_dtor_t,
1547}
1548#[doc = "Type that contains component lifecycle callbacks.\n\n \\ingroup components"]
1549#[repr(C)]
1550#[derive(Debug, Copy, Clone)]
1551pub struct ecs_type_hooks_t {
1552 #[doc = "< ctor"]
1553 pub ctor: ecs_xtor_t,
1554 #[doc = "< dtor"]
1555 pub dtor: ecs_xtor_t,
1556 #[doc = "< copy assignment"]
1557 pub copy: ecs_copy_t,
1558 #[doc = "< move assignment"]
1559 pub move_: ecs_move_t,
1560 #[doc = "Ctor + copy"]
1561 pub copy_ctor: ecs_copy_t,
1562 #[doc = "Ctor + move"]
1563 pub move_ctor: ecs_move_t,
1564 #[doc = "Ctor + move + dtor (or move_ctor + dtor).\n This combination is typically used when a component is moved from one\n location to a new location, like when it is moved to a new table. If\n not set explicitly it will be derived from other callbacks."]
1565 pub ctor_move_dtor: ecs_move_t,
1566 #[doc = "Move + dtor.\n This combination is typically used when a component is moved from one\n location to an existing location, like what happens during a remove. If\n not set explicitly it will be derived from other callbacks."]
1567 pub move_dtor: ecs_move_t,
1568 #[doc = "Callback that is invoked when an instance of a component is added. This\n callback is invoked before triggers are invoked."]
1569 pub on_add: ecs_iter_action_t,
1570 #[doc = "Callback that is invoked when an instance of the component is set. This\n callback is invoked before triggers are invoked, and enable the component\n to respond to changes on itself before others can."]
1571 pub on_set: ecs_iter_action_t,
1572 #[doc = "Callback that is invoked when an instance of the component is removed.\n This callback is invoked after the triggers are invoked, and before the\n destructor is invoked."]
1573 pub on_remove: ecs_iter_action_t,
1574 #[doc = "< User defined context"]
1575 pub ctx: *mut ::std::os::raw::c_void,
1576 #[doc = "< Language binding context"]
1577 pub binding_ctx: *mut ::std::os::raw::c_void,
1578 #[doc = "< Callback to free ctx"]
1579 pub ctx_free: ecs_ctx_free_t,
1580 #[doc = "< Callback to free binding_ctx"]
1581 pub binding_ctx_free: ecs_ctx_free_t,
1582}
1583#[doc = "Type that contains component information (passed to ctors/dtors/...)\n\n \\ingroup components"]
1584#[repr(C)]
1585#[derive(Debug, Copy, Clone)]
1586pub struct ecs_type_info_t {
1587 #[doc = "< Size of type"]
1588 pub size: ecs_size_t,
1589 #[doc = "< Alignment of type"]
1590 pub alignment: ecs_size_t,
1591 #[doc = "< Type hooks"]
1592 pub hooks: ecs_type_hooks_t,
1593 #[doc = "< Handle to component (do not set)"]
1594 pub component: ecs_entity_t,
1595 #[doc = "< Type name."]
1596 pub name: *const ::std::os::raw::c_char,
1597}
1598#[repr(C)]
1599#[derive(Debug, Copy, Clone)]
1600pub struct ecs_stage_t {
1601 _unused: [u8; 0],
1602}
1603#[repr(C)]
1604#[derive(Debug, Copy, Clone)]
1605pub struct ecs_data_t {
1606 _unused: [u8; 0],
1607}
1608#[repr(C)]
1609#[derive(Debug, Copy, Clone)]
1610pub struct ecs_switch_t {
1611 _unused: [u8; 0],
1612}
1613#[repr(C)]
1614#[derive(Debug, Copy, Clone)]
1615pub struct ecs_query_table_match_t {
1616 _unused: [u8; 0],
1617}
1618#[doc = "Mixin for emitting events to triggers/observers */\n/** All observers for a specific event"]
1619#[repr(C)]
1620#[derive(Debug, Copy, Clone)]
1621pub struct ecs_event_record_t {
1622 pub any: *mut ecs_event_id_record_t,
1623 pub wildcard: *mut ecs_event_id_record_t,
1624 pub wildcard_pair: *mut ecs_event_id_record_t,
1625 #[doc = "map<id, ecs_event_id_record_t>"]
1626 pub event_ids: ecs_map_t,
1627 pub event: ecs_entity_t,
1628}
1629#[repr(C)]
1630#[derive(Debug, Copy, Clone)]
1631pub struct ecs_observable_t {
1632 pub on_add: ecs_event_record_t,
1633 pub on_remove: ecs_event_record_t,
1634 pub on_set: ecs_event_record_t,
1635 pub un_set: ecs_event_record_t,
1636 pub on_wildcard: ecs_event_record_t,
1637 #[doc = "sparse<event, ecs_event_record_t>"]
1638 pub events: ecs_sparse_t,
1639}
1640#[doc = "Record for entity index"]
1641#[repr(C)]
1642#[derive(Debug, Copy, Clone)]
1643pub struct ecs_record_t {
1644 #[doc = "Id record to (*, entity) for target entities"]
1645 pub idr: *mut ecs_id_record_t,
1646 #[doc = "Identifies a type (and table) in world"]
1647 pub table: *mut ecs_table_t,
1648 #[doc = "Table row of the entity"]
1649 pub row: u32,
1650 #[doc = "Index in dense array"]
1651 pub dense: i32,
1652}
1653#[doc = "Range in table"]
1654#[repr(C)]
1655#[derive(Debug, Copy, Clone)]
1656pub struct ecs_table_range_t {
1657 pub table: *mut ecs_table_t,
1658 #[doc = "Leave both members to 0 to cover entire table"]
1659 pub offset: i32,
1660 pub count: i32,
1661}
1662#[doc = "Value of query variable"]
1663#[repr(C)]
1664#[derive(Debug, Copy, Clone)]
1665pub struct ecs_var_t {
1666 #[doc = "Set when variable stores a range of entities"]
1667 pub range: ecs_table_range_t,
1668 #[doc = "Set when variable stores single entity"]
1669 pub entity: ecs_entity_t,
1670}
1671#[doc = "Cached reference."]
1672#[repr(C)]
1673#[derive(Debug, Copy, Clone)]
1674pub struct ecs_ref_t {
1675 #[doc = "Entity"]
1676 pub entity: ecs_entity_t,
1677 #[doc = "Component id"]
1678 pub id: ecs_entity_t,
1679 #[doc = "Table record for component"]
1680 pub tr: *mut ecs_table_record_t,
1681 #[doc = "Entity index record"]
1682 pub record: *mut ecs_record_t,
1683}
1684#[doc = "Cursor to stack allocator. Type is public to allow for white box testing."]
1685#[repr(C)]
1686#[derive(Debug, Copy, Clone)]
1687pub struct ecs_stack_page_t {
1688 _unused: [u8; 0],
1689}
1690#[repr(C)]
1691#[derive(Debug, Copy, Clone)]
1692pub struct ecs_stack_cursor_t {
1693 pub prev: *mut ecs_stack_cursor_t,
1694 pub page: *mut ecs_stack_page_t,
1695 pub sp: i16,
1696 pub is_free: bool,
1697 pub owner: *mut ecs_stack_t,
1698}
1699#[doc = "Page-iterator specific data"]
1700#[repr(C)]
1701#[derive(Debug, Copy, Clone)]
1702pub struct ecs_page_iter_t {
1703 pub offset: i32,
1704 pub limit: i32,
1705 pub remaining: i32,
1706}
1707#[doc = "Worker-iterator specific data"]
1708#[repr(C)]
1709#[derive(Debug, Copy, Clone)]
1710pub struct ecs_worker_iter_t {
1711 pub index: i32,
1712 pub count: i32,
1713}
1714#[doc = "Convenience struct to iterate table array for id"]
1715#[repr(C)]
1716#[derive(Debug, Copy, Clone)]
1717pub struct ecs_table_cache_iter_t {
1718 pub cur: *mut ecs_table_cache_hdr_t,
1719 pub next: *mut ecs_table_cache_hdr_t,
1720 pub next_list: *mut ecs_table_cache_hdr_t,
1721}
1722#[doc = "Term-iterator specific data"]
1723#[repr(C)]
1724#[derive(Debug, Copy, Clone)]
1725pub struct ecs_term_iter_t {
1726 pub term: ecs_term_t,
1727 pub self_index: *mut ecs_id_record_t,
1728 pub set_index: *mut ecs_id_record_t,
1729 pub cur: *mut ecs_id_record_t,
1730 pub it: ecs_table_cache_iter_t,
1731 pub index: i32,
1732 pub observed_table_count: i32,
1733 pub table: *mut ecs_table_t,
1734 pub cur_match: i32,
1735 pub match_count: i32,
1736 pub last_column: i32,
1737 pub empty_tables: bool,
1738 #[doc = "Storage"]
1739 pub id: ecs_id_t,
1740 pub column: i32,
1741 pub subject: ecs_entity_t,
1742 pub size: ecs_size_t,
1743 pub ptr: *mut ::std::os::raw::c_void,
1744}
1745pub const ecs_iter_kind_t_EcsIterEvalCondition: ecs_iter_kind_t = 0;
1746pub const ecs_iter_kind_t_EcsIterEvalTables: ecs_iter_kind_t = 1;
1747pub const ecs_iter_kind_t_EcsIterEvalChain: ecs_iter_kind_t = 2;
1748pub const ecs_iter_kind_t_EcsIterEvalNone: ecs_iter_kind_t = 3;
1749pub type ecs_iter_kind_t = ::std::os::raw::c_uint;
1750#[doc = "Filter-iterator specific data"]
1751#[repr(C)]
1752#[derive(Debug, Copy, Clone)]
1753pub struct ecs_filter_iter_t {
1754 pub filter: *const ecs_filter_t,
1755 pub kind: ecs_iter_kind_t,
1756 pub term_iter: ecs_term_iter_t,
1757 pub matches_left: i32,
1758 pub pivot_term: i32,
1759}
1760#[doc = "Query-iterator specific data"]
1761#[repr(C)]
1762#[derive(Debug, Copy, Clone)]
1763pub struct ecs_query_iter_t {
1764 pub query: *mut ecs_query_t,
1765 pub node: *mut ecs_query_table_match_t,
1766 pub prev: *mut ecs_query_table_match_t,
1767 pub last: *mut ecs_query_table_match_t,
1768 pub sparse_smallest: i32,
1769 pub sparse_first: i32,
1770 pub bitset_first: i32,
1771 pub skip_count: i32,
1772}
1773#[doc = "Snapshot-iterator specific data"]
1774#[repr(C)]
1775#[derive(Debug, Copy, Clone)]
1776pub struct ecs_snapshot_iter_t {
1777 pub filter: ecs_filter_t,
1778 #[doc = "ecs_table_leaf_t"]
1779 pub tables: ecs_vec_t,
1780 pub index: i32,
1781}
1782#[repr(C)]
1783#[derive(Debug, Copy, Clone)]
1784pub struct ecs_rule_op_profile_t {
1785 #[doc = "0 = enter, 1 = redo"]
1786 pub count: [i32; 2usize],
1787}
1788#[doc = "Rule-iterator specific data"]
1789#[repr(C)]
1790#[derive(Debug, Copy, Clone)]
1791pub struct ecs_rule_iter_t {
1792 pub rule: *const ecs_rule_t,
1793 #[doc = "Variable storage"]
1794 pub vars: *mut ecs_var_t,
1795 pub rule_vars: *mut ecs_rule_var_t,
1796 pub ops: *mut ecs_rule_op_t,
1797 #[doc = "Operation-specific state"]
1798 pub op_ctx: *mut ecs_rule_op_ctx_t,
1799 pub written: *mut u64,
1800 pub profile: *mut ecs_rule_op_profile_t,
1801 pub redo: bool,
1802 pub op: i16,
1803 pub sp: i16,
1804}
1805#[doc = "Inline iterator arrays to prevent allocations for small array sizes"]
1806#[repr(C)]
1807#[derive(Debug, Copy, Clone)]
1808pub struct ecs_iter_cache_t {
1809 #[doc = "Stack cursor to restore to"]
1810 pub stack_cursor: *mut ecs_stack_cursor_t,
1811 #[doc = "For which fields is the cache used"]
1812 pub used: ecs_flags8_t,
1813 #[doc = "Which fields are allocated"]
1814 pub allocated: ecs_flags8_t,
1815}
1816#[doc = "Private iterator data. Used by iterator implementations to keep track of\n progress & to provide builtin storage."]
1817#[repr(C)]
1818#[derive(Copy, Clone)]
1819pub struct ecs_iter_private_t {
1820 #[doc = "Iterator specific data"]
1821 pub iter: ecs_iter_private_t__bindgen_ty_1,
1822 #[doc = "Filter applied after matching a table"]
1823 pub entity_iter: *mut ::std::os::raw::c_void,
1824 #[doc = "Inline arrays to reduce allocations"]
1825 pub cache: ecs_iter_cache_t,
1826}
1827#[repr(C)]
1828#[derive(Copy, Clone)]
1829pub union ecs_iter_private_t__bindgen_ty_1 {
1830 pub term: ecs_term_iter_t,
1831 pub filter: ecs_filter_iter_t,
1832 pub query: ecs_query_iter_t,
1833 pub rule: ecs_rule_iter_t,
1834 pub snapshot: ecs_snapshot_iter_t,
1835 pub page: ecs_page_iter_t,
1836 pub worker: ecs_worker_iter_t,
1837}
1838#[doc = "Iterator"]
1839#[repr(C)]
1840#[derive(Copy, Clone)]
1841pub struct ecs_iter_t {
1842 #[doc = "The world"]
1843 pub world: *mut ecs_world_t,
1844 #[doc = "Actual world. This differs from world when in readonly mode"]
1845 pub real_world: *mut ecs_world_t,
1846 #[doc = "Entity identifiers"]
1847 pub entities: *mut ecs_entity_t,
1848 #[doc = "Pointers to components. Array if from this, pointer if not."]
1849 pub ptrs: *mut *mut ::std::os::raw::c_void,
1850 #[doc = "Component sizes"]
1851 pub sizes: *mut ecs_size_t,
1852 #[doc = "Current table"]
1853 pub table: *mut ecs_table_t,
1854 #[doc = "Prev or next table when adding/removing"]
1855 pub other_table: *mut ecs_table_t,
1856 #[doc = "(Component) ids"]
1857 pub ids: *mut ecs_id_t,
1858 #[doc = "Values of variables (if any)"]
1859 pub variables: *mut ecs_var_t,
1860 #[doc = "Query term to table column mapping"]
1861 pub columns: *mut i32,
1862 #[doc = "Entity on which the id was matched (0 if same as entities)"]
1863 pub sources: *mut ecs_entity_t,
1864 #[doc = "Indices of current match for term. Allows an iterator to iterate\n all permutations of wildcards in query."]
1865 pub match_indices: *mut i32,
1866 #[doc = "Cached refs to components (if iterating a cache)"]
1867 pub references: *mut ecs_ref_t,
1868 #[doc = "Bitset that marks constrained variables"]
1869 pub constrained_vars: ecs_flags64_t,
1870 #[doc = "Group id for table, if group_by is used"]
1871 pub group_id: u64,
1872 #[doc = "Number of fields in iterator"]
1873 pub field_count: i32,
1874 #[doc = "The system (if applicable)"]
1875 pub system: ecs_entity_t,
1876 #[doc = "The event (if applicable)"]
1877 pub event: ecs_entity_t,
1878 #[doc = "The (component) id for the event"]
1879 pub event_id: ecs_id_t,
1880 #[doc = "Terms of query being evaluated"]
1881 pub terms: *mut ecs_term_t,
1882 #[doc = "Active table count for query"]
1883 pub table_count: i32,
1884 #[doc = "Index of term that emitted an event.\n This field will be set to the 'index' field\n of an observer term."]
1885 pub term_index: i32,
1886 #[doc = "Number of variables for query"]
1887 pub variable_count: i32,
1888 #[doc = "Names of variables (if any)"]
1889 pub variable_names: *mut *mut ::std::os::raw::c_char,
1890 #[doc = "Param passed to ecs_run"]
1891 pub param: *mut ::std::os::raw::c_void,
1892 #[doc = "System context"]
1893 pub ctx: *mut ::std::os::raw::c_void,
1894 #[doc = "Binding context"]
1895 pub binding_ctx: *mut ::std::os::raw::c_void,
1896 #[doc = "Time elapsed since last frame"]
1897 pub delta_time: f32,
1898 #[doc = "Time elapsed since last system invocation"]
1899 pub delta_system_time: f32,
1900 #[doc = "Offset relative to start of iteration"]
1901 pub frame_offset: i32,
1902 #[doc = "Offset relative to current table"]
1903 pub offset: i32,
1904 #[doc = "Number of entities to iterate"]
1905 pub count: i32,
1906 #[doc = "Number of entities to iterate before next table"]
1907 pub instance_count: i32,
1908 #[doc = "Iterator flags"]
1909 pub flags: ecs_flags32_t,
1910 #[doc = "When set, system execution is interrupted"]
1911 pub interrupted_by: ecs_entity_t,
1912 #[doc = "Private data"]
1913 pub priv_: ecs_iter_private_t,
1914 #[doc = "Function to progress iterator"]
1915 pub next: ecs_iter_next_action_t,
1916 #[doc = "Callback of system or observer"]
1917 pub callback: ecs_iter_action_t,
1918 #[doc = "Invoked after setting variable (optionally set)"]
1919 pub set_var: ecs_iter_action_t,
1920 #[doc = "Function to cleanup iterator resources"]
1921 pub fini: ecs_iter_fini_action_t,
1922 #[doc = "Optional, allows for creating iterator chains"]
1923 pub chain_it: *mut ecs_iter_t,
1924}
1925extern "C" {
1926 pub fn ecs_module_path_from_c(
1927 c_name: *const ::std::os::raw::c_char,
1928 ) -> *mut ::std::os::raw::c_char;
1929}
1930extern "C" {
1931 pub fn ecs_identifier_is_0(id: *const ::std::os::raw::c_char) -> bool;
1932}
1933extern "C" {
1934 #[doc = "Constructor that zeromem's a component value"]
1935 pub fn ecs_default_ctor(
1936 ptr: *mut ::std::os::raw::c_void,
1937 count: i32,
1938 ctx: *const ecs_type_info_t,
1939 );
1940}
1941extern "C" {
1942 #[doc = "Create allocated string from format"]
1943 pub fn ecs_vasprintf(
1944 fmt: *const ::std::os::raw::c_char,
1945 args: va_list,
1946 ) -> *mut ::std::os::raw::c_char;
1947}
1948extern "C" {
1949 #[doc = "Create allocated string from format"]
1950 pub fn ecs_asprintf(fmt: *const ::std::os::raw::c_char, ...) -> *mut ::std::os::raw::c_char;
1951}
1952extern "C" {
1953 #[doc = "Convert identifier to snake case"]
1954 pub fn flecs_to_snake_case(str_: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
1955}
1956extern "C" {
1957 pub fn flecs_table_observed_count(table: *const ecs_table_t) -> i32;
1958}
1959extern "C" {
1960 pub fn flecs_dump_backtrace(stream: *mut ::std::os::raw::c_void);
1961}
1962#[repr(C)]
1963#[derive(Debug, Copy, Clone)]
1964pub struct ecs_hm_bucket_t {
1965 pub keys: ecs_vec_t,
1966 pub values: ecs_vec_t,
1967}
1968#[repr(C)]
1969#[derive(Debug, Copy, Clone)]
1970pub struct ecs_hashmap_t {
1971 pub hash: ecs_hash_value_action_t,
1972 pub compare: ecs_compare_action_t,
1973 pub key_size: ecs_size_t,
1974 pub value_size: ecs_size_t,
1975 pub hashmap_allocator: *mut ecs_block_allocator_t,
1976 pub bucket_allocator: ecs_block_allocator_t,
1977 pub impl_: ecs_map_t,
1978}
1979#[repr(C)]
1980#[derive(Debug, Copy, Clone)]
1981pub struct flecs_hashmap_iter_t {
1982 pub it: ecs_map_iter_t,
1983 pub bucket: *mut ecs_hm_bucket_t,
1984 pub index: i32,
1985}
1986#[repr(C)]
1987#[derive(Debug, Copy, Clone)]
1988pub struct flecs_hashmap_result_t {
1989 pub key: *mut ::std::os::raw::c_void,
1990 pub value: *mut ::std::os::raw::c_void,
1991 pub hash: u64,
1992}
1993extern "C" {
1994 pub fn flecs_hashmap_init_(
1995 hm: *mut ecs_hashmap_t,
1996 key_size: ecs_size_t,
1997 value_size: ecs_size_t,
1998 hash: ecs_hash_value_action_t,
1999 compare: ecs_compare_action_t,
2000 allocator: *mut ecs_allocator_t,
2001 );
2002}
2003extern "C" {
2004 pub fn flecs_hashmap_fini(map: *mut ecs_hashmap_t);
2005}
2006extern "C" {
2007 pub fn flecs_hashmap_get_(
2008 map: *const ecs_hashmap_t,
2009 key_size: ecs_size_t,
2010 key: *const ::std::os::raw::c_void,
2011 value_size: ecs_size_t,
2012 ) -> *mut ::std::os::raw::c_void;
2013}
2014extern "C" {
2015 pub fn flecs_hashmap_ensure_(
2016 map: *mut ecs_hashmap_t,
2017 key_size: ecs_size_t,
2018 key: *const ::std::os::raw::c_void,
2019 value_size: ecs_size_t,
2020 ) -> flecs_hashmap_result_t;
2021}
2022extern "C" {
2023 pub fn flecs_hashmap_set_(
2024 map: *mut ecs_hashmap_t,
2025 key_size: ecs_size_t,
2026 key: *mut ::std::os::raw::c_void,
2027 value_size: ecs_size_t,
2028 value: *const ::std::os::raw::c_void,
2029 );
2030}
2031extern "C" {
2032 pub fn flecs_hashmap_remove_(
2033 map: *mut ecs_hashmap_t,
2034 key_size: ecs_size_t,
2035 key: *const ::std::os::raw::c_void,
2036 value_size: ecs_size_t,
2037 );
2038}
2039extern "C" {
2040 pub fn flecs_hashmap_remove_w_hash_(
2041 map: *mut ecs_hashmap_t,
2042 key_size: ecs_size_t,
2043 key: *const ::std::os::raw::c_void,
2044 value_size: ecs_size_t,
2045 hash: u64,
2046 );
2047}
2048extern "C" {
2049 pub fn flecs_hashmap_get_bucket(map: *const ecs_hashmap_t, hash: u64) -> *mut ecs_hm_bucket_t;
2050}
2051extern "C" {
2052 pub fn flecs_hm_bucket_remove(
2053 map: *mut ecs_hashmap_t,
2054 bucket: *mut ecs_hm_bucket_t,
2055 hash: u64,
2056 index: i32,
2057 );
2058}
2059extern "C" {
2060 pub fn flecs_hashmap_copy(dst: *mut ecs_hashmap_t, src: *const ecs_hashmap_t);
2061}
2062extern "C" {
2063 pub fn flecs_hashmap_iter(map: *mut ecs_hashmap_t) -> flecs_hashmap_iter_t;
2064}
2065extern "C" {
2066 pub fn flecs_hashmap_next_(
2067 it: *mut flecs_hashmap_iter_t,
2068 key_size: ecs_size_t,
2069 key_out: *mut ::std::os::raw::c_void,
2070 value_size: ecs_size_t,
2071 ) -> *mut ::std::os::raw::c_void;
2072}
2073#[doc = "Used with ecs_entity_init\n\n \\ingroup entities"]
2074#[repr(C)]
2075#[derive(Debug, Copy, Clone)]
2076pub struct ecs_entity_desc_t {
2077 pub _canary: i32,
2078 #[doc = "< Set to modify existing entity (optional)"]
2079 pub id: ecs_entity_t,
2080 #[doc = "< Name of the entity. If no entity is provided, an\n entity with this name will be looked up first. When\n an entity is provided, the name will be verified\n with the existing entity."]
2081 pub name: *const ::std::os::raw::c_char,
2082 #[doc = "< Optional custom separator for hierarchical names.\n Leave to NULL for default ('.') separator. Set to\n an empty string to prevent tokenization of name."]
2083 pub sep: *const ::std::os::raw::c_char,
2084 #[doc = "< Optional, used for identifiers relative to root"]
2085 pub root_sep: *const ::std::os::raw::c_char,
2086 #[doc = "< Optional entity symbol. A symbol is an unscoped\n identifier that can be used to lookup an entity. The\n primary use case for this is to associate the entity\n with a language identifier, such as a type or\n function name, where these identifiers differ from\n the name they are registered with in flecs. For\n example, C type \"EcsPosition\" might be registered\n as \"flecs.components.transform.Position\", with the\n symbol set to \"EcsPosition\"."]
2087 pub symbol: *const ::std::os::raw::c_char,
2088 #[doc = "< When set to true, a low id (typically reserved for\n components) will be used to create the entity, if\n no id is specified."]
2089 pub use_low_id: bool,
2090 #[doc = "Array of ids to add to the new or existing entity."]
2091 pub add: [ecs_id_t; 32usize],
2092 #[doc = "String expression with components to add"]
2093 pub add_expr: *const ::std::os::raw::c_char,
2094}
2095#[doc = "Used with ecs_bulk_init\n\n \\ingroup entities"]
2096#[repr(C)]
2097#[derive(Debug, Copy, Clone)]
2098pub struct ecs_bulk_desc_t {
2099 pub _canary: i32,
2100 #[doc = "< Entities to bulk insert. Entity ids provided by\n the application must be empty (cannot\n have components). If no entity ids are provided, the\n operation will create 'count' new entities."]
2101 pub entities: *mut ecs_entity_t,
2102 #[doc = "< Number of entities to create/populate"]
2103 pub count: i32,
2104 #[doc = "< Ids to create the entities with"]
2105 pub ids: [ecs_id_t; 32usize],
2106 #[doc = "< Array with component data to insert. Each element in\n the array must correspond with an element in the ids\n array. If an element in the ids array is a tag, the\n data array must contain a NULL. An element may be\n set to NULL for a component, in which case the\n component will not be set by the operation."]
2107 pub data: *mut *mut ::std::os::raw::c_void,
2108 #[doc = "< Table to insert the entities into. Should not be set\n at the same time as ids. When 'table' is set at the\n same time as 'data', the elements in the data array\n must correspond with the ids in the table's type."]
2109 pub table: *mut ecs_table_t,
2110}
2111#[doc = "Used with ecs_component_init.\n\n \\ingroup components"]
2112#[repr(C)]
2113#[derive(Debug, Copy, Clone)]
2114pub struct ecs_component_desc_t {
2115 pub _canary: i32,
2116 #[doc = "Existing entity to associate with observer (optional)"]
2117 pub entity: ecs_entity_t,
2118 #[doc = "Parameters for type (size, hooks, ...)"]
2119 pub type_: ecs_type_info_t,
2120}
2121#[doc = "Used with ecs_filter_init.\n\n \\ingroup filters"]
2122#[repr(C)]
2123#[derive(Debug, Copy, Clone)]
2124pub struct ecs_filter_desc_t {
2125 pub _canary: i32,
2126 #[doc = "Terms of the filter. If a filter has more terms than\n FLECS_TERM_DESC_MAX use terms_buffer"]
2127 pub terms: [ecs_term_t; 16usize],
2128 #[doc = "For filters with lots of terms an outside array can be provided."]
2129 pub terms_buffer: *mut ecs_term_t,
2130 #[doc = "Number of terms in array provided in terms_buffer."]
2131 pub terms_buffer_count: i32,
2132 #[doc = "External storage to prevent allocation of the filter object"]
2133 pub storage: *mut ecs_filter_t,
2134 #[doc = "When true, terms returned by an iterator may either contain 1 or N\n elements, where terms with N elements are owned, and terms with 1 element\n are shared, for example from a parent or base entity. When false, the\n iterator will at most return 1 element when the result contains both\n owned and shared terms."]
2135 pub instanced: bool,
2136 #[doc = "Flags for advanced usage"]
2137 pub flags: ecs_flags32_t,
2138 #[doc = "Filter expression. Should not be set at the same time as terms array"]
2139 pub expr: *const ::std::os::raw::c_char,
2140 #[doc = "Entity associated with query (optional)"]
2141 pub entity: ecs_entity_t,
2142}
2143#[doc = "Used with ecs_query_init.\n\n \\ingroup queries"]
2144#[repr(C)]
2145#[derive(Debug, Copy, Clone)]
2146pub struct ecs_query_desc_t {
2147 pub _canary: i32,
2148 #[doc = "Filter for the query"]
2149 pub filter: ecs_filter_desc_t,
2150 #[doc = "Component to be used by order_by"]
2151 pub order_by_component: ecs_entity_t,
2152 #[doc = "Callback used for ordering query results. If order_by_id is 0, the\n pointer provided to the callback will be NULL. If the callback is not\n set, results will not be ordered."]
2153 pub order_by: ecs_order_by_action_t,
2154 #[doc = "Callback used for ordering query results. Same as order_by,\n but more efficient."]
2155 pub sort_table: ecs_sort_table_action_t,
2156 #[doc = "Id to be used by group_by. This id is passed to the group_by function and\n can be used identify the part of an entity type that should be used for\n grouping."]
2157 pub group_by_id: ecs_id_t,
2158 #[doc = "Callback used for grouping results. If the callback is not set, results\n will not be grouped. When set, this callback will be used to calculate a\n \"rank\" for each entity (table) based on its components. This rank is then\n used to sort entities (tables), so that entities (tables) of the same\n rank are \"grouped\" together when iterated."]
2159 pub group_by: ecs_group_by_action_t,
2160 #[doc = "Callback that is invoked when a new group is created. The return value of\n the callback is stored as context for a group."]
2161 pub on_group_create: ecs_group_create_action_t,
2162 #[doc = "Callback that is invoked when an existing group is deleted. The return\n value of the on_group_create callback is passed as context parameter."]
2163 pub on_group_delete: ecs_group_delete_action_t,
2164 #[doc = "Context to pass to group_by"]
2165 pub group_by_ctx: *mut ::std::os::raw::c_void,
2166 #[doc = "Function to free group_by_ctx"]
2167 pub group_by_ctx_free: ecs_ctx_free_t,
2168 #[doc = "If set, the query will be created as a subquery. A subquery matches at\n most a subset of its parent query. Subqueries do not directly receive\n (table) notifications from the world. Instead parent queries forward\n results to subqueries. This can improve matching performance, as fewer\n queries need to be matched with new tables.\n Subqueries can be nested."]
2169 pub parent: *mut ecs_query_t,
2170 #[doc = "User context to pass to callback"]
2171 pub ctx: *mut ::std::os::raw::c_void,
2172 #[doc = "Context to be used for language bindings"]
2173 pub binding_ctx: *mut ::std::os::raw::c_void,
2174 #[doc = "Callback to free ctx"]
2175 pub ctx_free: ecs_ctx_free_t,
2176 #[doc = "Callback to free binding_ctx"]
2177 pub binding_ctx_free: ecs_ctx_free_t,
2178}
2179#[doc = "Used with ecs_observer_init.\n\n \\ingroup observers"]
2180#[repr(C)]
2181#[derive(Debug, Copy, Clone)]
2182pub struct ecs_observer_desc_t {
2183 pub _canary: i32,
2184 #[doc = "Existing entity to associate with observer (optional)"]
2185 pub entity: ecs_entity_t,
2186 #[doc = "Filter for observer"]
2187 pub filter: ecs_filter_desc_t,
2188 #[doc = "Events to observe (OnAdd, OnRemove, OnSet, UnSet)"]
2189 pub events: [ecs_entity_t; 8usize],
2190 #[doc = "When observer is created, generate events from existing data. For example,\n EcsOnAdd Position would match all existing instances of Position.\n This is only supported for events that are iterable (see EcsIterable)"]
2191 pub yield_existing: bool,
2192 #[doc = "Callback to invoke on an event, invoked when the observer matches."]
2193 pub callback: ecs_iter_action_t,
2194 #[doc = "Callback invoked on an event. When left to NULL the default runner\n is used which matches the event with the observer's filter, and calls\n 'callback' when it matches.\n A reason to override the run function is to improve performance, if there\n are more efficient way to test whether an event matches the observer than\n the general purpose query matcher."]
2195 pub run: ecs_run_action_t,
2196 #[doc = "User context to pass to callback"]
2197 pub ctx: *mut ::std::os::raw::c_void,
2198 #[doc = "Context to be used for language bindings"]
2199 pub binding_ctx: *mut ::std::os::raw::c_void,
2200 #[doc = "Callback to free ctx"]
2201 pub ctx_free: ecs_ctx_free_t,
2202 #[doc = "Callback to free binding_ctx"]
2203 pub binding_ctx_free: ecs_ctx_free_t,
2204 #[doc = "Observable with which to register the observer"]
2205 pub observable: *mut ecs_poly_t,
2206 #[doc = "Optional shared last event id for multiple observers. Ensures only one\n of the observers with the shared id gets triggered for an event"]
2207 pub last_event_id: *mut i32,
2208 #[doc = "Used for internal purposes"]
2209 pub term_index: i32,
2210}
2211#[doc = "Used with ecs_emit.\n\n \\ingroup observers"]
2212#[repr(C)]
2213#[derive(Debug, Copy, Clone)]
2214pub struct ecs_event_desc_t {
2215 #[doc = "The event id. Only triggers for the specified event will be notified"]
2216 pub event: ecs_entity_t,
2217 #[doc = "Component ids. Only triggers with a matching component id will be\n notified. Observers are guaranteed to get notified once, even if they\n match more than one id."]
2218 pub ids: *const ecs_type_t,
2219 #[doc = "The table for which to notify."]
2220 pub table: *mut ecs_table_t,
2221 #[doc = "Optional 2nd table to notify. This can be used to communicate the\n previous or next table, in case an entity is moved between tables."]
2222 pub other_table: *mut ecs_table_t,
2223 #[doc = "Limit notified entities to ones starting from offset (row) in table"]
2224 pub offset: i32,
2225 #[doc = "Limit number of notified entities to count. offset+count must be less\n than the total number of entities in the table. If left to 0, it will be\n automatically determined by doing ecs_table_count(table) - offset."]
2226 pub count: i32,
2227 #[doc = "Single-entity alternative to setting table / offset / count"]
2228 pub entity: ecs_entity_t,
2229 #[doc = "Optional context. Assigned to iter param member"]
2230 pub param: *const ::std::os::raw::c_void,
2231 #[doc = "Observable (usually the world)"]
2232 pub observable: *mut ecs_poly_t,
2233 #[doc = "Event flags"]
2234 pub flags: ecs_flags32_t,
2235}
2236#[doc = "Utility to hold a value of a dynamic type"]
2237#[repr(C)]
2238#[derive(Debug, Copy, Clone)]
2239pub struct ecs_value_t {
2240 pub type_: ecs_entity_t,
2241 pub ptr: *mut ::std::os::raw::c_void,
2242}
2243#[doc = "Type that contains information about the world."]
2244#[repr(C)]
2245#[derive(Debug, Copy, Clone)]
2246pub struct ecs_world_info_t {
2247 #[doc = "< Last issued component entity id"]
2248 pub last_component_id: ecs_entity_t,
2249 #[doc = "< First allowed entity id"]
2250 pub min_id: ecs_entity_t,
2251 #[doc = "< Last allowed entity id"]
2252 pub max_id: ecs_entity_t,
2253 #[doc = "< Raw delta time (no time scaling)"]
2254 pub delta_time_raw: f32,
2255 #[doc = "< Time passed to or computed by ecs_progress"]
2256 pub delta_time: f32,
2257 #[doc = "< Time scale applied to delta_time"]
2258 pub time_scale: f32,
2259 #[doc = "< Target fps"]
2260 pub target_fps: f32,
2261 #[doc = "< Total time spent processing a frame"]
2262 pub frame_time_total: f32,
2263 #[doc = "< Total time spent in systems"]
2264 pub system_time_total: f32,
2265 #[doc = "< Total time spent notifying observers"]
2266 pub emit_time_total: f32,
2267 #[doc = "< Total time spent in merges"]
2268 pub merge_time_total: f32,
2269 #[doc = "< Time elapsed in simulation"]
2270 pub world_time_total: f32,
2271 #[doc = "< Time elapsed in simulation (no scaling)"]
2272 pub world_time_total_raw: f32,
2273 #[doc = "< Time spent on query rematching"]
2274 pub rematch_time_total: f32,
2275 #[doc = "< Total number of frames"]
2276 pub frame_count_total: i64,
2277 #[doc = "< Total number of merges"]
2278 pub merge_count_total: i64,
2279 #[doc = "< Total number of rematches"]
2280 pub rematch_count_total: i64,
2281 #[doc = "< Total number of times a new id was created"]
2282 pub id_create_total: i64,
2283 #[doc = "< Total number of times an id was deleted"]
2284 pub id_delete_total: i64,
2285 #[doc = "< Total number of times a table was created"]
2286 pub table_create_total: i64,
2287 #[doc = "< Total number of times a table was deleted"]
2288 pub table_delete_total: i64,
2289 #[doc = "< Total number of pipeline builds"]
2290 pub pipeline_build_count_total: i64,
2291 #[doc = "< Total number of systems ran in last frame"]
2292 pub systems_ran_frame: i64,
2293 #[doc = "< Total number of times observer was invoked"]
2294 pub observers_ran_frame: i64,
2295 #[doc = "< Number of ids in the world (excluding wildcards)"]
2296 pub id_count: i32,
2297 #[doc = "< Number of tag (no data) ids in the world"]
2298 pub tag_id_count: i32,
2299 #[doc = "< Number of component (data) ids in the world"]
2300 pub component_id_count: i32,
2301 #[doc = "< Number of pair ids in the world"]
2302 pub pair_id_count: i32,
2303 #[doc = "< Number of wildcard ids"]
2304 pub wildcard_id_count: i32,
2305 #[doc = "< Number of tables"]
2306 pub table_count: i32,
2307 #[doc = "< Number of tag-only tables"]
2308 pub tag_table_count: i32,
2309 #[doc = "< Number of tables with trivial components (no lifecycle callbacks)"]
2310 pub trivial_table_count: i32,
2311 #[doc = "< Number of tables without entities"]
2312 pub empty_table_count: i32,
2313 #[doc = "< Total number of table records (entries in table caches)"]
2314 pub table_record_count: i32,
2315 #[doc = "< Total number of table storages"]
2316 pub table_storage_count: i32,
2317 pub cmd: ecs_world_info_t__bindgen_ty_1,
2318 #[doc = "< Value set by ecs_set_name_prefix. Used\n to remove library prefixes of symbol\n names (such as Ecs, ecs_) when\n registering them as names."]
2319 pub name_prefix: *const ::std::os::raw::c_char,
2320}
2321#[doc = "-- Command counts --"]
2322#[repr(C)]
2323#[derive(Debug, Copy, Clone)]
2324pub struct ecs_world_info_t__bindgen_ty_1 {
2325 #[doc = "< add commands processed"]
2326 pub add_count: i64,
2327 #[doc = "< remove commands processed"]
2328 pub remove_count: i64,
2329 #[doc = "< delete commands processed"]
2330 pub delete_count: i64,
2331 #[doc = "< clear commands processed"]
2332 pub clear_count: i64,
2333 #[doc = "< set commands processed"]
2334 pub set_count: i64,
2335 #[doc = "< get_mut/emplace commands processed"]
2336 pub get_mut_count: i64,
2337 #[doc = "< modified commands processed"]
2338 pub modified_count: i64,
2339 #[doc = "< other commands processed"]
2340 pub other_count: i64,
2341 #[doc = "< commands discarded, happens when entity is no longer alive when running the command"]
2342 pub discard_count: i64,
2343 #[doc = "< entities for which commands were batched"]
2344 pub batched_entity_count: i64,
2345 #[doc = "< commands batched"]
2346 pub batched_command_count: i64,
2347}
2348#[doc = "Type that contains information about a query group."]
2349#[repr(C)]
2350#[derive(Debug, Copy, Clone)]
2351pub struct ecs_query_group_info_t {
2352 #[doc = "< How often tables have been matched/unmatched"]
2353 pub match_count: i32,
2354 #[doc = "< Number of tables in group"]
2355 pub table_count: i32,
2356 #[doc = "< Group context, returned by on_group_create"]
2357 pub ctx: *mut ::std::os::raw::c_void,
2358}
2359#[doc = "A (string) identifier. Used as pair with EcsName and EcsSymbol tags"]
2360#[repr(C)]
2361#[derive(Debug, Copy, Clone)]
2362pub struct EcsIdentifier {
2363 #[doc = "< Identifier string"]
2364 pub value: *mut ::std::os::raw::c_char,
2365 #[doc = "< Length of identifier"]
2366 pub length: ecs_size_t,
2367 #[doc = "< Hash of current value"]
2368 pub hash: u64,
2369 #[doc = "< Hash of existing record in current index"]
2370 pub index_hash: u64,
2371 #[doc = "< Current index"]
2372 pub index: *mut ecs_hashmap_t,
2373}
2374#[doc = "Component information."]
2375#[repr(C)]
2376#[derive(Debug, Copy, Clone)]
2377pub struct EcsComponent {
2378 #[doc = "< Component size"]
2379 pub size: ecs_size_t,
2380 #[doc = "< Component alignment"]
2381 pub alignment: ecs_size_t,
2382}
2383#[doc = "Component for storing a poly object"]
2384#[repr(C)]
2385#[derive(Debug, Copy, Clone)]
2386pub struct EcsPoly {
2387 #[doc = "< Pointer to poly object"]
2388 pub poly: *mut ecs_poly_t,
2389}
2390#[doc = "Target data for flattened relationships."]
2391#[repr(C)]
2392#[derive(Debug, Copy, Clone)]
2393pub struct EcsTarget {
2394 pub count: i32,
2395 pub target: *mut ecs_record_t,
2396}
2397#[doc = "Component for iterable entities"]
2398pub type EcsIterable = ecs_iterable_t;
2399extern "C" {
2400 #[doc = "Indicates that the id is a pair."]
2401 pub static ECS_PAIR: ecs_id_t;
2402}
2403extern "C" {
2404 #[doc = "Automatically override component when it is inherited"]
2405 pub static ECS_OVERRIDE: ecs_id_t;
2406}
2407extern "C" {
2408 #[doc = "Adds bitset to storage which allows component to be enabled/disabled"]
2409 pub static ECS_TOGGLE: ecs_id_t;
2410}
2411extern "C" {
2412 #[doc = "Include all components from entity to which AND is applied"]
2413 pub static ECS_AND: ecs_id_t;
2414}
2415extern "C" {
2416 pub static FLECS_IDEcsComponentID_: ecs_entity_t;
2417}
2418extern "C" {
2419 pub static FLECS_IDEcsIdentifierID_: ecs_entity_t;
2420}
2421extern "C" {
2422 pub static FLECS_IDEcsIterableID_: ecs_entity_t;
2423}
2424extern "C" {
2425 pub static FLECS_IDEcsPolyID_: ecs_entity_t;
2426}
2427extern "C" {
2428 pub static EcsQuery: ecs_entity_t;
2429}
2430extern "C" {
2431 pub static EcsObserver: ecs_entity_t;
2432}
2433extern "C" {
2434 #[doc = "System module component ids"]
2435 pub static EcsSystem: ecs_entity_t;
2436}
2437extern "C" {
2438 pub static FLECS_IDEcsTickSourceID_: ecs_entity_t;
2439}
2440extern "C" {
2441 pub static FLECS_IDEcsPipelineQueryID_: ecs_entity_t;
2442}
2443extern "C" {
2444 pub static FLECS_IDEcsTimerID_: ecs_entity_t;
2445}
2446extern "C" {
2447 pub static FLECS_IDEcsRateFilterID_: ecs_entity_t;
2448}
2449extern "C" {
2450 #[doc = "Root scope for builtin flecs entities"]
2451 pub static EcsFlecs: ecs_entity_t;
2452}
2453extern "C" {
2454 #[doc = "Core module scope"]
2455 pub static EcsFlecsCore: ecs_entity_t;
2456}
2457extern "C" {
2458 #[doc = "Entity associated with world (used for \"attaching\" components to world)"]
2459 pub static EcsWorld: ecs_entity_t;
2460}
2461extern "C" {
2462 #[doc = "Wildcard entity (\"*\"). Matches any id, returns all matches."]
2463 pub static EcsWildcard: ecs_entity_t;
2464}
2465extern "C" {
2466 #[doc = "Any entity (\"_\"). Matches any id, returns only the first."]
2467 pub static EcsAny: ecs_entity_t;
2468}
2469extern "C" {
2470 #[doc = "This entity. Default source for queries."]
2471 pub static EcsThis: ecs_entity_t;
2472}
2473extern "C" {
2474 #[doc = "Variable entity (\"$\"). Used in expressions to prefix variable names"]
2475 pub static EcsVariable: ecs_entity_t;
2476}
2477extern "C" {
2478 #[doc = "Marks a relationship as transitive.\n Behavior:\n if R(X, Y) and R(Y, Z) then R(X, Z)"]
2479 pub static EcsTransitive: ecs_entity_t;
2480}
2481extern "C" {
2482 #[doc = "Marks a relatoinship as reflexive.\n Behavior:\n R(X, X) == true"]
2483 pub static EcsReflexive: ecs_entity_t;
2484}
2485extern "C" {
2486 #[doc = "Ensures that entity/component cannot be used as target in IsA relationship.\n Final can improve the performance of rule-based queries, as they will not\n attempt to substitute a final component with its subsets.\n\n Behavior:\n if IsA(X, Y) and Final(Y) throw error"]
2487 pub static EcsFinal: ecs_entity_t;
2488}
2489extern "C" {
2490 #[doc = "Ensures that component is never inherited from an IsA target.\n\n Behavior:\n if DontInherit(X) and X(B) and IsA(A, B) then X(A) is false."]
2491 pub static EcsDontInherit: ecs_entity_t;
2492}
2493extern "C" {
2494 #[doc = "Ensures a component is always overridden.\n\n Behavior:\n As if the component is added together with OVERRIDE | T"]
2495 pub static EcsAlwaysOverride: ecs_entity_t;
2496}
2497extern "C" {
2498 #[doc = "Marks relationship as commutative.\n Behavior:\n if R(X, Y) then R(Y, X)"]
2499 pub static EcsSymmetric: ecs_entity_t;
2500}
2501extern "C" {
2502 #[doc = "Can be added to relationship to indicate that the relationship can only occur\n once on an entity. Adding a 2nd instance will replace the 1st.\n\n Behavior:\n R(X, Y) + R(X, Z) = R(X, Z)"]
2503 pub static EcsExclusive: ecs_entity_t;
2504}
2505extern "C" {
2506 #[doc = "Marks a relationship as acyclic. Acyclic relationships may not form cycles."]
2507 pub static EcsAcyclic: ecs_entity_t;
2508}
2509extern "C" {
2510 #[doc = "Marks a relationship as traversable. Traversable relationships may be\n traversed with \"up\" queries. Traversable relationships are acyclic."]
2511 pub static EcsTraversable: ecs_entity_t;
2512}
2513extern "C" {
2514 #[doc = "Ensure that a component always is added together with another component.\n\n Behavior:\n If With(R, O) and R(X) then O(X)\n If With(R, O) and R(X, Y) then O(X, Y)"]
2515 pub static EcsWith: ecs_entity_t;
2516}
2517extern "C" {
2518 #[doc = "Ensure that relationship target is child of specified entity.\n\n Behavior:\n If OneOf(R, O) and R(X, Y), Y must be a child of O\n If OneOf(R) and R(X, Y), Y must be a child of R"]
2519 pub static EcsOneOf: ecs_entity_t;
2520}
2521extern "C" {
2522 #[doc = "Can be added to relationship to indicate that it should never hold data,\n even when it or the relationship target is a component."]
2523 pub static EcsTag: ecs_entity_t;
2524}
2525extern "C" {
2526 #[doc = "Tag to indicate that relationship is stored as union. Union relationships\n enable changing the target of a union without switching tables. Union\n relationships are also marked as exclusive."]
2527 pub static EcsUnion: ecs_entity_t;
2528}
2529extern "C" {
2530 #[doc = "Tag to indicate name identifier"]
2531 pub static EcsName: ecs_entity_t;
2532}
2533extern "C" {
2534 #[doc = "Tag to indicate symbol identifier"]
2535 pub static EcsSymbol: ecs_entity_t;
2536}
2537extern "C" {
2538 #[doc = "Tag to indicate alias identifier"]
2539 pub static EcsAlias: ecs_entity_t;
2540}
2541extern "C" {
2542 #[doc = "Used to express parent-child relationships."]
2543 pub static EcsChildOf: ecs_entity_t;
2544}
2545extern "C" {
2546 #[doc = "Used to express inheritance relationships."]
2547 pub static EcsIsA: ecs_entity_t;
2548}
2549extern "C" {
2550 #[doc = "Used to express dependency relationships"]
2551 pub static EcsDependsOn: ecs_entity_t;
2552}
2553extern "C" {
2554 #[doc = "Used to express a slot (used with prefab inheritance)"]
2555 pub static EcsSlotOf: ecs_entity_t;
2556}
2557extern "C" {
2558 #[doc = "Tag added to module entities"]
2559 pub static EcsModule: ecs_entity_t;
2560}
2561extern "C" {
2562 #[doc = "Tag to indicate an entity/component/system is private to a module"]
2563 pub static EcsPrivate: ecs_entity_t;
2564}
2565extern "C" {
2566 #[doc = "Tag added to prefab entities. Any entity with this tag is automatically\n ignored by queries, unless EcsPrefab is explicitly queried for."]
2567 pub static EcsPrefab: ecs_entity_t;
2568}
2569extern "C" {
2570 #[doc = "When this tag is added to an entity it is skipped by queries, unless\n EcsDisabled is explicitly queried for."]
2571 pub static EcsDisabled: ecs_entity_t;
2572}
2573extern "C" {
2574 #[doc = "Event that triggers when an id is added to an entity"]
2575 pub static EcsOnAdd: ecs_entity_t;
2576}
2577extern "C" {
2578 #[doc = "Event that triggers when an id is removed from an entity"]
2579 pub static EcsOnRemove: ecs_entity_t;
2580}
2581extern "C" {
2582 #[doc = "Event that triggers when a component is set for an entity"]
2583 pub static EcsOnSet: ecs_entity_t;
2584}
2585extern "C" {
2586 #[doc = "Event that triggers when a component is unset for an entity"]
2587 pub static EcsUnSet: ecs_entity_t;
2588}
2589extern "C" {
2590 #[doc = "Event that triggers observer when an entity starts/stops matching a query"]
2591 pub static EcsMonitor: ecs_entity_t;
2592}
2593extern "C" {
2594 #[doc = "Event that triggers when a table is created."]
2595 pub static EcsOnTableCreate: ecs_entity_t;
2596}
2597extern "C" {
2598 #[doc = "Event that triggers when a table is deleted."]
2599 pub static EcsOnTableDelete: ecs_entity_t;
2600}
2601extern "C" {
2602 #[doc = "Event that triggers when a table becomes empty (doesn't emit on creation)."]
2603 pub static EcsOnTableEmpty: ecs_entity_t;
2604}
2605extern "C" {
2606 #[doc = "Event that triggers when a table becomes non-empty."]
2607 pub static EcsOnTableFill: ecs_entity_t;
2608}
2609extern "C" {
2610 #[doc = "Relationship used for specifying cleanup behavior."]
2611 pub static EcsOnDelete: ecs_entity_t;
2612}
2613extern "C" {
2614 #[doc = "Relationship used to define what should happen when a target entity (second\n element of a pair) is deleted."]
2615 pub static EcsOnDeleteTarget: ecs_entity_t;
2616}
2617extern "C" {
2618 #[doc = "Remove cleanup policy. Must be used as target in pair with EcsOnDelete or\n EcsOnDeleteTarget."]
2619 pub static EcsRemove: ecs_entity_t;
2620}
2621extern "C" {
2622 #[doc = "Delete cleanup policy. Must be used as target in pair with EcsOnDelete or\n EcsOnDeleteTarget."]
2623 pub static EcsDelete: ecs_entity_t;
2624}
2625extern "C" {
2626 #[doc = "Panic cleanup policy. Must be used as target in pair with EcsOnDelete or\n EcsOnDeleteTarget."]
2627 pub static EcsPanic: ecs_entity_t;
2628}
2629extern "C" {
2630 pub static FLECS_IDEcsTargetID_: ecs_entity_t;
2631}
2632extern "C" {
2633 #[doc = "Tag added to root entity to indicate its subtree should be flattened. Used\n together with assemblies."]
2634 pub static EcsFlatten: ecs_entity_t;
2635}
2636extern "C" {
2637 #[doc = "Used like (EcsDefaultChildComponent, Component). When added to an entity,\n this informs serialization formats which component to use when a value is\n assigned to an entity without specifying the component. This is intended as\n a hint, serialization formats are not required to use it. Adding this\n component does not change the behavior of core ECS operations."]
2638 pub static EcsDefaultChildComponent: ecs_entity_t;
2639}
2640extern "C" {
2641 #[doc = "Builtin predicates for comparing entity ids in queries. Only supported by rules"]
2642 pub static EcsPredEq: ecs_entity_t;
2643}
2644extern "C" {
2645 pub static EcsPredMatch: ecs_entity_t;
2646}
2647extern "C" {
2648 pub static EcsPredLookup: ecs_entity_t;
2649}
2650extern "C" {
2651 #[doc = "Builtin marker entities for opening/closing query scopes"]
2652 pub static EcsScopeOpen: ecs_entity_t;
2653}
2654extern "C" {
2655 pub static EcsScopeClose: ecs_entity_t;
2656}
2657extern "C" {
2658 #[doc = "Tag used to indicate query is empty"]
2659 pub static EcsEmpty: ecs_entity_t;
2660}
2661extern "C" {
2662 pub static FLECS_IDEcsPipelineID_: ecs_entity_t;
2663}
2664extern "C" {
2665 pub static EcsOnStart: ecs_entity_t;
2666}
2667extern "C" {
2668 pub static EcsPreFrame: ecs_entity_t;
2669}
2670extern "C" {
2671 pub static EcsOnLoad: ecs_entity_t;
2672}
2673extern "C" {
2674 pub static EcsPostLoad: ecs_entity_t;
2675}
2676extern "C" {
2677 pub static EcsPreUpdate: ecs_entity_t;
2678}
2679extern "C" {
2680 pub static EcsOnUpdate: ecs_entity_t;
2681}
2682extern "C" {
2683 pub static EcsOnValidate: ecs_entity_t;
2684}
2685extern "C" {
2686 pub static EcsPostUpdate: ecs_entity_t;
2687}
2688extern "C" {
2689 pub static EcsPreStore: ecs_entity_t;
2690}
2691extern "C" {
2692 pub static EcsOnStore: ecs_entity_t;
2693}
2694extern "C" {
2695 pub static EcsPostFrame: ecs_entity_t;
2696}
2697extern "C" {
2698 pub static EcsPhase: ecs_entity_t;
2699}
2700extern "C" {
2701 #[doc = "Create a new world.\n This operation automatically imports modules from addons Flecs has been built\n with, except when the module specifies otherwise.\n\n @return A new world"]
2702 pub fn ecs_init() -> *mut ecs_world_t;
2703}
2704extern "C" {
2705 #[doc = "Create a new world with just the core module.\n Same as ecs_init, but doesn't import modules from addons. This operation is\n faster than ecs_init and results in less memory utilization.\n\n @return A new tiny world"]
2706 pub fn ecs_mini() -> *mut ecs_world_t;
2707}
2708extern "C" {
2709 #[doc = "Create a new world with arguments.\n Same as ecs_init, but allows passing in command line arguments. Command line\n arguments are used to:\n - automatically derive the name of the application from argv\\[0\\]\n\n @return A new world"]
2710 pub fn ecs_init_w_args(
2711 argc: ::std::os::raw::c_int,
2712 argv: *mut *mut ::std::os::raw::c_char,
2713 ) -> *mut ecs_world_t;
2714}
2715extern "C" {
2716 #[doc = "Delete a world.\n This operation deletes the world, and everything it contains.\n\n @param world The world to delete.\n @return Zero if successful, non-zero if failed."]
2717 pub fn ecs_fini(world: *mut ecs_world_t) -> ::std::os::raw::c_int;
2718}
2719extern "C" {
2720 #[doc = "Returns whether the world is being deleted.\n This operation can be used in callbacks like type hooks or observers to\n detect if they are invoked while the world is being deleted.\n\n @param world The world.\n @return True if being deleted, false if not."]
2721 pub fn ecs_is_fini(world: *const ecs_world_t) -> bool;
2722}
2723extern "C" {
2724 #[doc = "Register action to be executed when world is destroyed.\n Fini actions are typically used when a module needs to clean up before a\n world shuts down.\n\n @param world The world.\n @param action The function to execute.\n @param ctx Userdata to pass to the function"]
2725 pub fn ecs_atfini(
2726 world: *mut ecs_world_t,
2727 action: ecs_fini_action_t,
2728 ctx: *mut ::std::os::raw::c_void,
2729 );
2730}
2731extern "C" {
2732 #[doc = "Begin frame.\n When an application does not use ecs_progress to control the main loop, it\n can still use Flecs features such as FPS limiting and time measurements. This\n operation needs to be invoked whenever a new frame is about to get processed.\n\n Calls to ecs_frame_begin must always be followed by ecs_frame_end.\n\n The function accepts a delta_time parameter, which will get passed to\n systems. This value is also used to compute the amount of time the function\n needs to sleep to ensure it does not exceed the target_fps, when it is set.\n When 0 is provided for delta_time, the time will be measured.\n\n This function should only be ran from the main thread.\n\n @param world The world.\n @param delta_time Time elapsed since the last frame.\n @return The provided delta_time, or measured time if 0 was provided."]
2733 pub fn ecs_frame_begin(world: *mut ecs_world_t, delta_time: f32) -> f32;
2734}
2735extern "C" {
2736 #[doc = "End frame.\n This operation must be called at the end of the frame, and always after\n ecs_frame_begin.\n\n @param world The world."]
2737 pub fn ecs_frame_end(world: *mut ecs_world_t);
2738}
2739extern "C" {
2740 #[doc = "Register action to be executed once after frame.\n Post frame actions are typically used for calling operations that cannot be\n invoked during iteration, such as changing the number of threads.\n\n @param world The world.\n @param action The function to execute.\n @param ctx Userdata to pass to the function"]
2741 pub fn ecs_run_post_frame(
2742 world: *mut ecs_world_t,
2743 action: ecs_fini_action_t,
2744 ctx: *mut ::std::os::raw::c_void,
2745 );
2746}
2747extern "C" {
2748 #[doc = "Signal exit\n This operation signals that the application should quit. It will cause\n ecs_progress to return false.\n\n @param world The world to quit."]
2749 pub fn ecs_quit(world: *mut ecs_world_t);
2750}
2751extern "C" {
2752 #[doc = "Return whether a quit has been signaled.\n\n @param world The world."]
2753 pub fn ecs_should_quit(world: *const ecs_world_t) -> bool;
2754}
2755extern "C" {
2756 #[doc = "Measure frame time.\n Frame time measurements measure the total time passed in a single frame, and\n how much of that time was spent on systems and on merging.\n\n Frame time measurements add a small constant-time overhead to an application.\n When an application sets a target FPS, frame time measurements are enabled by\n default.\n\n @param world The world.\n @param enable Whether to enable or disable frame time measuring."]
2757 pub fn ecs_measure_frame_time(world: *mut ecs_world_t, enable: bool);
2758}
2759extern "C" {
2760 #[doc = "Measure system time.\n System time measurements measure the time spent in each system.\n\n System time measurements add overhead to every system invocation and\n therefore have a small but measurable impact on application performance.\n System time measurements must be enabled before obtaining system statistics.\n\n @param world The world.\n @param enable Whether to enable or disable system time measuring."]
2761 pub fn ecs_measure_system_time(world: *mut ecs_world_t, enable: bool);
2762}
2763extern "C" {
2764 #[doc = "Set target frames per second (FPS) for application.\n Setting the target FPS ensures that ecs_progress is not invoked faster than\n the specified FPS. When enabled, ecs_progress tracks the time passed since\n the last invocation, and sleeps the remaining time of the frame (if any).\n\n This feature ensures systems are ran at a consistent interval, as well as\n conserving CPU time by not running systems more often than required.\n\n Note that ecs_progress only sleeps if there is time left in the frame. Both\n time spent in flecs as time spent outside of flecs are taken into\n account.\n\n @param world The world.\n @param fps The target FPS."]
2765 pub fn ecs_set_target_fps(world: *mut ecs_world_t, fps: f32);
2766}
2767extern "C" {
2768 #[doc = "Begin readonly mode.\n Readonly mode guarantees that no mutations will occur on the world, which\n makes the world safe to access from multiple threads. While the world is in\n readonly mode, operations are deferred.\n\n Note that while similar to ecs_defer_begin, deferring only does not guarantee\n the world is not mutated. Operations that are not deferred (like creating a\n query) update data structures on the world and are allowed when deferring is\n enabled, but not when the world is in readonly mode.\n\n A call to ecs_readonly_begin must be followed up with ecs_readonly_end.\n\n The ecs_progress() function automatically enables readonly mode while systems\n are executed.\n\n When a world has more than one stage, the specific stage must be provided to\n mutating ECS operations. Failing to do so will throw a readonly assert. A\n world typically has more than one stage when using threads. An example:\n\n ecs_set_stage_count(world, 2);\n ecs_stage_t *stage = ecs_get_stage(world, 1);\n\n ecs_readonly_begin(world);\n ecs_add(world, e, Tag); // readonly assert\n ecs_add(stage, e, Tag); // OK\n\n @param world The world\n @return Whether world is in readonly mode."]
2769 pub fn ecs_readonly_begin(world: *mut ecs_world_t) -> bool;
2770}
2771extern "C" {
2772 #[doc = "End readonly mode.\n This operation ends readonly mode, and must be called after\n ecs_readonly_begin. Operations that were deferred while the world was in\n readonly mode will be flushed.\n\n @param world The world"]
2773 pub fn ecs_readonly_end(world: *mut ecs_world_t);
2774}
2775extern "C" {
2776 #[doc = "Merge world or stage.\n When automatic merging is disabled, an application can call this\n operation on either an individual stage, or on the world which will merge\n all stages. This operation may only be called when staging is not enabled\n (either after progress() or after readonly_end()).\n\n This operation may be called on an already merged stage or world.\n\n @param world The world."]
2777 pub fn ecs_merge(world: *mut ecs_world_t);
2778}
2779extern "C" {
2780 #[doc = "Defer operations until end of frame.\n When this operation is invoked while iterating, operations inbetween the\n defer_begin and defer_end operations are executed at the end of the frame.\n\n This operation is thread safe.\n\n @param world The world.\n @return true if world changed from non-deferred mode to deferred mode."]
2781 pub fn ecs_defer_begin(world: *mut ecs_world_t) -> bool;
2782}
2783extern "C" {
2784 #[doc = "Test if deferring is enabled for current stage.\n\n @param world The world.\n @return True if deferred, false if not."]
2785 pub fn ecs_is_deferred(world: *const ecs_world_t) -> bool;
2786}
2787extern "C" {
2788 #[doc = "End block of operations to defer.\n See defer_begin.\n\n This operation is thread safe.\n\n @param world The world.\n @return true if world changed from deferred mode to non-deferred mode."]
2789 pub fn ecs_defer_end(world: *mut ecs_world_t) -> bool;
2790}
2791extern "C" {
2792 #[doc = "Suspend deferring but do not flush queue.\n This operation can be used to do an undeferred operation while not flushing\n the operations in the queue.\n\n An application should invoke ecs_defer_resume before ecs_defer_end is called.\n The operation may only be called when deferring is enabled.\n\n @param world The world."]
2793 pub fn ecs_defer_suspend(world: *mut ecs_world_t);
2794}
2795extern "C" {
2796 #[doc = "Resume deferring.\n See ecs_defer_suspend.\n\n @param world The world."]
2797 pub fn ecs_defer_resume(world: *mut ecs_world_t);
2798}
2799extern "C" {
2800 #[doc = "Enable/disable automerging for world or stage.\n When automerging is enabled, staged data will automatically be merged with\n the world when staging ends. This happens at the end of progress(), at a\n sync point or when readonly_end() is called.\n\n Applications can exercise more control over when data from a stage is merged\n by disabling automerging. This requires an application to explicitly call\n merge() on the stage.\n\n When this function is invoked on the world, it sets all current stages to\n the provided value and sets the default for new stages. When this function is\n invoked on a stage, automerging is only set for that specific stage.\n\n @param world The world.\n @param automerge Whether to enable or disable automerging."]
2801 pub fn ecs_set_automerge(world: *mut ecs_world_t, automerge: bool);
2802}
2803extern "C" {
2804 #[doc = "Configure world to have N stages.\n This initializes N stages, which allows applications to defer operations to\n multiple isolated defer queues. This is typically used for applications with\n multiple threads, where each thread gets its own queue, and commands are\n merged when threads are synchronized.\n\n Note that the ecs_set_threads function already creates the appropriate\n number of stages. The set_stage_count() operation is useful for applications that\n want to manage their own stages and/or threads.\n\n @param world The world.\n @param stages The number of stages."]
2805 pub fn ecs_set_stage_count(world: *mut ecs_world_t, stages: i32);
2806}
2807extern "C" {
2808 #[doc = "Get number of configured stages.\n Return number of stages set by ecs_set_stage_count.\n\n @param world The world.\n @return The number of stages used for threading."]
2809 pub fn ecs_get_stage_count(world: *const ecs_world_t) -> i32;
2810}
2811extern "C" {
2812 #[doc = "Get current stage id.\n The stage id can be used by an application to learn about which stage it is\n using, which typically corresponds with the worker thread id.\n\n @param world The world.\n @return The stage id."]
2813 pub fn ecs_get_stage_id(world: *const ecs_world_t) -> i32;
2814}
2815extern "C" {
2816 #[doc = "Get stage-specific world pointer.\n Flecs threads can safely invoke the API as long as they have a private\n context to write to, also referred to as the stage. This function returns a\n pointer to a stage, disguised as a world pointer.\n\n Note that this function does not(!) create a new world. It simply wraps the\n existing world in a thread-specific context, which the API knows how to\n unwrap. The reason the stage is returned as an ecs_world_t is so that it\n can be passed transparently to the existing API functions, vs. having to\n create a dediated API for threading.\n\n @param world The world.\n @param stage_id The index of the stage to retrieve.\n @return A thread-specific pointer to the world."]
2817 pub fn ecs_get_stage(world: *const ecs_world_t, stage_id: i32) -> *mut ecs_world_t;
2818}
2819extern "C" {
2820 #[doc = "Test whether the current world is readonly.\n This function allows the code to test whether the currently used world\n is readonly or whether it allows for writing.\n\n @param world A pointer to a stage or the world.\n @return True if the world or stage is readonly."]
2821 pub fn ecs_stage_is_readonly(world: *const ecs_world_t) -> bool;
2822}
2823extern "C" {
2824 #[doc = "Create asynchronous stage.\n An asynchronous stage can be used to asynchronously queue operations for\n later merging with the world. An asynchronous stage is similar to a regular\n stage, except that it does not allow reading from the world.\n\n Asynchronous stages are never merged automatically, and must therefore be\n manually merged with the ecs_merge function. It is not necessary to call\n defer_begin or defer_end before and after enqueuing commands, as an\n asynchronous stage unconditionally defers operations.\n\n The application must ensure that no commands are added to the stage while the\n stage is being merged.\n\n An asynchronous stage must be cleaned up by ecs_async_stage_free.\n\n @param world The world.\n @return The stage."]
2825 pub fn ecs_async_stage_new(world: *mut ecs_world_t) -> *mut ecs_world_t;
2826}
2827extern "C" {
2828 #[doc = "Free asynchronous stage.\n The provided stage must be an asynchronous stage. If a non-asynchronous stage\n is provided, the operation will fail.\n\n @param stage The stage to free."]
2829 pub fn ecs_async_stage_free(stage: *mut ecs_world_t);
2830}
2831extern "C" {
2832 #[doc = "Test whether provided stage is asynchronous.\n\n @param stage The stage.\n @return True when the stage is asynchronous, false for a regular stage or\n world."]
2833 pub fn ecs_stage_is_async(stage: *mut ecs_world_t) -> bool;
2834}
2835extern "C" {
2836 #[doc = "Set a world context.\n This operation allows an application to register custom data with a world\n that can be accessed anywhere where the application has the world.\n\n @param world The world.\n @param ctx A pointer to a user defined structure.\n @param ctx_free A function that is invoked with ctx when the world is freed."]
2837 pub fn ecs_set_ctx(
2838 world: *mut ecs_world_t,
2839 ctx: *mut ::std::os::raw::c_void,
2840 ctx_free: ecs_ctx_free_t,
2841 );
2842}
2843extern "C" {
2844 #[doc = "Set a world binding context.\n Same as ecs_set_ctx but for binding context. A binding context is intended\n specifically for language bindings to store binding specific data.\n\n @param world The world.\n @param ctx A pointer to a user defined structure.\n @param ctx_free A function that is invoked with ctx when the world is freed."]
2845 pub fn ecs_set_binding_ctx(
2846 world: *mut ecs_world_t,
2847 ctx: *mut ::std::os::raw::c_void,
2848 ctx_free: ecs_ctx_free_t,
2849 );
2850}
2851extern "C" {
2852 #[doc = "Get the world context.\n This operation retrieves a previously set world context.\n\n @param world The world.\n @return The context set with ecs_set_ctx. If no context was set, the\n function returns NULL."]
2853 pub fn ecs_get_ctx(world: *const ecs_world_t) -> *mut ::std::os::raw::c_void;
2854}
2855extern "C" {
2856 #[doc = "Get the world binding context.\n This operation retrieves a previously set world binding context.\n\n @param world The world.\n @return The context set with ecs_set_binding_ctx. If no context was set, the\n function returns NULL."]
2857 pub fn ecs_get_binding_ctx(world: *const ecs_world_t) -> *mut ::std::os::raw::c_void;
2858}
2859extern "C" {
2860 #[doc = "Get world info.\n\n @param world The world.\n @return Pointer to the world info. Valid for as long as the world exists."]
2861 pub fn ecs_get_world_info(world: *const ecs_world_t) -> *const ecs_world_info_t;
2862}
2863extern "C" {
2864 #[doc = "Dimension the world for a specified number of entities.\n This operation will preallocate memory in the world for the specified number\n of entities. Specifying a number lower than the current number of entities in\n the world will have no effect.\n\n @param world The world.\n @param entity_count The number of entities to preallocate."]
2865 pub fn ecs_dim(world: *mut ecs_world_t, entity_count: i32);
2866}
2867extern "C" {
2868 #[doc = "Set a range for issueing new entity ids.\n This function constrains the entity identifiers returned by ecs_new to the\n specified range. This operation can be used to ensure that multiple processes\n can run in the same simulation without requiring a central service that\n coordinates issueing identifiers.\n\n If id_end is set to 0, the range is infinite. If id_end is set to a non-zero\n value, it has to be larger than id_start. If id_end is set and ecs_new is\n invoked after an id is issued that is equal to id_end, the application will\n abort.\n\n @param world The world.\n @param id_start The start of the range.\n @param id_end The end of the range."]
2869 pub fn ecs_set_entity_range(
2870 world: *mut ecs_world_t,
2871 id_start: ecs_entity_t,
2872 id_end: ecs_entity_t,
2873 );
2874}
2875extern "C" {
2876 #[doc = "Enable/disable range limits.\n When an application is both a receiver of range-limited entities and a\n producer of range-limited entities, range checking needs to be temporarily\n disabled when inserting received entities. Range checking is disabled on a\n stage, so setting this value is thread safe.\n\n @param world The world.\n @param enable True if range checking should be enabled, false to disable.\n @return The previous value."]
2877 pub fn ecs_enable_range_check(world: *mut ecs_world_t, enable: bool) -> bool;
2878}
2879extern "C" {
2880 #[doc = "Get the largest issued entity id (not counting generation).\n\n @param world The world."]
2881 pub fn ecs_get_max_id(world: *const ecs_world_t) -> ecs_entity_t;
2882}
2883extern "C" {
2884 #[doc = "Force aperiodic actions.\n The world may delay certain operations until they are necessary for the\n application to function correctly. This may cause observable side effects\n such as delayed triggering of events, which can be inconvenient when for\n example running a test suite.\n\n The flags parameter specifies which aperiodic actions to run. Specify 0 to\n run all actions. Supported flags start with 'EcsAperiodic'. Flags identify\n internal mechanisms and may change unannounced.\n\n @param world The world.\n @param flags The flags specifying which actions to run."]
2885 pub fn ecs_run_aperiodic(world: *mut ecs_world_t, flags: ecs_flags32_t);
2886}
2887extern "C" {
2888 #[doc = "Cleanup empty tables.\n This operation cleans up empty tables that meet certain conditions. Having\n large amounts of empty tables does not negatively impact performance of the\n ECS, but can take up considerable amounts of memory, especially in\n applications with many components, and many components per entity.\n\n The generation specifies the minimum number of times this operation has\n to be called before an empty table is cleaned up. If a table becomes non\n empty, the generation is reset.\n\n The operation allows for both a \"clear\" generation and a \"delete\"\n generation. When the clear generation is reached, the table's\n resources are freed (like component arrays) but the table itself is not\n deleted. When the delete generation is reached, the empty table is deleted.\n\n By specifying a non-zero id the cleanup logic can be limited to tables with\n a specific (component) id. The operation will only increase the generation\n count of matching tables.\n\n The min_id_count specifies a lower bound for the number of components a table\n should have. Often the more components a table has, the more specific it is\n and therefore less likely to be reused.\n\n The time budget specifies how long the operation should take at most.\n\n @param world The world.\n @param id Optional component filter for the tables to evaluate.\n @param clear_generation Free table data when generation > clear_generation.\n @param delete_generation Delete table when generation > delete_generation.\n @param min_id_count Minimum number of component ids the table should have.\n @param time_budget_seconds Amount of time operation is allowed to spend.\n @return Number of deleted tables."]
2889 pub fn ecs_delete_empty_tables(
2890 world: *mut ecs_world_t,
2891 id: ecs_id_t,
2892 clear_generation: u16,
2893 delete_generation: u16,
2894 min_id_count: i32,
2895 time_budget_seconds: f64,
2896 ) -> i32;
2897}
2898extern "C" {
2899 #[doc = "Get world from poly.\n\n @param poly A pointer to a poly object.\n @return The world."]
2900 pub fn ecs_get_world(poly: *const ecs_poly_t) -> *const ecs_world_t;
2901}
2902extern "C" {
2903 #[doc = "Get entity from poly.\n\n @param poly A pointer to a poly object.\n @return Entity associated with the poly object."]
2904 pub fn ecs_get_entity(poly: *const ecs_poly_t) -> ecs_entity_t;
2905}
2906extern "C" {
2907 #[doc = "Test if pointer is of specified type.\n Usage:\n ecs_poly_is(ptr, ecs_world_t)\n\n This operation only works for poly types.\n\n @param object The object to test.\n @param type The id of the type.\n @return True if the pointer is of the specified type."]
2908 pub fn ecs_poly_is_(object: *const ecs_poly_t, type_: i32) -> bool;
2909}
2910extern "C" {
2911 #[doc = "Make a pair id.\n This function is equivalent to using the ecs_pair macro, and is added for\n convenience to make it easier for non C/C++ bindings to work with pairs.\n\n @param first The first element of the pair of the pair.\n @param second The target of the pair."]
2912 pub fn ecs_make_pair(first: ecs_entity_t, second: ecs_entity_t) -> ecs_id_t;
2913}
2914extern "C" {
2915 #[doc = "Create new entity id.\n This operation returns an unused entity id. This operation is guaranteed to\n return an empty entity as it does not use values set by ecs_set_scope or\n ecs_set_with.\n\n @param world The world.\n @return The new entity id."]
2916 pub fn ecs_new_id(world: *mut ecs_world_t) -> ecs_entity_t;
2917}
2918extern "C" {
2919 #[doc = "Create new low id.\n This operation returns a new low id. Entity ids start after the\n FLECS_HI_COMPONENT_ID constant. This reserves a range of low ids for things\n like components, and allows parts of the code to optimize operations.\n\n Note that FLECS_HI_COMPONENT_ID does not represent the maximum number of\n components that can be created, only the maximum number of components that\n can take advantage of these optimizations.\n\n This operation is guaranteed to return an empty entity as it does not use\n values set by ecs_set_scope or ecs_set_with.\n\n This operation does not recycle ids.\n\n @param world The world.\n @return The new component id."]
2920 pub fn ecs_new_low_id(world: *mut ecs_world_t) -> ecs_entity_t;
2921}
2922extern "C" {
2923 #[doc = "Create new entity with (component) id.\n This operation creates a new entity with an optional (component) id. When 0\n is passed to the id paramter, no component is added to the new entity.\n\n @param world The world.\n @param id The component id to initialize the new entity with.\n @return The new entity."]
2924 pub fn ecs_new_w_id(world: *mut ecs_world_t, id: ecs_id_t) -> ecs_entity_t;
2925}
2926extern "C" {
2927 #[doc = "Create new entity in table.\n This operation creates a new entity in the specified table.\n\n @param world The world.\n @param table The table to which to add the new entity.\n @return The new entity."]
2928 pub fn ecs_new_w_table(world: *mut ecs_world_t, table: *mut ecs_table_t) -> ecs_entity_t;
2929}
2930extern "C" {
2931 #[doc = "Find or create an entity.\n This operation creates a new entity, or modifies an existing one. When a name\n is set in the ecs_entity_desc_t::name field and ecs_entity_desc_t::entity is\n not set, the operation will first attempt to find an existing entity by that\n name. If no entity with that name can be found, it will be created.\n\n If both a name and entity handle are provided, the operation will check if\n the entity name matches with the provided name. If the names do not match,\n the function will fail and return 0.\n\n If an id to a non-existing entity is provided, that entity id become alive.\n\n See the documentation of ecs_entity_desc_t for more details.\n\n @param world The world.\n @param desc Entity init parameters.\n @return A handle to the new or existing entity, or 0 if failed."]
2932 pub fn ecs_entity_init(world: *mut ecs_world_t, desc: *const ecs_entity_desc_t)
2933 -> ecs_entity_t;
2934}
2935extern "C" {
2936 #[doc = "Bulk create/populate new entities.\n This operation bulk inserts a list of new or predefined entities into a\n single table.\n\n The operation does not take ownership of component arrays provided by the\n application. Components that are non-trivially copyable will be moved into\n the storage.\n\n The operation will emit OnAdd events for each added id, and OnSet events for\n each component that has been set.\n\n If no entity ids are provided by the application, the returned array of ids\n points to an internal datastructure which changes when new entities are\n created/deleted.\n\n If as a result of the operation triggers are invoked that deletes\n entities and no entity ids were provided by the application, the returned\n array of identifiers may be incorrect. To avoid this problem, an application\n can first call ecs_bulk_init to create empty entities, copy the array to one\n that is owned by the application, and then use this array to populate the\n entities.\n\n @param world The world.\n @param desc Bulk creation parameters.\n @return Array with the list of entity ids created/populated."]
2937 pub fn ecs_bulk_init(
2938 world: *mut ecs_world_t,
2939 desc: *const ecs_bulk_desc_t,
2940 ) -> *const ecs_entity_t;
2941}
2942extern "C" {
2943 #[doc = "Create N new entities.\n This operation is the same as ecs_new_w_id, but creates N entities\n instead of one.\n\n @param world The world.\n @param id The component id to create the entities with.\n @param count The number of entities to create.\n @return The first entity id of the newly created entities."]
2944 pub fn ecs_bulk_new_w_id(
2945 world: *mut ecs_world_t,
2946 id: ecs_id_t,
2947 count: i32,
2948 ) -> *const ecs_entity_t;
2949}
2950extern "C" {
2951 #[doc = "Clone an entity\n This operation clones the components of one entity into another entity. If\n no destination entity is provided, a new entity will be created. Component\n values are not copied unless copy_value is true.\n\n @param world The world.\n @param dst The entity to copy the components to.\n @param src The entity to copy the components from.\n @param copy_value If true, the value of components will be copied to dst.\n @return The destination entity."]
2952 pub fn ecs_clone(
2953 world: *mut ecs_world_t,
2954 dst: ecs_entity_t,
2955 src: ecs_entity_t,
2956 copy_value: bool,
2957 ) -> ecs_entity_t;
2958}
2959extern "C" {
2960 #[doc = "Delete an entity.\n This operation will delete an entity and all of its components. The entity id\n will be made available for recycling. If the entity passed to ecs_delete is\n not alive, the operation will have no side effects.\n\n @param world The world.\n @param entity The entity."]
2961 pub fn ecs_delete(world: *mut ecs_world_t, entity: ecs_entity_t);
2962}
2963extern "C" {
2964 #[doc = "Delete all entities with the specified id.\n This will delete all entities (tables) that have the specified id. The id\n may be a wildcard and/or a pair.\n\n @param world The world.\n @param id The id."]
2965 pub fn ecs_delete_with(world: *mut ecs_world_t, id: ecs_id_t);
2966}
2967extern "C" {
2968 #[doc = "Add a (component) id to an entity.\n This operation adds a single (component) id to an entity. If the entity\n already has the id, this operation will have no side effects.\n\n @param world The world.\n @param entity The entity.\n @param id The id to add."]
2969 pub fn ecs_add_id(world: *mut ecs_world_t, entity: ecs_entity_t, id: ecs_id_t);
2970}
2971extern "C" {
2972 #[doc = "Remove a (component) id from an entity.\n This operation removes a single (component) id to an entity. If the entity\n does not have the id, this operation will have no side effects.\n\n @param world The world.\n @param entity The entity.\n @param id The id to remove."]
2973 pub fn ecs_remove_id(world: *mut ecs_world_t, entity: ecs_entity_t, id: ecs_id_t);
2974}
2975extern "C" {
2976 #[doc = "Add override for (component) id.\n Adding an override to an entity ensures that when the entity is instantiated\n (by adding an IsA relationship to it) the component with the override is\n copied to a component that is private to the instance. By default components\n reachable through an IsA relationship are shared.\n\n Adding an override does not add the component. If an override is added to an\n entity that does not have the component, it will still be added to the\n instance, but with an uninitialized value (unless the component has a ctor).\n When the entity does have the entity, the component of the instance will be\n initialized with the value of the component on the entity.\n\n This is the same as what happens when calling ecs_add_id for an id that is\n inherited (reachable through an IsA relationship).\n\n This operation is equivalent to doing:\n ecs_add_id(world, entity, ECS_OVERRIDE | id);\n\n @param world The world.\n @param entity The entity.\n @param id The id to override."]
2977 pub fn ecs_override_id(world: *mut ecs_world_t, entity: ecs_entity_t, id: ecs_id_t);
2978}
2979extern "C" {
2980 #[doc = "Clear all components.\n This operation will remove all components from an entity.\n\n @param world The world.\n @param entity The entity."]
2981 pub fn ecs_clear(world: *mut ecs_world_t, entity: ecs_entity_t);
2982}
2983extern "C" {
2984 #[doc = "Remove all instances of the specified (component) id.\n This will remove the specified id from all entities (tables). The id may be\n a wildcard and/or a pair.\n\n @param world The world.\n @param id The id."]
2985 pub fn ecs_remove_all(world: *mut ecs_world_t, id: ecs_id_t);
2986}
2987extern "C" {
2988 #[doc = "Set current with id.\n New entities are automatically created with the specified id.\n\n @param world The world.\n @param id The id.\n @return The previous id."]
2989 pub fn ecs_set_with(world: *mut ecs_world_t, id: ecs_id_t) -> ecs_entity_t;
2990}
2991extern "C" {
2992 #[doc = "Get current with id.\n Get the id set with ecs_set_with.\n\n @param world The world.\n @return The last id provided to ecs_set_with."]
2993 pub fn ecs_get_with(world: *const ecs_world_t) -> ecs_id_t;
2994}
2995extern "C" {
2996 #[doc = "Enable or disable entity.\n This operation enables or disables an entity by adding or removing the\n EcsDisabled tag. A disabled entity will not be matched with any systems,\n unless the system explicitly specifies the EcsDisabled tag.\n\n @param world The world.\n @param entity The entity to enable or disable.\n @param enabled true to enable the entity, false to disable."]
2997 pub fn ecs_enable(world: *mut ecs_world_t, entity: ecs_entity_t, enabled: bool);
2998}
2999extern "C" {
3000 #[doc = "Enable or disable component.\n Enabling or disabling a component does not add or remove a component from an\n entity, but prevents it from being matched with queries. This operation can\n be useful when a component must be temporarily disabled without destroying\n its value. It is also a more performant operation for when an application\n needs to add/remove components at high frequency, as enabling/disabling is\n cheaper than a regular add or remove.\n\n @param world The world.\n @param entity The entity.\n @param id The component.\n @param enable True to enable the component, false to disable."]
3001 pub fn ecs_enable_id(world: *mut ecs_world_t, entity: ecs_entity_t, id: ecs_id_t, enable: bool);
3002}
3003extern "C" {
3004 #[doc = "Test if component is enabled.\n Test whether a component is currently enabled or disabled. This operation\n will return true when the entity has the component and if it has not been\n disabled by ecs_enable_component.\n\n @param world The world.\n @param entity The entity.\n @param id The component.\n @return True if the component is enabled, otherwise false."]
3005 pub fn ecs_is_enabled_id(world: *const ecs_world_t, entity: ecs_entity_t, id: ecs_id_t)
3006 -> bool;
3007}
3008extern "C" {
3009 #[doc = "Get an immutable pointer to a component.\n This operation obtains a const pointer to the requested component. The\n operation accepts the component entity id.\n\n @param world The world.\n @param entity The entity.\n @param id The id of the component to get.\n @return The component pointer, NULL if the entity does not have the component."]
3010 pub fn ecs_get_id(
3011 world: *const ecs_world_t,
3012 entity: ecs_entity_t,
3013 id: ecs_id_t,
3014 ) -> *const ::std::os::raw::c_void;
3015}
3016extern "C" {
3017 #[doc = "Create a component ref.\n A ref is a handle to an entity + component which caches a small amount of\n data to reduce overhead of repeatedly accessing the component. Use\n ecs_ref_get to get the component data.\n\n @param world The world.\n @param entity The entity.\n @param id The id of the component.\n @return The reference."]
3018 pub fn ecs_ref_init_id(
3019 world: *const ecs_world_t,
3020 entity: ecs_entity_t,
3021 id: ecs_id_t,
3022 ) -> ecs_ref_t;
3023}
3024extern "C" {
3025 #[doc = "Get component from ref.\n Get component pointer from ref. The ref must be created with ecs_ref_init.\n\n @param world The world.\n @param ref The ref.\n @param id The component id.\n @return The component pointer, NULL if the entity does not have the component."]
3026 pub fn ecs_ref_get_id(
3027 world: *const ecs_world_t,
3028 ref_: *mut ecs_ref_t,
3029 id: ecs_id_t,
3030 ) -> *mut ::std::os::raw::c_void;
3031}
3032extern "C" {
3033 #[doc = "Update ref.\n Ensures contents of ref are up to date. Same as ecs_ref_get_id, but does not\n return pointer to component id.\n\n @param world The world.\n @param ref The ref."]
3034 pub fn ecs_ref_update(world: *const ecs_world_t, ref_: *mut ecs_ref_t);
3035}
3036extern "C" {
3037 #[doc = "Get a mutable pointer to a component.\n This operation returns a mutable pointer to a component. If the component did\n not yet exist, it will be added.\n\n If get_mut is called when the world is in deferred/readonly mode, the\n function will:\n - return a pointer to a temp storage if the component does not yet exist, or\n - return a pointer to the existing component if it exists\n\n @param world The world.\n @param entity The entity.\n @param id The entity id of the component to obtain.\n @return The component pointer."]
3038 pub fn ecs_get_mut_id(
3039 world: *mut ecs_world_t,
3040 entity: ecs_entity_t,
3041 id: ecs_id_t,
3042 ) -> *mut ::std::os::raw::c_void;
3043}
3044extern "C" {
3045 #[doc = "Combines get_mut + modifed in single operation.\n This operation is a more efficient alternative to calling ecs_get_mut_id and\n ecs_modified_id separately. This operation is only valid when the world is in\n deferred mode, which ensures that the Modified event is not emitted before\n the modification takes place.\n\n @param world The world.\n @param entity The entity.\n @param id The id of the component to obtain.\n @return The component pointer."]
3046 pub fn ecs_get_mut_modified_id(
3047 world: *mut ecs_world_t,
3048 entity: ecs_entity_t,
3049 id: ecs_id_t,
3050 ) -> *mut ::std::os::raw::c_void;
3051}
3052extern "C" {
3053 #[doc = "Begin exclusive write access to entity.\n This operation provides safe exclusive access to the components of an entity\n without the overhead of deferring operations.\n\n When this operation is called simultaneously for the same entity more than\n once it will throw an assert. Note that for this to happen, asserts must be\n enabled. It is up to the application to ensure that access is exclusive, for\n example by using a read-write mutex.\n\n Exclusive access is enforced at the table level, so only one entity can be\n exclusively accessed per table. The exclusive access check is thread safe.\n\n This operation must be followed up with ecs_write_end.\n\n @param world The world.\n @param entity The entity.\n @return A record to the entity."]
3054 pub fn ecs_write_begin(world: *mut ecs_world_t, entity: ecs_entity_t) -> *mut ecs_record_t;
3055}
3056extern "C" {
3057 #[doc = "End exclusive write access to entity.\n This operation ends exclusive access, and must be called after\n ecs_write_begin.\n\n @param record Record to the entity."]
3058 pub fn ecs_write_end(record: *mut ecs_record_t);
3059}
3060extern "C" {
3061 #[doc = "Begin read access to entity.\n This operation provides safe read access to the components of an entity.\n Multiple simultaneous reads are allowed per entity.\n\n This operation ensures that code attempting to mutate the entity's table will\n throw an assert. Note that for this to happen, asserts must be enabled. It is\n up to the application to ensure that this does not happen, for example by\n using a read-write mutex.\n\n This operation does *not* provide the same guarantees as a read-write mutex,\n as it is possible to call ecs_read_begin after calling ecs_write_begin. It is\n up to application has to ensure that this does not happen.\n\n This operation must be followed up with ecs_read_end.\n\n @param world The world.\n @param entity The entity.\n @return A record to the entity."]
3062 pub fn ecs_read_begin(world: *mut ecs_world_t, entity: ecs_entity_t) -> *const ecs_record_t;
3063}
3064extern "C" {
3065 #[doc = "End read access to entity.\n This operation ends read access, and must be called after ecs_read_begin.\n\n @param record Record to the entity."]
3066 pub fn ecs_read_end(record: *const ecs_record_t);
3067}
3068extern "C" {
3069 #[doc = "Get entity corresponding with record.\n This operation only works for entities that are not empty.\n\n @param record The record for which to obtain the entity id."]
3070 pub fn ecs_record_get_entity(record: *const ecs_record_t) -> ecs_entity_t;
3071}
3072extern "C" {
3073 #[doc = "Get component from entity record.\n This operation returns a pointer to a component for the entity\n associated with the provided record. For safe access to the component, obtain\n the record with ecs_read_begin or ecs_write_begin.\n\n Obtaining a component from a record is faster than obtaining it from the\n entity handle, as it reduces the number of lookups required.\n\n @param world The world.\n @param record Record to the entity.\n @param id The (component) id.\n @return Pointer to component, or NULL if entity does not have the component."]
3074 pub fn ecs_record_get_id(
3075 world: *mut ecs_world_t,
3076 record: *const ecs_record_t,
3077 id: ecs_id_t,
3078 ) -> *const ::std::os::raw::c_void;
3079}
3080extern "C" {
3081 #[doc = "Same as ecs_record_get_id, but returns a mutable pointer.\n For safe access to the component, obtain the record with ecs_write_begin.\n\n @param world The world.\n @param record Record to the entity.\n @param id The (component) id.\n @return Pointer to component, or NULL if entity does not have the component."]
3082 pub fn ecs_record_get_mut_id(
3083 world: *mut ecs_world_t,
3084 record: *mut ecs_record_t,
3085 id: ecs_id_t,
3086 ) -> *mut ::std::os::raw::c_void;
3087}
3088extern "C" {
3089 #[doc = "Test if entity for record has component.\n\n @param world The world.\n @param record Record to the entity.\n @param id The (component) id."]
3090 pub fn ecs_record_has_id(
3091 world: *mut ecs_world_t,
3092 record: *const ecs_record_t,
3093 id: ecs_id_t,
3094 ) -> bool;
3095}
3096extern "C" {
3097 #[doc = "Emplace a component.\n Emplace is similar to get_mut except that the component constructor is not\n invoked for the returned pointer, allowing the component to be \"constructed\"\n directly in the storage.\n\n Emplace can only be used if the entity does not yet have the component. If\n the entity has the component, the operation will fail.\n\n @param world The world.\n @param entity The entity.\n @param id The component to obtain.\n @return The (uninitialized) component pointer."]
3098 pub fn ecs_emplace_id(
3099 world: *mut ecs_world_t,
3100 entity: ecs_entity_t,
3101 id: ecs_id_t,
3102 ) -> *mut ::std::os::raw::c_void;
3103}
3104extern "C" {
3105 #[doc = "Signal that a component has been modified.\n This operation is usually used after modifying a component value obtained by\n ecs_get_mut_id. The operation will mark the component as dirty, and invoke\n OnSet observers and hooks.\n\n @param world The world.\n @param entity The entity.\n @param id The id of the component that was modified."]
3106 pub fn ecs_modified_id(world: *mut ecs_world_t, entity: ecs_entity_t, id: ecs_id_t);
3107}
3108extern "C" {
3109 #[doc = "Set the value of a component.\n This operation allows an application to set the value of a component. The\n operation is equivalent to calling ecs_get_mut_id followed by\n ecs_modified_id. The operation will not modify the value of the passed in\n component. If the component has a copy hook registered, it will be used to\n copy in the component.\n\n If the provided entity is 0, a new entity will be created.\n\n @param world The world.\n @param entity The entity.\n @param id The id of the component to set.\n @param size The size of the pointed-to value.\n @param ptr The pointer to the value.\n @return The entity. A new entity if no entity was provided."]
3110 pub fn ecs_set_id(
3111 world: *mut ecs_world_t,
3112 entity: ecs_entity_t,
3113 id: ecs_id_t,
3114 size: usize,
3115 ptr: *const ::std::os::raw::c_void,
3116 ) -> ecs_entity_t;
3117}
3118extern "C" {
3119 #[doc = "Test whether an entity is valid.\n Entities that are valid can be used with API functions. Using invalid\n entities with API operations will cause the function to panic.\n\n An entity is valid if it is not 0 and if it is alive.\n\n is_valid will return true for ids that don't exist (alive or not alive). This\n allows for using ids that have never been created by ecs_new or similar. In\n this the function differs from ecs_is_alive, which will return false for\n entities that do not yet exist.\n\n The operation will return false for an id that exists and is not alive, as\n using this id with an API operation would cause it to assert.\n\n @param world The world.\n @param e The entity.\n @return True if the entity is valid, false if the entity is not valid."]
3120 pub fn ecs_is_valid(world: *const ecs_world_t, e: ecs_entity_t) -> bool;
3121}
3122extern "C" {
3123 #[doc = "Test whether an entity is alive.\n Entities are alive after they are created, and become not alive when they are\n deleted. Operations that return alive ids are (amongst others) ecs_new_id,\n ecs_new_low_id and ecs_entity_init. Ids can be made alive with the ecs_ensure\n function.\n\n After an id is deleted it can be recycled. Recycled ids are different from\n the original id in that they have a different generation count. This makes it\n possible for the API to distinguish between the two. An example:\n\n ecs_entity_t e1 = ecs_new_id(world);\n ecs_is_alive(world, e1); // true\n ecs_delete(world, e1);\n ecs_is_alive(world, e1); // false\n\n ecs_entity_t e2 = ecs_new_id(world); // recycles e1\n ecs_is_alive(world, e2); // true\n ecs_is_alive(world, e1); // false\n\n @param world The world.\n @param e The entity.\n @return True if the entity is alive, false if the entity is not alive."]
3124 pub fn ecs_is_alive(world: *const ecs_world_t, e: ecs_entity_t) -> bool;
3125}
3126extern "C" {
3127 #[doc = "Remove generation from entity id.\n\n @param e The entity id.\n @return The entity id without the generation count."]
3128 pub fn ecs_strip_generation(e: ecs_entity_t) -> ecs_id_t;
3129}
3130extern "C" {
3131 #[doc = "Override the generation of an entity.\n The generation count of an entity is increased each time an entity is deleted\n and is used to test whether an entity id is alive.\n\n This operation overrides the current generation of an entity with the\n specified generation, which can be useful if an entity is externally managed,\n like for external pools, savefiles or netcode.\n\n @param world The world.\n @param entity Entity for which to set the generation with the new generation."]
3132 pub fn ecs_set_entity_generation(world: *mut ecs_world_t, entity: ecs_entity_t);
3133}
3134extern "C" {
3135 #[doc = "Get alive identifier.\n In some cases an application may need to work with identifiers from which\n the generation has been stripped. A typical scenario in which this happens is\n when iterating relationships in an entity type.\n\n For example, when obtaining the parent id from a ChildOf relationship, the parent\n (second element of the pair) will have been stored in a 32 bit value, which\n cannot store the entity generation. This function can retrieve the identifier\n with the current generation for that id.\n\n If the provided identifier is not alive, the function will return 0.\n\n @param world The world.\n @param e The for which to obtain the current alive entity id.\n @return The alive entity id if there is one, or 0 if the id is not alive."]
3136 pub fn ecs_get_alive(world: *const ecs_world_t, e: ecs_entity_t) -> ecs_entity_t;
3137}
3138extern "C" {
3139 #[doc = "Ensure id is alive.\n This operation ensures that the provided id is alive. This is useful in\n scenarios where an application has an existing id that has not been created\n with ecs_new (such as a global constant or an id from a remote application).\n\n When this operation is successful it guarantees that the provided id exists,\n is valid and is alive.\n\n Before this operation the id must either not be alive or have a generation\n that is equal to the passed in entity.\n\n If the provided id has a non-zero generation count and the id does not exist\n in the world, the id will be created with the specified generation.\n\n If the provided id is alive and has a generation count that does not match\n the provided id, the operation will fail.\n\n @param world The world.\n @param entity The entity id to make alive."]
3140 pub fn ecs_ensure(world: *mut ecs_world_t, entity: ecs_entity_t);
3141}
3142extern "C" {
3143 #[doc = "Same as ecs_ensure, but for (component) ids.\n An id can be an entity or pair, and can contain id flags. This operation\n ensures that the entity (or entities, for a pair) are alive.\n\n When this operation is successful it guarantees that the provided id can be\n used in operations that accept an id.\n\n Since entities in a pair do not encode their generation ids, this operation\n will not fail when an entity with non-zero generation count already exists in\n the world.\n\n This is different from ecs_ensure, which will fail if attempted with an id\n that has generation 0 and an entity with a non-zero generation is currently\n alive.\n\n @param world The world.\n @param id The id to make alive."]
3144 pub fn ecs_ensure_id(world: *mut ecs_world_t, id: ecs_id_t);
3145}
3146extern "C" {
3147 #[doc = "Test whether an entity exists.\n Similar as ecs_is_alive, but ignores entity generation count.\n\n @param world The world.\n @param entity The entity.\n @return True if the entity exists, false if the entity does not exist."]
3148 pub fn ecs_exists(world: *const ecs_world_t, entity: ecs_entity_t) -> bool;
3149}
3150extern "C" {
3151 #[doc = "Get the type of an entity.\n\n @param world The world.\n @param entity The entity.\n @return The type of the entity, NULL if the entity has no components."]
3152 pub fn ecs_get_type(world: *const ecs_world_t, entity: ecs_entity_t) -> *const ecs_type_t;
3153}
3154extern "C" {
3155 #[doc = "Get the table of an entity.\n\n @param world The world.\n @param entity The entity.\n @return The table of the entity, NULL if the entity has no components/tags."]
3156 pub fn ecs_get_table(world: *const ecs_world_t, entity: ecs_entity_t) -> *mut ecs_table_t;
3157}
3158extern "C" {
3159 #[doc = "Convert type to string.\n The result of this operation must be freed with ecs_os_free.\n\n @param world The world.\n @param type The type.\n @return The stringified type."]
3160 pub fn ecs_type_str(
3161 world: *const ecs_world_t,
3162 type_: *const ecs_type_t,
3163 ) -> *mut ::std::os::raw::c_char;
3164}
3165extern "C" {
3166 #[doc = "Convert table to string.\n Same as ecs_type_str(world, ecs_table_get_type(table)). The result of this\n operation must be freed with ecs_os_free.\n\n @param world The world.\n @param table The table.\n @return The stringified table type."]
3167 pub fn ecs_table_str(
3168 world: *const ecs_world_t,
3169 table: *const ecs_table_t,
3170 ) -> *mut ::std::os::raw::c_char;
3171}
3172extern "C" {
3173 #[doc = "Convert entity to string.\n Same as combining:\n - ecs_get_fullpath(world, entity)\n - ecs_type_str(world, ecs_get_type(world, entity))\n\n The result of this operation must be freed with ecs_os_free.\n\n @param world The world.\n @param entity The entity.\n @return The entity path with stringified type."]
3174 pub fn ecs_entity_str(
3175 world: *const ecs_world_t,
3176 entity: ecs_entity_t,
3177 ) -> *mut ::std::os::raw::c_char;
3178}
3179extern "C" {
3180 #[doc = "Test if an entity has an id.\n This operation returns true if the entity has or inherits the specified id.\n\n @param world The world.\n @param entity The entity.\n @param id The id to test for.\n @return True if the entity has the id, false if not."]
3181 pub fn ecs_has_id(world: *const ecs_world_t, entity: ecs_entity_t, id: ecs_id_t) -> bool;
3182}
3183extern "C" {
3184 #[doc = "Test if an entity owns an id.\n This operation returns true if the entity has the specified id. The operation\n behaves the same as ecs_has_id, except that it will return false for\n components that are inherited through an IsA relationship.\n\n @param world The world.\n @param entity The entity.\n @param id The id to test for.\n @return True if the entity has the id, false if not."]
3185 pub fn ecs_owns_id(world: *const ecs_world_t, entity: ecs_entity_t, id: ecs_id_t) -> bool;
3186}
3187extern "C" {
3188 #[doc = "Get the target of a relationship.\n This will return a target (second element of a pair) of the entity for the\n specified relationship. The index allows for iterating through the targets,\n if a single entity has multiple targets for the same relationship.\n\n If the index is larger than the total number of instances the entity has for\n the relationship, the operation will return 0.\n\n @param world The world.\n @param entity The entity.\n @param rel The relationship between the entity and the target.\n @param index The index of the relationship instance.\n @return The target for the relationship at the specified index."]
3189 pub fn ecs_get_target(
3190 world: *const ecs_world_t,
3191 entity: ecs_entity_t,
3192 rel: ecs_entity_t,
3193 index: i32,
3194 ) -> ecs_entity_t;
3195}
3196extern "C" {
3197 #[doc = "Get parent (target of ChildOf relationship) for entity.\n This operation is the same as calling:\n ecs_get_target(world, entity, EcsChildOf, 0);\n\n @param world The world.\n @param entity The entity.\n @return The parent of the entity, 0 if the entity has no parent."]
3198 pub fn ecs_get_parent(world: *const ecs_world_t, entity: ecs_entity_t) -> ecs_entity_t;
3199}
3200extern "C" {
3201 #[doc = "Get the target of a relationship for a given id.\n This operation returns the first entity that has the provided id by following\n the specified relationship. If the entity itself has the id then entity will\n be returned. If the id cannot be found on the entity or by following the\n relationship, the operation will return 0.\n\n This operation can be used to lookup, for example, which prefab is providing\n a component by specifying the IsA relationship:\n\n // Is Position provided by the entity or one of its base entities?\n ecs_get_target_for_id(world, entity, EcsIsA, ecs_id(Position))\n\n @param world The world.\n @param entity The entity.\n @param rel The relationship to follow.\n @param id The id to lookup.\n @return The entity for which the target has been found."]
3202 pub fn ecs_get_target_for_id(
3203 world: *const ecs_world_t,
3204 entity: ecs_entity_t,
3205 rel: ecs_entity_t,
3206 id: ecs_id_t,
3207 ) -> ecs_entity_t;
3208}
3209extern "C" {
3210 #[doc = "Return depth for entity in tree for the specified relationship.\n Depth is determined by counting the number of targets encountered while\n traversing up the relationship tree for rel. Only acyclic relationships are\n supported.\n\n @param world The world.\n @param entity The entity.\n @param rel The relationship.\n @return The depth of the entity in the tree."]
3211 pub fn ecs_get_depth(world: *const ecs_world_t, entity: ecs_entity_t, rel: ecs_entity_t)
3212 -> i32;
3213}
3214#[repr(C)]
3215#[derive(Debug, Copy, Clone)]
3216pub struct ecs_flatten_desc_t {
3217 #[doc = "When true, the flatten operation will not remove names from entities in\n the flattened tree. This may fail if entities from different subtrees\n have the same name."]
3218 pub keep_names: bool,
3219 #[doc = "When true, the flattened tree won't contain information about the\n original depth of the entities. This can reduce fragmentation, but may\n cause existing code, such as cascade queries, to no longer work."]
3220 pub lose_depth: bool,
3221}
3222extern "C" {
3223 #[doc = "Recursively flatten relationship for target entity (experimental).\n This operation combines entities in the subtree of the specified pair from\n different parents in the same table. This can reduce memory fragmentation\n and reduces the number of tables in the storage, which improves RAM\n utilization and various other operations, such as entity cleanup.\n\n The lifecycle of entities in a fixed subtree are bound to the specified\n parent. Entities in a fixed subtree cannot be deleted individually. Entities\n can also not change the target of the fixed relationship, which includes\n removing the relationship.\n\n Entities in a fixed subtree are still fragmented on subtree depth. This\n ensures that entities can still be iterated in breadth-first order with the\n cascade query modifier.\n\n The current implementation is limited to exclusive acyclic relationships, and\n does not allow for adding/removing to entities in flattened tables. An entity\n may only be flattened for a single relationship. Future iterations of the\n feature may remove these limitations.\n\n @param world The world.\n @param pair The relationship pair from which to start flattening.\n @param desc Options for flattening the tree."]
3224 pub fn ecs_flatten(world: *mut ecs_world_t, pair: ecs_id_t, desc: *const ecs_flatten_desc_t);
3225}
3226extern "C" {
3227 #[doc = "Count entities that have the specified id.\n Returns the number of entities that have the specified id.\n\n @param world The world.\n @param entity The id to search for.\n @return The number of entities that have the id."]
3228 pub fn ecs_count_id(world: *const ecs_world_t, entity: ecs_id_t) -> i32;
3229}
3230extern "C" {
3231 #[doc = "Get the name of an entity.\n This will return the name stored in (EcsIdentifier, EcsName).\n\n @param world The world.\n @param entity The entity.\n @return The type of the entity, NULL if the entity has no name."]
3232 pub fn ecs_get_name(
3233 world: *const ecs_world_t,
3234 entity: ecs_entity_t,
3235 ) -> *const ::std::os::raw::c_char;
3236}
3237extern "C" {
3238 #[doc = "Get the symbol of an entity.\n This will return the symbol stored in (EcsIdentifier, EcsSymbol).\n\n @param world The world.\n @param entity The entity.\n @return The type of the entity, NULL if the entity has no name."]
3239 pub fn ecs_get_symbol(
3240 world: *const ecs_world_t,
3241 entity: ecs_entity_t,
3242 ) -> *const ::std::os::raw::c_char;
3243}
3244extern "C" {
3245 #[doc = "Set the name of an entity.\n This will set or overwrite the name of an entity. If no entity is provided,\n a new entity will be created.\n\n The name is stored in (EcsIdentifier, EcsName).\n\n @param world The world.\n @param entity The entity.\n @param name The name.\n @return The provided entity, or a new entity if 0 was provided."]
3246 pub fn ecs_set_name(
3247 world: *mut ecs_world_t,
3248 entity: ecs_entity_t,
3249 name: *const ::std::os::raw::c_char,
3250 ) -> ecs_entity_t;
3251}
3252extern "C" {
3253 #[doc = "Set the symbol of an entity.\n This will set or overwrite the symbol of an entity. If no entity is provided,\n a new entity will be created.\n\n The symbol is stored in (EcsIdentifier, EcsSymbol).\n\n @param world The world.\n @param entity The entity.\n @param symbol The symbol.\n @return The provided entity, or a new entity if 0 was provided."]
3254 pub fn ecs_set_symbol(
3255 world: *mut ecs_world_t,
3256 entity: ecs_entity_t,
3257 symbol: *const ::std::os::raw::c_char,
3258 ) -> ecs_entity_t;
3259}
3260extern "C" {
3261 #[doc = "Set alias for entity.\n An entity can be looked up using its alias from the root scope without\n providing the fully qualified name if its parent. An entity can only have\n a single alias.\n\n The symbol is stored in (EcsIdentifier, EcsAlias).\n\n @param world The world.\n @param entity The entity.\n @param alias The alias."]
3262 pub fn ecs_set_alias(
3263 world: *mut ecs_world_t,
3264 entity: ecs_entity_t,
3265 alias: *const ::std::os::raw::c_char,
3266 );
3267}
3268extern "C" {
3269 #[doc = "Lookup an entity by name.\n Returns an entity that matches the specified name. Only looks for entities in\n the current scope (root if no scope is provided).\n\n @param world The world.\n @param name The entity name.\n @return The entity with the specified name, or 0 if no entity was found."]
3270 pub fn ecs_lookup(
3271 world: *const ecs_world_t,
3272 name: *const ::std::os::raw::c_char,
3273 ) -> ecs_entity_t;
3274}
3275extern "C" {
3276 #[doc = "Lookup a child entity by name.\n Returns an entity that matches the specified name. Only looks for entities in\n the provided parent. If no parent is provided, look in the current scope (\n root if no scope is provided).\n\n @param world The world.\n @param name The entity name.\n @return The entity with the specified name, or 0 if no entity was found."]
3277 pub fn ecs_lookup_child(
3278 world: *const ecs_world_t,
3279 parent: ecs_entity_t,
3280 name: *const ::std::os::raw::c_char,
3281 ) -> ecs_entity_t;
3282}
3283extern "C" {
3284 #[doc = "Lookup an entity from a path.\n Lookup an entity from a provided path, relative to the provided parent. The\n operation will use the provided separator to tokenize the path expression. If\n the provided path contains the prefix, the search will start from the root.\n\n If the entity is not found in the provided parent, the operation will\n continue to search in the parent of the parent, until the root is reached. If\n the entity is still not found, the lookup will search in the flecs.core\n scope. If the entity is not found there either, the function returns 0.\n\n @param world The world.\n @param parent The entity from which to resolve the path.\n @param path The path to resolve.\n @param sep The path separator.\n @param prefix The path prefix.\n @param recursive Recursively traverse up the tree until entity is found.\n @return The entity if found, else 0."]
3285 pub fn ecs_lookup_path_w_sep(
3286 world: *const ecs_world_t,
3287 parent: ecs_entity_t,
3288 path: *const ::std::os::raw::c_char,
3289 sep: *const ::std::os::raw::c_char,
3290 prefix: *const ::std::os::raw::c_char,
3291 recursive: bool,
3292 ) -> ecs_entity_t;
3293}
3294extern "C" {
3295 #[doc = "Lookup an entity by its symbol name.\n This looks up an entity by symbol stored in (EcsIdentifier, EcsSymbol). The\n operation does not take into account hierarchies.\n\n This operation can be useful to resolve, for example, a type by its C\n identifier, which does not include the Flecs namespacing.\n\n @param world The world.\n @param symbol The symbol.\n @param lookup_as_path If not found as a symbol, lookup as path.\n @param recursive If looking up as path, recursively traverse up the tree.\n @return The entity if found, else 0."]
3296 pub fn ecs_lookup_symbol(
3297 world: *const ecs_world_t,
3298 symbol: *const ::std::os::raw::c_char,
3299 lookup_as_path: bool,
3300 recursive: bool,
3301 ) -> ecs_entity_t;
3302}
3303extern "C" {
3304 #[doc = "Get a path identifier for an entity.\n This operation creates a path that contains the names of the entities from\n the specified parent to the provided entity, separated by the provided\n separator. If no parent is provided the path will be relative to the root. If\n a prefix is provided, the path will be prefixed by the prefix.\n\n If the parent is equal to the provided child, the operation will return an\n empty string. If a nonzero component is provided, the path will be created by\n looking for parents with that component.\n\n The returned path should be freed by the application.\n\n @param world The world.\n @param parent The entity from which to create the path.\n @param child The entity to which to create the path.\n @param sep The separator to use between path elements.\n @param prefix The initial character to use for root elements.\n @return The relative entity path."]
3305 pub fn ecs_get_path_w_sep(
3306 world: *const ecs_world_t,
3307 parent: ecs_entity_t,
3308 child: ecs_entity_t,
3309 sep: *const ::std::os::raw::c_char,
3310 prefix: *const ::std::os::raw::c_char,
3311 ) -> *mut ::std::os::raw::c_char;
3312}
3313extern "C" {
3314 #[doc = "Write path identifier to buffer.\n Same as ecs_get_path_w_sep, but writes result to an ecs_strbuf_t.\n\n @param world The world.\n @param parent The entity from which to create the path.\n @param child The entity to which to create the path.\n @param sep The separator to use between path elements.\n @param prefix The initial character to use for root elements.\n @param buf The buffer to write to."]
3315 pub fn ecs_get_path_w_sep_buf(
3316 world: *const ecs_world_t,
3317 parent: ecs_entity_t,
3318 child: ecs_entity_t,
3319 sep: *const ::std::os::raw::c_char,
3320 prefix: *const ::std::os::raw::c_char,
3321 buf: *mut ecs_strbuf_t,
3322 );
3323}
3324extern "C" {
3325 #[doc = "Find or create entity from path.\n This operation will find or create an entity from a path, and will create any\n intermediate entities if required. If the entity already exists, no entities\n will be created.\n\n If the path starts with the prefix, then the entity will be created from the\n root scope.\n\n @param world The world.\n @param parent The entity relative to which the entity should be created.\n @param path The path to create the entity for.\n @param sep The separator used in the path.\n @param prefix The prefix used in the path.\n @return The entity."]
3326 pub fn ecs_new_from_path_w_sep(
3327 world: *mut ecs_world_t,
3328 parent: ecs_entity_t,
3329 path: *const ::std::os::raw::c_char,
3330 sep: *const ::std::os::raw::c_char,
3331 prefix: *const ::std::os::raw::c_char,
3332 ) -> ecs_entity_t;
3333}
3334extern "C" {
3335 #[doc = "Add specified path to entity.\n This operation is similar to ecs_new_from_path, but will instead add the path\n to an existing entity.\n\n If an entity already exists for the path, it will be returned instead.\n\n @param world The world.\n @param entity The entity to which to add the path.\n @param parent The entity relative to which the entity should be created.\n @param path The path to create the entity for.\n @param sep The separator used in the path.\n @param prefix The prefix used in the path.\n @return The entity."]
3336 pub fn ecs_add_path_w_sep(
3337 world: *mut ecs_world_t,
3338 entity: ecs_entity_t,
3339 parent: ecs_entity_t,
3340 path: *const ::std::os::raw::c_char,
3341 sep: *const ::std::os::raw::c_char,
3342 prefix: *const ::std::os::raw::c_char,
3343 ) -> ecs_entity_t;
3344}
3345extern "C" {
3346 #[doc = "Set the current scope.\n This operation sets the scope of the current stage to the provided entity.\n As a result new entities will be created in this scope, and lookups will be\n relative to the provided scope.\n\n It is considered good practice to restore the scope to the old value.\n\n @param world The world.\n @param scope The entity to use as scope.\n @return The previous scope."]
3347 pub fn ecs_set_scope(world: *mut ecs_world_t, scope: ecs_entity_t) -> ecs_entity_t;
3348}
3349extern "C" {
3350 #[doc = "Get the current scope.\n Get the scope set by ecs_set_scope. If no scope is set, this operation will\n return 0.\n\n @param world The world.\n @return The current scope."]
3351 pub fn ecs_get_scope(world: *const ecs_world_t) -> ecs_entity_t;
3352}
3353extern "C" {
3354 #[doc = "Set a name prefix for newly created entities.\n This is a utility that lets C modules use prefixed names for C types and\n C functions, while using names for the entity names that do not have the\n prefix. The name prefix is currently only used by ECS_COMPONENT.\n\n @param world The world.\n @param prefix The name prefix to use.\n @return The previous prefix."]
3355 pub fn ecs_set_name_prefix(
3356 world: *mut ecs_world_t,
3357 prefix: *const ::std::os::raw::c_char,
3358 ) -> *const ::std::os::raw::c_char;
3359}
3360extern "C" {
3361 #[doc = "Set search path for lookup operations.\n This operation accepts an array of entity ids that will be used as search\n scopes by lookup operations. The operation returns the current search path.\n It is good practice to restore the old search path.\n\n The search path will be evaluated starting from the last element.\n\n The default search path includes flecs.core. When a custom search path is\n provided it overwrites the existing search path. Operations that rely on\n looking up names from flecs.core without providing the namespace may fail if\n the custom search path does not include flecs.core (EcsFlecsCore).\n\n The search path array is not copied into managed memory. The application must\n ensure that the provided array is valid for as long as it is used as the\n search path.\n\n The provided array must be terminated with a 0 element. This enables an\n application to push/pop elements to an existing array without invoking the\n ecs_set_lookup_path operation again.\n\n @param world The world.\n @param lookup_path 0-terminated array with entity ids for the lookup path.\n @return Current lookup path array."]
3362 pub fn ecs_set_lookup_path(
3363 world: *mut ecs_world_t,
3364 lookup_path: *const ecs_entity_t,
3365 ) -> *mut ecs_entity_t;
3366}
3367extern "C" {
3368 #[doc = "Get current lookup path.\n Returns value set by ecs_set_lookup_path.\n\n @param world The world.\n @return The current lookup path."]
3369 pub fn ecs_get_lookup_path(world: *const ecs_world_t) -> *mut ecs_entity_t;
3370}
3371extern "C" {
3372 #[doc = "Find or create a component.\n This operation creates a new component, or finds an existing one. The find or\n create behavior is the same as ecs_entity_init.\n\n When an existing component is found, the size and alignment are verified with\n the provided values. If the values do not match, the operation will fail.\n\n See the documentation of ecs_component_desc_t for more details.\n\n @param world The world.\n @param desc Component init parameters.\n @return A handle to the new or existing component, or 0 if failed."]
3373 pub fn ecs_component_init(
3374 world: *mut ecs_world_t,
3375 desc: *const ecs_component_desc_t,
3376 ) -> ecs_entity_t;
3377}
3378extern "C" {
3379 #[doc = "Get the type for an id.\n This function returnsthe type information for an id. The specified id can be\n any valid id. For the rules on how type information is determined based on\n id, see ecs_get_typeid.\n\n @param world The world.\n @param id The id.\n @return The type information of the id."]
3380 pub fn ecs_get_type_info(world: *const ecs_world_t, id: ecs_id_t) -> *const ecs_type_info_t;
3381}
3382extern "C" {
3383 #[doc = "Register hooks for component.\n Hooks allow for the execution of user code when components are constructed,\n copied, moved, destructed, added, removed or set. Hooks can be assigned as\n as long as a component has not yet been used (added to an entity).\n\n The hooks that are currently set can be accessed with ecs_get_type_info.\n\n @param world The world.\n @param id The component id for which to register the actions\n @param hooks Type that contains the component actions."]
3384 pub fn ecs_set_hooks_id(
3385 world: *mut ecs_world_t,
3386 id: ecs_entity_t,
3387 hooks: *const ecs_type_hooks_t,
3388 );
3389}
3390extern "C" {
3391 #[doc = "Get hooks for component.\n\n @param world The world.\n @param id The component id for which to retrieve the hooks.\n @return The hooks for the component, or NULL if not registered."]
3392 pub fn ecs_get_hooks_id(world: *mut ecs_world_t, id: ecs_entity_t) -> *const ecs_type_hooks_t;
3393}
3394extern "C" {
3395 #[doc = "Returns whether specified id a tag.\n This operation returns whether the specified type is a tag (a component\n without data/size).\n\n An id is a tag when:\n - it is an entity without the EcsComponent component\n - it has an EcsComponent with size member set to 0\n - it is a pair where both elements are a tag\n - it is a pair where the first element has the EcsTag tag\n\n @param world The world.\n @param id The id.\n @return Whether the provided id is a tag."]
3396 pub fn ecs_id_is_tag(world: *const ecs_world_t, id: ecs_id_t) -> bool;
3397}
3398extern "C" {
3399 #[doc = "Return whether represents a union.\n This operation returns whether the specified type represents a union. Only\n pair ids can be unions.\n\n An id represents a union when:\n - The first element of the pair is EcsUnion/flecs::Union\n - The first element of the pair has EcsUnion/flecs::Union\n\n @param world The world.\n @param id The id.\n @return Whether the provided id represents a union."]
3400 pub fn ecs_id_is_union(world: *const ecs_world_t, id: ecs_id_t) -> bool;
3401}
3402extern "C" {
3403 #[doc = "Returns whether specified id is in use.\n This operation returns whether an id is in use in the world. An id is in use\n if it has been added to one or more tables.\n\n @param world The world.\n @param id The id.\n @return Whether the id is in use."]
3404 pub fn ecs_id_in_use(world: *const ecs_world_t, id: ecs_id_t) -> bool;
3405}
3406extern "C" {
3407 #[doc = "Get the type for an id.\n This operation returns the component id for an id, if the id is associated\n with a type. For a regular component with a non-zero size (an entity with the\n EcsComponent component) the operation will return the entity itself.\n\n For an entity that does not have the EcsComponent component, or with an\n EcsComponent value with size 0, the operation will return 0.\n\n For a pair id the operation will return the type associated with the pair, by\n applying the following rules in order:\n - The first pair element is returned if it is a component\n - 0 is returned if the relationship entity has the Tag property\n - The second pair element is returned if it is a component\n - 0 is returned.\n\n @param world The world.\n @param id The id.\n @return The type id of the id."]
3408 pub fn ecs_get_typeid(world: *const ecs_world_t, id: ecs_id_t) -> ecs_entity_t;
3409}
3410extern "C" {
3411 #[doc = "Utility to match an id with a pattern.\n This operation returns true if the provided pattern matches the provided\n id. The pattern may contain a wildcard (or wildcards, when a pair).\n\n @param id The id.\n @param pattern The pattern to compare with."]
3412 pub fn ecs_id_match(id: ecs_id_t, pattern: ecs_id_t) -> bool;
3413}
3414extern "C" {
3415 #[doc = "Utility to check if id is a pair.\n\n @param id The id.\n @return True if id is a pair."]
3416 pub fn ecs_id_is_pair(id: ecs_id_t) -> bool;
3417}
3418extern "C" {
3419 #[doc = "Utility to check if id is a wildcard.\n\n @param id The id.\n @return True if id is a wildcard or a pair containing a wildcard."]
3420 pub fn ecs_id_is_wildcard(id: ecs_id_t) -> bool;
3421}
3422extern "C" {
3423 #[doc = "Utility to check if id is valid.\n A valid id is an id that can be added to an entity. Invalid ids are:\n - ids that contain wildcards\n - ids that contain invalid entities\n - ids that are 0 or contain 0 entities\n\n Note that the same rules apply to removing from an entity, with the exception\n of wildcards.\n\n @param world The world.\n @param id The id.\n @return True if the id is valid."]
3424 pub fn ecs_id_is_valid(world: *const ecs_world_t, id: ecs_id_t) -> bool;
3425}
3426extern "C" {
3427 #[doc = "Get flags associated with id.\n This operation returns the internal flags (see api_flags.h) that are\n associated with the provided id.\n\n @param world The world.\n @param id The id.\n @return Flags associated with the id, or 0 if the id is not in use."]
3428 pub fn ecs_id_get_flags(world: *const ecs_world_t, id: ecs_id_t) -> ecs_flags32_t;
3429}
3430extern "C" {
3431 #[doc = "Convert id flag to string.\n This operation converts a id flag to a string.\n\n @param id_flags The id flag.\n @return The id flag string, or NULL if no valid id is provided."]
3432 pub fn ecs_id_flag_str(id_flags: ecs_id_t) -> *const ::std::os::raw::c_char;
3433}
3434extern "C" {
3435 #[doc = "Convert id to string.\n This operation interprets the structure of an id and converts it to a string.\n\n @param world The world.\n @param id The id to convert to a string.\n @return The id converted to a string."]
3436 pub fn ecs_id_str(world: *const ecs_world_t, id: ecs_id_t) -> *mut ::std::os::raw::c_char;
3437}
3438extern "C" {
3439 #[doc = "Write id string to buffer.\n Same as ecs_id_str but writes result to ecs_strbuf_t.\n\n @param world The world.\n @param id The id to convert to a string.\n @param buf The buffer to write to."]
3440 pub fn ecs_id_str_buf(world: *const ecs_world_t, id: ecs_id_t, buf: *mut ecs_strbuf_t);
3441}
3442extern "C" {
3443 #[doc = "Iterator for a single (component) id.\n A term iterator returns all entities (tables) that match a single (component)\n id. The search for the matching set of entities (tables) is performed in\n constant time.\n\n @param world The world.\n @param term The term.\n @return The iterator."]
3444 pub fn ecs_term_iter(world: *const ecs_world_t, term: *mut ecs_term_t) -> ecs_iter_t;
3445}
3446extern "C" {
3447 #[doc = "Return a chained term iterator.\n A chained iterator applies a filter to the results of the input iterator. The\n resulting iterator must be iterated with ecs_term_next.\n\n @param it The input iterator\n @param term The term filter to apply to the iterator.\n @return The chained iterator."]
3448 pub fn ecs_term_chain_iter(it: *const ecs_iter_t, term: *mut ecs_term_t) -> ecs_iter_t;
3449}
3450extern "C" {
3451 #[doc = "Progress a term iterator.\n This operation progresses the term iterator to the next table. The\n iterator must have been initialized with `ecs_term_iter`. This operation\n must be invoked at least once before interpreting the contents of the\n iterator.\n\n @param it The iterator.\n @returns True if more data is available, false if not."]
3452 pub fn ecs_term_next(it: *mut ecs_iter_t) -> bool;
3453}
3454extern "C" {
3455 #[doc = "Iterator for a parent's children.\n This operation is equivalent to a term iterator for (ChildOf, parent).\n Iterate the result with ecs_children_next.\n\n @param world The world.\n @param parent The parent for which to iterate the children.\n @return The iterator."]
3456 pub fn ecs_children(world: *const ecs_world_t, parent: ecs_entity_t) -> ecs_iter_t;
3457}
3458extern "C" {
3459 #[doc = "Progress a children iterator.\n Equivalent to ecs_term_next.\n\n @param it The iterator.\n @returns True if more data is available, false if not."]
3460 pub fn ecs_children_next(it: *mut ecs_iter_t) -> bool;
3461}
3462extern "C" {
3463 #[doc = "Test whether term id is set.\n\n @param id The term id.\n @return True when set, false when not set."]
3464 pub fn ecs_term_id_is_set(id: *const ecs_term_id_t) -> bool;
3465}
3466extern "C" {
3467 #[doc = "Test whether a term is set.\n This operation can be used to test whether a term has been initialized with\n values or whether it is empty.\n\n An application generally does not need to invoke this operation. It is useful\n when initializing a 0-initialized array of terms (like in ecs_term_desc_t) as\n this operation can be used to find the last initialized element.\n\n @param term The term.\n @return True when set, false when not set."]
3468 pub fn ecs_term_is_initialized(term: *const ecs_term_t) -> bool;
3469}
3470extern "C" {
3471 #[doc = "Is term matched on $this variable.\n This operation checks whether a term is matched on the $this variable, which\n is the default source for queries.\n\n A term has a $this source when:\n - ecs_term_t::src::id is EcsThis\n - ecs_term_t::src::flags is EcsIsVariable\n\n If ecs_term_t::src is not populated, it will be automatically initialized to\n the $this source for the created query.\n\n @param term The term.\n @return True if term matches $this, false if not."]
3472 pub fn ecs_term_match_this(term: *const ecs_term_t) -> bool;
3473}
3474extern "C" {
3475 #[doc = "Is term matched on 0 source.\n This operation checks whether a term is matched on a 0 source. A 0 source is\n a term that isn't matched against anything, and can be used just to pass\n (component) ids to a query iterator.\n\n A term has a 0 source when:\n - ecs_term_t::src::id is 0\n - ecs_term_t::src::flags has EcsIsEntity set\n\n @param term The term.\n @return True if term has 0 source, false if not."]
3476 pub fn ecs_term_match_0(term: *const ecs_term_t) -> bool;
3477}
3478extern "C" {
3479 #[doc = "Finalize term.\n Ensure that all fields of a term are consistent and filled out. This\n operation should be invoked before using and after assigning members to, or\n parsing a term. When a term contains unresolved identifiers, this operation\n will resolve and assign the identifiers. If the term contains any identifiers\n that cannot be resolved, the operation will fail.\n\n An application generally does not need to invoke this operation as the APIs\n that use terms (such as filters, queries and triggers) will finalize terms\n when they are created.\n\n The name and expr parameters are optional, and only used for giving more\n descriptive error messages.\n\n @param world The world.\n @param term The term to finalize.\n @return Zero if success, nonzero if an error occurred."]
3480 pub fn ecs_term_finalize(
3481 world: *const ecs_world_t,
3482 term: *mut ecs_term_t,
3483 ) -> ::std::os::raw::c_int;
3484}
3485extern "C" {
3486 #[doc = "Copy resources of a term to another term.\n This operation copies one term to another term. If the source term contains\n allocated resources (such as identifiers), they will be duplicated so that\n no memory is shared between the terms.\n\n @param src The term to copy from.\n @return The destination term."]
3487 pub fn ecs_term_copy(src: *const ecs_term_t) -> ecs_term_t;
3488}
3489extern "C" {
3490 #[doc = "Move resources of a term to another term.\n Same as copy, but moves resources from src, if src->move is set to true. If\n src->move is not set to true, this operation will do a copy.\n\n The conditional move reduces redundant allocations in scenarios where a list\n of terms is partially created with allocated resources.\n\n @param src The term to move from.\n @return The destination term."]
3491 pub fn ecs_term_move(src: *mut ecs_term_t) -> ecs_term_t;
3492}
3493extern "C" {
3494 #[doc = "Free resources of term.\n This operation frees all resources (such as identifiers) of a term. The term\n itself is not freed.\n\n @param term The term to free."]
3495 pub fn ecs_term_fini(term: *mut ecs_term_t);
3496}
3497extern "C" {
3498 #[doc = "Initialize filter\n A filter is a lightweight object that can be used to query for entities in\n a world. Filters, as opposed to queries, do not cache results. They are\n therefore slower to iterate, but are faster to create.\n\n When a filter is copied by value, make sure to use \"ecs_filter_move\" to\n ensure that the terms pointer still points to the inline array:\n\n ecs_filter_move(&dst_filter, &src_filter)\n\n Alternatively, the ecs_filter_move function can be called with both arguments\n set to the same filter, to ensure the pointer is valid:\n\n ecs_filter_move(&f, &f)\n\n It is possible to create a filter without allocating any memory, by setting\n the .storage member in ecs_filter_desc_t. See the documentation for the\n member for more details.\n\n @param world The world.\n @param desc Properties for the filter to create.\n @return The filter if successful, NULL if not successful."]
3499 pub fn ecs_filter_init(
3500 world: *mut ecs_world_t,
3501 desc: *const ecs_filter_desc_t,
3502 ) -> *mut ecs_filter_t;
3503}
3504extern "C" {
3505 #[doc = "Deinitialize filter.\n Free resources associated with filter.\n\n @param filter The filter to deinitialize."]
3506 pub fn ecs_filter_fini(filter: *mut ecs_filter_t);
3507}
3508extern "C" {
3509 #[doc = "Finalize filter.\n When manually assigning an array of terms to the filter struct (so not when\n using ecs_filter_init), this operation should be used to ensure that all\n terms are assigned properly and all (derived) fields have been set.\n\n When ecs_filter_init is used to create the filter, this function should not\n be called. The purpose of this operation is to support creation of filters\n without allocating memory.\n\n @param filter The filter to finalize.\n @return Zero if filter is valid, non-zero if it contains errors.\n @"]
3510 pub fn ecs_filter_finalize(
3511 world: *const ecs_world_t,
3512 filter: *mut ecs_filter_t,
3513 ) -> ::std::os::raw::c_int;
3514}
3515extern "C" {
3516 #[doc = "Find index for $this variable.\n This operation looks up the index of the $this variable. This index can\n be used in operations like ecs_iter_set_var and ecs_iter_get_var.\n\n The operation will return -1 if the variable was not found. This happens when\n a filter only has terms that are not matched on the $this variable, like a\n filter that exclusively matches singleton components.\n\n @param filter The rule.\n @return The index of the $this variable."]
3517 pub fn ecs_filter_find_this_var(filter: *const ecs_filter_t) -> i32;
3518}
3519extern "C" {
3520 #[doc = "Convert term to string expression.\n Convert term to a string expression. The resulting expression is equivalent\n to the same term, with the exception of And & Or operators.\n\n @param world The world.\n @param term The term.\n @return The term converted to a string."]
3521 pub fn ecs_term_str(
3522 world: *const ecs_world_t,
3523 term: *const ecs_term_t,
3524 ) -> *mut ::std::os::raw::c_char;
3525}
3526extern "C" {
3527 #[doc = "Convert filter to string expression.\n Convert filter terms to a string expression. The resulting expression can be\n parsed to create the same filter.\n\n @param world The world.\n @param filter The filter.\n @return The filter converted to a string."]
3528 pub fn ecs_filter_str(
3529 world: *const ecs_world_t,
3530 filter: *const ecs_filter_t,
3531 ) -> *mut ::std::os::raw::c_char;
3532}
3533extern "C" {
3534 #[doc = "Return a filter iterator.\n A filter iterator lets an application iterate over entities that match the\n specified filter.\n\n @param world The world.\n @param filter The filter.\n @return An iterator that can be used with ecs_filter_next."]
3535 pub fn ecs_filter_iter(world: *const ecs_world_t, filter: *const ecs_filter_t) -> ecs_iter_t;
3536}
3537extern "C" {
3538 #[doc = "Return a chained filter iterator.\n A chained iterator applies a filter to the results of the input iterator. The\n resulting iterator must be iterated with ecs_filter_next.\n\n @param it The input iterator\n @param filter The filter to apply to the iterator.\n @return The chained iterator."]
3539 pub fn ecs_filter_chain_iter(it: *const ecs_iter_t, filter: *const ecs_filter_t) -> ecs_iter_t;
3540}
3541extern "C" {
3542 #[doc = "Get pivot term for filter.\n The pivot term is the term that matches the smallest set of tables, and is\n a good default starting point for a search.\n\n The following conditions must be met for a term to be considered as pivot:\n - It must have a This subject\n - It must have the And operator\n\n When a filter does not have any terms that match those conditions, it will\n return -1.\n\n If one or more terms in the filter have no matching tables the filter won't\n yield any results. In this case the operation will return -2 which gives a\n search function the option to early out.\n\n @param world The world.\n @param filter The filter.\n @return Index of the pivot term (use with filter->terms)"]
3543 pub fn ecs_filter_pivot_term(world: *const ecs_world_t, filter: *const ecs_filter_t) -> i32;
3544}
3545extern "C" {
3546 #[doc = "Iterate tables matched by filter.\n This operation progresses the filter iterator to the next table. The\n iterator must have been initialized with `ecs_filter_iter`. This operation\n must be invoked at least once before interpreting the contents of the\n iterator.\n\n @param it The iterator\n @return True if more data is available, false if not."]
3547 pub fn ecs_filter_next(it: *mut ecs_iter_t) -> bool;
3548}
3549extern "C" {
3550 #[doc = "Same as ecs_filter_next, but always instanced.\n See instanced property of ecs_filter_desc_t.\n\n @param it The iterator\n @return True if more data is available, false if not."]
3551 pub fn ecs_filter_next_instanced(it: *mut ecs_iter_t) -> bool;
3552}
3553extern "C" {
3554 #[doc = "Move resources of one filter to another.\n\n @param dst The destination filter.\n @param src The source filter."]
3555 pub fn ecs_filter_move(dst: *mut ecs_filter_t, src: *mut ecs_filter_t);
3556}
3557extern "C" {
3558 #[doc = "Copy resources of one filter to another.\n\n @param dst The destination filter.\n @param src The source filter."]
3559 pub fn ecs_filter_copy(dst: *mut ecs_filter_t, src: *const ecs_filter_t);
3560}
3561extern "C" {
3562 #[doc = "Create a query.\n This operation creates a query. Queries are used to iterate over entities\n that match a filter and are the fastest way to find and iterate over entities\n and their components.\n\n Queries should be created once, and reused multiple times. While iterating a\n query is a cheap operation, creating and deleting a query is expensive. The\n reason for this is that queries are \"prematched\", which means that a query\n stores state about which entities (or rather, tables) match with the query.\n Building up this state happens during query creation.\n\n Once a query is created, matching only happens when new tables are created.\n In most applications this is an infrequent process, since it only occurs when\n a new combination of components is introduced. While matching is expensive,\n it is importent to note that matching does not happen on a per-entity basis,\n but on a per-table basis. This means that the average time spent on matching\n per frame should rapidly approach zero over the lifetime of an application.\n\n A query provides direct access to the component arrays. When an application\n creates/deletes entities or adds/removes components, these arrays can shift\n component values around, or may grow in size. This can cause unexpected or\n undefined behavior to occur if these operations are performed while\n iterating. To prevent this from happening an application should either not\n perform these operations while iterating, or use deferred operations (see\n ecs_defer_begin and ecs_defer_end).\n\n Queries can be created and deleted dynamically. If a query was not deleted\n (using ecs_query_fini) before the world is deleted, it will be deleted\n automatically.\n\n @param world The world.\n @param desc A structure describing the query properties.\n @return The new query."]
3563 pub fn ecs_query_init(
3564 world: *mut ecs_world_t,
3565 desc: *const ecs_query_desc_t,
3566 ) -> *mut ecs_query_t;
3567}
3568extern "C" {
3569 #[doc = "Destroy a query.\n This operation destroys a query and its resources. If the query is used as\n the parent of subqueries, those subqueries will be orphaned and must be\n deinitialized as well.\n\n @param query The query."]
3570 pub fn ecs_query_fini(query: *mut ecs_query_t);
3571}
3572extern "C" {
3573 #[doc = "Get filter from a query.\n This operation obtains a pointer to the internally constructed filter\n of the query and can be used to introspect the query terms.\n\n @param query The query.\n @return The filter."]
3574 pub fn ecs_query_get_filter(query: *const ecs_query_t) -> *const ecs_filter_t;
3575}
3576extern "C" {
3577 #[doc = "Return a query iterator.\n A query iterator lets an application iterate over entities that match the\n specified query. If a sorting function is specified, the query will check\n whether a resort is required upon creating the iterator.\n\n Creating a query iterator is a cheap operation that does not allocate any\n resources. An application does not need to deinitialize or free a query\n iterator before it goes out of scope.\n\n To iterate the iterator, an application should use ecs_query_next to progress\n the iterator and test if it has data.\n\n Query iteration requires an outer and an inner loop. The outer loop uses\n ecs_query_next to test if new tables are available. The inner loop iterates\n the entities in the table, and is usually a for loop that uses iter.count to\n loop through the entities and component arrays.\n\n The two loops are necessary because of how data is stored internally.\n Entities are grouped by the components they have, in tables. A single query\n can (and often does) match with multiple tables. Because each table has its\n own set of arrays, an application has to reobtain pointers to those arrays\n for each matching table.\n\n @param world The world or stage, when iterating in readonly mode.\n @param query The query to iterate.\n @return The query iterator."]
3578 pub fn ecs_query_iter(world: *const ecs_world_t, query: *mut ecs_query_t) -> ecs_iter_t;
3579}
3580extern "C" {
3581 #[doc = "Progress the query iterator.\n This operation progresses the query iterator to the next table. The\n iterator must have been initialized with `ecs_query_iter`. This operation\n must be invoked at least once before interpreting the contents of the\n iterator.\n\n @param iter The iterator.\n @returns True if more data is available, false if not."]
3582 pub fn ecs_query_next(iter: *mut ecs_iter_t) -> bool;
3583}
3584extern "C" {
3585 #[doc = "Same as ecs_query_next, but always instanced.\n See \"instanced\" property of ecs_filter_desc_t.\n\n @param iter The iterator.\n @returns True if more data is available, false if not."]
3586 pub fn ecs_query_next_instanced(iter: *mut ecs_iter_t) -> bool;
3587}
3588extern "C" {
3589 #[doc = "Fast alternative to ecs_query_next that only returns matched tables.\n This operation only populates the ecs_iter_t::table field. To access the\n matched components, call ecs_query_populate.\n\n If this operation is used with a query that has inout/out terms, those terms\n will not be marked dirty unless ecs_query_populate is called.\n\n @param iter The iterator.\n @returns True if more data is available, false if not."]
3590 pub fn ecs_query_next_table(iter: *mut ecs_iter_t) -> bool;
3591}
3592extern "C" {
3593 #[doc = "Populate iterator fields.\n This operation can be combined with ecs_query_next_table to populate the\n iterator fields for the current table.\n\n Populating fields conditionally can save time when a query uses change\n detection, and only needs iterator data when the table has changed. When this\n operation is called, inout/out terms will be marked dirty.\n\n In cases where inout/out terms are conditionally written and no changes\n were made after calling ecs_query_populate, the ecs_query_skip function can\n be called to prevent the matched table components from being marked dirty.\n\n This operation does should not be used with queries that match disabled\n components, union relationships, or with queries that use order_by.\n\n When the when_changed argument is set to true, the iterator data will only\n populate when the data has changed, using query change detection.\n\n @param iter The iterator.\n @param when_changed Only populate data when result has changed."]
3594 pub fn ecs_query_populate(iter: *mut ecs_iter_t, when_changed: bool) -> ::std::os::raw::c_int;
3595}
3596extern "C" {
3597 #[doc = "Returns whether the query data changed since the last iteration.\n The operation will return true after:\n - new entities have been matched with\n - new tables have been matched/unmatched with\n - matched entities were deleted\n - matched components were changed\n\n The operation will not return true after a write-only (EcsOut) or filter\n (EcsInOutNone) term has changed, when a term is not matched with the\n current table (This subject) or for tag terms.\n\n The changed state of a table is reset after it is iterated. If a iterator was\n not iterated until completion, tables may still be marked as changed.\n\n If no iterator is provided the operation will return the changed state of the\n all matched tables of the query.\n\n If an iterator is provided, the operation will return the changed state of\n the currently returned iterator result. The following preconditions must be\n met before using an iterator with change detection:\n\n - The iterator is a query iterator (created with ecs_query_iter)\n - The iterator must be valid (ecs_query_next must have returned true)\n - The iterator must be instanced\n\n @param query The query (optional if 'it' is provided).\n @param it The iterator result to test (optional if 'query' is provided).\n @return true if entities changed, otherwise false."]
3598 pub fn ecs_query_changed(query: *mut ecs_query_t, it: *const ecs_iter_t) -> bool;
3599}
3600extern "C" {
3601 #[doc = "Skip a table while iterating.\n This operation lets the query iterator know that a table was skipped while\n iterating. A skipped table will not reset its changed state, and the query\n will not update the dirty flags of the table for its out columns.\n\n Only valid iterators must be provided (next has to be called at least once &\n return true) and the iterator must be a query iterator.\n\n @param it The iterator result to skip."]
3602 pub fn ecs_query_skip(it: *mut ecs_iter_t);
3603}
3604extern "C" {
3605 #[doc = "Set group to iterate for query iterator.\n This operation limits the results returned by the query to only the selected\n group id. The query must have a group_by function, and the iterator must\n be a query iterator.\n\n Groups are sets of tables that are stored together in the query cache based\n on a group id, which is calculated per table by the group_by function. To\n iterate a group, an iterator only needs to know the first and last cache node\n for that group, which can both be found in a fast O(1) operation.\n\n As a result, group iteration is one of the most efficient mechanisms to\n filter out large numbers of entities, even if those entities are distributed\n across many tables. This makes it a good fit for things like dividing up\n a world into cells, and only iterating cells close to a player.\n\n The group to iterate must be set before the first call to ecs_query_next. No\n operations that can add/remove components should be invoked between calling\n ecs_query_set_group and ecs_query_next.\n\n @param it The query iterator.\n @param group_id The group to iterate."]
3606 pub fn ecs_query_set_group(it: *mut ecs_iter_t, group_id: u64);
3607}
3608extern "C" {
3609 #[doc = "Get context of query group.\n This operation returns the context of a query group as returned by the\n on_group_create callback.\n\n @param query The query.\n @param group_id The group for which to obtain the context.\n @return The group context, NULL if the group doesn't exist."]
3610 pub fn ecs_query_get_group_ctx(
3611 query: *const ecs_query_t,
3612 group_id: u64,
3613 ) -> *mut ::std::os::raw::c_void;
3614}
3615extern "C" {
3616 #[doc = "Get information about query group.\n This operation returns information about a query group, including the group\n context returned by the on_group_create callback.\n\n @param query The query.\n @param group_id The group for which to obtain the group info.\n @return The group info, NULL if the group doesn't exist."]
3617 pub fn ecs_query_get_group_info(
3618 query: *const ecs_query_t,
3619 group_id: u64,
3620 ) -> *const ecs_query_group_info_t;
3621}
3622extern "C" {
3623 #[doc = "Returns whether query is orphaned.\n When the parent query of a subquery is deleted, it is left in an orphaned\n state. The only valid operation on an orphaned query is deleting it. Only\n subqueries can be orphaned.\n\n @param query The query.\n @return true if query is orphaned, otherwise false."]
3624 pub fn ecs_query_orphaned(query: *const ecs_query_t) -> bool;
3625}
3626extern "C" {
3627 #[doc = "Convert query to string.\n\n @param query The query.\n @return The query string."]
3628 pub fn ecs_query_str(query: *const ecs_query_t) -> *mut ::std::os::raw::c_char;
3629}
3630extern "C" {
3631 #[doc = "Returns number of tables query matched with.\n\n @param query The query.\n @return The number of matched tables."]
3632 pub fn ecs_query_table_count(query: *const ecs_query_t) -> i32;
3633}
3634extern "C" {
3635 #[doc = "Returns number of empty tables query matched with.\n\n @param query The query.\n @return The number of matched empty tables."]
3636 pub fn ecs_query_empty_table_count(query: *const ecs_query_t) -> i32;
3637}
3638extern "C" {
3639 #[doc = "Returns number of entities query matched with.\n This operation iterates all non-empty tables in the query cache to find the\n total number of entities.\n\n @param query The query.\n @return The number of matched entities."]
3640 pub fn ecs_query_entity_count(query: *const ecs_query_t) -> i32;
3641}
3642extern "C" {
3643 #[doc = "Get query ctx.\n Return the value set in ecs_query_desc_t::ctx.\n\n @param query The query.\n @return The context."]
3644 pub fn ecs_query_get_ctx(query: *const ecs_query_t) -> *mut ::std::os::raw::c_void;
3645}
3646extern "C" {
3647 #[doc = "Get query binding ctx.\n Return the value set in ecs_query_desc_t::binding_ctx.\n\n @param query The query.\n @return The context."]
3648 pub fn ecs_query_get_binding_ctx(query: *const ecs_query_t) -> *mut ::std::os::raw::c_void;
3649}
3650extern "C" {
3651 #[doc = "Send event.\n This sends an event to matching triggers & is the mechanism used by flecs\n itself to send OnAdd, OnRemove, etc events.\n\n Applications can use this function to send custom events, where a custom\n event can be any regular entity.\n\n Applications should not send builtin flecs events, as this may violate\n assumptions the code makes about the conditions under which those events are\n sent.\n\n Triggers are invoked synchronously. It is therefore safe to use stack-based\n data as event context, which can be set in the \"param\" member.\n\n @param world The world.\n @param desc Event parameters."]
3652 pub fn ecs_emit(world: *mut ecs_world_t, desc: *mut ecs_event_desc_t);
3653}
3654extern "C" {
3655 #[doc = "Create observer.\n Observers are like triggers, but can subscribe for multiple terms. An\n observer only triggers when the source of the event meets all terms.\n\n See the documentation for ecs_observer_desc_t for more details.\n\n @param world The world.\n @param desc The observer creation parameters."]
3656 pub fn ecs_observer_init(
3657 world: *mut ecs_world_t,
3658 desc: *const ecs_observer_desc_t,
3659 ) -> ecs_entity_t;
3660}
3661extern "C" {
3662 #[doc = "Default run action for observer.\n This function can be called from a custom observer run action (see\n ecs_observer_desc_t::run for more details). This function ensures that the\n observer's filter is applied to the iterator's table, filters out duplicate\n events and implements EcsMonitor logic.\n\n @param it The iterator.\n @return True if the observer was invoked."]
3663 pub fn ecs_observer_default_run_action(it: *mut ecs_iter_t) -> bool;
3664}
3665extern "C" {
3666 #[doc = "Get observer ctx.\n Return the value set in ecs_observer_desc_t::ctx.\n\n @param world The world.\n @param observer The observer.\n @return The context."]
3667 pub fn ecs_observer_get_ctx(
3668 world: *const ecs_world_t,
3669 observer: ecs_entity_t,
3670 ) -> *mut ::std::os::raw::c_void;
3671}
3672extern "C" {
3673 #[doc = "Get observer binding ctx.\n Return the value set in ecs_observer_desc_t::binding_ctx.\n\n @param world The world.\n @param observer The observer.\n @return The context."]
3674 pub fn ecs_observer_get_binding_ctx(
3675 world: *const ecs_world_t,
3676 observer: ecs_entity_t,
3677 ) -> *mut ::std::os::raw::c_void;
3678}
3679extern "C" {
3680 #[doc = "Create iterator from poly object.\n The provided poly object must have the iterable mixin. If an object is\n provided that does not have the mixin, the function will assert.\n\n When a filter is provided, an array of two iterators must be passed to the\n function. This allows the mixin implementation to create a chained iterator\n when necessary, which requires two iterator objects.\n\n If a filter is provided, the first element in the array of two iterators is\n the one that should be iterated. The mixin implementation may or may not set\n the second element, depending on whether an iterator chain is required.\n\n Additionally, when a filter is provided the returned iterator will be for a\n single term with the provided filter id. If the iterator is chained, the\n previous iterator in the chain can be accessed through it->chain_it.\n\n @param world The world or stage for which to create the iterator.\n @param poly The poly object from which to create the iterator.\n @param iter The iterator (out, ecs_iter_t\\[2\\] when filter is set).\n @param filter Optional term used for filtering the results."]
3681 pub fn ecs_iter_poly(
3682 world: *const ecs_world_t,
3683 poly: *const ecs_poly_t,
3684 iter: *mut ecs_iter_t,
3685 filter: *mut ecs_term_t,
3686 );
3687}
3688extern "C" {
3689 #[doc = "Progress any iterator.\n This operation is useful in combination with iterators for which it is not\n known what created them. Example use cases are functions that should accept\n any kind of iterator (such as serializers) or iterators created from poly\n objects.\n\n This operation is slightly slower than using a type-specific iterator (e.g.\n ecs_filter_next, ecs_query_next) as it has to call a function pointer which\n introduces a level of indirection.\n\n @param it The iterator.\n @return True if iterator has more results, false if not."]
3690 pub fn ecs_iter_next(it: *mut ecs_iter_t) -> bool;
3691}
3692extern "C" {
3693 #[doc = "Cleanup iterator resources.\n This operation cleans up any resources associated with the iterator.\n\n This operation should only be used when an iterator is not iterated until\n completion (next has not yet returned false). When an iterator is iterated\n until completion, resources are automatically freed.\n\n @param it The iterator."]
3694 pub fn ecs_iter_fini(it: *mut ecs_iter_t);
3695}
3696extern "C" {
3697 #[doc = "Count number of matched entities in query.\n This operation returns the number of matched entities. If a query contains no\n matched entities but still yields results (e.g. it has no terms with This\n sources) the operation will return 0.\n\n To determine the number of matched entities, the operation iterates the\n iterator until it yields no more results.\n\n @param it The iterator.\n @return True if iterator has more results, false if not."]
3698 pub fn ecs_iter_count(it: *mut ecs_iter_t) -> i32;
3699}
3700extern "C" {
3701 #[doc = "Test if iterator is true.\n This operation will return true if the iterator returns at least one result.\n This is especially useful in combination with fact-checking rules (see the\n rules addon).\n\n The operation requires a valid iterator. After the operation is invoked, the\n application should no longer invoke next on the iterator and should treat it\n as if the iterator is iterated until completion.\n\n @param it The iterator.\n @return true if the iterator returns at least one result."]
3702 pub fn ecs_iter_is_true(it: *mut ecs_iter_t) -> bool;
3703}
3704extern "C" {
3705 #[doc = "Get first matching entity from iterator.\n After this operation the application should treat the iterator as if it has\n been iterated until completion.\n\n @param it The iterator.\n @return The first matching entity, or 0 if no entities were matched."]
3706 pub fn ecs_iter_first(it: *mut ecs_iter_t) -> ecs_entity_t;
3707}
3708extern "C" {
3709 #[doc = "Set value for iterator variable.\n This constrains the iterator to return only results for which the variable\n equals the specified value. The default value for all variables is\n EcsWildcard, which means the variable can assume any value.\n\n Example:\n\n // Rule that matches (Eats, *)\n ecs_rule_t *r = ecs_rule_init(world, &(ecs_filter_desc_t){\n .terms = {\n { .first.id = Eats, .second.name = \"$food\" }\n }\n });\n\n int food_var = ecs_rule_find_var(r, \"food\");\n\n // Set Food to Apples, so we're only matching (Eats, Apples)\n ecs_iter_t it = ecs_rule_iter(world, r);\n ecs_iter_set_var(&it, food_var, Apples);\n\n while (ecs_rule_next(&it)) {\n for (int i = 0; i < it.count; i ++) {\n // iterate as usual\n }\n }\n\n The variable must be initialized after creating the iterator and before the\n first call to next.\n\n @param it The iterator.\n @param var_id The variable index.\n @param entity The entity variable value."]
3710 pub fn ecs_iter_set_var(it: *mut ecs_iter_t, var_id: i32, entity: ecs_entity_t);
3711}
3712extern "C" {
3713 #[doc = "Same as ecs_iter_set_var, but for a table.\n This constrains the variable to all entities in a table.\n\n @param it The iterator.\n @param var_id The variable index.\n @param table The table variable value."]
3714 pub fn ecs_iter_set_var_as_table(it: *mut ecs_iter_t, var_id: i32, table: *const ecs_table_t);
3715}
3716extern "C" {
3717 #[doc = "Same as ecs_iter_set_var, but for a range of entities\n This constrains the variable to a range of entities in a table.\n\n @param it The iterator.\n @param var_id The variable index.\n @param range The range variable value."]
3718 pub fn ecs_iter_set_var_as_range(
3719 it: *mut ecs_iter_t,
3720 var_id: i32,
3721 range: *const ecs_table_range_t,
3722 );
3723}
3724extern "C" {
3725 #[doc = "Get value of iterator variable as entity.\n A variable can be interpreted as entity if it is set to an entity, or if it\n is set to a table range with count 1.\n\n This operation can only be invoked on valid iterators. The variable index\n must be smaller than the total number of variables provided by the iterator\n (as set in ecs_iter_t::variable_count).\n\n @param it The iterator.\n @param var_id The variable index.\n @return The variable value."]
3726 pub fn ecs_iter_get_var(it: *mut ecs_iter_t, var_id: i32) -> ecs_entity_t;
3727}
3728extern "C" {
3729 #[doc = "Get value of iterator variable as table.\n A variable can be interpreted as table if it is set as table range with\n both offset and count set to 0, or if offset is 0 and count matches the\n number of elements in the table.\n\n This operation can only be invoked on valid iterators. The variable index\n must be smaller than the total number of variables provided by the iterator\n (as set in ecs_iter_t::variable_count).\n\n @param it The iterator.\n @param var_id The variable index.\n @return The variable value."]
3730 pub fn ecs_iter_get_var_as_table(it: *mut ecs_iter_t, var_id: i32) -> *mut ecs_table_t;
3731}
3732extern "C" {
3733 #[doc = "Get value of iterator variable as table range.\n A value can be interpreted as table range if it is set as table range, or if\n it is set to an entity with a non-empty type (the entity must have at least\n one component, tag or relationship in its type).\n\n This operation can only be invoked on valid iterators. The variable index\n must be smaller than the total number of variables provided by the iterator\n (as set in ecs_iter_t::variable_count).\n\n @param it The iterator.\n @param var_id The variable index.\n @return The variable value."]
3734 pub fn ecs_iter_get_var_as_range(it: *mut ecs_iter_t, var_id: i32) -> ecs_table_range_t;
3735}
3736extern "C" {
3737 #[doc = "Returns whether variable is constrained.\n This operation returns true for variables set by one of the ecs_iter_set_var*\n operations.\n\n A constrained variable is guaranteed not to change values while results are\n being iterated.\n\n @param it The iterator.\n @param var_id The variable index.\n @return Whether the variable is constrained to a specified value."]
3738 pub fn ecs_iter_var_is_constrained(it: *mut ecs_iter_t, var_id: i32) -> bool;
3739}
3740extern "C" {
3741 #[doc = "Convert iterator to string.\n Prints the contents of an iterator to a string. Useful for debugging and/or\n testing the output of an iterator.\n\n The function only converts the currently iterated data to a string. To\n convert all data, the application has to manually call the next function and\n call ecs_iter_str on each result.\n\n @param it The iterator.\n @return A string representing the contents of the iterator."]
3742 pub fn ecs_iter_str(it: *const ecs_iter_t) -> *mut ::std::os::raw::c_char;
3743}
3744extern "C" {
3745 #[doc = "Create a paged iterator.\n Paged iterators limit the results to those starting from 'offset', and will\n return at most 'limit' results.\n\n The iterator must be iterated with ecs_page_next.\n\n A paged iterator acts as a passthrough for data exposed by the parent\n iterator, so that any data provided by the parent will also be provided by\n the paged iterator.\n\n @param it The source iterator.\n @param offset The number of entities to skip.\n @param limit The maximum number of entities to iterate.\n @return A page iterator."]
3746 pub fn ecs_page_iter(it: *const ecs_iter_t, offset: i32, limit: i32) -> ecs_iter_t;
3747}
3748extern "C" {
3749 #[doc = "Progress a paged iterator.\n Progresses an iterator created by ecs_page_iter.\n\n @param it The iterator.\n @return true if iterator has more results, false if not."]
3750 pub fn ecs_page_next(it: *mut ecs_iter_t) -> bool;
3751}
3752extern "C" {
3753 #[doc = "Create a worker iterator.\n Worker iterators can be used to equally divide the number of matched entities\n across N resources (usually threads). Each resource will process the total\n number of matched entities divided by 'count'.\n\n Entities are distributed across resources such that the distribution is\n stable between queries. Two queries that match the same table are guaranteed\n to match the same entities in that table.\n\n The iterator must be iterated with ecs_worker_next.\n\n A worker iterator acts as a passthrough for data exposed by the parent\n iterator, so that any data provided by the parent will also be provided by\n the worker iterator.\n\n @param it The source iterator.\n @param index The index of the current resource.\n @param count The total number of resources to divide entities between.\n @return A worker iterator."]
3754 pub fn ecs_worker_iter(it: *const ecs_iter_t, index: i32, count: i32) -> ecs_iter_t;
3755}
3756extern "C" {
3757 #[doc = "Progress a worker iterator.\n Progresses an iterator created by ecs_worker_iter.\n\n @param it The iterator.\n @return true if iterator has more results, false if not."]
3758 pub fn ecs_worker_next(it: *mut ecs_iter_t) -> bool;
3759}
3760extern "C" {
3761 #[doc = "Obtain data for a query field.\n This operation retrieves a pointer to an array of data that belongs to the\n term in the query. The index refers to the location of the term in the query,\n and starts counting from one.\n\n For example, the query \"Position, Velocity\" will return the Position array\n for index 1, and the Velocity array for index 2.\n\n When the specified field is not owned by the entity this function returns a\n pointer instead of an array. This happens when the source of a field is not\n the entity being iterated, such as a shared component (from a prefab), a\n component from a parent, or another entity. The ecs_field_is_self operation\n can be used to test dynamically if a field is owned.\n\n The provided size must be either 0 or must match the size of the datatype\n of the returned array. If the size does not match, the operation may assert.\n The size can be dynamically obtained with ecs_field_size.\n\n @param it The iterator.\n @param size The type size of the requested data.\n @param index The index of the field in the iterator.\n @return A pointer to the data of the field."]
3762 pub fn ecs_field_w_size(
3763 it: *const ecs_iter_t,
3764 size: usize,
3765 index: i32,
3766 ) -> *mut ::std::os::raw::c_void;
3767}
3768extern "C" {
3769 #[doc = "Test whether the field is readonly.\n This operation returns whether the field is readonly. Readonly fields are\n annotated with \\[in\\], or are added as a const type in the C++ API.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return Whether the field is readonly."]
3770 pub fn ecs_field_is_readonly(it: *const ecs_iter_t, index: i32) -> bool;
3771}
3772extern "C" {
3773 #[doc = "Test whether the field is writeonly.\n This operation returns whether this is a writeonly field. Writeonly terms are\n annotated with \\[out\\].\n\n Serializers are not required to serialize the values of a writeonly field.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return Whether the field is writeonly."]
3774 pub fn ecs_field_is_writeonly(it: *const ecs_iter_t, index: i32) -> bool;
3775}
3776extern "C" {
3777 #[doc = "Test whether field is set.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return Whether the field is set."]
3778 pub fn ecs_field_is_set(it: *const ecs_iter_t, index: i32) -> bool;
3779}
3780extern "C" {
3781 #[doc = "Return id matched for field.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return The id matched for the field."]
3782 pub fn ecs_field_id(it: *const ecs_iter_t, index: i32) -> ecs_id_t;
3783}
3784extern "C" {
3785 #[doc = "Return index of matched table column.\n This function only returns column indices for fields that have been matched\n on the $this variable. Fields matched on other tables will return -1.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return The index of the matched column, -1 if not matched."]
3786 pub fn ecs_field_column_index(it: *const ecs_iter_t, index: i32) -> i32;
3787}
3788extern "C" {
3789 #[doc = "Return field source.\n The field source is the entity on which the field was matched.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return The source for the field."]
3790 pub fn ecs_field_src(it: *const ecs_iter_t, index: i32) -> ecs_entity_t;
3791}
3792extern "C" {
3793 #[doc = "Return field type size.\n Return type size of the field. Returns 0 if the field has no data.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return The type size for the field."]
3794 pub fn ecs_field_size(it: *const ecs_iter_t, index: i32) -> usize;
3795}
3796extern "C" {
3797 #[doc = "Test whether the field is matched on self.\n This operation returns whether the field is matched on the currently iterated\n entity. This function will return false when the field is owned by another\n entity, such as a parent or a prefab.\n\n When this operation returns false, the field must be accessed as a single\n value instead of an array. Fields for which this operation returns true\n return arrays with it->count values.\n\n @param it The iterator.\n @param index The index of the field in the iterator.\n @return Whether the field is matched on self."]
3798 pub fn ecs_field_is_self(it: *const ecs_iter_t, index: i32) -> bool;
3799}
3800extern "C" {
3801 #[doc = "Get type for table.\n The table type is a vector that contains all component, tag and pair ids.\n\n @param table The table.\n @return The type of the table."]
3802 pub fn ecs_table_get_type(table: *const ecs_table_t) -> *const ecs_type_t;
3803}
3804extern "C" {
3805 #[doc = "Get type index for id.\n This operation returns the index for an id in the table's type.\n\n @param world The world.\n @param table The table.\n @param id The id.\n @return The index of the id in the table type, or -1 if not found."]
3806 pub fn ecs_table_get_type_index(
3807 world: *const ecs_world_t,
3808 table: *const ecs_table_t,
3809 id: ecs_id_t,
3810 ) -> i32;
3811}
3812extern "C" {
3813 #[doc = "Get column index for id.\n This operation returns the column index for an id in the table's type. If the\n id is not a component, the function will return -1.\n\n @param world The world.\n @param table The table.\n @param id The component id.\n @return The column index of the id, or -1 if not found/not a component."]
3814 pub fn ecs_table_get_column_index(
3815 world: *const ecs_world_t,
3816 table: *const ecs_table_t,
3817 id: ecs_id_t,
3818 ) -> i32;
3819}
3820extern "C" {
3821 #[doc = "Return number of columns in table.\n Similar to ecs_table_get_type(table)->count, except that the column count\n only counts the number of components in a table.\n\n @param table The table.\n @return The number of columns in the table."]
3822 pub fn ecs_table_column_count(table: *const ecs_table_t) -> i32;
3823}
3824extern "C" {
3825 #[doc = "Convert type index to column index.\n Tables have an array of columns for each component in the table. This array\n does not include elements for tags, which means that the index for a\n component in the table type is not necessarily the same as the index in the\n column array. This operation converts from an index in the table type to an\n index in the column array.\n\n @param table The table.\n @param index The index in the table type.\n @return The index in the table column array."]
3826 pub fn ecs_table_type_to_column_index(table: *const ecs_table_t, index: i32) -> i32;
3827}
3828extern "C" {
3829 #[doc = "Convert column index to type index.\n Same as ecs_table_type_to_column_index, but converts from an index in the\n column array to an index in the table type.\n\n @param table The table.\n @param index The column index.\n @return The index in the table type."]
3830 pub fn ecs_table_column_to_type_index(table: *const ecs_table_t, index: i32) -> i32;
3831}
3832extern "C" {
3833 #[doc = "Get column from table by column index.\n This operation returns the component array for the provided index.\n\n @param table The table.\n @param index The column index.\n @param offset The index of the first row to return (0 for entire column).\n @return The component array, or NULL if the index is not a component."]
3834 pub fn ecs_table_get_column(
3835 table: *const ecs_table_t,
3836 index: i32,
3837 offset: i32,
3838 ) -> *mut ::std::os::raw::c_void;
3839}
3840extern "C" {
3841 #[doc = "Get column from table by component id.\n This operation returns the component array for the provided component id.\n\n @param table The table.\n @param id The component id for the column.\n @param offset The index of the first row to return (0 for entire column).\n @return The component array, or NULL if the index is not a component."]
3842 pub fn ecs_table_get_id(
3843 world: *const ecs_world_t,
3844 table: *const ecs_table_t,
3845 id: ecs_id_t,
3846 offset: i32,
3847 ) -> *mut ::std::os::raw::c_void;
3848}
3849extern "C" {
3850 #[doc = "Get column size from table.\n This operation returns the component size for the provided index.\n\n @param table The table.\n @param index The column index.\n @return The component size, or 0 if the index is not a component."]
3851 pub fn ecs_table_get_column_size(table: *const ecs_table_t, index: i32) -> usize;
3852}
3853extern "C" {
3854 #[doc = "Returns the number of records in the table.\n This operation returns the number of records that have been populated through\n the regular (entity) API as well as the number of records that have been\n inserted using the direct access API.\n\n @param table The table.\n @return The number of records in a table."]
3855 pub fn ecs_table_count(table: *const ecs_table_t) -> i32;
3856}
3857extern "C" {
3858 #[doc = "Test if table has id.\n Same as ecs_table_get_type_index(world, table, id) != -1.\n\n @param world The world.\n @param table The table.\n @param id The id.\n @return True if the table has the id, false if the table doesn't."]
3859 pub fn ecs_table_has_id(
3860 world: *const ecs_world_t,
3861 table: *const ecs_table_t,
3862 id: ecs_id_t,
3863 ) -> bool;
3864}
3865extern "C" {
3866 #[doc = "Return depth for table in tree for relationship rel.\n Depth is determined by counting the number of targets encountered while\n traversing up the relationship tree for rel. Only acyclic relationships are\n supported.\n\n @param world The world.\n @param table The table.\n @param rel The relationship.\n @return The depth of the table in the tree."]
3867 pub fn ecs_table_get_depth(
3868 world: *const ecs_world_t,
3869 table: *const ecs_table_t,
3870 rel: ecs_entity_t,
3871 ) -> i32;
3872}
3873extern "C" {
3874 #[doc = "Get table that has all components of current table plus the specified id.\n If the provided table already has the provided id, the operation will return\n the provided table.\n\n @param world The world.\n @param table The table.\n @param id The id to add.\n @result The resulting table."]
3875 pub fn ecs_table_add_id(
3876 world: *mut ecs_world_t,
3877 table: *mut ecs_table_t,
3878 id: ecs_id_t,
3879 ) -> *mut ecs_table_t;
3880}
3881extern "C" {
3882 #[doc = "Find table from id array.\n This operation finds or creates a table with the specified array of\n (component) ids. The ids in the array must be sorted, and it may not contain\n duplicate elements.\n\n @param world The world.\n @param ids The id array.\n @param id_count The number of elements in the id array.\n @return The table with the specified (component) ids."]
3883 pub fn ecs_table_find(
3884 world: *mut ecs_world_t,
3885 ids: *const ecs_id_t,
3886 id_count: i32,
3887 ) -> *mut ecs_table_t;
3888}
3889extern "C" {
3890 #[doc = "Get table that has all components of current table minus the specified id.\n If the provided table doesn't have the provided id, the operation will return\n the provided table.\n\n @param world The world.\n @param table The table.\n @param id The id to remove.\n @result The resulting table."]
3891 pub fn ecs_table_remove_id(
3892 world: *mut ecs_world_t,
3893 table: *mut ecs_table_t,
3894 id: ecs_id_t,
3895 ) -> *mut ecs_table_t;
3896}
3897extern "C" {
3898 #[doc = "Lock or unlock table.\n When a table is locked, modifications to it will throw an assert. When the\n table is locked recursively, it will take an equal amount of unlock\n operations to actually unlock the table.\n\n Table locks can be used to build safe iterators where it is guaranteed that\n the contents of a table are not modified while it is being iterated.\n\n The operation only works when called on the world, and has no side effects\n when called on a stage. The assumption is that when called on a stage,\n operations are deferred already.\n\n @param world The world.\n @param table The table to lock."]
3899 pub fn ecs_table_lock(world: *mut ecs_world_t, table: *mut ecs_table_t);
3900}
3901extern "C" {
3902 #[doc = "Unlock a table.\n Must be called after calling ecs_table_lock.\n\n @param world The world.\n @param table The table to unlock."]
3903 pub fn ecs_table_unlock(world: *mut ecs_world_t, table: *mut ecs_table_t);
3904}
3905extern "C" {
3906 #[doc = "Test table for flags.\n Test if table has all of the provided flags. See\n include/flecs/private/api_flags.h for a list of table flags that can be used\n with this function.\n\n @param table The table.\n @param flags The flags to test for.\n @return Whether the specified flags are set for the table."]
3907 pub fn ecs_table_has_flags(table: *mut ecs_table_t, flags: ecs_flags32_t) -> bool;
3908}
3909extern "C" {
3910 #[doc = "Swaps two elements inside the table. This is useful for implementing custom\n table sorting algorithms.\n @param world The world\n @param table The table to swap elements in\n @param row_1 Table element to swap with row_2\n @param row_2 Table element to swap with row_1"]
3911 pub fn ecs_table_swap_rows(
3912 world: *mut ecs_world_t,
3913 table: *mut ecs_table_t,
3914 row_1: i32,
3915 row_2: i32,
3916 );
3917}
3918extern "C" {
3919 #[doc = "Commit (move) entity to a table.\n This operation moves an entity from its current table to the specified\n table. This may cause the following actions:\n - Ctor for each component in the target table\n - Move for each overlapping component\n - Dtor for each component in the source table.\n - OnAdd triggers for non-overlapping components in the target table\n - OnRemove triggers for non-overlapping components in the source table.\n\n This operation is a faster than adding/removing components individually.\n\n The application must explicitly provide the difference in components between\n tables as the added/removed parameters. This can usually be derived directly\n from the result of ecs_table_add_id and esc_table_remove_id. These arrays are\n required to properly execute OnAdd/OnRemove triggers.\n\n @param world The world.\n @param entity The entity to commit.\n @param record The entity's record (optional, providing it saves a lookup).\n @param table The table to commit the entity to.\n @return True if the entity got moved, false otherwise."]
3920 pub fn ecs_commit(
3921 world: *mut ecs_world_t,
3922 entity: ecs_entity_t,
3923 record: *mut ecs_record_t,
3924 table: *mut ecs_table_t,
3925 added: *const ecs_type_t,
3926 removed: *const ecs_type_t,
3927 ) -> bool;
3928}
3929extern "C" {
3930 #[doc = "Find record for entity."]
3931 pub fn ecs_record_find(world: *const ecs_world_t, entity: ecs_entity_t) -> *mut ecs_record_t;
3932}
3933extern "C" {
3934 #[doc = "Get component pointer from column/record."]
3935 pub fn ecs_record_get_column(
3936 r: *const ecs_record_t,
3937 column: i32,
3938 c_size: usize,
3939 ) -> *mut ::std::os::raw::c_void;
3940}
3941extern "C" {
3942 #[doc = "Search for component id in table type.\n This operation returns the index of first occurrance of the id in the table\n type. The id may be a wildcard.\n\n When id_out is provided, the function will assign it with the found id. The\n found id may be different from the provided id if it is a wildcard.\n\n This is a constant time operation.\n\n @param world The world.\n @param table The table.\n @param id The id to search for.\n @param id_out If provided, it will be set to the found id (optional).\n @return The index of the id in the table type."]
3943 pub fn ecs_search(
3944 world: *const ecs_world_t,
3945 table: *const ecs_table_t,
3946 id: ecs_id_t,
3947 id_out: *mut ecs_id_t,
3948 ) -> i32;
3949}
3950extern "C" {
3951 #[doc = "Search for component id in table type starting from an offset.\n This operation is the same as ecs_search, but starts searching from an offset\n in the table type.\n\n This operation is typically called in a loop where the resulting index is\n used in the next iteration as offset:\n\n int32_t index = -1;\n while ((index = ecs_search_offset(world, table, offset, id, NULL))) {\n // do stuff\n }\n\n Depending on how the operation is used it is either linear or constant time.\n When the id has the form (id) or (rel, *) and the operation is invoked as\n in the above example, it is guaranteed to be constant time.\n\n If the provided id has the form (*, tgt) the operation takes linear time. The\n reason for this is that ids for an target are not packed together, as they\n are sorted relationship first.\n\n If the id at the offset does not match the provided id, the operation will do\n a linear search to find a matching id.\n\n @param world The world.\n @param table The table.\n @param offset Offset from where to start searching.\n @param id The id to search for.\n @param id_out If provided, it will be set to the found id (optional).\n @return The index of the id in the table type."]
3952 pub fn ecs_search_offset(
3953 world: *const ecs_world_t,
3954 table: *const ecs_table_t,
3955 offset: i32,
3956 id: ecs_id_t,
3957 id_out: *mut ecs_id_t,
3958 ) -> i32;
3959}
3960extern "C" {
3961 #[doc = "Search for component/relationship id in table type starting from an offset.\n This operation is the same as ecs_search_offset, but has the additional\n capability of traversing relationships to find a component. For example, if\n an application wants to find a component for either the provided table or a\n prefab (using the IsA relationship) of that table, it could use the operation\n like this:\n\n int32_t index = ecs_search_relation(\n world, // the world\n table, // the table\n 0, // offset 0\n ecs_id(Position), // the component id\n EcsIsA, // the relationship to traverse\n 0, // start at depth 0 (the table itself)\n 0, // no depth limit\n NULL, // (optional) entity on which component was found\n NULL, // see above\n NULL); // internal type with information about matched id\n\n The operation searches depth first. If a table type has 2 IsA relationships, the\n operation will first search the IsA tree of the first relationship.\n\n When choosing betwen ecs_search, ecs_search_offset and ecs_search_relation,\n the simpler the function the better its performance.\n\n @param world The world.\n @param table The table.\n @param offset Offset from where to start searching.\n @param id The id to search for.\n @param rel The relationship to traverse (optional).\n @param flags Whether to search EcsSelf and/or EcsUp.\n @param subject_out If provided, it will be set to the matched entity.\n @param id_out If provided, it will be set to the found id (optional).\n @param tr_out Internal datatype.\n @return The index of the id in the table type."]
3962 pub fn ecs_search_relation(
3963 world: *const ecs_world_t,
3964 table: *const ecs_table_t,
3965 offset: i32,
3966 id: ecs_id_t,
3967 rel: ecs_entity_t,
3968 flags: ecs_flags32_t,
3969 subject_out: *mut ecs_entity_t,
3970 id_out: *mut ecs_id_t,
3971 tr_out: *mut *mut ecs_table_record_t,
3972 ) -> i32;
3973}
3974extern "C" {
3975 #[doc = "Construct a value in existing storage\n\n @param world The world.\n @param type The type of the value to create.\n @param ptr Pointer to a value of type 'type'\n @return Zero if success, nonzero if failed."]
3976 pub fn ecs_value_init(
3977 world: *const ecs_world_t,
3978 type_: ecs_entity_t,
3979 ptr: *mut ::std::os::raw::c_void,
3980 ) -> ::std::os::raw::c_int;
3981}
3982extern "C" {
3983 #[doc = "Construct a value in existing storage\n\n @param world The world.\n @param ti The type info of the type to create.\n @param ptr Pointer to a value of type 'type'\n @return Zero if success, nonzero if failed."]
3984 pub fn ecs_value_init_w_type_info(
3985 world: *const ecs_world_t,
3986 ti: *const ecs_type_info_t,
3987 ptr: *mut ::std::os::raw::c_void,
3988 ) -> ::std::os::raw::c_int;
3989}
3990extern "C" {
3991 #[doc = "Construct a value in new storage\n\n @param world The world.\n @param type The type of the value to create.\n @return Pointer to type if success, NULL if failed."]
3992 pub fn ecs_value_new(
3993 world: *mut ecs_world_t,
3994 type_: ecs_entity_t,
3995 ) -> *mut ::std::os::raw::c_void;
3996}
3997extern "C" {
3998 #[doc = "Construct a value in new storage\n\n @param world The world.\n @param ti The type info of the type to create.\n @return Pointer to type if success, NULL if failed."]
3999 pub fn ecs_value_new_w_type_info(
4000 world: *mut ecs_world_t,
4001 ti: *const ecs_type_info_t,
4002 ) -> *mut ::std::os::raw::c_void;
4003}
4004extern "C" {
4005 #[doc = "Destruct a value\n\n @param world The world.\n @param ti Type info of the value to destruct.\n @param ptr Pointer to constructed value of type 'type'.\n @return Zero if success, nonzero if failed."]
4006 pub fn ecs_value_fini_w_type_info(
4007 world: *const ecs_world_t,
4008 ti: *const ecs_type_info_t,
4009 ptr: *mut ::std::os::raw::c_void,
4010 ) -> ::std::os::raw::c_int;
4011}
4012extern "C" {
4013 #[doc = "Destruct a value\n\n @param world The world.\n @param type The type of the value to destruct.\n @param ptr Pointer to constructed value of type 'type'.\n @return Zero if success, nonzero if failed."]
4014 pub fn ecs_value_fini(
4015 world: *const ecs_world_t,
4016 type_: ecs_entity_t,
4017 ptr: *mut ::std::os::raw::c_void,
4018 ) -> ::std::os::raw::c_int;
4019}
4020extern "C" {
4021 #[doc = "Destruct a value, free storage\n\n @param world The world.\n @param type The type of the value to destruct.\n @return Zero if success, nonzero if failed."]
4022 pub fn ecs_value_free(
4023 world: *mut ecs_world_t,
4024 type_: ecs_entity_t,
4025 ptr: *mut ::std::os::raw::c_void,
4026 ) -> ::std::os::raw::c_int;
4027}
4028extern "C" {
4029 #[doc = "Copy value.\n\n @param world The world.\n @param ti Type info of the value to copy.\n @param dst Pointer to the storage to copy to.\n @param src Pointer to the value to copy.\n @return Zero if success, nonzero if failed."]
4030 pub fn ecs_value_copy_w_type_info(
4031 world: *const ecs_world_t,
4032 ti: *const ecs_type_info_t,
4033 dst: *mut ::std::os::raw::c_void,
4034 src: *const ::std::os::raw::c_void,
4035 ) -> ::std::os::raw::c_int;
4036}
4037extern "C" {
4038 #[doc = "Copy value.\n\n @param world The world.\n @param type The type of the value to copy.\n @param dst Pointer to the storage to copy to.\n @param src Pointer to the value to copy.\n @return Zero if success, nonzero if failed."]
4039 pub fn ecs_value_copy(
4040 world: *const ecs_world_t,
4041 type_: ecs_entity_t,
4042 dst: *mut ::std::os::raw::c_void,
4043 src: *const ::std::os::raw::c_void,
4044 ) -> ::std::os::raw::c_int;
4045}
4046extern "C" {
4047 #[doc = "Move value.\n\n @param world The world.\n @param ti Type info of the value to move.\n @param dst Pointer to the storage to move to.\n @param src Pointer to the value to move.\n @return Zero if success, nonzero if failed."]
4048 pub fn ecs_value_move_w_type_info(
4049 world: *const ecs_world_t,
4050 ti: *const ecs_type_info_t,
4051 dst: *mut ::std::os::raw::c_void,
4052 src: *mut ::std::os::raw::c_void,
4053 ) -> ::std::os::raw::c_int;
4054}
4055extern "C" {
4056 #[doc = "Move value.\n\n @param world The world.\n @param type The type of the value to move.\n @param dst Pointer to the storage to move to.\n @param src Pointer to the value to move.\n @return Zero if success, nonzero if failed."]
4057 pub fn ecs_value_move(
4058 world: *const ecs_world_t,
4059 type_: ecs_entity_t,
4060 dst: *mut ::std::os::raw::c_void,
4061 src: *mut ::std::os::raw::c_void,
4062 ) -> ::std::os::raw::c_int;
4063}
4064extern "C" {
4065 #[doc = "Move construct value.\n\n @param world The world.\n @param ti Type info of the value to move.\n @param dst Pointer to the storage to move to.\n @param src Pointer to the value to move.\n @return Zero if success, nonzero if failed."]
4066 pub fn ecs_value_move_ctor_w_type_info(
4067 world: *const ecs_world_t,
4068 ti: *const ecs_type_info_t,
4069 dst: *mut ::std::os::raw::c_void,
4070 src: *mut ::std::os::raw::c_void,
4071 ) -> ::std::os::raw::c_int;
4072}
4073extern "C" {
4074 #[doc = "Move construct value.\n\n @param world The world.\n @param type The type of the value to move.\n @param dst Pointer to the storage to move to.\n @param src Pointer to the value to move.\n @return Zero if success, nonzero if failed."]
4075 pub fn ecs_value_move_ctor(
4076 world: *const ecs_world_t,
4077 type_: ecs_entity_t,
4078 dst: *mut ::std::os::raw::c_void,
4079 src: *mut ::std::os::raw::c_void,
4080 ) -> ::std::os::raw::c_int;
4081}
4082extern "C" {
4083 #[doc = "Tracing"]
4084 pub fn ecs_deprecated_(
4085 file: *const ::std::os::raw::c_char,
4086 line: i32,
4087 msg: *const ::std::os::raw::c_char,
4088 );
4089}
4090extern "C" {
4091 #[doc = "Increase log stack.\n This operation increases the indent_ value of the OS API and can be useful to\n make nested behavior more visible.\n\n @param level The log level."]
4092 pub fn ecs_log_push_(level: i32);
4093}
4094extern "C" {
4095 #[doc = "Decrease log stack.\n This operation decreases the indent_ value of the OS API and can be useful to\n make nested behavior more visible.\n\n @param level The log level."]
4096 pub fn ecs_log_pop_(level: i32);
4097}
4098extern "C" {
4099 #[doc = "Should current level be logged.\n This operation returns true when the specified log level should be logged\n with the current log level.\n\n @param level The log level to check for.\n @return Whether logging is enabled for the current level."]
4100 pub fn ecs_should_log(level: i32) -> bool;
4101}
4102extern "C" {
4103 #[doc = "Get description for error code"]
4104 pub fn ecs_strerror(error_code: i32) -> *const ::std::os::raw::c_char;
4105}
4106extern "C" {
4107 #[doc = "Logging functions (do nothing when logging is enabled)"]
4108 pub fn ecs_print_(
4109 level: i32,
4110 file: *const ::std::os::raw::c_char,
4111 line: i32,
4112 fmt: *const ::std::os::raw::c_char,
4113 ...
4114 );
4115}
4116extern "C" {
4117 pub fn ecs_printv_(
4118 level: ::std::os::raw::c_int,
4119 file: *const ::std::os::raw::c_char,
4120 line: i32,
4121 fmt: *const ::std::os::raw::c_char,
4122 args: va_list,
4123 );
4124}
4125extern "C" {
4126 pub fn ecs_log_(
4127 level: i32,
4128 file: *const ::std::os::raw::c_char,
4129 line: i32,
4130 fmt: *const ::std::os::raw::c_char,
4131 ...
4132 );
4133}
4134extern "C" {
4135 pub fn ecs_logv_(
4136 level: ::std::os::raw::c_int,
4137 file: *const ::std::os::raw::c_char,
4138 line: i32,
4139 fmt: *const ::std::os::raw::c_char,
4140 args: va_list,
4141 );
4142}
4143extern "C" {
4144 pub fn ecs_abort_(
4145 error_code: i32,
4146 file: *const ::std::os::raw::c_char,
4147 line: i32,
4148 fmt: *const ::std::os::raw::c_char,
4149 ...
4150 );
4151}
4152extern "C" {
4153 pub fn ecs_assert_(
4154 condition: bool,
4155 error_code: i32,
4156 condition_str: *const ::std::os::raw::c_char,
4157 file: *const ::std::os::raw::c_char,
4158 line: i32,
4159 fmt: *const ::std::os::raw::c_char,
4160 ...
4161 ) -> bool;
4162}
4163extern "C" {
4164 pub fn ecs_parser_error_(
4165 name: *const ::std::os::raw::c_char,
4166 expr: *const ::std::os::raw::c_char,
4167 column: i64,
4168 fmt: *const ::std::os::raw::c_char,
4169 ...
4170 );
4171}
4172extern "C" {
4173 pub fn ecs_parser_errorv_(
4174 name: *const ::std::os::raw::c_char,
4175 expr: *const ::std::os::raw::c_char,
4176 column: i64,
4177 fmt: *const ::std::os::raw::c_char,
4178 args: va_list,
4179 );
4180}
4181extern "C" {
4182 #[doc = "Enable or disable log.\n This will enable builtin log. For log to work, it will have to be\n compiled in which requires defining one of the following macros:\n\n FLECS_LOG_0 - All log is disabled\n FLECS_LOG_1 - Enable log level 1\n FLECS_LOG_2 - Enable log level 2 and below\n FLECS_LOG_3 - Enable log level 3 and below\n\n If no log level is defined and this is a debug build, FLECS_LOG_3 will\n have been automatically defined.\n\n The provided level corresponds with the log level. If -1 is provided as\n value, warnings are disabled. If -2 is provided, errors are disabled as well.\n\n @param level Desired tracing level.\n @return Previous log level."]
4183 pub fn ecs_log_set_level(level: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
4184}
4185extern "C" {
4186 #[doc = "Get current log level.\n\n @return Previous log level."]
4187 pub fn ecs_log_get_level() -> ::std::os::raw::c_int;
4188}
4189extern "C" {
4190 #[doc = "Enable/disable tracing with colors.\n By default colors are enabled.\n\n @param enabled Whether to enable tracing with colors.\n @return Previous color setting."]
4191 pub fn ecs_log_enable_colors(enabled: bool) -> bool;
4192}
4193extern "C" {
4194 #[doc = "Enable/disable logging timestamp.\n By default timestamps are disabled. Note that enabling timestamps introduces\n overhead as the logging code will need to obtain the current time.\n\n @param enabled Whether to enable tracing with timestamps.\n @return Previous timestamp setting."]
4195 pub fn ecs_log_enable_timestamp(enabled: bool) -> bool;
4196}
4197extern "C" {
4198 #[doc = "Enable/disable logging time since last log.\n By default deltatime is disabled. Note that enabling timestamps introduces\n overhead as the logging code will need to obtain the current time.\n\n When enabled, this logs the amount of time in seconds passed since the last\n log, when this amount is non-zero. The format is a '+' character followed by\n the number of seconds:\n\n +1 trace: log message\n\n @param enabled Whether to enable tracing with timestamps.\n @return Previous timestamp setting."]
4199 pub fn ecs_log_enable_timedelta(enabled: bool) -> bool;
4200}
4201extern "C" {
4202 #[doc = "Get last logged error code.\n Calling this operation resets the error code.\n\n @return Last error, 0 if none was logged since last call to last_error."]
4203 pub fn ecs_log_last_error() -> ::std::os::raw::c_int;
4204}
4205#[doc = "Callback type for init action."]
4206pub type ecs_app_init_action_t =
4207 ::std::option::Option<unsafe extern "C" fn(world: *mut ecs_world_t) -> ::std::os::raw::c_int>;
4208#[doc = "Used with ecs_app_run."]
4209#[repr(C)]
4210#[derive(Debug, Copy, Clone)]
4211pub struct ecs_app_desc_t {
4212 #[doc = "< Target FPS."]
4213 pub target_fps: f32,
4214 #[doc = "< Frame time increment (0 for measured values)"]
4215 pub delta_time: f32,
4216 #[doc = "< Number of threads."]
4217 pub threads: i32,
4218 #[doc = "< Number of frames to run (0 for infinite)"]
4219 pub frames: i32,
4220 #[doc = "< Enables ECS access over HTTP, necessary for explorer"]
4221 pub enable_rest: bool,
4222 #[doc = "< Periodically collect statistics"]
4223 pub enable_monitor: bool,
4224 #[doc = "< HTTP port used by REST API"]
4225 pub port: u16,
4226 #[doc = "< If set, function is ran before starting the\n main loop."]
4227 pub init: ecs_app_init_action_t,
4228 #[doc = "< Reserved for custom run/frame actions"]
4229 pub ctx: *mut ::std::os::raw::c_void,
4230}
4231#[doc = "Callback type for run action."]
4232pub type ecs_app_run_action_t = ::std::option::Option<
4233 unsafe extern "C" fn(
4234 world: *mut ecs_world_t,
4235 desc: *mut ecs_app_desc_t,
4236 ) -> ::std::os::raw::c_int,
4237>;
4238#[doc = "Callback type for frame action."]
4239pub type ecs_app_frame_action_t = ::std::option::Option<
4240 unsafe extern "C" fn(
4241 world: *mut ecs_world_t,
4242 desc: *const ecs_app_desc_t,
4243 ) -> ::std::os::raw::c_int,
4244>;
4245extern "C" {
4246 #[doc = "Run application.\n This will run the application with the parameters specified in desc. After\n the application quits (ecs_quit is called) the world will be cleaned up.\n\n If a custom run action is set, it will be invoked by this operation. The\n default run action calls the frame action in a loop until it returns a\n non-zero value.\n\n @param world The world.\n @param desc Application parameters."]
4247 pub fn ecs_app_run(world: *mut ecs_world_t, desc: *mut ecs_app_desc_t)
4248 -> ::std::os::raw::c_int;
4249}
4250extern "C" {
4251 #[doc = "Default frame callback.\n This operation will run a single frame. By default this operation will invoke\n ecs_progress directly, unless a custom frame action is set.\n\n @param world The world.\n @param desc The desc struct passed to ecs_app_run.\n @return value returned by ecs_progress"]
4252 pub fn ecs_app_run_frame(
4253 world: *mut ecs_world_t,
4254 desc: *const ecs_app_desc_t,
4255 ) -> ::std::os::raw::c_int;
4256}
4257extern "C" {
4258 #[doc = "Set custom run action.\n See ecs_app_run.\n\n @param callback The run action."]
4259 pub fn ecs_app_set_run_action(callback: ecs_app_run_action_t) -> ::std::os::raw::c_int;
4260}
4261extern "C" {
4262 #[doc = "Set custom frame action.\n See ecs_app_run_frame.\n\n @param callback The frame action."]
4263 pub fn ecs_app_set_frame_action(callback: ecs_app_frame_action_t) -> ::std::os::raw::c_int;
4264}
4265#[repr(C)]
4266#[derive(Debug, Copy, Clone)]
4267pub struct ecs_http_server_t {
4268 _unused: [u8; 0],
4269}
4270#[doc = "A connection manages communication with the remote host"]
4271#[repr(C)]
4272#[derive(Debug, Copy, Clone)]
4273pub struct ecs_http_connection_t {
4274 pub id: u64,
4275 pub server: *mut ecs_http_server_t,
4276 pub host: [::std::os::raw::c_char; 128usize],
4277 pub port: [::std::os::raw::c_char; 16usize],
4278}
4279#[doc = "Helper type used for headers & URL query parameters"]
4280#[repr(C)]
4281#[derive(Debug, Copy, Clone)]
4282pub struct ecs_http_key_value_t {
4283 pub key: *const ::std::os::raw::c_char,
4284 pub value: *const ::std::os::raw::c_char,
4285}
4286pub const ecs_http_method_t_EcsHttpGet: ecs_http_method_t = 0;
4287pub const ecs_http_method_t_EcsHttpPost: ecs_http_method_t = 1;
4288pub const ecs_http_method_t_EcsHttpPut: ecs_http_method_t = 2;
4289pub const ecs_http_method_t_EcsHttpDelete: ecs_http_method_t = 3;
4290pub const ecs_http_method_t_EcsHttpOptions: ecs_http_method_t = 4;
4291pub const ecs_http_method_t_EcsHttpMethodUnsupported: ecs_http_method_t = 5;
4292#[doc = "Supported request methods"]
4293pub type ecs_http_method_t = ::std::os::raw::c_uint;
4294#[doc = "A request"]
4295#[repr(C)]
4296#[derive(Debug, Copy, Clone)]
4297pub struct ecs_http_request_t {
4298 pub id: u64,
4299 pub method: ecs_http_method_t,
4300 pub path: *mut ::std::os::raw::c_char,
4301 pub body: *mut ::std::os::raw::c_char,
4302 pub headers: [ecs_http_key_value_t; 32usize],
4303 pub params: [ecs_http_key_value_t; 32usize],
4304 pub header_count: i32,
4305 pub param_count: i32,
4306 pub conn: *mut ecs_http_connection_t,
4307}
4308#[doc = "A reply"]
4309#[repr(C)]
4310#[derive(Debug, Copy, Clone)]
4311pub struct ecs_http_reply_t {
4312 #[doc = "< default = 200"]
4313 pub code: ::std::os::raw::c_int,
4314 #[doc = "< default = \"\""]
4315 pub body: ecs_strbuf_t,
4316 #[doc = "< default = OK"]
4317 pub status: *const ::std::os::raw::c_char,
4318 #[doc = "< default = application/json"]
4319 pub content_type: *const ::std::os::raw::c_char,
4320 #[doc = "< default = \"\""]
4321 pub headers: ecs_strbuf_t,
4322}
4323extern "C" {
4324 #[doc = "Global statistics."]
4325 pub static mut ecs_http_request_received_count: i64;
4326}
4327extern "C" {
4328 pub static mut ecs_http_request_invalid_count: i64;
4329}
4330extern "C" {
4331 pub static mut ecs_http_request_handled_ok_count: i64;
4332}
4333extern "C" {
4334 pub static mut ecs_http_request_handled_error_count: i64;
4335}
4336extern "C" {
4337 pub static mut ecs_http_request_not_handled_count: i64;
4338}
4339extern "C" {
4340 pub static mut ecs_http_request_preflight_count: i64;
4341}
4342extern "C" {
4343 pub static mut ecs_http_send_ok_count: i64;
4344}
4345extern "C" {
4346 pub static mut ecs_http_send_error_count: i64;
4347}
4348extern "C" {
4349 pub static mut ecs_http_busy_count: i64;
4350}
4351#[doc = "Request callback.\n Invoked for each valid request. The function should populate the reply and\n return true. When the function returns false, the server will reply with a\n 404 (Not found) code."]
4352pub type ecs_http_reply_action_t = ::std::option::Option<
4353 unsafe extern "C" fn(
4354 request: *const ecs_http_request_t,
4355 reply: *mut ecs_http_reply_t,
4356 ctx: *mut ::std::os::raw::c_void,
4357 ) -> bool,
4358>;
4359#[doc = "Used with ecs_http_server_init."]
4360#[repr(C)]
4361#[derive(Debug, Copy, Clone)]
4362pub struct ecs_http_server_desc_t {
4363 #[doc = "< Function called for each request"]
4364 pub callback: ecs_http_reply_action_t,
4365 #[doc = "< Passed to callback (optional)"]
4366 pub ctx: *mut ::std::os::raw::c_void,
4367 #[doc = "< HTTP port"]
4368 pub port: u16,
4369 #[doc = "< Interface to listen on (optional)"]
4370 pub ipaddr: *const ::std::os::raw::c_char,
4371 #[doc = "< Send queue wait time when empty"]
4372 pub send_queue_wait_ms: i32,
4373}
4374extern "C" {
4375 #[doc = "Create server.\n Use ecs_http_server_start to start receiving requests.\n\n @param desc Server configuration parameters.\n @return The new server, or NULL if creation failed."]
4376 pub fn ecs_http_server_init(desc: *const ecs_http_server_desc_t) -> *mut ecs_http_server_t;
4377}
4378extern "C" {
4379 #[doc = "Destroy server.\n This operation will stop the server if it was still running.\n\n @param server The server to destroy."]
4380 pub fn ecs_http_server_fini(server: *mut ecs_http_server_t);
4381}
4382extern "C" {
4383 #[doc = "Start server.\n After this operation the server will be able to accept requests.\n\n @param server The server to start.\n @return Zero if successful, non-zero if failed."]
4384 pub fn ecs_http_server_start(server: *mut ecs_http_server_t) -> ::std::os::raw::c_int;
4385}
4386extern "C" {
4387 #[doc = "Process server requests.\n This operation invokes the reply callback for each received request. No new\n requests will be enqueued while processing requests.\n\n @param server The server for which to process requests."]
4388 pub fn ecs_http_server_dequeue(server: *mut ecs_http_server_t, delta_time: f32);
4389}
4390extern "C" {
4391 #[doc = "Stop server.\n After this operation no new requests can be received.\n\n @param server The server."]
4392 pub fn ecs_http_server_stop(server: *mut ecs_http_server_t);
4393}
4394extern "C" {
4395 #[doc = "Emulate a request.\n The request string must be a valid HTTP request. A minimal example:\n GET /entity/flecs/core/World?label=true HTTP/1.1\n\n @param srv The server.\n @param req The request.\n @param len The length of the request (optional).\n @return The reply."]
4396 pub fn ecs_http_server_http_request(
4397 srv: *mut ecs_http_server_t,
4398 req: *const ::std::os::raw::c_char,
4399 len: ecs_size_t,
4400 reply_out: *mut ecs_http_reply_t,
4401 ) -> ::std::os::raw::c_int;
4402}
4403extern "C" {
4404 #[doc = "Convenience wrapper around ecs_http_server_request."]
4405 pub fn ecs_http_server_request(
4406 srv: *mut ecs_http_server_t,
4407 method: *const ::std::os::raw::c_char,
4408 req: *const ::std::os::raw::c_char,
4409 reply_out: *mut ecs_http_reply_t,
4410 ) -> ::std::os::raw::c_int;
4411}
4412extern "C" {
4413 #[doc = "Get context provided in ecs_http_server_desc_t"]
4414 pub fn ecs_http_server_ctx(srv: *mut ecs_http_server_t) -> *mut ::std::os::raw::c_void;
4415}
4416extern "C" {
4417 #[doc = "Find header in request.\n\n @param req The request.\n @param name name of the header to find\n @return The header value, or NULL if not found."]
4418 pub fn ecs_http_get_header(
4419 req: *const ecs_http_request_t,
4420 name: *const ::std::os::raw::c_char,
4421 ) -> *const ::std::os::raw::c_char;
4422}
4423extern "C" {
4424 #[doc = "Find query parameter in request.\n\n @param req The request.\n @param name The parameter name.\n @return The decoded parameter value, or NULL if not found."]
4425 pub fn ecs_http_get_param(
4426 req: *const ecs_http_request_t,
4427 name: *const ::std::os::raw::c_char,
4428 ) -> *const ::std::os::raw::c_char;
4429}
4430extern "C" {
4431 pub static FLECS_IDEcsRestID_: ecs_entity_t;
4432}
4433#[repr(C)]
4434#[derive(Debug, Copy, Clone)]
4435pub struct EcsRest {
4436 #[doc = "< Port of server (optional, default = 27750)"]
4437 pub port: u16,
4438 #[doc = "< Interface address (optional, default = 0.0.0.0)"]
4439 pub ipaddr: *mut ::std::os::raw::c_char,
4440 pub impl_: *mut ::std::os::raw::c_void,
4441}
4442extern "C" {
4443 #[doc = "Global statistics"]
4444 pub static mut ecs_rest_request_count: i64;
4445}
4446extern "C" {
4447 pub static mut ecs_rest_entity_count: i64;
4448}
4449extern "C" {
4450 pub static mut ecs_rest_entity_error_count: i64;
4451}
4452extern "C" {
4453 pub static mut ecs_rest_query_count: i64;
4454}
4455extern "C" {
4456 pub static mut ecs_rest_query_error_count: i64;
4457}
4458extern "C" {
4459 pub static mut ecs_rest_query_name_count: i64;
4460}
4461extern "C" {
4462 pub static mut ecs_rest_query_name_error_count: i64;
4463}
4464extern "C" {
4465 pub static mut ecs_rest_query_name_from_cache_count: i64;
4466}
4467extern "C" {
4468 pub static mut ecs_rest_enable_count: i64;
4469}
4470extern "C" {
4471 pub static mut ecs_rest_enable_error_count: i64;
4472}
4473extern "C" {
4474 pub static mut ecs_rest_delete_count: i64;
4475}
4476extern "C" {
4477 pub static mut ecs_rest_delete_error_count: i64;
4478}
4479extern "C" {
4480 pub static mut ecs_rest_world_stats_count: i64;
4481}
4482extern "C" {
4483 pub static mut ecs_rest_pipeline_stats_count: i64;
4484}
4485extern "C" {
4486 pub static mut ecs_rest_stats_error_count: i64;
4487}
4488extern "C" {
4489 #[doc = "Create HTTP server for REST API.\n This allows for the creation of a REST server that can be managed by the\n application without using Flecs systems.\n\n @param world The world.\n @param desc The HTTP server descriptor.\n @return The HTTP server, or NULL if failed."]
4490 pub fn ecs_rest_server_init(
4491 world: *mut ecs_world_t,
4492 desc: *const ecs_http_server_desc_t,
4493 ) -> *mut ecs_http_server_t;
4494}
4495extern "C" {
4496 #[doc = "Cleanup REST HTTP server.\n The server must have been created with ecs_rest_server_init."]
4497 pub fn ecs_rest_server_fini(srv: *mut ecs_http_server_t);
4498}
4499extern "C" {
4500 #[doc = "Module import"]
4501 pub fn FlecsRestImport(world: *mut ecs_world_t);
4502}
4503#[doc = "Component used for one shot/interval timer functionality"]
4504#[repr(C)]
4505#[derive(Debug, Copy, Clone)]
4506pub struct EcsTimer {
4507 #[doc = "< Timer timeout period"]
4508 pub timeout: f32,
4509 #[doc = "< Incrementing time value"]
4510 pub time: f32,
4511 #[doc = "< Used to correct returned interval time"]
4512 pub overshoot: f32,
4513 #[doc = "< Number of times ticked"]
4514 pub fired_count: i32,
4515 #[doc = "< Is the timer active or not"]
4516 pub active: bool,
4517 #[doc = "< Is this a single shot timer"]
4518 pub single_shot: bool,
4519}
4520#[doc = "Apply a rate filter to a tick source"]
4521#[repr(C)]
4522#[derive(Debug, Copy, Clone)]
4523pub struct EcsRateFilter {
4524 #[doc = "< Source of the rate filter"]
4525 pub src: ecs_entity_t,
4526 #[doc = "< Rate of the rate filter"]
4527 pub rate: i32,
4528 #[doc = "< Number of times the rate filter ticked"]
4529 pub tick_count: i32,
4530 #[doc = "< Time elapsed since last tick"]
4531 pub time_elapsed: f32,
4532}
4533extern "C" {
4534 #[doc = "Set timer timeout.\n This operation executes any systems associated with the timer after the\n specified timeout value. If the entity contains an existing timer, the\n timeout value will be reset. The timer can be started and stopped with\n ecs_start_timer and ecs_stop_timer.\n\n The timer is synchronous, and is incremented each frame by delta_time.\n\n The tick_source entity will be a tick source after this operation. Tick\n sources can be read by getting the EcsTickSource component. If the tick\n source ticked this frame, the 'tick' member will be true. When the tick\n source is a system, the system will tick when the timer ticks.\n\n @param world The world.\n @param tick_source The timer for which to set the timeout (0 to create one).\n @param timeout The timeout value.\n @return The timer entity."]
4535 pub fn ecs_set_timeout(
4536 world: *mut ecs_world_t,
4537 tick_source: ecs_entity_t,
4538 timeout: f32,
4539 ) -> ecs_entity_t;
4540}
4541extern "C" {
4542 #[doc = "Get current timeout value for the specified timer.\n This operation returns the value set by ecs_set_timeout. If no timer is\n active for this entity, the operation returns 0.\n\n After the timeout expires the EcsTimer component is removed from the entity.\n This means that if ecs_get_timeout is invoked after the timer is expired, the\n operation will return 0.\n\n The timer is synchronous, and is incremented each frame by delta_time.\n\n The tick_source entity will be a tick source after this operation. Tick\n sources can be read by getting the EcsTickSource component. If the tick\n source ticked this frame, the 'tick' member will be true. When the tick\n source is a system, the system will tick when the timer ticks.\n\n @param world The world.\n @param tick_source The timer.\n @return The current timeout value, or 0 if no timer is active."]
4543 pub fn ecs_get_timeout(world: *const ecs_world_t, tick_source: ecs_entity_t) -> f32;
4544}
4545extern "C" {
4546 #[doc = "Set timer interval.\n This operation will continously invoke systems associated with the timer\n after the interval period expires. If the entity contains an existing timer,\n the interval value will be reset.\n\n The timer is synchronous, and is incremented each frame by delta_time.\n\n The tick_source entity will be a tick source after this operation. Tick\n sources can be read by getting the EcsTickSource component. If the tick\n source ticked this frame, the 'tick' member will be true. When the tick\n source is a system, the system will tick when the timer ticks.\n\n @param world The world.\n @param tick_source The timer for which to set the interval (0 to create one).\n @param interval The interval value.\n @return The timer entity."]
4547 pub fn ecs_set_interval(
4548 world: *mut ecs_world_t,
4549 tick_source: ecs_entity_t,
4550 interval: f32,
4551 ) -> ecs_entity_t;
4552}
4553extern "C" {
4554 #[doc = "Get current interval value for the specified timer.\n This operation returns the value set by ecs_set_interval. If the entity is\n not a timer, the operation will return 0.\n\n @param world The world.\n @param tick_source The timer for which to set the interval.\n @return The current interval value, or 0 if no timer is active."]
4555 pub fn ecs_get_interval(world: *const ecs_world_t, tick_source: ecs_entity_t) -> f32;
4556}
4557extern "C" {
4558 #[doc = "Start timer.\n This operation resets the timer and starts it with the specified timeout.\n\n @param world The world.\n @param tick_source The timer to start."]
4559 pub fn ecs_start_timer(world: *mut ecs_world_t, tick_source: ecs_entity_t);
4560}
4561extern "C" {
4562 #[doc = "Stop timer\n This operation stops a timer from triggering.\n\n @param world The world.\n @param tick_source The timer to stop."]
4563 pub fn ecs_stop_timer(world: *mut ecs_world_t, tick_source: ecs_entity_t);
4564}
4565extern "C" {
4566 #[doc = "Reset time value of timer to 0.\n This operation resets the timer value to 0.\n\n @param world The world.\n @param tick_source The timer to reset."]
4567 pub fn ecs_reset_timer(world: *mut ecs_world_t, tick_source: ecs_entity_t);
4568}
4569extern "C" {
4570 #[doc = "Enable randomizing initial time value of timers.\n Intializes timers with a random time value, which can improve scheduling as\n systems/timers for the same interval don't all happen on the same tick.\n\n @param world The world."]
4571 pub fn ecs_randomize_timers(world: *mut ecs_world_t);
4572}
4573extern "C" {
4574 #[doc = "Set rate filter.\n This operation initializes a rate filter. Rate filters sample tick sources\n and tick at a configurable multiple. A rate filter is a tick source itself,\n which means that rate filters can be chained.\n\n Rate filters enable deterministic system execution which cannot be achieved\n with interval timers alone. For example, if timer A has interval 2.0 and\n timer B has interval 4.0, it is not guaranteed that B will tick at exactly\n twice the multiple of A. This is partly due to the indeterministic nature of\n timers, and partly due to floating point rounding errors.\n\n Rate filters can be combined with timers (or other rate filters) to ensure\n that a system ticks at an exact multiple of a tick source (which can be\n another system). If a rate filter is created with a rate of 1 it will tick\n at the exact same time as its source.\n\n If no tick source is provided, the rate filter will use the frame tick as\n source, which corresponds with the number of times ecs_progress is called.\n\n The tick_source entity will be a tick source after this operation. Tick\n sources can be read by getting the EcsTickSource component. If the tick\n source ticked this frame, the 'tick' member will be true. When the tick\n source is a system, the system will tick when the timer ticks.\n\n @param world The world.\n @param tick_source The rate filter entity (0 to create one).\n @param rate The rate to apply.\n @param source The tick source (0 to use frames)\n @return The filter entity."]
4575 pub fn ecs_set_rate(
4576 world: *mut ecs_world_t,
4577 tick_source: ecs_entity_t,
4578 rate: i32,
4579 source: ecs_entity_t,
4580 ) -> ecs_entity_t;
4581}
4582extern "C" {
4583 #[doc = "Assign tick source to system.\n Systems can be their own tick source, which can be any of the tick sources\n (one shot timers, interval times and rate filters). However, in some cases it\n is must be guaranteed that different systems tick on the exact same frame.\n\n This cannot be guaranteed by giving two systems the same interval/rate filter\n as it is possible that one system is (for example) disabled, which would\n cause the systems to go out of sync. To provide these guarantees, systems\n must use the same tick source, which is what this operation enables.\n\n When two systems share the same tick source, it is guaranteed that they tick\n in the same frame. The provided tick source can be any entity that is a tick\n source, including another system. If the provided entity is not a tick source\n the system will not be ran.\n\n To disassociate a tick source from a system, use 0 for the tick_source\n parameter.\n\n @param world The world.\n @param system The system to associate with the timer.\n @param tick_source The tick source to associate with the system."]
4584 pub fn ecs_set_tick_source(
4585 world: *mut ecs_world_t,
4586 system: ecs_entity_t,
4587 tick_source: ecs_entity_t,
4588 );
4589}
4590extern "C" {
4591 #[doc = "Module"]
4592 pub fn FlecsTimerImport(world: *mut ecs_world_t);
4593}
4594#[doc = "Pipeline descriptor (used with ecs_pipeline_init)"]
4595#[repr(C)]
4596#[derive(Debug, Copy, Clone)]
4597pub struct ecs_pipeline_desc_t {
4598 #[doc = "Existing entity to associate with pipeline (optional)"]
4599 pub entity: ecs_entity_t,
4600 #[doc = "Query descriptor. The first term of the query must match the EcsSystem\n component."]
4601 pub query: ecs_query_desc_t,
4602}
4603extern "C" {
4604 #[doc = "Create a custom pipeline."]
4605 pub fn ecs_pipeline_init(
4606 world: *mut ecs_world_t,
4607 desc: *const ecs_pipeline_desc_t,
4608 ) -> ecs_entity_t;
4609}
4610extern "C" {
4611 #[doc = "Set a custom pipeline.\n This operation sets the pipeline to run when ecs_progress is invoked.\n\n @param world The world.\n @param pipeline The pipeline to set."]
4612 pub fn ecs_set_pipeline(world: *mut ecs_world_t, pipeline: ecs_entity_t);
4613}
4614extern "C" {
4615 #[doc = "Get the current pipeline.\n This operation gets the current pipeline.\n\n @param world The world.\n @return The current pipeline."]
4616 pub fn ecs_get_pipeline(world: *const ecs_world_t) -> ecs_entity_t;
4617}
4618extern "C" {
4619 #[doc = "Progress a world.\n This operation progresses the world by running all systems that are both\n enabled and periodic on their matching entities.\n\n An application can pass a delta_time into the function, which is the time\n passed since the last frame. This value is passed to systems so they can\n update entity values proportional to the elapsed time since their last\n invocation.\n\n When an application passes 0 to delta_time, ecs_progress will automatically\n measure the time passed since the last frame. If an application does not uses\n time management, it should pass a non-zero value for delta_time (1.0 is\n recommended). That way, no time will be wasted measuring the time.\n\n @param world The world to progress.\n @param delta_time The time passed since the last frame.\n @return false if ecs_quit has been called, true otherwise."]
4620 pub fn ecs_progress(world: *mut ecs_world_t, delta_time: f32) -> bool;
4621}
4622extern "C" {
4623 #[doc = "Set time scale.\n Increase or decrease simulation speed by the provided multiplier.\n\n @param world The world.\n @param scale The scale to apply (default = 1)."]
4624 pub fn ecs_set_time_scale(world: *mut ecs_world_t, scale: f32);
4625}
4626extern "C" {
4627 #[doc = "Reset world clock.\n Reset the clock that keeps track of the total time passed in the simulation.\n\n @param world The world."]
4628 pub fn ecs_reset_clock(world: *mut ecs_world_t);
4629}
4630extern "C" {
4631 #[doc = "Run pipeline.\n This will run all systems in the provided pipeline. This operation may be\n invoked from multiple threads, and only when staging is disabled, as the\n pipeline manages staging and, if necessary, synchronization between threads.\n\n If 0 is provided for the pipeline id, the default pipeline will be ran (this\n is either the builtin pipeline or the pipeline set with set_pipeline()).\n\n When using progress() this operation will be invoked automatically for the\n default pipeline (either the builtin pipeline or the pipeline set with\n set_pipeline()). An application may run additional pipelines.\n\n @param world The world.\n @param pipeline The pipeline to run."]
4632 pub fn ecs_run_pipeline(world: *mut ecs_world_t, pipeline: ecs_entity_t, delta_time: f32);
4633}
4634extern "C" {
4635 #[doc = "Set number of worker threads.\n Setting this value to a value higher than 1 will start as many threads and\n will cause systems to evenly distribute matched entities across threads. The\n operation may be called multiple times to reconfigure the number of threads\n used, but never while running a system / pipeline.\n Calling ecs_set_threads will also end the use of task threads setup with\n ecs_set_task_threads and vice-versa"]
4636 pub fn ecs_set_threads(world: *mut ecs_world_t, threads: i32);
4637}
4638extern "C" {
4639 #[doc = "Set number of worker task threads.\n ecs_set_task_threads is similar to ecs_set_threads, except threads are treated\n as short-lived tasks and will be created and joined around each update of the world.\n Creation and joining of these tasks will use the os_api_t tasks APIs rather than the\n the standard thread API functions, although they may be the same if desired.\n This function is useful for multithreading world updates using an external\n asynchronous job system rather than long running threads by providing the APIs\n to create tasks for your job system and then wait on their conclusion.\n The operation may be called multiple times to reconfigure the number of task threads\n used, but never while running a system / pipeline.\n Calling ecs_set_task_threads will also end the use of threads setup with\n ecs_set_threads and vice-versa"]
4640 pub fn ecs_set_task_threads(world: *mut ecs_world_t, task_threads: i32);
4641}
4642extern "C" {
4643 #[doc = "Returns true if task thread use have been requested."]
4644 pub fn ecs_using_task_threads(world: *mut ecs_world_t) -> bool;
4645}
4646extern "C" {
4647 #[doc = "Module"]
4648 pub fn FlecsPipelineImport(world: *mut ecs_world_t);
4649}
4650#[doc = "Component used to provide a tick source to systems"]
4651#[repr(C)]
4652#[derive(Debug, Copy, Clone)]
4653pub struct EcsTickSource {
4654 #[doc = "< True if providing tick"]
4655 pub tick: bool,
4656 #[doc = "< Time elapsed since last tick"]
4657 pub time_elapsed: f32,
4658}
4659#[doc = "Use with ecs_system_init"]
4660#[repr(C)]
4661#[derive(Debug, Copy, Clone)]
4662pub struct ecs_system_desc_t {
4663 pub _canary: i32,
4664 #[doc = "Existing entity to associate with system (optional)"]
4665 pub entity: ecs_entity_t,
4666 #[doc = "System query parameters"]
4667 pub query: ecs_query_desc_t,
4668 #[doc = "Callback that is invoked when a system is ran.\n When left to NULL, the default system runner is used, which calls the\n \"callback\" action for each result returned from the system's query.\n\n It should not be assumed that the input iterator can always be iterated\n with ecs_query_next. When a system is multithreaded and/or paged, the\n iterator can be either a worker or paged iterator. Future use cases may\n introduce additional inputs for a system, such as rules and filters. The\n correct function to use for iteration is ecs_iter_next.\n\n An implementation can test whether the iterator is a query iterator by\n testing whether the it->next value is equal to ecs_query_next."]
4669 pub run: ecs_run_action_t,
4670 #[doc = "Callback that is ran for each result returned by the system's query. This\n means that this callback can be invoked multiple times per system per\n frame, typically once for each matching table."]
4671 pub callback: ecs_iter_action_t,
4672 #[doc = "Context to be passed to callback (as ecs_iter_t::param)"]
4673 pub ctx: *mut ::std::os::raw::c_void,
4674 #[doc = "Binding context, for when system is implemented in other language"]
4675 pub binding_ctx: *mut ::std::os::raw::c_void,
4676 #[doc = "Functions that are invoked during system cleanup to free context data.\n When set, functions are called unconditionally, even when the ctx\n pointers are NULL."]
4677 pub ctx_free: ecs_ctx_free_t,
4678 pub binding_ctx_free: ecs_ctx_free_t,
4679 #[doc = "Interval in seconds at which the system should run"]
4680 pub interval: f32,
4681 #[doc = "Rate at which the system should run"]
4682 pub rate: i32,
4683 #[doc = "External tick soutce that determines when system ticks"]
4684 pub tick_source: ecs_entity_t,
4685 #[doc = "If true, system will be ran on multiple threads"]
4686 pub multi_threaded: bool,
4687 #[doc = "If true, system will have access to actuall world. Cannot be true at the\n same time as multi_threaded."]
4688 pub no_readonly: bool,
4689}
4690extern "C" {
4691 #[doc = "Create a system"]
4692 pub fn ecs_system_init(world: *mut ecs_world_t, desc: *const ecs_system_desc_t)
4693 -> ecs_entity_t;
4694}
4695extern "C" {
4696 #[doc = "Run a specific system manually.\n This operation runs a single system manually. It is an efficient way to\n invoke logic on a set of entities, as manual systems are only matched to\n tables at creation time or after creation time, when a new table is created.\n\n Manual systems are useful to evaluate lists of prematched entities at\n application defined times. Because none of the matching logic is evaluated\n before the system is invoked, manual systems are much more efficient than\n manually obtaining a list of entities and retrieving their components.\n\n An application may pass custom data to a system through the param parameter.\n This data can be accessed by the system through the param member in the\n ecs_iter_t value that is passed to the system callback.\n\n Any system may interrupt execution by setting the interrupted_by member in\n the ecs_iter_t value. This is particularly useful for manual systems, where\n the value of interrupted_by is returned by this operation. This, in\n combination with the param argument lets applications use manual systems\n to lookup entities: once the entity has been found its handle is passed to\n interrupted_by, which is then subsequently returned.\n\n @param world The world.\n @param system The system to run.\n @param delta_time The time passed since the last system invocation.\n @param param A user-defined parameter to pass to the system.\n @return handle to last evaluated entity if system was interrupted."]
4697 pub fn ecs_run(
4698 world: *mut ecs_world_t,
4699 system: ecs_entity_t,
4700 delta_time: f32,
4701 param: *mut ::std::os::raw::c_void,
4702 ) -> ecs_entity_t;
4703}
4704extern "C" {
4705 #[doc = "Same as ecs_run, but subdivides entities across number of provided stages.\n\n @param world The world.\n @param system The system to run.\n @param stage_current The id of the current stage.\n @param stage_count The total number of stages.\n @param delta_time The time passed since the last system invocation.\n @param param A user-defined parameter to pass to the system.\n @return handle to last evaluated entity if system was interrupted."]
4706 pub fn ecs_run_worker(
4707 world: *mut ecs_world_t,
4708 system: ecs_entity_t,
4709 stage_current: i32,
4710 stage_count: i32,
4711 delta_time: f32,
4712 param: *mut ::std::os::raw::c_void,
4713 ) -> ecs_entity_t;
4714}
4715extern "C" {
4716 #[doc = "Run system with offset/limit and type filter.\n This operation is the same as ecs_run, but filters the entities that will be\n iterated by the system.\n\n Entities can be filtered in two ways. Offset and limit control the range of\n entities that is iterated over. The range is applied to all entities matched\n with the system, thus may cover multiple archetypes.\n\n The type filter controls which entity types the system will evaluate. Only\n types that contain all components in the type filter will be iterated over. A\n type filter is only evaluated once per table, which makes filtering cheap if\n the number of entities is large and the number of tables is small, but not as\n cheap as filtering in the system signature.\n\n @param world The world.\n @param system The system to invoke.\n @param delta_time The time passed since the last system invocation.\n @param param A user-defined parameter to pass to the system.\n @return handle to last evaluated entity if system was interrupted."]
4717 pub fn ecs_run_w_filter(
4718 world: *mut ecs_world_t,
4719 system: ecs_entity_t,
4720 delta_time: f32,
4721 offset: i32,
4722 limit: i32,
4723 param: *mut ::std::os::raw::c_void,
4724 ) -> ecs_entity_t;
4725}
4726extern "C" {
4727 #[doc = "Get the query object for a system.\n Systems use queries under the hood. This enables an application to get access\n to the underlying query object of a system. This can be useful when, for\n example, an application needs to enable sorting for a system.\n\n @param world The world.\n @param system The system from which to obtain the query.\n @return The query."]
4728 pub fn ecs_system_get_query(
4729 world: *const ecs_world_t,
4730 system: ecs_entity_t,
4731 ) -> *mut ecs_query_t;
4732}
4733extern "C" {
4734 #[doc = "Get system context.\n This operation returns the context pointer set for the system. If\n the provided entity is not a system, the function will return NULL.\n\n @param world The world.\n @param system The system from which to obtain the context.\n @return The context."]
4735 pub fn ecs_system_get_ctx(
4736 world: *const ecs_world_t,
4737 system: ecs_entity_t,
4738 ) -> *mut ::std::os::raw::c_void;
4739}
4740extern "C" {
4741 #[doc = "Get system binding context.\n The binding context is a context typically used to attach any language\n binding specific data that is needed when invoking a callback that is\n implemented in another language.\n\n @param world The world.\n @param system The system from which to obtain the context.\n @return The context."]
4742 pub fn ecs_system_get_binding_ctx(
4743 world: *const ecs_world_t,
4744 system: ecs_entity_t,
4745 ) -> *mut ::std::os::raw::c_void;
4746}
4747extern "C" {
4748 pub fn FlecsSystemImport(world: *mut ecs_world_t);
4749}
4750#[doc = "Simple value that indicates current state"]
4751#[repr(C)]
4752#[derive(Debug, Copy, Clone)]
4753pub struct ecs_gauge_t {
4754 pub avg: [f32; 60usize],
4755 pub min: [f32; 60usize],
4756 pub max: [f32; 60usize],
4757}
4758#[doc = "Monotonically increasing counter"]
4759#[repr(C)]
4760#[derive(Debug, Copy, Clone)]
4761pub struct ecs_counter_t {
4762 #[doc = "< Keep track of deltas too"]
4763 pub rate: ecs_gauge_t,
4764 pub value: [f64; 60usize],
4765}
4766#[doc = "Make all metrics the same size, so we can iterate over fields"]
4767#[repr(C)]
4768#[derive(Copy, Clone)]
4769pub union ecs_metric_t {
4770 pub gauge: ecs_gauge_t,
4771 pub counter: ecs_counter_t,
4772}
4773#[repr(C)]
4774#[derive(Copy, Clone)]
4775pub struct ecs_world_stats_t {
4776 pub first_: i64,
4777 pub entities: ecs_world_stats_t__bindgen_ty_1,
4778 pub ids: ecs_world_stats_t__bindgen_ty_2,
4779 pub tables: ecs_world_stats_t__bindgen_ty_3,
4780 pub queries: ecs_world_stats_t__bindgen_ty_4,
4781 pub commands: ecs_world_stats_t__bindgen_ty_5,
4782 pub frame: ecs_world_stats_t__bindgen_ty_6,
4783 pub performance: ecs_world_stats_t__bindgen_ty_7,
4784 pub memory: ecs_world_stats_t__bindgen_ty_8,
4785 pub rest: ecs_world_stats_t__bindgen_ty_9,
4786 pub http: ecs_world_stats_t__bindgen_ty_10,
4787 pub last_: i64,
4788 #[doc = "Current position in ringbuffer"]
4789 pub t: i32,
4790}
4791#[doc = "Entities"]
4792#[repr(C)]
4793#[derive(Copy, Clone)]
4794pub struct ecs_world_stats_t__bindgen_ty_1 {
4795 #[doc = "< Number of entities"]
4796 pub count: ecs_metric_t,
4797 #[doc = "< Number of not alive (recyclable) entity ids"]
4798 pub not_alive_count: ecs_metric_t,
4799}
4800#[doc = "Components and ids"]
4801#[repr(C)]
4802#[derive(Copy, Clone)]
4803pub struct ecs_world_stats_t__bindgen_ty_2 {
4804 #[doc = "< Number of ids (excluding wildcards)"]
4805 pub count: ecs_metric_t,
4806 #[doc = "< Number of tag ids (ids without data)"]
4807 pub tag_count: ecs_metric_t,
4808 #[doc = "< Number of components ids (ids with data)"]
4809 pub component_count: ecs_metric_t,
4810 #[doc = "< Number of pair ids"]
4811 pub pair_count: ecs_metric_t,
4812 #[doc = "< Number of wildcard ids"]
4813 pub wildcard_count: ecs_metric_t,
4814 #[doc = "< Number of registered types"]
4815 pub type_count: ecs_metric_t,
4816 #[doc = "< Number of times id has been created"]
4817 pub create_count: ecs_metric_t,
4818 #[doc = "< Number of times id has been deleted"]
4819 pub delete_count: ecs_metric_t,
4820}
4821#[doc = "Tables"]
4822#[repr(C)]
4823#[derive(Copy, Clone)]
4824pub struct ecs_world_stats_t__bindgen_ty_3 {
4825 #[doc = "< Number of tables"]
4826 pub count: ecs_metric_t,
4827 #[doc = "< Number of empty tables"]
4828 pub empty_count: ecs_metric_t,
4829 #[doc = "< Number of tables with only tags"]
4830 pub tag_only_count: ecs_metric_t,
4831 #[doc = "< Number of tables with only trivial components"]
4832 pub trivial_only_count: ecs_metric_t,
4833 #[doc = "< Number of table cache records"]
4834 pub record_count: ecs_metric_t,
4835 #[doc = "< Number of table storages"]
4836 pub storage_count: ecs_metric_t,
4837 #[doc = "< Number of times table has been created"]
4838 pub create_count: ecs_metric_t,
4839 #[doc = "< Number of times table has been deleted"]
4840 pub delete_count: ecs_metric_t,
4841}
4842#[doc = "Queries & events"]
4843#[repr(C)]
4844#[derive(Copy, Clone)]
4845pub struct ecs_world_stats_t__bindgen_ty_4 {
4846 #[doc = "< Number of queries"]
4847 pub query_count: ecs_metric_t,
4848 #[doc = "< Number of observers"]
4849 pub observer_count: ecs_metric_t,
4850 #[doc = "< Number of systems"]
4851 pub system_count: ecs_metric_t,
4852}
4853#[doc = "Commands"]
4854#[repr(C)]
4855#[derive(Copy, Clone)]
4856pub struct ecs_world_stats_t__bindgen_ty_5 {
4857 pub add_count: ecs_metric_t,
4858 pub remove_count: ecs_metric_t,
4859 pub delete_count: ecs_metric_t,
4860 pub clear_count: ecs_metric_t,
4861 pub set_count: ecs_metric_t,
4862 pub get_mut_count: ecs_metric_t,
4863 pub modified_count: ecs_metric_t,
4864 pub other_count: ecs_metric_t,
4865 pub discard_count: ecs_metric_t,
4866 pub batched_entity_count: ecs_metric_t,
4867 pub batched_count: ecs_metric_t,
4868}
4869#[doc = "Frame data"]
4870#[repr(C)]
4871#[derive(Copy, Clone)]
4872pub struct ecs_world_stats_t__bindgen_ty_6 {
4873 #[doc = "< Number of frames processed."]
4874 pub frame_count: ecs_metric_t,
4875 #[doc = "< Number of merges executed."]
4876 pub merge_count: ecs_metric_t,
4877 #[doc = "< Number of query rematches"]
4878 pub rematch_count: ecs_metric_t,
4879 #[doc = "< Number of system pipeline rebuilds (occurs when an inactive system becomes active)."]
4880 pub pipeline_build_count: ecs_metric_t,
4881 #[doc = "< Number of systems ran."]
4882 pub systems_ran: ecs_metric_t,
4883 #[doc = "< Number of times an observer was invoked."]
4884 pub observers_ran: ecs_metric_t,
4885 #[doc = "< Number of events emitted"]
4886 pub event_emit_count: ecs_metric_t,
4887}
4888#[doc = "Timing"]
4889#[repr(C)]
4890#[derive(Copy, Clone)]
4891pub struct ecs_world_stats_t__bindgen_ty_7 {
4892 #[doc = "< Actual time passed since simulation start (first time progress() is called)"]
4893 pub world_time_raw: ecs_metric_t,
4894 #[doc = "< Simulation time passed since simulation start. Takes into account time scaling"]
4895 pub world_time: ecs_metric_t,
4896 #[doc = "< Time spent processing a frame. Smaller than world_time_total when load is not 100%"]
4897 pub frame_time: ecs_metric_t,
4898 #[doc = "< Time spent on running systems."]
4899 pub system_time: ecs_metric_t,
4900 #[doc = "< Time spent on notifying observers."]
4901 pub emit_time: ecs_metric_t,
4902 #[doc = "< Time spent on merging commands."]
4903 pub merge_time: ecs_metric_t,
4904 #[doc = "< Time spent on rematching."]
4905 pub rematch_time: ecs_metric_t,
4906 #[doc = "< Frames per second."]
4907 pub fps: ecs_metric_t,
4908 #[doc = "< Delta_time."]
4909 pub delta_time: ecs_metric_t,
4910}
4911#[repr(C)]
4912#[derive(Copy, Clone)]
4913pub struct ecs_world_stats_t__bindgen_ty_8 {
4914 #[doc = "< Allocs per frame"]
4915 pub alloc_count: ecs_metric_t,
4916 #[doc = "< Reallocs per frame"]
4917 pub realloc_count: ecs_metric_t,
4918 #[doc = "< Frees per frame"]
4919 pub free_count: ecs_metric_t,
4920 #[doc = "< Difference between allocs & frees"]
4921 pub outstanding_alloc_count: ecs_metric_t,
4922 #[doc = "< Block allocations per frame"]
4923 pub block_alloc_count: ecs_metric_t,
4924 #[doc = "< Block frees per frame"]
4925 pub block_free_count: ecs_metric_t,
4926 #[doc = "< Difference between allocs & frees"]
4927 pub block_outstanding_alloc_count: ecs_metric_t,
4928 #[doc = "< Page allocations per frame"]
4929 pub stack_alloc_count: ecs_metric_t,
4930 #[doc = "< Page frees per frame"]
4931 pub stack_free_count: ecs_metric_t,
4932 #[doc = "< Difference between allocs & frees"]
4933 pub stack_outstanding_alloc_count: ecs_metric_t,
4934}
4935#[doc = "REST statistics"]
4936#[repr(C)]
4937#[derive(Copy, Clone)]
4938pub struct ecs_world_stats_t__bindgen_ty_9 {
4939 pub request_count: ecs_metric_t,
4940 pub entity_count: ecs_metric_t,
4941 pub entity_error_count: ecs_metric_t,
4942 pub query_count: ecs_metric_t,
4943 pub query_error_count: ecs_metric_t,
4944 pub query_name_count: ecs_metric_t,
4945 pub query_name_error_count: ecs_metric_t,
4946 pub query_name_from_cache_count: ecs_metric_t,
4947 pub enable_count: ecs_metric_t,
4948 pub enable_error_count: ecs_metric_t,
4949 pub world_stats_count: ecs_metric_t,
4950 pub pipeline_stats_count: ecs_metric_t,
4951 pub stats_error_count: ecs_metric_t,
4952}
4953#[doc = "HTTP statistics"]
4954#[repr(C)]
4955#[derive(Copy, Clone)]
4956pub struct ecs_world_stats_t__bindgen_ty_10 {
4957 pub request_received_count: ecs_metric_t,
4958 pub request_invalid_count: ecs_metric_t,
4959 pub request_handled_ok_count: ecs_metric_t,
4960 pub request_handled_error_count: ecs_metric_t,
4961 pub request_not_handled_count: ecs_metric_t,
4962 pub request_preflight_count: ecs_metric_t,
4963 pub send_ok_count: ecs_metric_t,
4964 pub send_error_count: ecs_metric_t,
4965 pub busy_count: ecs_metric_t,
4966}
4967#[doc = "Statistics for a single query (use ecs_query_stats_get)"]
4968#[repr(C)]
4969#[derive(Copy, Clone)]
4970pub struct ecs_query_stats_t {
4971 pub first_: i64,
4972 #[doc = "< Matched non-empty tables"]
4973 pub matched_table_count: ecs_metric_t,
4974 #[doc = "< Matched empty tables"]
4975 pub matched_empty_table_count: ecs_metric_t,
4976 #[doc = "< Number of matched entities"]
4977 pub matched_entity_count: ecs_metric_t,
4978 pub last_: i64,
4979 #[doc = "Current position in ringbuffer"]
4980 pub t: i32,
4981}
4982#[doc = "Statistics for a single system (use ecs_system_stats_get)"]
4983#[repr(C)]
4984#[derive(Copy, Clone)]
4985pub struct ecs_system_stats_t {
4986 pub first_: i64,
4987 #[doc = "< Time spent processing a system"]
4988 pub time_spent: ecs_metric_t,
4989 #[doc = "< Number of times system is invoked"]
4990 pub invoke_count: ecs_metric_t,
4991 pub last_: i64,
4992 #[doc = "< Is system a task"]
4993 pub task: bool,
4994 pub query: ecs_query_stats_t,
4995}
4996#[doc = "Statistics for sync point"]
4997#[repr(C)]
4998#[derive(Copy, Clone)]
4999pub struct ecs_sync_stats_t {
5000 pub first_: i64,
5001 pub time_spent: ecs_metric_t,
5002 pub commands_enqueued: ecs_metric_t,
5003 pub last_: i64,
5004 pub system_count: i32,
5005 pub multi_threaded: bool,
5006 pub no_readonly: bool,
5007}
5008#[doc = "Statistics for all systems in a pipeline."]
5009#[repr(C)]
5010#[derive(Debug, Copy, Clone)]
5011pub struct ecs_pipeline_stats_t {
5012 #[doc = "Allow for initializing struct with {0}"]
5013 pub canary_: i8,
5014 #[doc = "Vector with system ids of all systems in the pipeline. The systems are\n stored in the order they are executed. Merges are represented by a 0."]
5015 pub systems: ecs_vec_t,
5016 #[doc = "Vector with sync point stats"]
5017 pub sync_points: ecs_vec_t,
5018 #[doc = "Map with system statistics. For each system in the systems vector, an\n entry in the map exists of type ecs_system_stats_t."]
5019 pub system_stats: ecs_map_t,
5020 #[doc = "Current position in ringbuffer"]
5021 pub t: i32,
5022 #[doc = "< Number of systems in pipeline"]
5023 pub system_count: i32,
5024 #[doc = "< Number of active systems in pipeline"]
5025 pub active_system_count: i32,
5026 #[doc = "< Number of times pipeline has rebuilt"]
5027 pub rebuild_count: i32,
5028}
5029extern "C" {
5030 #[doc = "Get world statistics.\n\n @param world The world.\n @param stats Out parameter for statistics."]
5031 pub fn ecs_world_stats_get(world: *const ecs_world_t, stats: *mut ecs_world_stats_t);
5032}
5033extern "C" {
5034 #[doc = "Reduce source measurement window into single destination measurement."]
5035 pub fn ecs_world_stats_reduce(dst: *mut ecs_world_stats_t, src: *const ecs_world_stats_t);
5036}
5037extern "C" {
5038 #[doc = "Reduce last measurement into previous measurement, restore old value."]
5039 pub fn ecs_world_stats_reduce_last(
5040 stats: *mut ecs_world_stats_t,
5041 old: *const ecs_world_stats_t,
5042 count: i32,
5043 );
5044}
5045extern "C" {
5046 #[doc = "Repeat last measurement."]
5047 pub fn ecs_world_stats_repeat_last(stats: *mut ecs_world_stats_t);
5048}
5049extern "C" {
5050 #[doc = "Copy last measurement from source to destination."]
5051 pub fn ecs_world_stats_copy_last(dst: *mut ecs_world_stats_t, src: *const ecs_world_stats_t);
5052}
5053extern "C" {
5054 pub fn ecs_world_stats_log(world: *const ecs_world_t, stats: *const ecs_world_stats_t);
5055}
5056extern "C" {
5057 #[doc = "Get query statistics.\n Obtain statistics for the provided query.\n\n @param world The world.\n @param query The query.\n @param stats Out parameter for statistics."]
5058 pub fn ecs_query_stats_get(
5059 world: *const ecs_world_t,
5060 query: *const ecs_query_t,
5061 stats: *mut ecs_query_stats_t,
5062 );
5063}
5064extern "C" {
5065 #[doc = "Reduce source measurement window into single destination measurement."]
5066 pub fn ecs_query_stats_reduce(dst: *mut ecs_query_stats_t, src: *const ecs_query_stats_t);
5067}
5068extern "C" {
5069 #[doc = "Reduce last measurement into previous measurement, restore old value."]
5070 pub fn ecs_query_stats_reduce_last(
5071 stats: *mut ecs_query_stats_t,
5072 old: *const ecs_query_stats_t,
5073 count: i32,
5074 );
5075}
5076extern "C" {
5077 #[doc = "Repeat last measurement."]
5078 pub fn ecs_query_stats_repeat_last(stats: *mut ecs_query_stats_t);
5079}
5080extern "C" {
5081 #[doc = "Copy last measurement from source to destination."]
5082 pub fn ecs_query_stats_copy_last(dst: *mut ecs_query_stats_t, src: *const ecs_query_stats_t);
5083}
5084extern "C" {
5085 #[doc = "Get system statistics.\n Obtain statistics for the provided system.\n\n @param world The world.\n @param system The system.\n @param stats Out parameter for statistics.\n @return true if success, false if not a system."]
5086 pub fn ecs_system_stats_get(
5087 world: *const ecs_world_t,
5088 system: ecs_entity_t,
5089 stats: *mut ecs_system_stats_t,
5090 ) -> bool;
5091}
5092extern "C" {
5093 #[doc = "Reduce source measurement window into single destination measurement"]
5094 pub fn ecs_system_stats_reduce(dst: *mut ecs_system_stats_t, src: *const ecs_system_stats_t);
5095}
5096extern "C" {
5097 #[doc = "Reduce last measurement into previous measurement, restore old value."]
5098 pub fn ecs_system_stats_reduce_last(
5099 stats: *mut ecs_system_stats_t,
5100 old: *const ecs_system_stats_t,
5101 count: i32,
5102 );
5103}
5104extern "C" {
5105 #[doc = "Repeat last measurement."]
5106 pub fn ecs_system_stats_repeat_last(stats: *mut ecs_system_stats_t);
5107}
5108extern "C" {
5109 #[doc = "Copy last measurement from source to destination."]
5110 pub fn ecs_system_stats_copy_last(dst: *mut ecs_system_stats_t, src: *const ecs_system_stats_t);
5111}
5112extern "C" {
5113 #[doc = "Get pipeline statistics.\n Obtain statistics for the provided pipeline.\n\n @param world The world.\n @param pipeline The pipeline.\n @param stats Out parameter for statistics.\n @return true if success, false if not a pipeline."]
5114 pub fn ecs_pipeline_stats_get(
5115 world: *mut ecs_world_t,
5116 pipeline: ecs_entity_t,
5117 stats: *mut ecs_pipeline_stats_t,
5118 ) -> bool;
5119}
5120extern "C" {
5121 #[doc = "Free pipeline stats.\n\n @param stats The stats to free."]
5122 pub fn ecs_pipeline_stats_fini(stats: *mut ecs_pipeline_stats_t);
5123}
5124extern "C" {
5125 #[doc = "Reduce source measurement window into single destination measurement"]
5126 pub fn ecs_pipeline_stats_reduce(
5127 dst: *mut ecs_pipeline_stats_t,
5128 src: *const ecs_pipeline_stats_t,
5129 );
5130}
5131extern "C" {
5132 #[doc = "Reduce last measurement into previous measurement, restore old value."]
5133 pub fn ecs_pipeline_stats_reduce_last(
5134 stats: *mut ecs_pipeline_stats_t,
5135 old: *const ecs_pipeline_stats_t,
5136 count: i32,
5137 );
5138}
5139extern "C" {
5140 #[doc = "Repeat last measurement."]
5141 pub fn ecs_pipeline_stats_repeat_last(stats: *mut ecs_pipeline_stats_t);
5142}
5143extern "C" {
5144 #[doc = "Copy last measurement to destination.\n This operation copies the last measurement into the destination. It does not\n modify the cursor.\n\n @param dst The metrics.\n @param src The metrics to copy."]
5145 pub fn ecs_pipeline_stats_copy_last(
5146 dst: *mut ecs_pipeline_stats_t,
5147 src: *const ecs_pipeline_stats_t,
5148 );
5149}
5150extern "C" {
5151 #[doc = "Reduce all measurements from a window into a single measurement."]
5152 pub fn ecs_metric_reduce(
5153 dst: *mut ecs_metric_t,
5154 src: *const ecs_metric_t,
5155 t_dst: i32,
5156 t_src: i32,
5157 );
5158}
5159extern "C" {
5160 #[doc = "Reduce last measurement into previous measurement"]
5161 pub fn ecs_metric_reduce_last(m: *mut ecs_metric_t, t: i32, count: i32);
5162}
5163extern "C" {
5164 #[doc = "Copy measurement"]
5165 pub fn ecs_metric_copy(m: *mut ecs_metric_t, dst: i32, src: i32);
5166}
5167extern "C" {
5168 pub static mut FLECS_IDFlecsMetricsID_: ecs_entity_t;
5169}
5170extern "C" {
5171 pub static mut EcsMetric: ecs_entity_t;
5172}
5173extern "C" {
5174 pub static mut FLECS_IDEcsMetricID_: ecs_entity_t;
5175}
5176extern "C" {
5177 pub static mut EcsCounter: ecs_entity_t;
5178}
5179extern "C" {
5180 pub static mut FLECS_IDEcsCounterID_: ecs_entity_t;
5181}
5182extern "C" {
5183 pub static mut EcsCounterIncrement: ecs_entity_t;
5184}
5185extern "C" {
5186 pub static mut FLECS_IDEcsCounterIncrementID_: ecs_entity_t;
5187}
5188extern "C" {
5189 pub static mut EcsCounterId: ecs_entity_t;
5190}
5191extern "C" {
5192 pub static mut FLECS_IDEcsCounterIdID_: ecs_entity_t;
5193}
5194extern "C" {
5195 pub static mut EcsGauge: ecs_entity_t;
5196}
5197extern "C" {
5198 pub static mut FLECS_IDEcsGaugeID_: ecs_entity_t;
5199}
5200extern "C" {
5201 pub static mut EcsMetricInstance: ecs_entity_t;
5202}
5203extern "C" {
5204 pub static mut FLECS_IDEcsMetricInstanceID_: ecs_entity_t;
5205}
5206extern "C" {
5207 pub static mut FLECS_IDEcsMetricValueID_: ecs_entity_t;
5208}
5209extern "C" {
5210 pub static mut FLECS_IDEcsMetricSourceID_: ecs_entity_t;
5211}
5212#[repr(C)]
5213#[derive(Debug, Copy, Clone)]
5214pub struct EcsMetricValue {
5215 pub value: f64,
5216}
5217#[repr(C)]
5218#[derive(Debug, Copy, Clone)]
5219pub struct EcsMetricSource {
5220 pub entity: ecs_entity_t,
5221}
5222#[repr(C)]
5223#[derive(Debug, Copy, Clone)]
5224pub struct ecs_metric_desc_t {
5225 pub _canary: i32,
5226 #[doc = "Entity associated with metric"]
5227 pub entity: ecs_entity_t,
5228 #[doc = "Entity associated with member that stores metric value. Must not be set\n at the same time as id. Cannot be combined with EcsCounterId."]
5229 pub member: ecs_entity_t,
5230 #[doc = "Member dot expression. Can be used instead of member and supports nested\n members. Must be set together with id and should not be set at the same\n time as member."]
5231 pub dotmember: *const ::std::os::raw::c_char,
5232 #[doc = "Tracks whether entities have the specified component id. Must not be set\n at the same time as member."]
5233 pub id: ecs_id_t,
5234 #[doc = "If id is a (R, *) wildcard and relationship R has the OneOf property,\n setting this value to true will track individual targets.\n If the kind is EcsCountId and the id is a (R, *) wildcard, this value\n will create a metric per target."]
5235 pub targets: bool,
5236 #[doc = "Must be EcsGauge, EcsCounter, EcsCounterIncrement or EcsCounterId"]
5237 pub kind: ecs_entity_t,
5238 #[doc = "Description of metric. Will only be set if FLECS_DOC addon is enabled"]
5239 pub brief: *const ::std::os::raw::c_char,
5240}
5241extern "C" {
5242 #[doc = "Create a new metric.\n Metrics are entities that store values measured from a range of different\n properties in the ECS storage. Metrics provide a single unified interface to\n discovering and reading these values, which can be useful for monitoring\n utilities, or for debugging.\n\n Examples of properties that can be measured by metrics are:\n - Component member values\n - How long an entity has had a specific component\n - How long an entity has had a specific target for a relationship\n - How many entities have a specific component\n\n Metrics can either be created as a \"gauge\" or \"counter\". A gauge is a metric\n that represents the value of something at a specific point in time, for\n example \"velocity\". A counter metric represents a value that is monotonically\n increasing, for example \"miles driven\".\n\n There are three different kinds of counter metric kinds:\n - EcsCounter\n When combined with a member, this will store the actual value of the member\n in the metric. This is useful for values that are already counters, such as\n a MilesDriven component.\n This kind creates a metric per entity that has the member/id.\n\n - EcsCounterIncrement\n When combined with a member, this will increment the value of the metric by\n the value of the member * delta_time. This is useful for values that are\n not counters, such as a Velocity component.\n This kind creates a metric per entity that has the member.\n\n - EcsCounterId\n This metric kind will count the number of entities with a specific\n (component) id. This kind creates a single metric instance for regular ids,\n and a metric instance per target for wildcard ids when targets is set.\n\n @param world The world.\n @param desc Metric description.\n @return The metric entity."]
5243 pub fn ecs_metric_init(world: *mut ecs_world_t, desc: *const ecs_metric_desc_t)
5244 -> ecs_entity_t;
5245}
5246extern "C" {
5247 #[doc = "Module import"]
5248 pub fn FlecsMetricsImport(world: *mut ecs_world_t);
5249}
5250extern "C" {
5251 pub static mut FLECS_IDFlecsAlertsID_: ecs_entity_t;
5252}
5253extern "C" {
5254 pub static mut FLECS_IDEcsAlertID_: ecs_entity_t;
5255}
5256extern "C" {
5257 pub static mut FLECS_IDEcsAlertInstanceID_: ecs_entity_t;
5258}
5259extern "C" {
5260 pub static mut FLECS_IDEcsAlertsActiveID_: ecs_entity_t;
5261}
5262extern "C" {
5263 pub static mut FLECS_IDEcsAlertTimeoutID_: ecs_entity_t;
5264}
5265extern "C" {
5266 pub static mut EcsAlertInfo: ecs_entity_t;
5267}
5268extern "C" {
5269 pub static mut FLECS_IDEcsAlertInfoID_: ecs_entity_t;
5270}
5271extern "C" {
5272 pub static mut EcsAlertWarning: ecs_entity_t;
5273}
5274extern "C" {
5275 pub static mut FLECS_IDEcsAlertWarningID_: ecs_entity_t;
5276}
5277extern "C" {
5278 pub static mut EcsAlertError: ecs_entity_t;
5279}
5280extern "C" {
5281 pub static mut FLECS_IDEcsAlertErrorID_: ecs_entity_t;
5282}
5283extern "C" {
5284 pub static mut EcsAlertCritical: ecs_entity_t;
5285}
5286extern "C" {
5287 pub static mut FLECS_IDEcsAlertCriticalID_: ecs_entity_t;
5288}
5289#[doc = "Alert information. Added to each alert instance"]
5290#[repr(C)]
5291#[derive(Debug, Copy, Clone)]
5292pub struct EcsAlertInstance {
5293 pub message: *mut ::std::os::raw::c_char,
5294}
5295#[doc = "Map with active alerts for entity."]
5296#[repr(C)]
5297#[derive(Debug, Copy, Clone)]
5298pub struct EcsAlertsActive {
5299 pub info_count: i32,
5300 pub warning_count: i32,
5301 pub error_count: i32,
5302 pub alerts: ecs_map_t,
5303}
5304#[repr(C)]
5305#[derive(Debug, Copy, Clone)]
5306pub struct ecs_alert_severity_filter_t {
5307 #[doc = "Severity kind"]
5308 pub severity: ecs_entity_t,
5309 #[doc = "Component to match"]
5310 pub with: ecs_id_t,
5311 #[doc = "Variable to match component on. Do not include the\n '$' character. Leave to NULL for $this."]
5312 pub var: *const ::std::os::raw::c_char,
5313 #[doc = "Index of variable in filter (do not set)"]
5314 pub _var_index: i32,
5315}
5316#[repr(C)]
5317#[derive(Debug, Copy, Clone)]
5318pub struct ecs_alert_desc_t {
5319 pub _canary: i32,
5320 #[doc = "Entity associated with alert"]
5321 pub entity: ecs_entity_t,
5322 #[doc = "Alert query. An alert will be created for each entity that matches the\n specified query. The query must have at least one term that uses the\n $this variable (default)."]
5323 pub filter: ecs_filter_desc_t,
5324 #[doc = "Template for alert message. This string is used to generate the alert\n message and may refer to variables in the query result. The format for\n the template expressions is as specified by ecs_interpolate_string.\n\n Examples:\n \"$this has Position but not Velocity\"\n \"$this has a parent entity $parent without Position\""]
5325 pub message: *const ::std::os::raw::c_char,
5326 #[doc = "User friendly name. Will only be set if FLECS_DOC addon is enabled."]
5327 pub doc_name: *const ::std::os::raw::c_char,
5328 #[doc = "Description of alert. Will only be set if FLECS_DOC addon is enabled"]
5329 pub brief: *const ::std::os::raw::c_char,
5330 #[doc = "Metric kind. Must be EcsAlertInfo, EcsAlertWarning, EcsAlertError or\n EcsAlertCritical. Defaults to EcsAlertError."]
5331 pub severity: ecs_entity_t,
5332 #[doc = "Severity filters can be used to assign different severities to the same\n alert. This prevents having to create multiple alerts, and allows\n entities to transition between severities without resetting the\n alert duration (optional)."]
5333 pub severity_filters: [ecs_alert_severity_filter_t; 4usize],
5334 #[doc = "The retain period specifies how long an alert must be inactive before it\n is cleared. This makes it easier to track noisy alerts. While an alert is\n inactive its duration won't increase.\n When the retain period is 0, the alert will clear immediately after it no\n longer matches the alert query."]
5335 pub retain_period: f32,
5336 #[doc = "Alert when member value is out of range. Uses the warning/error ranges\n assigned to the member in the MemberRanges component (optional)."]
5337 pub member: ecs_entity_t,
5338 #[doc = "(Component) id of member to monitor. If left to 0 this will be set to\n the parent entity of the member (optional)."]
5339 pub id: ecs_id_t,
5340 #[doc = "Variable from which to fetch the member (optional). When left to NULL\n 'id' will be obtained from $this."]
5341 pub var: *const ::std::os::raw::c_char,
5342}
5343extern "C" {
5344 #[doc = "Create a new alert.\n An alert is a query that is evaluated periodically and creates alert\n instances for each entity that matches the query. Alerts can be used to\n automate detection of errors in an application.\n\n Alerts are automatically cleared when a query is no longer true for an alert\n instance. At most one alert instance will be created per matched entity.\n\n Alert instances have three components:\n - AlertInstance: contains the alert message for the instance\n - MetricSource: contains the entity that triggered the alert\n - MetricValue: contains how long the alert has been active\n\n Alerts reuse components from the metrics addon so that alert instances can be\n tracked and discovered as metrics. Just like metrics, alert instances are\n created as children of the alert.\n\n When an entity has active alerts, it will have the EcsAlertsActive component\n which contains a map with active alerts for the entity. This component\n will be automatically removed once all alerts are cleared for the entity.\n\n @param world The world.\n @param desc Alert description.\n @return The alert entity."]
5345 pub fn ecs_alert_init(world: *mut ecs_world_t, desc: *const ecs_alert_desc_t) -> ecs_entity_t;
5346}
5347extern "C" {
5348 #[doc = "Return number of active alerts for entity.\n When a valid alert entity is specified for the alert parameter, the operation\n will return whether the specified alert is active for the entity. When no\n alert is specified, the operation will return the total number of active\n alerts for the entity.\n\n @param world The world.\n @param entity The entity.\n @param alert The alert to test for (optional).\n @return The number of active alerts for the entity."]
5349 pub fn ecs_get_alert_count(
5350 world: *const ecs_world_t,
5351 entity: ecs_entity_t,
5352 alert: ecs_entity_t,
5353 ) -> i32;
5354}
5355extern "C" {
5356 #[doc = "Return alert instance for specified alert.\n This operation returns the alert instance for the specified alert. If the\n alert is not active for the entity, the operation will return 0.\n\n @param world The world.\n @param entity The entity.\n @param alert The alert to test for.\n @return The alert instance for the specified alert."]
5357 pub fn ecs_get_alert(
5358 world: *const ecs_world_t,
5359 entity: ecs_entity_t,
5360 alert: ecs_entity_t,
5361 ) -> ecs_entity_t;
5362}
5363extern "C" {
5364 #[doc = "Module import"]
5365 pub fn FlecsAlertsImport(world: *mut ecs_world_t);
5366}
5367extern "C" {
5368 pub static mut FLECS_IDFlecsMonitorID_: ecs_entity_t;
5369}
5370extern "C" {
5371 pub static mut FLECS_IDEcsWorldStatsID_: ecs_entity_t;
5372}
5373extern "C" {
5374 pub static mut FLECS_IDEcsWorldSummaryID_: ecs_entity_t;
5375}
5376extern "C" {
5377 pub static mut FLECS_IDEcsPipelineStatsID_: ecs_entity_t;
5378}
5379extern "C" {
5380 pub static mut EcsPeriod1s: ecs_entity_t;
5381}
5382extern "C" {
5383 pub static mut EcsPeriod1m: ecs_entity_t;
5384}
5385extern "C" {
5386 pub static mut EcsPeriod1h: ecs_entity_t;
5387}
5388extern "C" {
5389 pub static mut EcsPeriod1d: ecs_entity_t;
5390}
5391extern "C" {
5392 pub static mut EcsPeriod1w: ecs_entity_t;
5393}
5394#[repr(C)]
5395#[derive(Debug, Copy, Clone)]
5396pub struct EcsStatsHeader {
5397 pub elapsed: f32,
5398 pub reduce_count: i32,
5399}
5400#[repr(C)]
5401#[derive(Copy, Clone)]
5402pub struct EcsWorldStats {
5403 pub hdr: EcsStatsHeader,
5404 pub stats: ecs_world_stats_t,
5405}
5406#[repr(C)]
5407#[derive(Debug, Copy, Clone)]
5408pub struct EcsPipelineStats {
5409 pub hdr: EcsStatsHeader,
5410 pub stats: ecs_pipeline_stats_t,
5411}
5412#[repr(C)]
5413#[derive(Debug, Copy, Clone)]
5414pub struct EcsWorldSummary {
5415 #[doc = "< Target FPS"]
5416 pub target_fps: f64,
5417 #[doc = "< Total time spent processing a frame"]
5418 pub frame_time_total: f64,
5419 #[doc = "< Total time spent in systems"]
5420 pub system_time_total: f64,
5421 #[doc = "< Total time spent in merges"]
5422 pub merge_time_total: f64,
5423 #[doc = "< Time spent processing a frame"]
5424 pub frame_time_last: f64,
5425 #[doc = "< Time spent in systems"]
5426 pub system_time_last: f64,
5427 #[doc = "< Time spent in merges"]
5428 pub merge_time_last: f64,
5429}
5430extern "C" {
5431 #[doc = "Module import"]
5432 pub fn FlecsMonitorImport(world: *mut ecs_world_t);
5433}
5434extern "C" {
5435 #[doc = "Module import"]
5436 pub fn FlecsCoreDocImport(world: *mut ecs_world_t);
5437}
5438extern "C" {
5439 pub static FLECS_IDEcsDocDescriptionID_: ecs_entity_t;
5440}
5441extern "C" {
5442 pub static EcsDocBrief: ecs_entity_t;
5443}
5444extern "C" {
5445 pub static EcsDocDetail: ecs_entity_t;
5446}
5447extern "C" {
5448 pub static EcsDocLink: ecs_entity_t;
5449}
5450extern "C" {
5451 pub static EcsDocColor: ecs_entity_t;
5452}
5453#[repr(C)]
5454#[derive(Debug, Copy, Clone)]
5455pub struct EcsDocDescription {
5456 pub value: *mut ::std::os::raw::c_char,
5457}
5458extern "C" {
5459 #[doc = "Add human-readable name to entity.\n Contrary to entity names, human readable names do not have to be unique and\n can contain special characters used in the query language like '*'.\n\n @param world The world.\n @param entity The entity to which to add the name.\n @param name The name to add."]
5460 pub fn ecs_doc_set_name(
5461 world: *mut ecs_world_t,
5462 entity: ecs_entity_t,
5463 name: *const ::std::os::raw::c_char,
5464 );
5465}
5466extern "C" {
5467 #[doc = "Add brief description to entity.\n\n @param world The world.\n @param entity The entity to which to add the description.\n @param description The description to add."]
5468 pub fn ecs_doc_set_brief(
5469 world: *mut ecs_world_t,
5470 entity: ecs_entity_t,
5471 description: *const ::std::os::raw::c_char,
5472 );
5473}
5474extern "C" {
5475 #[doc = "Add detailed description to entity.\n\n @param world The world.\n @param entity The entity to which to add the description.\n @param description The description to add."]
5476 pub fn ecs_doc_set_detail(
5477 world: *mut ecs_world_t,
5478 entity: ecs_entity_t,
5479 description: *const ::std::os::raw::c_char,
5480 );
5481}
5482extern "C" {
5483 #[doc = "Add link to external documentation to entity.\n\n @param world The world.\n @param entity The entity to which to add the link.\n @param link The link to add."]
5484 pub fn ecs_doc_set_link(
5485 world: *mut ecs_world_t,
5486 entity: ecs_entity_t,
5487 link: *const ::std::os::raw::c_char,
5488 );
5489}
5490extern "C" {
5491 #[doc = "Add color to entity.\n UIs can use color as hint to improve visualizing entities.\n\n @param world The world.\n @param entity The entity to which to add the link.\n @param color The color to add."]
5492 pub fn ecs_doc_set_color(
5493 world: *mut ecs_world_t,
5494 entity: ecs_entity_t,
5495 color: *const ::std::os::raw::c_char,
5496 );
5497}
5498extern "C" {
5499 #[doc = "Get human readable name from entity.\n If entity does not have an explicit human readable name, this operation will\n return the entity name.\n\n To test if an entity has a human readable name, use:\n ecs_has_pair(world, e, ecs_id(EcsDescription), EcsName);\n Or in C++:\n e.has<flecs::Description>(flecs::Name);\n\n @param world The world.\n @param entity The entity from which to get the name.\n @return The name."]
5500 pub fn ecs_doc_get_name(
5501 world: *const ecs_world_t,
5502 entity: ecs_entity_t,
5503 ) -> *const ::std::os::raw::c_char;
5504}
5505extern "C" {
5506 #[doc = "Get brief description from entity.\n\n @param world The world.\n @param entity The entity from which to get the description.\n @return The description."]
5507 pub fn ecs_doc_get_brief(
5508 world: *const ecs_world_t,
5509 entity: ecs_entity_t,
5510 ) -> *const ::std::os::raw::c_char;
5511}
5512extern "C" {
5513 #[doc = "Get detailed description from entity.\n\n @param world The world.\n @param entity The entity from which to get the description.\n @return The description."]
5514 pub fn ecs_doc_get_detail(
5515 world: *const ecs_world_t,
5516 entity: ecs_entity_t,
5517 ) -> *const ::std::os::raw::c_char;
5518}
5519extern "C" {
5520 #[doc = "Get link to external documentation from entity.\n\n @param world The world.\n @param entity The entity from which to get the link.\n @return The link."]
5521 pub fn ecs_doc_get_link(
5522 world: *const ecs_world_t,
5523 entity: ecs_entity_t,
5524 ) -> *const ::std::os::raw::c_char;
5525}
5526extern "C" {
5527 #[doc = "Get color from entity.\n\n @param world The world.\n @param entity The entity from which to get the link.\n @return The color."]
5528 pub fn ecs_doc_get_color(
5529 world: *const ecs_world_t,
5530 entity: ecs_entity_t,
5531 ) -> *const ::std::os::raw::c_char;
5532}
5533extern "C" {
5534 #[doc = "Module import"]
5535 pub fn FlecsDocImport(world: *mut ecs_world_t);
5536}
5537#[doc = "Used with ecs_ptr_from_json, ecs_entity_from_json."]
5538#[repr(C)]
5539#[derive(Debug, Copy, Clone)]
5540pub struct ecs_from_json_desc_t {
5541 #[doc = "< Name of expression (used for logging)"]
5542 pub name: *const ::std::os::raw::c_char,
5543 #[doc = "< Full expression (used for logging)"]
5544 pub expr: *const ::std::os::raw::c_char,
5545 #[doc = "Callback that allows for specifying a custom lookup function. The\n default behavior uses ecs_lookup_fullpath"]
5546 pub lookup_action: ::std::option::Option<
5547 unsafe extern "C" fn(
5548 arg1: *const ecs_world_t,
5549 value: *const ::std::os::raw::c_char,
5550 ctx: *mut ::std::os::raw::c_void,
5551 ) -> ecs_entity_t,
5552 >,
5553 pub lookup_ctx: *mut ::std::os::raw::c_void,
5554}
5555extern "C" {
5556 #[doc = "Parse JSON string into value.\n This operation parses a JSON expression into the provided pointer. The\n memory pointed to must be large enough to contain a value of the used type.\n\n @param world The world.\n @param type The type of the expression to parse.\n @param ptr Pointer to the memory to write to.\n @param json The JSON expression to parse.\n @param desc Configuration parameters for deserializer.\n @return Pointer to the character after the last one read, or NULL if failed."]
5557 pub fn ecs_ptr_from_json(
5558 world: *const ecs_world_t,
5559 type_: ecs_entity_t,
5560 ptr: *mut ::std::os::raw::c_void,
5561 json: *const ::std::os::raw::c_char,
5562 desc: *const ecs_from_json_desc_t,
5563 ) -> *const ::std::os::raw::c_char;
5564}
5565extern "C" {
5566 #[doc = "Parse JSON object with multiple component values into entity. The format\n is the same as the one outputted by ecs_entity_to_json, but at the moment\n only supports the \"ids\" and \"values\" member.\n\n @param world The world.\n @param entity The entity to serialize to.\n @param json The JSON expression to parse (see entity in JSON format manual).\n @param desc Configuration parameters for deserializer.\n @return Pointer to the character after the last one read, or NULL if failed."]
5567 pub fn ecs_entity_from_json(
5568 world: *mut ecs_world_t,
5569 entity: ecs_entity_t,
5570 json: *const ::std::os::raw::c_char,
5571 desc: *const ecs_from_json_desc_t,
5572 ) -> *const ::std::os::raw::c_char;
5573}
5574extern "C" {
5575 #[doc = "Parse JSON object with multiple entities into the world. The format is the\n same as the one outputted by ecs_world_to_json.\n\n @param world The world.\n @param json The JSON expression to parse (see iterator in JSON format manual)."]
5576 pub fn ecs_world_from_json(
5577 world: *mut ecs_world_t,
5578 json: *const ::std::os::raw::c_char,
5579 desc: *const ecs_from_json_desc_t,
5580 ) -> *const ::std::os::raw::c_char;
5581}
5582extern "C" {
5583 #[doc = "Serialize array into JSON string.\n This operation serializes a value of the provided type to a JSON string. The\n memory pointed to must be large enough to contain a value of the used type.\n\n If count is 0, the function will serialize a single value, not wrapped in\n array brackets. If count is >= 1, the operation will serialize values to a\n a comma-separated list inside of array brackets.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @param count The number of elements to serialize.\n @return String with JSON expression, or NULL if failed."]
5584 pub fn ecs_array_to_json(
5585 world: *const ecs_world_t,
5586 type_: ecs_entity_t,
5587 data: *const ::std::os::raw::c_void,
5588 count: i32,
5589 ) -> *mut ::std::os::raw::c_char;
5590}
5591extern "C" {
5592 #[doc = "Serialize array into JSON string buffer.\n Same as ecs_array_to_json_buf, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @param count The number of elements to serialize.\n @param buf_out The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
5593 pub fn ecs_array_to_json_buf(
5594 world: *const ecs_world_t,
5595 type_: ecs_entity_t,
5596 data: *const ::std::os::raw::c_void,
5597 count: i32,
5598 buf_out: *mut ecs_strbuf_t,
5599 ) -> ::std::os::raw::c_int;
5600}
5601extern "C" {
5602 #[doc = "Serialize value into JSON string.\n Same as ecs_array_to_json, with count = 0.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @return String with JSON expression, or NULL if failed."]
5603 pub fn ecs_ptr_to_json(
5604 world: *const ecs_world_t,
5605 type_: ecs_entity_t,
5606 data: *const ::std::os::raw::c_void,
5607 ) -> *mut ::std::os::raw::c_char;
5608}
5609extern "C" {
5610 #[doc = "Serialize value into JSON string buffer.\n Same as ecs_ptr_to_json, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @param buf_out The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
5611 pub fn ecs_ptr_to_json_buf(
5612 world: *const ecs_world_t,
5613 type_: ecs_entity_t,
5614 data: *const ::std::os::raw::c_void,
5615 buf_out: *mut ecs_strbuf_t,
5616 ) -> ::std::os::raw::c_int;
5617}
5618extern "C" {
5619 #[doc = "Serialize type info to JSON.\n This serializes type information to JSON, and can be used to store/transmit\n the structure of a (component) value.\n\n If the provided type does not have reflection data, \"0\" will be returned.\n\n @param world The world.\n @param type The type to serialize to JSON.\n @return A JSON string with the serialized type info, or NULL if failed."]
5620 pub fn ecs_type_info_to_json(
5621 world: *const ecs_world_t,
5622 type_: ecs_entity_t,
5623 ) -> *mut ::std::os::raw::c_char;
5624}
5625extern "C" {
5626 #[doc = "Serialize type info into JSON string buffer.\n Same as ecs_type_info_to_json, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param type The type to serialize.\n @param buf_out The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
5627 pub fn ecs_type_info_to_json_buf(
5628 world: *const ecs_world_t,
5629 type_: ecs_entity_t,
5630 buf_out: *mut ecs_strbuf_t,
5631 ) -> ::std::os::raw::c_int;
5632}
5633#[doc = "Used with ecs_iter_to_json."]
5634#[repr(C)]
5635#[derive(Debug, Copy, Clone)]
5636pub struct ecs_entity_to_json_desc_t {
5637 #[doc = "< Serialize full pathname"]
5638 pub serialize_path: bool,
5639 #[doc = "< Serialize doc name"]
5640 pub serialize_label: bool,
5641 #[doc = "< Serialize brief doc description"]
5642 pub serialize_brief: bool,
5643 #[doc = "< Serialize doc link (URL)"]
5644 pub serialize_link: bool,
5645 #[doc = "< Serialize doc color"]
5646 pub serialize_color: bool,
5647 #[doc = "< Serialize (component) ids"]
5648 pub serialize_ids: bool,
5649 #[doc = "< Serialize labels of (component) ids"]
5650 pub serialize_id_labels: bool,
5651 #[doc = "< Serialize base components"]
5652 pub serialize_base: bool,
5653 #[doc = "< Serialize private components"]
5654 pub serialize_private: bool,
5655 #[doc = "< Serialize ids hidden by override"]
5656 pub serialize_hidden: bool,
5657 #[doc = "< Serialize component values"]
5658 pub serialize_values: bool,
5659 #[doc = "< Serialize type info (requires serialize_values)"]
5660 pub serialize_type_info: bool,
5661 #[doc = "< Serialize active alerts for entity"]
5662 pub serialize_alerts: bool,
5663 #[doc = "< Serialize references (incoming edges) for relationship"]
5664 pub serialize_refs: ecs_entity_t,
5665 #[doc = "< Serialize which queries entity matches with"]
5666 pub serialize_matches: bool,
5667}
5668extern "C" {
5669 #[doc = "Serialize entity into JSON string.\n This creates a JSON object with the entity's (path) name, which components\n and tags the entity has, and the component values.\n\n The operation may fail if the entity contains components with invalid values.\n\n @param world The world.\n @param entity The entity to serialize to JSON.\n @return A JSON string with the serialized entity data, or NULL if failed."]
5670 pub fn ecs_entity_to_json(
5671 world: *const ecs_world_t,
5672 entity: ecs_entity_t,
5673 desc: *const ecs_entity_to_json_desc_t,
5674 ) -> *mut ::std::os::raw::c_char;
5675}
5676extern "C" {
5677 #[doc = "Serialize entity into JSON string buffer.\n Same as ecs_entity_to_json, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param entity The entity to serialize.\n @param buf_out The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
5678 pub fn ecs_entity_to_json_buf(
5679 world: *const ecs_world_t,
5680 entity: ecs_entity_t,
5681 buf_out: *mut ecs_strbuf_t,
5682 desc: *const ecs_entity_to_json_desc_t,
5683 ) -> ::std::os::raw::c_int;
5684}
5685#[doc = "Used with ecs_iter_to_json."]
5686#[repr(C)]
5687#[derive(Debug, Copy, Clone)]
5688pub struct ecs_iter_to_json_desc_t {
5689 #[doc = "< Serialize query term component ids"]
5690 pub serialize_term_ids: bool,
5691 #[doc = "< Serialize query term component id labels"]
5692 pub serialize_term_labels: bool,
5693 #[doc = "< Serialize actual (matched) component ids"]
5694 pub serialize_ids: bool,
5695 #[doc = "< Serialize actual (matched) component id labels"]
5696 pub serialize_id_labels: bool,
5697 #[doc = "< Serialize sources"]
5698 pub serialize_sources: bool,
5699 #[doc = "< Serialize variables"]
5700 pub serialize_variables: bool,
5701 #[doc = "< Serialize is_set (for optional terms)"]
5702 pub serialize_is_set: bool,
5703 #[doc = "< Serialize component values"]
5704 pub serialize_values: bool,
5705 #[doc = "< Serialize component values"]
5706 pub serialize_private: bool,
5707 #[doc = "< Serialize entities (for This terms)"]
5708 pub serialize_entities: bool,
5709 #[doc = "< Serialize doc name for entities"]
5710 pub serialize_entity_labels: bool,
5711 #[doc = "< Serialize numerical ids for entities"]
5712 pub serialize_entity_ids: bool,
5713 #[doc = "< Serialize names (not paths) for entities"]
5714 pub serialize_entity_names: bool,
5715 #[doc = "< Serialize doc name for variables"]
5716 pub serialize_variable_labels: bool,
5717 #[doc = "< Serialize numerical ids for variables"]
5718 pub serialize_variable_ids: bool,
5719 #[doc = "< Serialize doc color for entities"]
5720 pub serialize_colors: bool,
5721 #[doc = "< Serialize evaluation duration"]
5722 pub measure_eval_duration: bool,
5723 #[doc = "< Serialize type information"]
5724 pub serialize_type_info: bool,
5725 #[doc = "< Serialize entire table vs. matched components"]
5726 pub serialize_table: bool,
5727}
5728extern "C" {
5729 #[doc = "Serialize iterator into JSON string.\n This operation will iterate the contents of the iterator and serialize them\n to JSON. The function acccepts iterators from any source.\n\n @param world The world.\n @param iter The iterator to serialize to JSON.\n @return A JSON string with the serialized iterator data, or NULL if failed."]
5730 pub fn ecs_iter_to_json(
5731 world: *const ecs_world_t,
5732 iter: *mut ecs_iter_t,
5733 desc: *const ecs_iter_to_json_desc_t,
5734 ) -> *mut ::std::os::raw::c_char;
5735}
5736extern "C" {
5737 #[doc = "Serialize iterator into JSON string buffer.\n Same as ecs_iter_to_json, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param iter The iterator to serialize.\n @param buf_out The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
5738 pub fn ecs_iter_to_json_buf(
5739 world: *const ecs_world_t,
5740 iter: *mut ecs_iter_t,
5741 buf_out: *mut ecs_strbuf_t,
5742 desc: *const ecs_iter_to_json_desc_t,
5743 ) -> ::std::os::raw::c_int;
5744}
5745#[doc = "Used with ecs_iter_to_json."]
5746#[repr(C)]
5747#[derive(Debug, Copy, Clone)]
5748pub struct ecs_world_to_json_desc_t {
5749 #[doc = "< Exclude flecs modules & contents"]
5750 pub serialize_builtin: bool,
5751 #[doc = "< Exclude modules & contents"]
5752 pub serialize_modules: bool,
5753}
5754extern "C" {
5755 #[doc = "Serialize world into JSON string.\n This operation iterates the contents of the world to JSON. The operation is\n equivalent to the following code:\n\n ecs_filter_t *f = ecs_filter(world, {\n .terms = {{ .id = EcsAny }}\n });\n\n ecs_iter_t it = ecs_filter_init(world, &f);\n ecs_iter_to_json_desc_t desc = { .serialize_table = true };\n ecs_iter_to_json(world, iter, &desc);\n\n @param world The world to serialize.\n @return A JSON string with the serialized iterator data, or NULL if failed."]
5756 pub fn ecs_world_to_json(
5757 world: *mut ecs_world_t,
5758 desc: *const ecs_world_to_json_desc_t,
5759 ) -> *mut ::std::os::raw::c_char;
5760}
5761extern "C" {
5762 #[doc = "Serialize world into JSON string buffer.\n Same as ecs_world_to_json, but serializes to an ecs_strbuf_t instance.\n\n @param world The world to serialize.\n @param buf_out The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
5763 pub fn ecs_world_to_json_buf(
5764 world: *mut ecs_world_t,
5765 buf_out: *mut ecs_strbuf_t,
5766 desc: *const ecs_world_to_json_desc_t,
5767 ) -> ::std::os::raw::c_int;
5768}
5769extern "C" {
5770 pub static mut EcsUnitPrefixes: ecs_entity_t;
5771}
5772extern "C" {
5773 pub static mut FLECS_IDEcsUnitPrefixesID_: ecs_entity_t;
5774}
5775extern "C" {
5776 pub static mut EcsYocto: ecs_entity_t;
5777}
5778extern "C" {
5779 pub static mut FLECS_IDEcsYoctoID_: ecs_entity_t;
5780}
5781extern "C" {
5782 pub static mut EcsZepto: ecs_entity_t;
5783}
5784extern "C" {
5785 pub static mut FLECS_IDEcsZeptoID_: ecs_entity_t;
5786}
5787extern "C" {
5788 pub static mut EcsAtto: ecs_entity_t;
5789}
5790extern "C" {
5791 pub static mut FLECS_IDEcsAttoID_: ecs_entity_t;
5792}
5793extern "C" {
5794 pub static mut EcsFemto: ecs_entity_t;
5795}
5796extern "C" {
5797 pub static mut FLECS_IDEcsFemtoID_: ecs_entity_t;
5798}
5799extern "C" {
5800 pub static mut EcsPico: ecs_entity_t;
5801}
5802extern "C" {
5803 pub static mut FLECS_IDEcsPicoID_: ecs_entity_t;
5804}
5805extern "C" {
5806 pub static mut EcsNano: ecs_entity_t;
5807}
5808extern "C" {
5809 pub static mut FLECS_IDEcsNanoID_: ecs_entity_t;
5810}
5811extern "C" {
5812 pub static mut EcsMicro: ecs_entity_t;
5813}
5814extern "C" {
5815 pub static mut FLECS_IDEcsMicroID_: ecs_entity_t;
5816}
5817extern "C" {
5818 pub static mut EcsMilli: ecs_entity_t;
5819}
5820extern "C" {
5821 pub static mut FLECS_IDEcsMilliID_: ecs_entity_t;
5822}
5823extern "C" {
5824 pub static mut EcsCenti: ecs_entity_t;
5825}
5826extern "C" {
5827 pub static mut FLECS_IDEcsCentiID_: ecs_entity_t;
5828}
5829extern "C" {
5830 pub static mut EcsDeci: ecs_entity_t;
5831}
5832extern "C" {
5833 pub static mut FLECS_IDEcsDeciID_: ecs_entity_t;
5834}
5835extern "C" {
5836 pub static mut EcsDeca: ecs_entity_t;
5837}
5838extern "C" {
5839 pub static mut FLECS_IDEcsDecaID_: ecs_entity_t;
5840}
5841extern "C" {
5842 pub static mut EcsHecto: ecs_entity_t;
5843}
5844extern "C" {
5845 pub static mut FLECS_IDEcsHectoID_: ecs_entity_t;
5846}
5847extern "C" {
5848 pub static mut EcsKilo: ecs_entity_t;
5849}
5850extern "C" {
5851 pub static mut FLECS_IDEcsKiloID_: ecs_entity_t;
5852}
5853extern "C" {
5854 pub static mut EcsMega: ecs_entity_t;
5855}
5856extern "C" {
5857 pub static mut FLECS_IDEcsMegaID_: ecs_entity_t;
5858}
5859extern "C" {
5860 pub static mut EcsGiga: ecs_entity_t;
5861}
5862extern "C" {
5863 pub static mut FLECS_IDEcsGigaID_: ecs_entity_t;
5864}
5865extern "C" {
5866 pub static mut EcsTera: ecs_entity_t;
5867}
5868extern "C" {
5869 pub static mut FLECS_IDEcsTeraID_: ecs_entity_t;
5870}
5871extern "C" {
5872 pub static mut EcsPeta: ecs_entity_t;
5873}
5874extern "C" {
5875 pub static mut FLECS_IDEcsPetaID_: ecs_entity_t;
5876}
5877extern "C" {
5878 pub static mut EcsExa: ecs_entity_t;
5879}
5880extern "C" {
5881 pub static mut FLECS_IDEcsExaID_: ecs_entity_t;
5882}
5883extern "C" {
5884 pub static mut EcsZetta: ecs_entity_t;
5885}
5886extern "C" {
5887 pub static mut FLECS_IDEcsZettaID_: ecs_entity_t;
5888}
5889extern "C" {
5890 pub static mut EcsYotta: ecs_entity_t;
5891}
5892extern "C" {
5893 pub static mut FLECS_IDEcsYottaID_: ecs_entity_t;
5894}
5895extern "C" {
5896 pub static mut EcsKibi: ecs_entity_t;
5897}
5898extern "C" {
5899 pub static mut FLECS_IDEcsKibiID_: ecs_entity_t;
5900}
5901extern "C" {
5902 pub static mut EcsMebi: ecs_entity_t;
5903}
5904extern "C" {
5905 pub static mut FLECS_IDEcsMebiID_: ecs_entity_t;
5906}
5907extern "C" {
5908 pub static mut EcsGibi: ecs_entity_t;
5909}
5910extern "C" {
5911 pub static mut FLECS_IDEcsGibiID_: ecs_entity_t;
5912}
5913extern "C" {
5914 pub static mut EcsTebi: ecs_entity_t;
5915}
5916extern "C" {
5917 pub static mut FLECS_IDEcsTebiID_: ecs_entity_t;
5918}
5919extern "C" {
5920 pub static mut EcsPebi: ecs_entity_t;
5921}
5922extern "C" {
5923 pub static mut FLECS_IDEcsPebiID_: ecs_entity_t;
5924}
5925extern "C" {
5926 pub static mut EcsExbi: ecs_entity_t;
5927}
5928extern "C" {
5929 pub static mut FLECS_IDEcsExbiID_: ecs_entity_t;
5930}
5931extern "C" {
5932 pub static mut EcsZebi: ecs_entity_t;
5933}
5934extern "C" {
5935 pub static mut FLECS_IDEcsZebiID_: ecs_entity_t;
5936}
5937extern "C" {
5938 pub static mut EcsYobi: ecs_entity_t;
5939}
5940extern "C" {
5941 pub static mut FLECS_IDEcsYobiID_: ecs_entity_t;
5942}
5943extern "C" {
5944 pub static mut EcsDuration: ecs_entity_t;
5945}
5946extern "C" {
5947 pub static mut FLECS_IDEcsDurationID_: ecs_entity_t;
5948}
5949extern "C" {
5950 pub static mut EcsPicoSeconds: ecs_entity_t;
5951}
5952extern "C" {
5953 pub static mut FLECS_IDEcsPicoSecondsID_: ecs_entity_t;
5954}
5955extern "C" {
5956 pub static mut EcsNanoSeconds: ecs_entity_t;
5957}
5958extern "C" {
5959 pub static mut FLECS_IDEcsNanoSecondsID_: ecs_entity_t;
5960}
5961extern "C" {
5962 pub static mut EcsMicroSeconds: ecs_entity_t;
5963}
5964extern "C" {
5965 pub static mut FLECS_IDEcsMicroSecondsID_: ecs_entity_t;
5966}
5967extern "C" {
5968 pub static mut EcsMilliSeconds: ecs_entity_t;
5969}
5970extern "C" {
5971 pub static mut FLECS_IDEcsMilliSecondsID_: ecs_entity_t;
5972}
5973extern "C" {
5974 pub static mut EcsSeconds: ecs_entity_t;
5975}
5976extern "C" {
5977 pub static mut FLECS_IDEcsSecondsID_: ecs_entity_t;
5978}
5979extern "C" {
5980 pub static mut EcsMinutes: ecs_entity_t;
5981}
5982extern "C" {
5983 pub static mut FLECS_IDEcsMinutesID_: ecs_entity_t;
5984}
5985extern "C" {
5986 pub static mut EcsHours: ecs_entity_t;
5987}
5988extern "C" {
5989 pub static mut FLECS_IDEcsHoursID_: ecs_entity_t;
5990}
5991extern "C" {
5992 pub static mut EcsDays: ecs_entity_t;
5993}
5994extern "C" {
5995 pub static mut FLECS_IDEcsDaysID_: ecs_entity_t;
5996}
5997extern "C" {
5998 pub static mut EcsTime: ecs_entity_t;
5999}
6000extern "C" {
6001 pub static mut FLECS_IDEcsTimeID_: ecs_entity_t;
6002}
6003extern "C" {
6004 pub static mut EcsDate: ecs_entity_t;
6005}
6006extern "C" {
6007 pub static mut FLECS_IDEcsDateID_: ecs_entity_t;
6008}
6009extern "C" {
6010 pub static mut EcsMass: ecs_entity_t;
6011}
6012extern "C" {
6013 pub static mut FLECS_IDEcsMassID_: ecs_entity_t;
6014}
6015extern "C" {
6016 pub static mut EcsGrams: ecs_entity_t;
6017}
6018extern "C" {
6019 pub static mut FLECS_IDEcsGramsID_: ecs_entity_t;
6020}
6021extern "C" {
6022 pub static mut EcsKiloGrams: ecs_entity_t;
6023}
6024extern "C" {
6025 pub static mut FLECS_IDEcsKiloGramsID_: ecs_entity_t;
6026}
6027extern "C" {
6028 pub static mut EcsElectricCurrent: ecs_entity_t;
6029}
6030extern "C" {
6031 pub static mut FLECS_IDEcsElectricCurrentID_: ecs_entity_t;
6032}
6033extern "C" {
6034 pub static mut EcsAmpere: ecs_entity_t;
6035}
6036extern "C" {
6037 pub static mut FLECS_IDEcsAmpereID_: ecs_entity_t;
6038}
6039extern "C" {
6040 pub static mut EcsAmount: ecs_entity_t;
6041}
6042extern "C" {
6043 pub static mut FLECS_IDEcsAmountID_: ecs_entity_t;
6044}
6045extern "C" {
6046 pub static mut EcsMole: ecs_entity_t;
6047}
6048extern "C" {
6049 pub static mut FLECS_IDEcsMoleID_: ecs_entity_t;
6050}
6051extern "C" {
6052 pub static mut EcsLuminousIntensity: ecs_entity_t;
6053}
6054extern "C" {
6055 pub static mut FLECS_IDEcsLuminousIntensityID_: ecs_entity_t;
6056}
6057extern "C" {
6058 pub static mut EcsCandela: ecs_entity_t;
6059}
6060extern "C" {
6061 pub static mut FLECS_IDEcsCandelaID_: ecs_entity_t;
6062}
6063extern "C" {
6064 pub static mut EcsForce: ecs_entity_t;
6065}
6066extern "C" {
6067 pub static mut FLECS_IDEcsForceID_: ecs_entity_t;
6068}
6069extern "C" {
6070 pub static mut EcsNewton: ecs_entity_t;
6071}
6072extern "C" {
6073 pub static mut FLECS_IDEcsNewtonID_: ecs_entity_t;
6074}
6075extern "C" {
6076 pub static mut EcsLength: ecs_entity_t;
6077}
6078extern "C" {
6079 pub static mut FLECS_IDEcsLengthID_: ecs_entity_t;
6080}
6081extern "C" {
6082 pub static mut EcsMeters: ecs_entity_t;
6083}
6084extern "C" {
6085 pub static mut FLECS_IDEcsMetersID_: ecs_entity_t;
6086}
6087extern "C" {
6088 pub static mut EcsPicoMeters: ecs_entity_t;
6089}
6090extern "C" {
6091 pub static mut FLECS_IDEcsPicoMetersID_: ecs_entity_t;
6092}
6093extern "C" {
6094 pub static mut EcsNanoMeters: ecs_entity_t;
6095}
6096extern "C" {
6097 pub static mut FLECS_IDEcsNanoMetersID_: ecs_entity_t;
6098}
6099extern "C" {
6100 pub static mut EcsMicroMeters: ecs_entity_t;
6101}
6102extern "C" {
6103 pub static mut FLECS_IDEcsMicroMetersID_: ecs_entity_t;
6104}
6105extern "C" {
6106 pub static mut EcsMilliMeters: ecs_entity_t;
6107}
6108extern "C" {
6109 pub static mut FLECS_IDEcsMilliMetersID_: ecs_entity_t;
6110}
6111extern "C" {
6112 pub static mut EcsCentiMeters: ecs_entity_t;
6113}
6114extern "C" {
6115 pub static mut FLECS_IDEcsCentiMetersID_: ecs_entity_t;
6116}
6117extern "C" {
6118 pub static mut EcsKiloMeters: ecs_entity_t;
6119}
6120extern "C" {
6121 pub static mut FLECS_IDEcsKiloMetersID_: ecs_entity_t;
6122}
6123extern "C" {
6124 pub static mut EcsMiles: ecs_entity_t;
6125}
6126extern "C" {
6127 pub static mut FLECS_IDEcsMilesID_: ecs_entity_t;
6128}
6129extern "C" {
6130 pub static mut EcsPixels: ecs_entity_t;
6131}
6132extern "C" {
6133 pub static mut FLECS_IDEcsPixelsID_: ecs_entity_t;
6134}
6135extern "C" {
6136 pub static mut EcsPressure: ecs_entity_t;
6137}
6138extern "C" {
6139 pub static mut FLECS_IDEcsPressureID_: ecs_entity_t;
6140}
6141extern "C" {
6142 pub static mut EcsPascal: ecs_entity_t;
6143}
6144extern "C" {
6145 pub static mut FLECS_IDEcsPascalID_: ecs_entity_t;
6146}
6147extern "C" {
6148 pub static mut EcsBar: ecs_entity_t;
6149}
6150extern "C" {
6151 pub static mut FLECS_IDEcsBarID_: ecs_entity_t;
6152}
6153extern "C" {
6154 pub static mut EcsSpeed: ecs_entity_t;
6155}
6156extern "C" {
6157 pub static mut FLECS_IDEcsSpeedID_: ecs_entity_t;
6158}
6159extern "C" {
6160 pub static mut EcsMetersPerSecond: ecs_entity_t;
6161}
6162extern "C" {
6163 pub static mut FLECS_IDEcsMetersPerSecondID_: ecs_entity_t;
6164}
6165extern "C" {
6166 pub static mut EcsKiloMetersPerSecond: ecs_entity_t;
6167}
6168extern "C" {
6169 pub static mut FLECS_IDEcsKiloMetersPerSecondID_: ecs_entity_t;
6170}
6171extern "C" {
6172 pub static mut EcsKiloMetersPerHour: ecs_entity_t;
6173}
6174extern "C" {
6175 pub static mut FLECS_IDEcsKiloMetersPerHourID_: ecs_entity_t;
6176}
6177extern "C" {
6178 pub static mut EcsMilesPerHour: ecs_entity_t;
6179}
6180extern "C" {
6181 pub static mut FLECS_IDEcsMilesPerHourID_: ecs_entity_t;
6182}
6183extern "C" {
6184 pub static mut EcsTemperature: ecs_entity_t;
6185}
6186extern "C" {
6187 pub static mut FLECS_IDEcsTemperatureID_: ecs_entity_t;
6188}
6189extern "C" {
6190 pub static mut EcsKelvin: ecs_entity_t;
6191}
6192extern "C" {
6193 pub static mut FLECS_IDEcsKelvinID_: ecs_entity_t;
6194}
6195extern "C" {
6196 pub static mut EcsCelsius: ecs_entity_t;
6197}
6198extern "C" {
6199 pub static mut FLECS_IDEcsCelsiusID_: ecs_entity_t;
6200}
6201extern "C" {
6202 pub static mut EcsFahrenheit: ecs_entity_t;
6203}
6204extern "C" {
6205 pub static mut FLECS_IDEcsFahrenheitID_: ecs_entity_t;
6206}
6207extern "C" {
6208 pub static mut EcsData: ecs_entity_t;
6209}
6210extern "C" {
6211 pub static mut FLECS_IDEcsDataID_: ecs_entity_t;
6212}
6213extern "C" {
6214 pub static mut EcsBits: ecs_entity_t;
6215}
6216extern "C" {
6217 pub static mut FLECS_IDEcsBitsID_: ecs_entity_t;
6218}
6219extern "C" {
6220 pub static mut EcsKiloBits: ecs_entity_t;
6221}
6222extern "C" {
6223 pub static mut FLECS_IDEcsKiloBitsID_: ecs_entity_t;
6224}
6225extern "C" {
6226 pub static mut EcsMegaBits: ecs_entity_t;
6227}
6228extern "C" {
6229 pub static mut FLECS_IDEcsMegaBitsID_: ecs_entity_t;
6230}
6231extern "C" {
6232 pub static mut EcsGigaBits: ecs_entity_t;
6233}
6234extern "C" {
6235 pub static mut FLECS_IDEcsGigaBitsID_: ecs_entity_t;
6236}
6237extern "C" {
6238 pub static mut EcsBytes: ecs_entity_t;
6239}
6240extern "C" {
6241 pub static mut FLECS_IDEcsBytesID_: ecs_entity_t;
6242}
6243extern "C" {
6244 pub static mut EcsKiloBytes: ecs_entity_t;
6245}
6246extern "C" {
6247 pub static mut FLECS_IDEcsKiloBytesID_: ecs_entity_t;
6248}
6249extern "C" {
6250 pub static mut EcsMegaBytes: ecs_entity_t;
6251}
6252extern "C" {
6253 pub static mut FLECS_IDEcsMegaBytesID_: ecs_entity_t;
6254}
6255extern "C" {
6256 pub static mut EcsGigaBytes: ecs_entity_t;
6257}
6258extern "C" {
6259 pub static mut FLECS_IDEcsGigaBytesID_: ecs_entity_t;
6260}
6261extern "C" {
6262 pub static mut EcsKibiBytes: ecs_entity_t;
6263}
6264extern "C" {
6265 pub static mut FLECS_IDEcsKibiBytesID_: ecs_entity_t;
6266}
6267extern "C" {
6268 pub static mut EcsMebiBytes: ecs_entity_t;
6269}
6270extern "C" {
6271 pub static mut FLECS_IDEcsMebiBytesID_: ecs_entity_t;
6272}
6273extern "C" {
6274 pub static mut EcsGibiBytes: ecs_entity_t;
6275}
6276extern "C" {
6277 pub static mut FLECS_IDEcsGibiBytesID_: ecs_entity_t;
6278}
6279extern "C" {
6280 pub static mut EcsDataRate: ecs_entity_t;
6281}
6282extern "C" {
6283 pub static mut FLECS_IDEcsDataRateID_: ecs_entity_t;
6284}
6285extern "C" {
6286 pub static mut EcsBitsPerSecond: ecs_entity_t;
6287}
6288extern "C" {
6289 pub static mut FLECS_IDEcsBitsPerSecondID_: ecs_entity_t;
6290}
6291extern "C" {
6292 pub static mut EcsKiloBitsPerSecond: ecs_entity_t;
6293}
6294extern "C" {
6295 pub static mut FLECS_IDEcsKiloBitsPerSecondID_: ecs_entity_t;
6296}
6297extern "C" {
6298 pub static mut EcsMegaBitsPerSecond: ecs_entity_t;
6299}
6300extern "C" {
6301 pub static mut FLECS_IDEcsMegaBitsPerSecondID_: ecs_entity_t;
6302}
6303extern "C" {
6304 pub static mut EcsGigaBitsPerSecond: ecs_entity_t;
6305}
6306extern "C" {
6307 pub static mut FLECS_IDEcsGigaBitsPerSecondID_: ecs_entity_t;
6308}
6309extern "C" {
6310 pub static mut EcsBytesPerSecond: ecs_entity_t;
6311}
6312extern "C" {
6313 pub static mut FLECS_IDEcsBytesPerSecondID_: ecs_entity_t;
6314}
6315extern "C" {
6316 pub static mut EcsKiloBytesPerSecond: ecs_entity_t;
6317}
6318extern "C" {
6319 pub static mut FLECS_IDEcsKiloBytesPerSecondID_: ecs_entity_t;
6320}
6321extern "C" {
6322 pub static mut EcsMegaBytesPerSecond: ecs_entity_t;
6323}
6324extern "C" {
6325 pub static mut FLECS_IDEcsMegaBytesPerSecondID_: ecs_entity_t;
6326}
6327extern "C" {
6328 pub static mut EcsGigaBytesPerSecond: ecs_entity_t;
6329}
6330extern "C" {
6331 pub static mut FLECS_IDEcsGigaBytesPerSecondID_: ecs_entity_t;
6332}
6333extern "C" {
6334 pub static mut EcsAngle: ecs_entity_t;
6335}
6336extern "C" {
6337 pub static mut FLECS_IDEcsAngleID_: ecs_entity_t;
6338}
6339extern "C" {
6340 pub static mut EcsRadians: ecs_entity_t;
6341}
6342extern "C" {
6343 pub static mut FLECS_IDEcsRadiansID_: ecs_entity_t;
6344}
6345extern "C" {
6346 pub static mut EcsDegrees: ecs_entity_t;
6347}
6348extern "C" {
6349 pub static mut FLECS_IDEcsDegreesID_: ecs_entity_t;
6350}
6351extern "C" {
6352 pub static mut EcsFrequency: ecs_entity_t;
6353}
6354extern "C" {
6355 pub static mut FLECS_IDEcsFrequencyID_: ecs_entity_t;
6356}
6357extern "C" {
6358 pub static mut EcsHertz: ecs_entity_t;
6359}
6360extern "C" {
6361 pub static mut FLECS_IDEcsHertzID_: ecs_entity_t;
6362}
6363extern "C" {
6364 pub static mut EcsKiloHertz: ecs_entity_t;
6365}
6366extern "C" {
6367 pub static mut FLECS_IDEcsKiloHertzID_: ecs_entity_t;
6368}
6369extern "C" {
6370 pub static mut EcsMegaHertz: ecs_entity_t;
6371}
6372extern "C" {
6373 pub static mut FLECS_IDEcsMegaHertzID_: ecs_entity_t;
6374}
6375extern "C" {
6376 pub static mut EcsGigaHertz: ecs_entity_t;
6377}
6378extern "C" {
6379 pub static mut FLECS_IDEcsGigaHertzID_: ecs_entity_t;
6380}
6381extern "C" {
6382 pub static mut EcsUri: ecs_entity_t;
6383}
6384extern "C" {
6385 pub static mut FLECS_IDEcsUriID_: ecs_entity_t;
6386}
6387extern "C" {
6388 pub static mut EcsUriHyperlink: ecs_entity_t;
6389}
6390extern "C" {
6391 pub static mut FLECS_IDEcsUriHyperlinkID_: ecs_entity_t;
6392}
6393extern "C" {
6394 pub static mut EcsUriImage: ecs_entity_t;
6395}
6396extern "C" {
6397 pub static mut FLECS_IDEcsUriImageID_: ecs_entity_t;
6398}
6399extern "C" {
6400 pub static mut EcsUriFile: ecs_entity_t;
6401}
6402extern "C" {
6403 pub static mut FLECS_IDEcsUriFileID_: ecs_entity_t;
6404}
6405extern "C" {
6406 pub static mut EcsAcceleration: ecs_entity_t;
6407}
6408extern "C" {
6409 pub static mut FLECS_IDEcsAccelerationID_: ecs_entity_t;
6410}
6411extern "C" {
6412 pub static mut EcsPercentage: ecs_entity_t;
6413}
6414extern "C" {
6415 pub static mut FLECS_IDEcsPercentageID_: ecs_entity_t;
6416}
6417extern "C" {
6418 pub static mut EcsBel: ecs_entity_t;
6419}
6420extern "C" {
6421 pub static mut FLECS_IDEcsBelID_: ecs_entity_t;
6422}
6423extern "C" {
6424 pub static mut EcsDeciBel: ecs_entity_t;
6425}
6426extern "C" {
6427 pub static mut FLECS_IDEcsDeciBelID_: ecs_entity_t;
6428}
6429extern "C" {
6430 #[doc = "Module"]
6431 pub fn FlecsUnitsImport(world: *mut ecs_world_t);
6432}
6433#[doc = "Primitive type definitions.\n These typedefs allow the builtin primitives to be used as regular components:\n ecs_set(world, e, ecs_i32_t, {10});\n\n Or a more useful example (create an enum constant with a manual value):\n ecs_set_pair_object(world, e, EcsConstant, ecs_i32_t, {10});"]
6434pub type ecs_bool_t = bool;
6435pub type ecs_char_t = ::std::os::raw::c_char;
6436pub type ecs_byte_t = ::std::os::raw::c_uchar;
6437pub type ecs_u8_t = u8;
6438pub type ecs_u16_t = u16;
6439pub type ecs_u32_t = u32;
6440pub type ecs_u64_t = u64;
6441pub type ecs_uptr_t = usize;
6442pub type ecs_i8_t = i8;
6443pub type ecs_i16_t = i16;
6444pub type ecs_i32_t = i32;
6445pub type ecs_i64_t = i64;
6446pub type ecs_iptr_t = isize;
6447pub type ecs_f32_t = f32;
6448pub type ecs_f64_t = f64;
6449pub type ecs_string_t = *mut ::std::os::raw::c_char;
6450extern "C" {
6451 pub static FLECS_IDEcsMetaTypeID_: ecs_entity_t;
6452}
6453extern "C" {
6454 pub static FLECS_IDEcsMetaTypeSerializedID_: ecs_entity_t;
6455}
6456extern "C" {
6457 pub static FLECS_IDEcsPrimitiveID_: ecs_entity_t;
6458}
6459extern "C" {
6460 pub static FLECS_IDEcsEnumID_: ecs_entity_t;
6461}
6462extern "C" {
6463 pub static FLECS_IDEcsBitmaskID_: ecs_entity_t;
6464}
6465extern "C" {
6466 pub static FLECS_IDEcsMemberID_: ecs_entity_t;
6467}
6468extern "C" {
6469 pub static FLECS_IDEcsMemberRangesID_: ecs_entity_t;
6470}
6471extern "C" {
6472 pub static FLECS_IDEcsStructID_: ecs_entity_t;
6473}
6474extern "C" {
6475 pub static FLECS_IDEcsArrayID_: ecs_entity_t;
6476}
6477extern "C" {
6478 pub static FLECS_IDEcsVectorID_: ecs_entity_t;
6479}
6480extern "C" {
6481 pub static FLECS_IDEcsOpaqueID_: ecs_entity_t;
6482}
6483extern "C" {
6484 pub static FLECS_IDEcsUnitID_: ecs_entity_t;
6485}
6486extern "C" {
6487 pub static FLECS_IDEcsUnitPrefixID_: ecs_entity_t;
6488}
6489extern "C" {
6490 pub static EcsConstant: ecs_entity_t;
6491}
6492extern "C" {
6493 pub static EcsQuantity: ecs_entity_t;
6494}
6495extern "C" {
6496 pub static FLECS_IDecs_bool_tID_: ecs_entity_t;
6497}
6498extern "C" {
6499 pub static FLECS_IDecs_char_tID_: ecs_entity_t;
6500}
6501extern "C" {
6502 pub static FLECS_IDecs_byte_tID_: ecs_entity_t;
6503}
6504extern "C" {
6505 pub static FLECS_IDecs_u8_tID_: ecs_entity_t;
6506}
6507extern "C" {
6508 pub static FLECS_IDecs_u16_tID_: ecs_entity_t;
6509}
6510extern "C" {
6511 pub static FLECS_IDecs_u32_tID_: ecs_entity_t;
6512}
6513extern "C" {
6514 pub static FLECS_IDecs_u64_tID_: ecs_entity_t;
6515}
6516extern "C" {
6517 pub static FLECS_IDecs_uptr_tID_: ecs_entity_t;
6518}
6519extern "C" {
6520 pub static FLECS_IDecs_i8_tID_: ecs_entity_t;
6521}
6522extern "C" {
6523 pub static FLECS_IDecs_i16_tID_: ecs_entity_t;
6524}
6525extern "C" {
6526 pub static FLECS_IDecs_i32_tID_: ecs_entity_t;
6527}
6528extern "C" {
6529 pub static FLECS_IDecs_i64_tID_: ecs_entity_t;
6530}
6531extern "C" {
6532 pub static FLECS_IDecs_iptr_tID_: ecs_entity_t;
6533}
6534extern "C" {
6535 pub static FLECS_IDecs_f32_tID_: ecs_entity_t;
6536}
6537extern "C" {
6538 pub static FLECS_IDecs_f64_tID_: ecs_entity_t;
6539}
6540extern "C" {
6541 pub static FLECS_IDecs_string_tID_: ecs_entity_t;
6542}
6543extern "C" {
6544 pub static FLECS_IDecs_entity_tID_: ecs_entity_t;
6545}
6546pub const ecs_type_kind_t_EcsPrimitiveType: ecs_type_kind_t = 0;
6547pub const ecs_type_kind_t_EcsBitmaskType: ecs_type_kind_t = 1;
6548pub const ecs_type_kind_t_EcsEnumType: ecs_type_kind_t = 2;
6549pub const ecs_type_kind_t_EcsStructType: ecs_type_kind_t = 3;
6550pub const ecs_type_kind_t_EcsArrayType: ecs_type_kind_t = 4;
6551pub const ecs_type_kind_t_EcsVectorType: ecs_type_kind_t = 5;
6552pub const ecs_type_kind_t_EcsOpaqueType: ecs_type_kind_t = 6;
6553pub const ecs_type_kind_t_EcsTypeKindLast: ecs_type_kind_t = 6;
6554#[doc = "Type kinds supported by meta addon"]
6555pub type ecs_type_kind_t = ::std::os::raw::c_uint;
6556#[doc = "Component that is automatically added to every type with the right kind."]
6557#[repr(C)]
6558#[derive(Debug, Copy, Clone)]
6559pub struct EcsMetaType {
6560 pub kind: ecs_type_kind_t,
6561 #[doc = "< Did the type exist or is it populated from reflection"]
6562 pub existing: bool,
6563 #[doc = "< Is the reflection data a partial type description"]
6564 pub partial: bool,
6565}
6566pub const ecs_primitive_kind_t_EcsBool: ecs_primitive_kind_t = 1;
6567pub const ecs_primitive_kind_t_EcsChar: ecs_primitive_kind_t = 2;
6568pub const ecs_primitive_kind_t_EcsByte: ecs_primitive_kind_t = 3;
6569pub const ecs_primitive_kind_t_EcsU8: ecs_primitive_kind_t = 4;
6570pub const ecs_primitive_kind_t_EcsU16: ecs_primitive_kind_t = 5;
6571pub const ecs_primitive_kind_t_EcsU32: ecs_primitive_kind_t = 6;
6572pub const ecs_primitive_kind_t_EcsU64: ecs_primitive_kind_t = 7;
6573pub const ecs_primitive_kind_t_EcsI8: ecs_primitive_kind_t = 8;
6574pub const ecs_primitive_kind_t_EcsI16: ecs_primitive_kind_t = 9;
6575pub const ecs_primitive_kind_t_EcsI32: ecs_primitive_kind_t = 10;
6576pub const ecs_primitive_kind_t_EcsI64: ecs_primitive_kind_t = 11;
6577pub const ecs_primitive_kind_t_EcsF32: ecs_primitive_kind_t = 12;
6578pub const ecs_primitive_kind_t_EcsF64: ecs_primitive_kind_t = 13;
6579pub const ecs_primitive_kind_t_EcsUPtr: ecs_primitive_kind_t = 14;
6580pub const ecs_primitive_kind_t_EcsIPtr: ecs_primitive_kind_t = 15;
6581pub const ecs_primitive_kind_t_EcsString: ecs_primitive_kind_t = 16;
6582pub const ecs_primitive_kind_t_EcsEntity: ecs_primitive_kind_t = 17;
6583pub const ecs_primitive_kind_t_EcsPrimitiveKindLast: ecs_primitive_kind_t = 17;
6584#[doc = "Primitive type kinds supported by meta addon"]
6585pub type ecs_primitive_kind_t = ::std::os::raw::c_uint;
6586#[doc = "Component added to primitive types"]
6587#[repr(C)]
6588#[derive(Debug, Copy, Clone)]
6589pub struct EcsPrimitive {
6590 pub kind: ecs_primitive_kind_t,
6591}
6592#[doc = "Component added to member entities"]
6593#[repr(C)]
6594#[derive(Debug, Copy, Clone)]
6595pub struct EcsMember {
6596 pub type_: ecs_entity_t,
6597 pub count: i32,
6598 pub unit: ecs_entity_t,
6599 pub offset: i32,
6600}
6601#[doc = "Type expressing a range for a member value"]
6602#[repr(C)]
6603#[derive(Debug, Copy, Clone)]
6604pub struct ecs_member_value_range_t {
6605 pub min: f64,
6606 pub max: f64,
6607}
6608#[doc = "Component added to member entities to express valid value ranges"]
6609#[repr(C)]
6610#[derive(Debug, Copy, Clone)]
6611pub struct EcsMemberRanges {
6612 pub value: ecs_member_value_range_t,
6613 pub warning: ecs_member_value_range_t,
6614 pub error: ecs_member_value_range_t,
6615}
6616#[doc = "Element type of members vector in EcsStruct"]
6617#[repr(C)]
6618#[derive(Debug, Copy, Clone)]
6619pub struct ecs_member_t {
6620 #[doc = "Must be set when used with ecs_struct_desc_t"]
6621 pub name: *const ::std::os::raw::c_char,
6622 pub type_: ecs_entity_t,
6623 #[doc = "May be set when used with ecs_struct_desc_t"]
6624 pub count: i32,
6625 pub offset: i32,
6626 #[doc = "May be set when used with ecs_struct_desc_t, will be auto-populated if\n type entity is also a unit"]
6627 pub unit: ecs_entity_t,
6628 #[doc = "Numerical range that specifies which values member can assume. This\n range may be used by UI elements such as a progress bar or slider. The\n value of a member should not exceed this range."]
6629 pub range: ecs_member_value_range_t,
6630 #[doc = "Numerical range outside of which the value represents an error. This\n range may be used by UI elements to style a value."]
6631 pub error_range: ecs_member_value_range_t,
6632 #[doc = "Numerical range outside of which the value represents an warning. This\n range may be used by UI elements to style a value."]
6633 pub warning_range: ecs_member_value_range_t,
6634 #[doc = "Should not be set by ecs_struct_desc_t"]
6635 pub size: ecs_size_t,
6636 pub member: ecs_entity_t,
6637}
6638#[doc = "Component added to struct type entities"]
6639#[repr(C)]
6640#[derive(Debug, Copy, Clone)]
6641pub struct EcsStruct {
6642 #[doc = "vector<ecs_member_t>"]
6643 pub members: ecs_vec_t,
6644}
6645#[repr(C)]
6646#[derive(Debug, Copy, Clone)]
6647pub struct ecs_enum_constant_t {
6648 #[doc = "Must be set when used with ecs_enum_desc_t"]
6649 pub name: *const ::std::os::raw::c_char,
6650 #[doc = "May be set when used with ecs_enum_desc_t"]
6651 pub value: i32,
6652 #[doc = "Should not be set by ecs_enum_desc_t"]
6653 pub constant: ecs_entity_t,
6654}
6655#[doc = "Component added to enum type entities"]
6656#[repr(C)]
6657#[derive(Debug, Copy, Clone)]
6658pub struct EcsEnum {
6659 #[doc = "map<i32_t, ecs_enum_constant_t>"]
6660 pub constants: ecs_map_t,
6661}
6662#[repr(C)]
6663#[derive(Debug, Copy, Clone)]
6664pub struct ecs_bitmask_constant_t {
6665 #[doc = "Must be set when used with ecs_bitmask_desc_t"]
6666 pub name: *const ::std::os::raw::c_char,
6667 #[doc = "May be set when used with ecs_bitmask_desc_t"]
6668 pub value: ecs_flags32_t,
6669 #[doc = "Should not be set by ecs_bitmask_desc_t"]
6670 pub constant: ecs_entity_t,
6671}
6672#[doc = "Component added to bitmask type entities"]
6673#[repr(C)]
6674#[derive(Debug, Copy, Clone)]
6675pub struct EcsBitmask {
6676 #[doc = "map<u32_t, ecs_bitmask_constant_t>"]
6677 pub constants: ecs_map_t,
6678}
6679#[doc = "Component added to array type entities"]
6680#[repr(C)]
6681#[derive(Debug, Copy, Clone)]
6682pub struct EcsArray {
6683 #[doc = "< Element type"]
6684 pub type_: ecs_entity_t,
6685 #[doc = "< Number of elements"]
6686 pub count: i32,
6687}
6688#[doc = "Component added to vector type entities"]
6689#[repr(C)]
6690#[derive(Debug, Copy, Clone)]
6691pub struct EcsVector {
6692 #[doc = "< Element type"]
6693 pub type_: ecs_entity_t,
6694}
6695#[doc = "Serializer interface"]
6696#[repr(C)]
6697#[derive(Debug, Copy, Clone)]
6698pub struct ecs_serializer_t {
6699 #[doc = "Serialize value"]
6700 pub value: ::std::option::Option<
6701 unsafe extern "C" fn(
6702 ser: *const ecs_serializer_t,
6703 type_: ecs_entity_t,
6704 value: *const ::std::os::raw::c_void,
6705 ) -> ::std::os::raw::c_int,
6706 >,
6707 #[doc = "Serialize member"]
6708 pub member: ::std::option::Option<
6709 unsafe extern "C" fn(
6710 ser: *const ecs_serializer_t,
6711 member: *const ::std::os::raw::c_char,
6712 ) -> ::std::os::raw::c_int,
6713 >,
6714 pub world: *const ecs_world_t,
6715 pub ctx: *mut ::std::os::raw::c_void,
6716}
6717#[doc = "Callback invoked serializing an opaque type."]
6718pub type ecs_meta_serialize_t = ::std::option::Option<
6719 unsafe extern "C" fn(
6720 ser: *const ecs_serializer_t,
6721 src: *const ::std::os::raw::c_void,
6722 ) -> ::std::os::raw::c_int,
6723>;
6724#[repr(C)]
6725#[derive(Debug, Copy, Clone)]
6726pub struct EcsOpaque {
6727 #[doc = "< Type that describes the serialized output"]
6728 pub as_type: ecs_entity_t,
6729 #[doc = "< Serialize action"]
6730 pub serialize: ecs_meta_serialize_t,
6731 #[doc = "Assign bool value"]
6732 pub assign_bool:
6733 ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void, value: bool)>,
6734 #[doc = "Assign char value"]
6735 pub assign_char: ::std::option::Option<
6736 unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void, value: ::std::os::raw::c_char),
6737 >,
6738 #[doc = "Assign int value"]
6739 pub assign_int:
6740 ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void, value: i64)>,
6741 #[doc = "Assign unsigned int value"]
6742 pub assign_uint:
6743 ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void, value: u64)>,
6744 #[doc = "Assign float value"]
6745 pub assign_float:
6746 ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void, value: f64)>,
6747 #[doc = "Assign string value"]
6748 pub assign_string: ::std::option::Option<
6749 unsafe extern "C" fn(
6750 dst: *mut ::std::os::raw::c_void,
6751 value: *const ::std::os::raw::c_char,
6752 ),
6753 >,
6754 #[doc = "Assign entity value"]
6755 pub assign_entity: ::std::option::Option<
6756 unsafe extern "C" fn(
6757 dst: *mut ::std::os::raw::c_void,
6758 world: *mut ecs_world_t,
6759 entity: ecs_entity_t,
6760 ),
6761 >,
6762 #[doc = "Assign null value"]
6763 pub assign_null: ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void)>,
6764 #[doc = "Clear collection elements"]
6765 pub clear: ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void)>,
6766 #[doc = "Ensure & get collection element"]
6767 pub ensure_element: ::std::option::Option<
6768 unsafe extern "C" fn(
6769 dst: *mut ::std::os::raw::c_void,
6770 elem: usize,
6771 ) -> *mut ::std::os::raw::c_void,
6772 >,
6773 #[doc = "Ensure & get element"]
6774 pub ensure_member: ::std::option::Option<
6775 unsafe extern "C" fn(
6776 dst: *mut ::std::os::raw::c_void,
6777 member: *const ::std::os::raw::c_char,
6778 ) -> *mut ::std::os::raw::c_void,
6779 >,
6780 #[doc = "Return number of elements"]
6781 pub count:
6782 ::std::option::Option<unsafe extern "C" fn(dst: *const ::std::os::raw::c_void) -> usize>,
6783 #[doc = "Resize to number of elements"]
6784 pub resize:
6785 ::std::option::Option<unsafe extern "C" fn(dst: *mut ::std::os::raw::c_void, count: usize)>,
6786}
6787#[doc = "Helper type to describe translation between two units. Note that this\n is not intended as a generic approach to unit conversions (e.g. from celsius\n to fahrenheit) but to translate between units that derive from the same base\n (e.g. meters to kilometers).\n\n Note that power is applied to the factor. When describing a translation of\n 1000, either use {factor = 1000, power = 1} or {factor = 1, power = 3}."]
6788#[repr(C)]
6789#[derive(Debug, Copy, Clone)]
6790pub struct ecs_unit_translation_t {
6791 #[doc = "< Factor to apply (e.g. \"1000\", \"1000000\", \"1024\")"]
6792 pub factor: i32,
6793 #[doc = "< Power to apply to factor (e.g. \"1\", \"3\", \"-9\")"]
6794 pub power: i32,
6795}
6796#[repr(C)]
6797#[derive(Debug, Copy, Clone)]
6798pub struct EcsUnit {
6799 pub symbol: *mut ::std::os::raw::c_char,
6800 #[doc = "< Order of magnitude prefix relative to derived"]
6801 pub prefix: ecs_entity_t,
6802 #[doc = "< Base unit (e.g. \"meters\")"]
6803 pub base: ecs_entity_t,
6804 #[doc = "< Over unit (e.g. \"per second\")"]
6805 pub over: ecs_entity_t,
6806 #[doc = "< Translation for derived unit"]
6807 pub translation: ecs_unit_translation_t,
6808}
6809#[repr(C)]
6810#[derive(Debug, Copy, Clone)]
6811pub struct EcsUnitPrefix {
6812 #[doc = "< Symbol of prefix (e.g. \"K\", \"M\", \"Ki\")"]
6813 pub symbol: *mut ::std::os::raw::c_char,
6814 #[doc = "< Translation of prefix"]
6815 pub translation: ecs_unit_translation_t,
6816}
6817pub const ecs_meta_type_op_kind_t_EcsOpArray: ecs_meta_type_op_kind_t = 0;
6818pub const ecs_meta_type_op_kind_t_EcsOpVector: ecs_meta_type_op_kind_t = 1;
6819pub const ecs_meta_type_op_kind_t_EcsOpOpaque: ecs_meta_type_op_kind_t = 2;
6820pub const ecs_meta_type_op_kind_t_EcsOpPush: ecs_meta_type_op_kind_t = 3;
6821pub const ecs_meta_type_op_kind_t_EcsOpPop: ecs_meta_type_op_kind_t = 4;
6822#[doc = "< Marks last constant that can open/close a scope"]
6823pub const ecs_meta_type_op_kind_t_EcsOpScope: ecs_meta_type_op_kind_t = 5;
6824pub const ecs_meta_type_op_kind_t_EcsOpEnum: ecs_meta_type_op_kind_t = 6;
6825pub const ecs_meta_type_op_kind_t_EcsOpBitmask: ecs_meta_type_op_kind_t = 7;
6826#[doc = "< Marks first constant that's a primitive"]
6827pub const ecs_meta_type_op_kind_t_EcsOpPrimitive: ecs_meta_type_op_kind_t = 8;
6828pub const ecs_meta_type_op_kind_t_EcsOpBool: ecs_meta_type_op_kind_t = 9;
6829pub const ecs_meta_type_op_kind_t_EcsOpChar: ecs_meta_type_op_kind_t = 10;
6830pub const ecs_meta_type_op_kind_t_EcsOpByte: ecs_meta_type_op_kind_t = 11;
6831pub const ecs_meta_type_op_kind_t_EcsOpU8: ecs_meta_type_op_kind_t = 12;
6832pub const ecs_meta_type_op_kind_t_EcsOpU16: ecs_meta_type_op_kind_t = 13;
6833pub const ecs_meta_type_op_kind_t_EcsOpU32: ecs_meta_type_op_kind_t = 14;
6834pub const ecs_meta_type_op_kind_t_EcsOpU64: ecs_meta_type_op_kind_t = 15;
6835pub const ecs_meta_type_op_kind_t_EcsOpI8: ecs_meta_type_op_kind_t = 16;
6836pub const ecs_meta_type_op_kind_t_EcsOpI16: ecs_meta_type_op_kind_t = 17;
6837pub const ecs_meta_type_op_kind_t_EcsOpI32: ecs_meta_type_op_kind_t = 18;
6838pub const ecs_meta_type_op_kind_t_EcsOpI64: ecs_meta_type_op_kind_t = 19;
6839pub const ecs_meta_type_op_kind_t_EcsOpF32: ecs_meta_type_op_kind_t = 20;
6840pub const ecs_meta_type_op_kind_t_EcsOpF64: ecs_meta_type_op_kind_t = 21;
6841pub const ecs_meta_type_op_kind_t_EcsOpUPtr: ecs_meta_type_op_kind_t = 22;
6842pub const ecs_meta_type_op_kind_t_EcsOpIPtr: ecs_meta_type_op_kind_t = 23;
6843pub const ecs_meta_type_op_kind_t_EcsOpString: ecs_meta_type_op_kind_t = 24;
6844pub const ecs_meta_type_op_kind_t_EcsOpEntity: ecs_meta_type_op_kind_t = 25;
6845pub const ecs_meta_type_op_kind_t_EcsMetaTypeOpKindLast: ecs_meta_type_op_kind_t = 25;
6846#[doc = "Serializer utilities"]
6847pub type ecs_meta_type_op_kind_t = ::std::os::raw::c_uint;
6848#[repr(C)]
6849#[derive(Debug, Copy, Clone)]
6850pub struct ecs_meta_type_op_t {
6851 pub kind: ecs_meta_type_op_kind_t,
6852 #[doc = "< Offset of current field"]
6853 pub offset: ecs_size_t,
6854 pub count: i32,
6855 #[doc = "< Name of value (only used for struct members)"]
6856 pub name: *const ::std::os::raw::c_char,
6857 #[doc = "< Number of operations until next field or end"]
6858 pub op_count: i32,
6859 #[doc = "< Size of type of operation"]
6860 pub size: ecs_size_t,
6861 #[doc = "< Type entity"]
6862 pub type_: ecs_entity_t,
6863 #[doc = "< Index of member in struct"]
6864 pub member_index: i32,
6865 #[doc = "< string -> member index (structs only)"]
6866 pub members: *mut ecs_hashmap_t,
6867}
6868#[repr(C)]
6869#[derive(Debug, Copy, Clone)]
6870pub struct EcsMetaTypeSerialized {
6871 #[doc = "< vector<ecs_meta_type_op_t>"]
6872 pub ops: ecs_vec_t,
6873}
6874#[repr(C)]
6875#[derive(Debug, Copy, Clone)]
6876pub struct ecs_meta_scope_t {
6877 #[doc = "< The type being iterated"]
6878 pub type_: ecs_entity_t,
6879 #[doc = "< The type operations (see ecs_meta_type_op_t)"]
6880 pub ops: *mut ecs_meta_type_op_t,
6881 #[doc = "< Number of operations in ops array to process"]
6882 pub op_count: i32,
6883 #[doc = "< Current operation"]
6884 pub op_cur: i32,
6885 #[doc = "< Current element (for collections)"]
6886 pub elem_cur: i32,
6887 #[doc = "< Depth to restore, in case dotmember was used"]
6888 pub prev_depth: i32,
6889 #[doc = "< Pointer to the value being iterated"]
6890 pub ptr: *mut ::std::os::raw::c_void,
6891 #[doc = "< Pointer to component, in case size/alignment is needed"]
6892 pub comp: *const EcsComponent,
6893 #[doc = "< Opaque type interface"]
6894 pub opaque: *const EcsOpaque,
6895 #[doc = "< Current vector, in case a vector is iterated"]
6896 pub vector: *mut ecs_vec_t,
6897 #[doc = "< string -> member index"]
6898 pub members: *mut ecs_hashmap_t,
6899 #[doc = "< Is the scope iterating elements?"]
6900 pub is_collection: bool,
6901 #[doc = "< Is the scope iterating an inline array?"]
6902 pub is_inline_array: bool,
6903 #[doc = "< Was scope populated (for collections)"]
6904 pub is_empty_scope: bool,
6905}
6906#[doc = "Type that enables iterating/populating a value using reflection data"]
6907#[repr(C)]
6908#[derive(Debug, Copy, Clone)]
6909pub struct ecs_meta_cursor_t {
6910 pub world: *const ecs_world_t,
6911 pub scope: [ecs_meta_scope_t; 32usize],
6912 pub depth: i32,
6913 pub valid: bool,
6914 #[doc = "< If in root scope, this allows for a push for primitive types"]
6915 pub is_primitive_scope: bool,
6916 #[doc = "Custom entity lookup action for overriding default ecs_lookup_fullpath"]
6917 pub lookup_action: ::std::option::Option<
6918 unsafe extern "C" fn(
6919 arg1: *const ecs_world_t,
6920 arg2: *const ::std::os::raw::c_char,
6921 arg3: *mut ::std::os::raw::c_void,
6922 ) -> ecs_entity_t,
6923 >,
6924 pub lookup_ctx: *mut ::std::os::raw::c_void,
6925}
6926extern "C" {
6927 pub fn ecs_meta_cursor(
6928 world: *const ecs_world_t,
6929 type_: ecs_entity_t,
6930 ptr: *mut ::std::os::raw::c_void,
6931 ) -> ecs_meta_cursor_t;
6932}
6933extern "C" {
6934 #[doc = "Get pointer to current field"]
6935 pub fn ecs_meta_get_ptr(cursor: *mut ecs_meta_cursor_t) -> *mut ::std::os::raw::c_void;
6936}
6937extern "C" {
6938 #[doc = "Move cursor to next field"]
6939 pub fn ecs_meta_next(cursor: *mut ecs_meta_cursor_t) -> ::std::os::raw::c_int;
6940}
6941extern "C" {
6942 #[doc = "Move cursor to a element"]
6943 pub fn ecs_meta_elem(cursor: *mut ecs_meta_cursor_t, elem: i32) -> ::std::os::raw::c_int;
6944}
6945extern "C" {
6946 #[doc = "Move cursor to member"]
6947 pub fn ecs_meta_member(
6948 cursor: *mut ecs_meta_cursor_t,
6949 name: *const ::std::os::raw::c_char,
6950 ) -> ::std::os::raw::c_int;
6951}
6952extern "C" {
6953 #[doc = "Move cursor to member, supports dot-separated nested members"]
6954 pub fn ecs_meta_dotmember(
6955 cursor: *mut ecs_meta_cursor_t,
6956 name: *const ::std::os::raw::c_char,
6957 ) -> ::std::os::raw::c_int;
6958}
6959extern "C" {
6960 #[doc = "Push a scope (required/only valid for structs & collections)"]
6961 pub fn ecs_meta_push(cursor: *mut ecs_meta_cursor_t) -> ::std::os::raw::c_int;
6962}
6963extern "C" {
6964 #[doc = "Pop a struct or collection scope (must follow a push)"]
6965 pub fn ecs_meta_pop(cursor: *mut ecs_meta_cursor_t) -> ::std::os::raw::c_int;
6966}
6967extern "C" {
6968 #[doc = "Is the current scope a collection?"]
6969 pub fn ecs_meta_is_collection(cursor: *const ecs_meta_cursor_t) -> bool;
6970}
6971extern "C" {
6972 #[doc = "Get type of current element."]
6973 pub fn ecs_meta_get_type(cursor: *const ecs_meta_cursor_t) -> ecs_entity_t;
6974}
6975extern "C" {
6976 #[doc = "Get unit of current element."]
6977 pub fn ecs_meta_get_unit(cursor: *const ecs_meta_cursor_t) -> ecs_entity_t;
6978}
6979extern "C" {
6980 #[doc = "Get member name of current member"]
6981 pub fn ecs_meta_get_member(cursor: *const ecs_meta_cursor_t) -> *const ::std::os::raw::c_char;
6982}
6983extern "C" {
6984 #[doc = "Get member entity of current member"]
6985 pub fn ecs_meta_get_member_id(cursor: *const ecs_meta_cursor_t) -> ecs_entity_t;
6986}
6987extern "C" {
6988 #[doc = "Set field with boolean value"]
6989 pub fn ecs_meta_set_bool(cursor: *mut ecs_meta_cursor_t, value: bool) -> ::std::os::raw::c_int;
6990}
6991extern "C" {
6992 #[doc = "Set field with char value"]
6993 pub fn ecs_meta_set_char(
6994 cursor: *mut ecs_meta_cursor_t,
6995 value: ::std::os::raw::c_char,
6996 ) -> ::std::os::raw::c_int;
6997}
6998extern "C" {
6999 #[doc = "Set field with int value"]
7000 pub fn ecs_meta_set_int(cursor: *mut ecs_meta_cursor_t, value: i64) -> ::std::os::raw::c_int;
7001}
7002extern "C" {
7003 #[doc = "Set field with uint value"]
7004 pub fn ecs_meta_set_uint(cursor: *mut ecs_meta_cursor_t, value: u64) -> ::std::os::raw::c_int;
7005}
7006extern "C" {
7007 #[doc = "Set field with float value"]
7008 pub fn ecs_meta_set_float(cursor: *mut ecs_meta_cursor_t, value: f64) -> ::std::os::raw::c_int;
7009}
7010extern "C" {
7011 #[doc = "Set field with string value"]
7012 pub fn ecs_meta_set_string(
7013 cursor: *mut ecs_meta_cursor_t,
7014 value: *const ::std::os::raw::c_char,
7015 ) -> ::std::os::raw::c_int;
7016}
7017extern "C" {
7018 #[doc = "Set field with string literal value (has enclosing \"\")"]
7019 pub fn ecs_meta_set_string_literal(
7020 cursor: *mut ecs_meta_cursor_t,
7021 value: *const ::std::os::raw::c_char,
7022 ) -> ::std::os::raw::c_int;
7023}
7024extern "C" {
7025 #[doc = "Set field with entity value"]
7026 pub fn ecs_meta_set_entity(
7027 cursor: *mut ecs_meta_cursor_t,
7028 value: ecs_entity_t,
7029 ) -> ::std::os::raw::c_int;
7030}
7031extern "C" {
7032 #[doc = "Set field with null value"]
7033 pub fn ecs_meta_set_null(cursor: *mut ecs_meta_cursor_t) -> ::std::os::raw::c_int;
7034}
7035extern "C" {
7036 #[doc = "Set field with dynamic value"]
7037 pub fn ecs_meta_set_value(
7038 cursor: *mut ecs_meta_cursor_t,
7039 value: *const ecs_value_t,
7040 ) -> ::std::os::raw::c_int;
7041}
7042extern "C" {
7043 #[doc = "Get field value as boolean."]
7044 pub fn ecs_meta_get_bool(cursor: *const ecs_meta_cursor_t) -> bool;
7045}
7046extern "C" {
7047 #[doc = "Get field value as char."]
7048 pub fn ecs_meta_get_char(cursor: *const ecs_meta_cursor_t) -> ::std::os::raw::c_char;
7049}
7050extern "C" {
7051 #[doc = "Get field value as signed integer."]
7052 pub fn ecs_meta_get_int(cursor: *const ecs_meta_cursor_t) -> i64;
7053}
7054extern "C" {
7055 #[doc = "Get field value as unsigned integer."]
7056 pub fn ecs_meta_get_uint(cursor: *const ecs_meta_cursor_t) -> u64;
7057}
7058extern "C" {
7059 #[doc = "Get field value as float."]
7060 pub fn ecs_meta_get_float(cursor: *const ecs_meta_cursor_t) -> f64;
7061}
7062extern "C" {
7063 #[doc = "Get field value as string.\n This operation does not perform conversions. If the field is not a string,\n this operation will fail."]
7064 pub fn ecs_meta_get_string(cursor: *const ecs_meta_cursor_t) -> *const ::std::os::raw::c_char;
7065}
7066extern "C" {
7067 #[doc = "Get field value as entity.\n This operation does not perform conversions."]
7068 pub fn ecs_meta_get_entity(cursor: *const ecs_meta_cursor_t) -> ecs_entity_t;
7069}
7070extern "C" {
7071 #[doc = "Convert pointer of primitive kind to float."]
7072 pub fn ecs_meta_ptr_to_float(
7073 type_kind: ecs_primitive_kind_t,
7074 ptr: *const ::std::os::raw::c_void,
7075 ) -> f64;
7076}
7077#[doc = "Used with ecs_primitive_init."]
7078#[repr(C)]
7079#[derive(Debug, Copy, Clone)]
7080pub struct ecs_primitive_desc_t {
7081 #[doc = "< Existing entity to use for type (optional)"]
7082 pub entity: ecs_entity_t,
7083 pub kind: ecs_primitive_kind_t,
7084}
7085extern "C" {
7086 #[doc = "Create a new primitive type"]
7087 pub fn ecs_primitive_init(
7088 world: *mut ecs_world_t,
7089 desc: *const ecs_primitive_desc_t,
7090 ) -> ecs_entity_t;
7091}
7092#[doc = "Used with ecs_enum_init."]
7093#[repr(C)]
7094#[derive(Debug, Copy, Clone)]
7095pub struct ecs_enum_desc_t {
7096 #[doc = "< Existing entity to use for type (optional)"]
7097 pub entity: ecs_entity_t,
7098 pub constants: [ecs_enum_constant_t; 32usize],
7099}
7100extern "C" {
7101 #[doc = "Create a new enum type"]
7102 pub fn ecs_enum_init(world: *mut ecs_world_t, desc: *const ecs_enum_desc_t) -> ecs_entity_t;
7103}
7104#[doc = "Used with ecs_bitmask_init."]
7105#[repr(C)]
7106#[derive(Debug, Copy, Clone)]
7107pub struct ecs_bitmask_desc_t {
7108 #[doc = "< Existing entity to use for type (optional)"]
7109 pub entity: ecs_entity_t,
7110 pub constants: [ecs_bitmask_constant_t; 32usize],
7111}
7112extern "C" {
7113 #[doc = "Create a new bitmask type"]
7114 pub fn ecs_bitmask_init(
7115 world: *mut ecs_world_t,
7116 desc: *const ecs_bitmask_desc_t,
7117 ) -> ecs_entity_t;
7118}
7119#[doc = "Used with ecs_array_init."]
7120#[repr(C)]
7121#[derive(Debug, Copy, Clone)]
7122pub struct ecs_array_desc_t {
7123 #[doc = "< Existing entity to use for type (optional)"]
7124 pub entity: ecs_entity_t,
7125 pub type_: ecs_entity_t,
7126 pub count: i32,
7127}
7128extern "C" {
7129 #[doc = "Create a new array type"]
7130 pub fn ecs_array_init(world: *mut ecs_world_t, desc: *const ecs_array_desc_t) -> ecs_entity_t;
7131}
7132#[doc = "Used with ecs_vector_init."]
7133#[repr(C)]
7134#[derive(Debug, Copy, Clone)]
7135pub struct ecs_vector_desc_t {
7136 #[doc = "< Existing entity to use for type (optional)"]
7137 pub entity: ecs_entity_t,
7138 pub type_: ecs_entity_t,
7139}
7140extern "C" {
7141 #[doc = "Create a new vector type"]
7142 pub fn ecs_vector_init(world: *mut ecs_world_t, desc: *const ecs_vector_desc_t)
7143 -> ecs_entity_t;
7144}
7145#[doc = "Used with ecs_struct_init."]
7146#[repr(C)]
7147#[derive(Debug, Copy, Clone)]
7148pub struct ecs_struct_desc_t {
7149 #[doc = "< Existing entity to use for type (optional)"]
7150 pub entity: ecs_entity_t,
7151 pub members: [ecs_member_t; 32usize],
7152}
7153extern "C" {
7154 #[doc = "Create a new struct type"]
7155 pub fn ecs_struct_init(world: *mut ecs_world_t, desc: *const ecs_struct_desc_t)
7156 -> ecs_entity_t;
7157}
7158#[doc = "Used with ecs_opaque_init."]
7159#[repr(C)]
7160#[derive(Debug, Copy, Clone)]
7161pub struct ecs_opaque_desc_t {
7162 pub entity: ecs_entity_t,
7163 pub type_: EcsOpaque,
7164}
7165extern "C" {
7166 #[doc = "Create a new opaque type.\n Opaque types are types of which the layout doesn't match what can be modelled\n with the primitives of the meta framework, but which have a structure\n that can be described with meta primitives. Typical examples are STL types\n such as std::string or std::vector, types with a nontrivial layout, and types\n that only expose getter/setter methods.\n\n An opaque type is a combination of a serialization function, and a handle to\n a meta type which describes the structure of the serialized output. For\n example, an opaque type for std::string would have a serializer function that\n accesses .c_str(), and with type ecs_string_t.\n\n The serializer callback accepts a serializer object and a pointer to the\n value of the opaque type to be serialized. The serializer has two methods:\n\n - value, which serializes a value (such as .c_str())\n - member, which specifies a member to be serialized (in the case of a struct)"]
7167 pub fn ecs_opaque_init(world: *mut ecs_world_t, desc: *const ecs_opaque_desc_t)
7168 -> ecs_entity_t;
7169}
7170#[doc = "Used with ecs_unit_init."]
7171#[repr(C)]
7172#[derive(Debug, Copy, Clone)]
7173pub struct ecs_unit_desc_t {
7174 #[doc = "Existing entity to associate with unit (optional)"]
7175 pub entity: ecs_entity_t,
7176 #[doc = "Unit symbol, e.g. \"m\", \"%\", \"g\". (optional)"]
7177 pub symbol: *const ::std::os::raw::c_char,
7178 #[doc = "Unit quantity, e.g. distance, percentage, weight. (optional)"]
7179 pub quantity: ecs_entity_t,
7180 #[doc = "Base unit, e.g. \"meters\" (optional)"]
7181 pub base: ecs_entity_t,
7182 #[doc = "Over unit, e.g. \"per second\" (optional)"]
7183 pub over: ecs_entity_t,
7184 #[doc = "Translation to apply to derived unit (optional)"]
7185 pub translation: ecs_unit_translation_t,
7186 #[doc = "Prefix indicating order of magnitude relative to the derived unit. If set\n together with \"translation\", the values must match. If translation is not\n set, setting prefix will autopopulate it.\n Additionally, setting the prefix will enforce that the symbol (if set)\n is consistent with the prefix symbol + symbol of the derived unit. If the\n symbol is not set, it will be auto populated."]
7187 pub prefix: ecs_entity_t,
7188}
7189extern "C" {
7190 #[doc = "Create a new unit"]
7191 pub fn ecs_unit_init(world: *mut ecs_world_t, desc: *const ecs_unit_desc_t) -> ecs_entity_t;
7192}
7193#[doc = "Used with ecs_unit_prefix_init."]
7194#[repr(C)]
7195#[derive(Debug, Copy, Clone)]
7196pub struct ecs_unit_prefix_desc_t {
7197 #[doc = "Existing entity to associate with unit prefix (optional)"]
7198 pub entity: ecs_entity_t,
7199 #[doc = "Unit symbol, e.g. \"m\", \"%\", \"g\". (optional)"]
7200 pub symbol: *const ::std::os::raw::c_char,
7201 #[doc = "Translation to apply to derived unit (optional)"]
7202 pub translation: ecs_unit_translation_t,
7203}
7204extern "C" {
7205 #[doc = "Create a new unit prefix"]
7206 pub fn ecs_unit_prefix_init(
7207 world: *mut ecs_world_t,
7208 desc: *const ecs_unit_prefix_desc_t,
7209 ) -> ecs_entity_t;
7210}
7211extern "C" {
7212 #[doc = "Create a new quantity"]
7213 pub fn ecs_quantity_init(
7214 world: *mut ecs_world_t,
7215 desc: *const ecs_entity_desc_t,
7216 ) -> ecs_entity_t;
7217}
7218extern "C" {
7219 #[doc = "Module import"]
7220 pub fn FlecsMetaImport(world: *mut ecs_world_t);
7221}
7222extern "C" {
7223 #[doc = "Write an escaped character.\n Write a character to an output string, insert escape character if necessary.\n\n @param out The string to write the character to.\n @param in The input character.\n @param delimiter The delimiiter used (for example '\"')\n @return Pointer to the character after the last one written."]
7224 pub fn ecs_chresc(
7225 out: *mut ::std::os::raw::c_char,
7226 in_: ::std::os::raw::c_char,
7227 delimiter: ::std::os::raw::c_char,
7228 ) -> *mut ::std::os::raw::c_char;
7229}
7230extern "C" {
7231 #[doc = "Parse an escaped character.\n Parse a character with a potential escape sequence.\n\n @param in Pointer to character in input string.\n @param out Output string.\n @return Pointer to the character after the last one read."]
7232 pub fn ecs_chrparse(
7233 in_: *const ::std::os::raw::c_char,
7234 out: *mut ::std::os::raw::c_char,
7235 ) -> *const ::std::os::raw::c_char;
7236}
7237extern "C" {
7238 #[doc = "Write an escaped string.\n Write an input string to an output string, escape characters where necessary.\n To determine the size of the output string, call the operation with a NULL\n argument for 'out', and use the returned size to allocate a string that is\n large enough.\n\n @param out Pointer to output string (msut be).\n @param size Maximum number of characters written to output.\n @param delimiter The delimiter used (for example '\"').\n @param in The input string.\n @return The number of characters that (would) have been written."]
7239 pub fn ecs_stresc(
7240 out: *mut ::std::os::raw::c_char,
7241 size: ecs_size_t,
7242 delimiter: ::std::os::raw::c_char,
7243 in_: *const ::std::os::raw::c_char,
7244 ) -> ecs_size_t;
7245}
7246extern "C" {
7247 #[doc = "Return escaped string.\n Return escaped version of input string. Same as ecs_stresc, but returns an\n allocated string of the right size.\n\n @param delimiter The delimiter used (for example '\"').\n @param in The input string.\n @return Escaped string."]
7248 pub fn ecs_astresc(
7249 delimiter: ::std::os::raw::c_char,
7250 in_: *const ::std::os::raw::c_char,
7251 ) -> *mut ::std::os::raw::c_char;
7252}
7253#[doc = "Storage for parser variables. Variables make it possible to parameterize\n expression strings, and are referenced with the $ operator (e.g. $var)."]
7254#[repr(C)]
7255#[derive(Debug, Copy, Clone)]
7256pub struct ecs_expr_var_t {
7257 pub name: *mut ::std::os::raw::c_char,
7258 pub value: ecs_value_t,
7259 #[doc = "Set to false if ecs_vars_t should not take ownership of var"]
7260 pub owned: bool,
7261}
7262#[repr(C)]
7263#[derive(Debug, Copy, Clone)]
7264pub struct ecs_expr_var_scope_t {
7265 pub var_index: ecs_hashmap_t,
7266 pub vars: ecs_vec_t,
7267 pub parent: *mut ecs_expr_var_scope_t,
7268}
7269#[repr(C)]
7270#[derive(Debug, Copy, Clone)]
7271pub struct ecs_vars_t {
7272 pub world: *mut ecs_world_t,
7273 pub root: ecs_expr_var_scope_t,
7274 pub cur: *mut ecs_expr_var_scope_t,
7275}
7276extern "C" {
7277 #[doc = "Init variable storage"]
7278 pub fn ecs_vars_init(world: *mut ecs_world_t, vars: *mut ecs_vars_t);
7279}
7280extern "C" {
7281 #[doc = "Cleanup variable storage"]
7282 pub fn ecs_vars_fini(vars: *mut ecs_vars_t);
7283}
7284extern "C" {
7285 #[doc = "Push variable scope"]
7286 pub fn ecs_vars_push(vars: *mut ecs_vars_t);
7287}
7288extern "C" {
7289 #[doc = "Pop variable scope"]
7290 pub fn ecs_vars_pop(vars: *mut ecs_vars_t) -> ::std::os::raw::c_int;
7291}
7292extern "C" {
7293 #[doc = "Declare variable in current scope"]
7294 pub fn ecs_vars_declare(
7295 vars: *mut ecs_vars_t,
7296 name: *const ::std::os::raw::c_char,
7297 type_: ecs_entity_t,
7298 ) -> *mut ecs_expr_var_t;
7299}
7300extern "C" {
7301 #[doc = "Declare variable in current scope from value.\n This operation takes ownership of the value. The value pointer must be\n allocated with ecs_value_new."]
7302 pub fn ecs_vars_declare_w_value(
7303 vars: *mut ecs_vars_t,
7304 name: *const ::std::os::raw::c_char,
7305 value: *mut ecs_value_t,
7306 ) -> *mut ecs_expr_var_t;
7307}
7308extern "C" {
7309 #[doc = "Lookup variable in scope and parent scopes"]
7310 pub fn ecs_vars_lookup(
7311 vars: *const ecs_vars_t,
7312 name: *const ::std::os::raw::c_char,
7313 ) -> *mut ecs_expr_var_t;
7314}
7315#[doc = "Used with ecs_parse_expr."]
7316#[repr(C)]
7317#[derive(Debug, Copy, Clone)]
7318pub struct ecs_parse_expr_desc_t {
7319 pub name: *const ::std::os::raw::c_char,
7320 pub expr: *const ::std::os::raw::c_char,
7321 pub lookup_action: ::std::option::Option<
7322 unsafe extern "C" fn(
7323 arg1: *const ecs_world_t,
7324 value: *const ::std::os::raw::c_char,
7325 ctx: *mut ::std::os::raw::c_void,
7326 ) -> ecs_entity_t,
7327 >,
7328 pub lookup_ctx: *mut ::std::os::raw::c_void,
7329 pub vars: *mut ecs_vars_t,
7330}
7331extern "C" {
7332 #[doc = "Parse expression into value.\n This operation parses a flecs expression into the provided pointer. The\n memory pointed to must be large enough to contain a value of the used type.\n\n If no type and pointer are provided for the value argument, the operation\n will discover the type from the expression and allocate storage for the\n value. The allocated value must be freed with ecs_value_free.\n\n @param world The world.\n @param ptr The pointer to the expression to parse.\n @param value The value containing type & pointer to write to.\n @param desc Configuration parameters for deserializer.\n @return Pointer to the character after the last one read, or NULL if failed."]
7333 pub fn ecs_parse_expr(
7334 world: *mut ecs_world_t,
7335 ptr: *const ::std::os::raw::c_char,
7336 value: *mut ecs_value_t,
7337 desc: *const ecs_parse_expr_desc_t,
7338 ) -> *const ::std::os::raw::c_char;
7339}
7340extern "C" {
7341 #[doc = "Serialize value into expression string.\n This operation serializes a value of the provided type to a string. The\n memory pointed to must be large enough to contain a value of the used type.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @return String with expression, or NULL if failed."]
7342 pub fn ecs_ptr_to_expr(
7343 world: *const ecs_world_t,
7344 type_: ecs_entity_t,
7345 data: *const ::std::os::raw::c_void,
7346 ) -> *mut ::std::os::raw::c_char;
7347}
7348extern "C" {
7349 #[doc = "Serialize value into expression buffer.\n Same as ecs_ptr_to_expr, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @param buf The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
7350 pub fn ecs_ptr_to_expr_buf(
7351 world: *const ecs_world_t,
7352 type_: ecs_entity_t,
7353 data: *const ::std::os::raw::c_void,
7354 buf: *mut ecs_strbuf_t,
7355 ) -> ::std::os::raw::c_int;
7356}
7357extern "C" {
7358 #[doc = "Similar as ecs_ptr_to_expr, but serializes values to string.\n Whereas the output of ecs_ptr_to_expr is a valid expression, the output of\n ecs_ptr_to_str is a string representation of the value. In most cases the\n output of the two operations is the same, but there are some differences:\n - Strings are not quoted\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @return String with result, or NULL if failed."]
7359 pub fn ecs_ptr_to_str(
7360 world: *const ecs_world_t,
7361 type_: ecs_entity_t,
7362 data: *const ::std::os::raw::c_void,
7363 ) -> *mut ::std::os::raw::c_char;
7364}
7365extern "C" {
7366 #[doc = "Serialize value into string buffer.\n Same as ecs_ptr_to_str, but serializes to an ecs_strbuf_t instance.\n\n @param world The world.\n @param type The type of the value to serialize.\n @param data The value to serialize.\n @param buf The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
7367 pub fn ecs_ptr_to_str_buf(
7368 world: *const ecs_world_t,
7369 type_: ecs_entity_t,
7370 data: *const ::std::os::raw::c_void,
7371 buf: *mut ecs_strbuf_t,
7372 ) -> ::std::os::raw::c_int;
7373}
7374extern "C" {
7375 #[doc = "Serialize primitive value into string buffer.\n Serializes a primitive value to an ecs_strbuf_t instance. This operation can\n be reused by other serializers to avoid having to write boilerplate code that\n serializes primitive values to a string.\n\n @param world The world.\n @param kind The kind of primitive value.\n @param data The value ot serialize\n @param buf The strbuf to append the string to.\n @return Zero if success, non-zero if failed."]
7376 pub fn ecs_primitive_to_expr_buf(
7377 world: *const ecs_world_t,
7378 kind: ecs_primitive_kind_t,
7379 data: *const ::std::os::raw::c_void,
7380 buf: *mut ecs_strbuf_t,
7381 ) -> ::std::os::raw::c_int;
7382}
7383extern "C" {
7384 #[doc = "Parse expression token.\n Expression tokens can contain more characters (such as '|') than tokens\n parsed by the query (term) parser.\n\n @param name The name of the expression (used for debug logs).\n @param expr The full expression (used for debug logs).\n @param ptr The pointer to the expression to parse.\n @param token The buffer to write to (must have size ECS_MAX_TOKEN_SIZE)\n @return Pointer to the character after the last one read, or NULL if failed."]
7385 pub fn ecs_parse_expr_token(
7386 name: *const ::std::os::raw::c_char,
7387 expr: *const ::std::os::raw::c_char,
7388 ptr: *const ::std::os::raw::c_char,
7389 token: *mut ::std::os::raw::c_char,
7390 ) -> *const ::std::os::raw::c_char;
7391}
7392extern "C" {
7393 #[doc = "Evaluate interpolated expressions in string.\n This operation evaluates expressions in a string, and replaces them with\n their evaluated result. Supported expression formats are:\n - $variable_name\n - {expression}\n\n The $, { and } characters can be escaped with a backslash (\\).\n\n @param world The world.\n @param str The string to evaluate.\n @param vars The variables to use for evaluation."]
7394 pub fn ecs_interpolate_string(
7395 world: *mut ecs_world_t,
7396 str_: *const ::std::os::raw::c_char,
7397 vars: *const ecs_vars_t,
7398 ) -> *mut ::std::os::raw::c_char;
7399}
7400extern "C" {
7401 #[doc = "Convert iterator to vars\n This operation converts an iterator to a variable array. This allows for\n using iterator results in expressions. The operation only converts a\n single result at a time, and does not progress the iterator.\n\n Iterator fields with data will be made available as variables with as name\n the field index (e.g. \"$1\"). The operation does not check if reflection data\n is registered for a field type. If no reflection data is registered for the\n type, using the field variable in expressions will fail.\n\n Field variables will only contain single elements, even if the iterator\n returns component arrays. The offset parameter can be used to specify which\n element in the component arrays to return. The offset parameter must be\n smaller than it->count.\n\n The operation will create a variable for query variables that contain a\n single entity.\n\n The operation will attempt to use existing variables. If a variable does not\n yet exist, the operation will create it. If an existing variable exists with\n a mismatching type, the operation will fail.\n\n Accessing variables after progressing the iterator or after the iterator is\n destroyed will result in undefined behavior.\n\n If vars contains a variable that is not present in the iterator, the variable\n will not be modified.\n\n @param it The iterator to convert to variables.\n @param vars The variables to write to.\n @param offset The offset to the current element."]
7402 pub fn ecs_iter_to_vars(
7403 it: *const ecs_iter_t,
7404 vars: *mut ecs_vars_t,
7405 offset: ::std::os::raw::c_int,
7406 );
7407}
7408extern "C" {
7409 #[doc = "Populate meta information from type descriptor."]
7410 pub fn ecs_meta_from_desc(
7411 world: *mut ecs_world_t,
7412 component: ecs_entity_t,
7413 kind: ecs_type_kind_t,
7414 desc: *const ::std::os::raw::c_char,
7415 ) -> ::std::os::raw::c_int;
7416}
7417extern "C" {
7418 pub static mut FLECS_IDEcsScriptID_: ecs_entity_t;
7419}
7420#[doc = "Script component"]
7421#[repr(C)]
7422#[derive(Debug, Copy, Clone)]
7423pub struct EcsScript {
7424 pub using_: ecs_vec_t,
7425 pub script: *mut ::std::os::raw::c_char,
7426 pub prop_defaults: ecs_vec_t,
7427 pub world: *mut ecs_world_t,
7428}
7429extern "C" {
7430 #[doc = "Parse plecs string.\n This parses a plecs string and instantiates the entities in the world.\n\n @param world The world.\n @param name The script name (typically the file).\n @param str The plecs string.\n @return Zero if success, non-zero otherwise."]
7431 pub fn ecs_plecs_from_str(
7432 world: *mut ecs_world_t,
7433 name: *const ::std::os::raw::c_char,
7434 str_: *const ::std::os::raw::c_char,
7435 ) -> ::std::os::raw::c_int;
7436}
7437extern "C" {
7438 #[doc = "Parse plecs file.\n This parses a plecs file and instantiates the entities in the world. This\n operation is equivalent to loading the file contents and passing it to\n ecs_plecs_from_str.\n\n @param world The world.\n @param filename The plecs file name.\n @return Zero if success, non-zero otherwise."]
7439 pub fn ecs_plecs_from_file(
7440 world: *mut ecs_world_t,
7441 filename: *const ::std::os::raw::c_char,
7442 ) -> ::std::os::raw::c_int;
7443}
7444#[doc = "Used with ecs_script_init"]
7445#[repr(C)]
7446#[derive(Debug, Copy, Clone)]
7447pub struct ecs_script_desc_t {
7448 #[doc = "Set to customize entity handle associated with script"]
7449 pub entity: ecs_entity_t,
7450 #[doc = "Set to load script from file"]
7451 pub filename: *const ::std::os::raw::c_char,
7452 #[doc = "Set to parse script from string"]
7453 pub str_: *const ::std::os::raw::c_char,
7454}
7455extern "C" {
7456 #[doc = "Load managed script.\n A managed script tracks which entities it creates, and keeps those entities\n synchronized when the contents of the script are updated. When the script is\n updated, entities that are no longer in the new version will be deleted.\n\n This feature is experimental.\n\n @param world The world.\n @param desc Script descriptor."]
7457 pub fn ecs_script_init(world: *mut ecs_world_t, desc: *const ecs_script_desc_t)
7458 -> ecs_entity_t;
7459}
7460extern "C" {
7461 #[doc = "Update script with new code.\n\n @param world The world.\n @param script The script entity.\n @param instance An assembly instance (optional).\n @param str The script code.\n @param vars Optional preset variables for script parameterization."]
7462 pub fn ecs_script_update(
7463 world: *mut ecs_world_t,
7464 script: ecs_entity_t,
7465 instance: ecs_entity_t,
7466 str_: *const ::std::os::raw::c_char,
7467 vars: *mut ecs_vars_t,
7468 ) -> ::std::os::raw::c_int;
7469}
7470extern "C" {
7471 #[doc = "Clear all entities associated with script.\n\n @param world The world.\n @param script The script entity.\n @param instance The script instance."]
7472 pub fn ecs_script_clear(world: *mut ecs_world_t, script: ecs_entity_t, instance: ecs_entity_t);
7473}
7474extern "C" {
7475 #[doc = "Module import"]
7476 pub fn FlecsScriptImport(world: *mut ecs_world_t);
7477}
7478extern "C" {
7479 #[doc = "Create a rule.\n A rule accepts the same descriptor as a filter, but has the additional\n ability to use query variables.\n\n Query variables can be used to constrain wildcards across multiple terms to\n the same entity. Regular ECS queries do this in a limited form, as querying\n for Position, Velocity only returns entities that have both components.\n\n Query variables expand this to constrain entities that are resolved while the\n query is being matched. Consider a query for all entities and the mission\n they are on:\n (Mission, *)\n\n If an entity is on multiple missions, the wildcard will match it multiple\n times. Now say we want to only list combat missions. Naively we could try:\n (Mission, *), CombatMission(*)\n\n But this doesn't work, as term 1 returns entities with missions, and term 2\n returns all combat missions for all entities. Query variables make it\n possible to apply CombatMission to the found mission:\n (Mission, $M), CombatMission($M)\n\n By using the same variable ('M') we ensure that CombatMission is applied to\n the mission found in the current result.\n\n Variables can be used in each part of the term (predicate, subject, object).\n This is a valid query:\n Likes($X, $Y), Likes($Y, $X)\n\n This is also a valid query:\n _Component, Serializable(_Component)\n\n In the query expression syntax, variables are prefixed with a $. When using\n the descriptor, specify the variable kind:\n desc.terms\\[0\\].second = { .name = \"X\", .var = EcsVarIsVariable }\n\n Different terms with the same variable name are automatically correlated by\n the query engine.\n\n A rule needs to be explicitly deleted with ecs_rule_fini.\n\n @param world The world.\n @param desc The descriptor (see ecs_filter_desc_t)\n @return The rule."]
7480 pub fn ecs_rule_init(
7481 world: *mut ecs_world_t,
7482 desc: *const ecs_filter_desc_t,
7483 ) -> *mut ecs_rule_t;
7484}
7485extern "C" {
7486 #[doc = "Delete a rule.\n\n @param rule The rule."]
7487 pub fn ecs_rule_fini(rule: *mut ecs_rule_t);
7488}
7489extern "C" {
7490 #[doc = "Obtain filter from rule.\n This operation returns the filter with which the rule was created.\n\n @param rule The rule.\n @return The filter."]
7491 pub fn ecs_rule_get_filter(rule: *const ecs_rule_t) -> *const ecs_filter_t;
7492}
7493extern "C" {
7494 #[doc = "Return number of variables in rule.\n\n @param rule The rule.\n @return The number of variables/"]
7495 pub fn ecs_rule_var_count(rule: *const ecs_rule_t) -> i32;
7496}
7497extern "C" {
7498 #[doc = "Find variable index.\n This operation looks up the index of a variable in the rule. This index can\n be used in operations like ecs_iter_set_var and ecs_iter_get_var.\n\n @param rule The rule.\n @param name The variable name.\n @return The variable index."]
7499 pub fn ecs_rule_find_var(rule: *const ecs_rule_t, name: *const ::std::os::raw::c_char) -> i32;
7500}
7501extern "C" {
7502 #[doc = "Get variable name.\n This operation returns the variable name for an index.\n\n @param rule The rule.\n @param var_id The variable index."]
7503 pub fn ecs_rule_var_name(rule: *const ecs_rule_t, var_id: i32)
7504 -> *const ::std::os::raw::c_char;
7505}
7506extern "C" {
7507 #[doc = "Test if variable is an entity.\n Internally the rule engine has entity variables and table variables. When\n iterating through rule variables (by using ecs_rule_variable_count) only\n the values for entity variables are accessible. This operation enables an\n appliction to check if a variable is an entity variable.\n\n @param rule The rule.\n @param var_id The variable id."]
7508 pub fn ecs_rule_var_is_entity(rule: *const ecs_rule_t, var_id: i32) -> bool;
7509}
7510extern "C" {
7511 #[doc = "Iterate a rule.\n Note that rule iterators may allocate memory, and that unless the iterator\n is iterated until completion, it may still hold resources. When stopping\n iteration before ecs_rule_next has returned false, use ecs_iter_fini to\n cleanup any remaining resources.\n\n @param world The world.\n @param rule The rule.\n @return An iterator."]
7512 pub fn ecs_rule_iter(world: *const ecs_world_t, rule: *const ecs_rule_t) -> ecs_iter_t;
7513}
7514extern "C" {
7515 #[doc = "Progress rule iterator.\n\n @param it The iterator."]
7516 pub fn ecs_rule_next(it: *mut ecs_iter_t) -> bool;
7517}
7518extern "C" {
7519 #[doc = "Progress instanced iterator.\n Should not be called unless you know what you're doing :-)\n\n @param it The iterator."]
7520 pub fn ecs_rule_next_instanced(it: *mut ecs_iter_t) -> bool;
7521}
7522extern "C" {
7523 #[doc = "Convert rule to a string.\n This will convert the rule program to a string which can aid in debugging\n the behavior of a rule.\n\n The returned string must be freed with ecs_os_free.\n\n @param rule The rule.\n @return The string"]
7524 pub fn ecs_rule_str(rule: *const ecs_rule_t) -> *mut ::std::os::raw::c_char;
7525}
7526extern "C" {
7527 #[doc = "Convert rule to string with profile.\n To use this you must set the EcsIterProfile flag on an iterator before\n starting uteration:\n it.flags |= EcsIterProfile\n\n @param rule The rule.\n @return The string"]
7528 pub fn ecs_rule_str_w_profile(
7529 rule: *const ecs_rule_t,
7530 it: *const ecs_iter_t,
7531 ) -> *mut ::std::os::raw::c_char;
7532}
7533extern "C" {
7534 #[doc = "Populate variables from key-value string.\n Convenience function to set rule variables from a key-value string separated\n by comma's. The string must have the followig format:\n var_a: value, var_b: value\n\n The key-value list may optionally be enclosed in parenthesis.\n\n @param rule The rule.\n @param it The iterator for which to set the variables.\n @param expr The key-value expression."]
7535 pub fn ecs_rule_parse_vars(
7536 rule: *mut ecs_rule_t,
7537 it: *mut ecs_iter_t,
7538 expr: *const ::std::os::raw::c_char,
7539 ) -> *const ::std::os::raw::c_char;
7540}
7541#[repr(C)]
7542#[derive(Debug, Copy, Clone)]
7543pub struct ecs_snapshot_t {
7544 _unused: [u8; 0],
7545}
7546extern "C" {
7547 #[doc = "Create a snapshot.\n This operation makes a copy of the current state of the world.\n\n @param world The world to snapshot.\n @return The snapshot."]
7548 pub fn ecs_snapshot_take(world: *mut ecs_world_t) -> *mut ecs_snapshot_t;
7549}
7550extern "C" {
7551 #[doc = "Create a filtered snapshot.\n This operation is the same as ecs_snapshot_take, but accepts an iterator so\n an application can control what is stored by the snapshot.\n\n @param iter An iterator to the data to be stored by the snapshot.\n @return The snapshot."]
7552 pub fn ecs_snapshot_take_w_iter(iter: *mut ecs_iter_t) -> *mut ecs_snapshot_t;
7553}
7554extern "C" {
7555 #[doc = "Restore a snapshot.\n This operation restores the world to the state it was in when the specified\n snapshot was taken. A snapshot can only be used once for restoring, as its\n data replaces the data that is currently in the world.\n This operation also resets the last issued entity handle, so any calls to\n ecs_new may return entity ids that have been issued before restoring the\n snapshot.\n\n The world in which the snapshot is restored must be the same as the world in\n which the snapshot is taken.\n\n @param world The world to restore the snapshot to.\n @param snapshot The snapshot to restore."]
7556 pub fn ecs_snapshot_restore(world: *mut ecs_world_t, snapshot: *mut ecs_snapshot_t);
7557}
7558extern "C" {
7559 #[doc = "Obtain iterator to snapshot data.\n\n @param snapshot The snapshot to iterate over.\n @return Iterator to snapshot data."]
7560 pub fn ecs_snapshot_iter(snapshot: *mut ecs_snapshot_t) -> ecs_iter_t;
7561}
7562extern "C" {
7563 #[doc = "Progress snapshot iterator.\n\n @param iter The snapshot iterator.\n @return True if more data is available, otherwise false."]
7564 pub fn ecs_snapshot_next(iter: *mut ecs_iter_t) -> bool;
7565}
7566extern "C" {
7567 #[doc = "Free snapshot resources.\n This frees resources associated with a snapshot without restoring it.\n\n @param snapshot The snapshot to free."]
7568 pub fn ecs_snapshot_free(snapshot: *mut ecs_snapshot_t);
7569}
7570extern "C" {
7571 #[doc = "Skip whitespace characters.\n This function skips whitespace characters. Does not skip newlines.\n\n @param ptr Pointer to (potential) whitespaces to skip.\n @return Pointer to the next non-whitespace character."]
7572 pub fn ecs_parse_ws(ptr: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char;
7573}
7574extern "C" {
7575 #[doc = "Skip whitespace and newline characters.\n This function skips whitespace characters.\n\n @param ptr Pointer to (potential) whitespaces to skip.\n @return Pointer to the next non-whitespace character."]
7576 pub fn ecs_parse_ws_eol(ptr: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char;
7577}
7578extern "C" {
7579 #[doc = "Utility function to parse an identifier"]
7580 pub fn ecs_parse_identifier(
7581 name: *const ::std::os::raw::c_char,
7582 expr: *const ::std::os::raw::c_char,
7583 ptr: *const ::std::os::raw::c_char,
7584 token_out: *mut ::std::os::raw::c_char,
7585 ) -> *const ::std::os::raw::c_char;
7586}
7587extern "C" {
7588 #[doc = "Parse digit.\n This function will parse until the first non-digit character is found. The\n provided expression must contain at least one digit character.\n\n @param ptr The expression to parse.\n @param token The output buffer.\n @return Pointer to the first non-digit character."]
7589 pub fn ecs_parse_digit(
7590 ptr: *const ::std::os::raw::c_char,
7591 token: *mut ::std::os::raw::c_char,
7592 ) -> *const ::std::os::raw::c_char;
7593}
7594extern "C" {
7595 #[doc = "Parse a single token.\n This function can be used as simple tokenizer by other parsers.\n\n @param name of program (used for logging).\n @param expr pointer to token to parse.\n @param ptr pointer to first character to parse.\n @param token_out Parsed token (buffer should be ECS_MAX_TOKEN_SIZE large)\n @return Pointer to the next token, or NULL if error occurred."]
7596 pub fn ecs_parse_token(
7597 name: *const ::std::os::raw::c_char,
7598 expr: *const ::std::os::raw::c_char,
7599 ptr: *const ::std::os::raw::c_char,
7600 token_out: *mut ::std::os::raw::c_char,
7601 delim: ::std::os::raw::c_char,
7602 ) -> *const ::std::os::raw::c_char;
7603}
7604extern "C" {
7605 #[doc = "Parse term in expression.\n This operation parses a single term in an expression and returns a pointer\n to the next term expression.\n\n If the returned pointer points to the 0-terminator, the expression is fully\n parsed. The function would typically be called in a while loop:\n\n const char *ptr = expr;\n while (ptr\\[0\\] && (ptr = ecs_parse_term(world, name, expr, ptr, &term))) { }\n\n The operation does not attempt to find entity ids from the names in the\n expression. Use the ecs_term_resolve_ids function to resolve the identifiers\n in the parsed term.\n\n The returned term will in most cases contain allocated resources, which\n should freed (or used) by the application. To free the resources for a term,\n use the ecs_term_free function.\n\n The parser accepts expressions in the legacy string format.\n\n @param world The world.\n @param name The name of the expression (optional, improves error logs)\n @param expr The expression to parse (optional, improves error logs)\n @param ptr The pointer to the current term (must be in expr).\n @param term_out Out parameter for the term.\n @return pointer to next term if successful, NULL if failed."]
7606 pub fn ecs_parse_term(
7607 world: *const ecs_world_t,
7608 name: *const ::std::os::raw::c_char,
7609 expr: *const ::std::os::raw::c_char,
7610 ptr: *const ::std::os::raw::c_char,
7611 term_out: *mut ecs_term_t,
7612 ) -> *mut ::std::os::raw::c_char;
7613}
7614extern "C" {
7615 pub fn ecs_set_os_api_impl();
7616}
7617extern "C" {
7618 #[doc = "Import a module.\n This operation will load a modules and store the public module handles in the\n handles_out out parameter. The module name will be used to verify if the\n module was already loaded, in which case it won't be reimported. The name\n will be translated from PascalCase to an entity path (pascal.case) before the\n lookup occurs.\n\n Module contents will be stored as children of the module entity. This\n prevents modules from accidentally defining conflicting identifiers. This is\n enforced by setting the scope before and after loading the module to the\n module entity id.\n\n A more convenient way to import a module is by using the ECS_IMPORT macro.\n\n @param world The world.\n @param module The module import function.\n @param module_name The name of the module.\n @return The module entity."]
7619 pub fn ecs_import(
7620 world: *mut ecs_world_t,
7621 module: ecs_module_action_t,
7622 module_name: *const ::std::os::raw::c_char,
7623 ) -> ecs_entity_t;
7624}
7625extern "C" {
7626 #[doc = "Same as ecs_import, but with name to scope conversion.\n PascalCase names are automatically converted to scoped names.\n\n @param world The world.\n @param module The module import function.\n @param module_name_c The name of the module.\n @return The module entity."]
7627 pub fn ecs_import_c(
7628 world: *mut ecs_world_t,
7629 module: ecs_module_action_t,
7630 module_name_c: *const ::std::os::raw::c_char,
7631 ) -> ecs_entity_t;
7632}
7633extern "C" {
7634 #[doc = "Import a module from a library.\n Similar to ecs_import, except that this operation will attempt to load the\n module from a dynamic library.\n\n A library may contain multiple modules, which is why both a library name and\n a module name need to be provided. If only a library name is provided, the\n library name will be reused for the module name.\n\n The library will be looked up using a canonical name, which is in the same\n form as a module, like `flecs.components.transform`. To transform this\n identifier to a platform specific library name, the operation relies on the\n module_to_dl callback of the os_api which the application has to override if\n the default does not yield the correct library name.\n\n @param world The world.\n @param library_name The name of the library to load.\n @param module_name The name of the module to load."]
7635 pub fn ecs_import_from_library(
7636 world: *mut ecs_world_t,
7637 library_name: *const ::std::os::raw::c_char,
7638 module_name: *const ::std::os::raw::c_char,
7639 ) -> ecs_entity_t;
7640}
7641extern "C" {
7642 #[doc = "Register a new module."]
7643 pub fn ecs_module_init(
7644 world: *mut ecs_world_t,
7645 c_name: *const ::std::os::raw::c_char,
7646 desc: *const ecs_component_desc_t,
7647 ) -> ecs_entity_t;
7648}
7649extern "C" {
7650 pub fn ecs_cpp_get_type_name(
7651 type_name: *mut ::std::os::raw::c_char,
7652 func_name: *const ::std::os::raw::c_char,
7653 len: usize,
7654 front_len: usize,
7655 ) -> *mut ::std::os::raw::c_char;
7656}
7657extern "C" {
7658 pub fn ecs_cpp_get_symbol_name(
7659 symbol_name: *mut ::std::os::raw::c_char,
7660 type_name: *const ::std::os::raw::c_char,
7661 len: usize,
7662 ) -> *mut ::std::os::raw::c_char;
7663}
7664extern "C" {
7665 pub fn ecs_cpp_get_constant_name(
7666 constant_name: *mut ::std::os::raw::c_char,
7667 func_name: *const ::std::os::raw::c_char,
7668 len: usize,
7669 back_len: usize,
7670 ) -> *mut ::std::os::raw::c_char;
7671}
7672extern "C" {
7673 pub fn ecs_cpp_trim_module(
7674 world: *mut ecs_world_t,
7675 type_name: *const ::std::os::raw::c_char,
7676 ) -> *const ::std::os::raw::c_char;
7677}
7678extern "C" {
7679 pub fn ecs_cpp_component_validate(
7680 world: *mut ecs_world_t,
7681 id: ecs_entity_t,
7682 name: *const ::std::os::raw::c_char,
7683 symbol: *const ::std::os::raw::c_char,
7684 size: usize,
7685 alignment: usize,
7686 implicit_name: bool,
7687 );
7688}
7689extern "C" {
7690 pub fn ecs_cpp_component_register(
7691 world: *mut ecs_world_t,
7692 id: ecs_entity_t,
7693 name: *const ::std::os::raw::c_char,
7694 symbol: *const ::std::os::raw::c_char,
7695 size: ecs_size_t,
7696 alignment: ecs_size_t,
7697 implicit_name: bool,
7698 existing_out: *mut bool,
7699 ) -> ecs_entity_t;
7700}
7701extern "C" {
7702 pub fn ecs_cpp_component_register_explicit(
7703 world: *mut ecs_world_t,
7704 s_id: ecs_entity_t,
7705 id: ecs_entity_t,
7706 name: *const ::std::os::raw::c_char,
7707 type_name: *const ::std::os::raw::c_char,
7708 symbol: *const ::std::os::raw::c_char,
7709 size: usize,
7710 alignment: usize,
7711 is_component: bool,
7712 existing_out: *mut bool,
7713 ) -> ecs_entity_t;
7714}
7715extern "C" {
7716 pub fn ecs_cpp_enum_init(world: *mut ecs_world_t, id: ecs_entity_t);
7717}
7718extern "C" {
7719 pub fn ecs_cpp_enum_constant_register(
7720 world: *mut ecs_world_t,
7721 parent: ecs_entity_t,
7722 id: ecs_entity_t,
7723 name: *const ::std::os::raw::c_char,
7724 value: ::std::os::raw::c_int,
7725 ) -> ecs_entity_t;
7726}
7727extern "C" {
7728 pub fn ecs_cpp_reset_count_get() -> i32;
7729}
7730extern "C" {
7731 pub fn ecs_cpp_reset_count_inc() -> i32;
7732}
7733extern "C" {
7734 pub fn ecs_cpp_last_member(
7735 world: *const ecs_world_t,
7736 type_: ecs_entity_t,
7737 ) -> *const ecs_member_t;
7738}
7739pub type __builtin_va_list = *mut ::std::os::raw::c_char;
7740#[repr(C)]
7741#[derive(Debug, Copy, Clone)]
7742pub struct ecs_event_id_record_t {
7743 pub _address: u8,
7744}
7745#[repr(C)]
7746#[derive(Debug, Copy, Clone)]
7747pub struct ecs_stack_t {
7748 pub _address: u8,
7749}
7750#[repr(C)]
7751#[derive(Debug, Copy, Clone)]
7752pub struct ecs_table_cache_hdr_t {
7753 pub _address: u8,
7754}
7755#[repr(C)]
7756#[derive(Debug, Copy, Clone)]
7757pub struct ecs_rule_var_t {
7758 pub _address: u8,
7759}
7760#[repr(C)]
7761#[derive(Debug, Copy, Clone)]
7762pub struct ecs_rule_op_t {
7763 pub _address: u8,
7764}
7765#[doc = "Operation-specific state"]
7766#[repr(C)]
7767#[derive(Debug, Copy, Clone)]
7768pub struct ecs_rule_op_ctx_t {
7769 pub _address: u8,
7770}