C API

API toggles & constants

FLECS_FLOAT float

FLECS_NO_DEPRECATED_WARNINGS

FLECS_SANITIZE

FLECS_CPP /* C++ API */

FLECS_MODULE /* Module support */

Mentioned in:

FLECS_PARSER /* String parser for queries */

FLECS_PLECS /* ECS data definition format */

FLECS_RULES /* Constraint solver for advanced queries */

FLECS_SNAPSHOT /* Snapshot & restore ECS data */

Mentioned in:

FLECS_STATS /* Keep track of runtime statistics */

Mentioned in:

FLECS_SYSTEM /* System support */

Mentioned in:

FLECS_PIPELINE /* Pipeline support */

FLECS_TIMER /* Timer support */

Mentioned in:

FLECS_META /* Reflection support */

FLECS_EXPR /* Parsing strings to/from component values */

FLECS_JSON /* Parsing JSON to/from component values */

Basic API types

typedef void ecs_poly_t

An object with a mixin table.

typedef uint64_t ecs_id_t

An id. Ids are the things that can be added to an entity. An id can be an entity or pair, and can have an optional role.

Mentioned in:

Quickstart / Pair

Quickstart / Type

Manual / Local component handles

Query Manual / Iter (C)

Relations Manual / Relation wildcards

Relations Manual / Inspecting relations

Relations Manual / Relation performance

typedef ecs_id_t ecs_entity_t

An entity identifier.

Mentioned in:

Readme / Examples

Quickstart / Entity

Quickstart / Component

Quickstart / Tag

Quickstart / Pair

Quickstart / Hierarchies

Quickstart / Instancing

Quickstart / Type

Quickstart / System

Quickstart / Observer

Manual / Entity

Manual / Component

Manual / Tag

Manual / System

Manual / Phase

Manual / Pipeline

Manual / Trigger

Manual / Type

Manual / Scope

Manual / Naming conventions

Manual / Entity names

Manual / Macro's

Manual / Entities

Manual / Generations

Manual / Basic usage

Manual / Advanced usage

Manual / Type roles

Manual / Components

Manual / Global component handles

Manual / Component disabling

Manual / Tag handles

Manual / Switchable tags

Manual / Modules

Manual / Hierarchies

Manual / Iteration

Manual / Path identifiers

Manual / Scoping

Manual / Paths and signatures

Manual / Inheritance

Manual / Overriding

Manual / Automatic overriding

Manual / Inheritance hierarchies

Manual / Prefabs

Manual / Deferred operations

Manual / Staging

Query Manual / Iter (C)

Query Manual / Sorting

Query Manual / Sorting by entity id

Query Manual / Tag

Query Manual / Relation

Relations Manual / Relations

Relations Manual / Relation components

Relations Manual / Using relations to add components multiple times

Relations Manual / Relation wildcards

Relations Manual / Inspecting relations

Relations Manual / The IsA relation

Relations Manual / Component sharing

Relations Manual / Final entities

Relations Manual / The ChildOf relation

Relations Manual / Namespacing

Relations Manual / Scoping

Relations Manual / Relation cleanup properties

Relations Manual / Transitive relations

Relations Manual / Tag relations

typedef const ecs_vector_t * ecs_type_t

A vector containing component identifiers used to describe a type.

Mentioned in:

Quickstart / Type

Manual / Basic usage

Manual / Advanced usage

Manual / Local component handles

Manual / Tag handles

Relations Manual / Inspecting relations

typedef struct ecs_world_t ecs_world_t

A world is the container for all ECS data and supporting features.

Mentioned in:

Readme / Examples

Quickstart / World

Quickstart / Module

Manual / Naming conventions

Manual / Components

Manual / Global component handles

Manual / Local component handles

Manual / Component disabling

Manual / Tagging

Manual / Tag handles

Manual / Modules

typedef struct ecs_query_t ecs_query_t

A query allows for cached iteration over ECS data

Mentioned in:

Quickstart / Hierarchies

Quickstart / Query

Manual / Hierarchical queries

Query Manual / Query Descriptors (C)

Query Manual / Iter (C)

Query Manual / Sorting

Query Manual / Sorting by entity id

Query Manual / Not operator

Query Manual / Optional operator

Query Manual / Or operator

Query Manual / AndFrom, OrFrom, NotFrom operators

Query Manual / Read/write access

Query Manual / Component

Query Manual / Tag

Query Manual / Relation

Query Manual / Singleton

Query Manual / Assigning Identifiers with the API

Query Manual / Wildcard

Query Manual / Variables

Query Manual / Substitution on Identifiers

Relations Manual / Relations

Relations Manual / Relation wildcards

typedef struct ecs_rule_t ecs_rule_t

A rule implements a non-trivial filter

typedef struct ecs_observable_t ecs_observable_t

An observable contains lists of triggers for specific events/components

typedef struct ecs_iter_t ecs_iter_t

Mentioned in:

typedef struct ecs_ref_t ecs_ref_t

Refs cache data that lets them access components faster than ecs_get.

API constants

ECS_MAX_ADD_REMOVE (32)

ECS_TERM_CACHE_SIZE (8)

ECS_TERM_DESC_CACHE_SIZE (16)

ECS_TRIGGER_DESC_EVENT_COUNT_MAX (8)

Function Types

typedef void(* ecs_iter_action_t)(ecs_iter_t *it)

Action callback for systems and triggers

typedef bool(* ecs_iter_next_action_t)(ecs_iter_t *it)

typedef int(* ecs_order_by_action_t)(ecs_entity_t e1, const void *ptr1, ecs_entity_t e2, const void *ptr2)

Callback used for sorting components

typedef uint64_t(* ecs_group_by_action_t)(ecs_world_t *world, ecs_type_t type, ecs_id_t id, void *ctx)

Callback used for ranking types

typedef void(* ecs_module_action_t)(ecs_world_t *world)

Initialization action for modules

typedef void(* ecs_fini_action_t)(ecs_world_t *world, void *ctx)

Action callback on world exit

typedef void(* ecs_ctx_free_t)(void *ctx)

Function to cleanup context data

typedef int(* ecs_compare_action_t)(const void *ptr1, const void *ptr2)

Callback used for sorting values

typedef uint64_t(* ecs_hash_value_action_t)(const void *ptr)

Callback used for hashing values

Types used to describe filters, terms and triggers

EcsDefaultSet (0) /* Default set, SuperSet|Self for This subject */

Set flags describe if & how a matched entity should be substituted

EcsSelf (1) /* Select self (inclusive) */

Mentioned in:

EcsSuperSet (2) /* Select superset until predicate match */

Mentioned in:

EcsSubSet (4) /* Select subset until predicate match */

EcsCascade (8) /* Use breadth-first ordering of relations */

Mentioned in:

EcsAll (16) /* Walk full super/subset, regardless of match */

EcsParent (32) /* Shortcut for SuperSet(ChildOf) */

EcsNothing (64) /* Select from nothing */

ecs_inout_kind_tSpecify read/write access for term
ecs_var_kind_tSpecifies whether term identifier is a variable or entity
ecs_oper_kind_tType describing an operator used in an signature of a system signature
ecs_term_set_tSubstitution with set parameters
ecs_term_id_tType that describes a single identifier in a term
ecs_term_tType that describes a single column in the system signature
ecs_filter_tFilters alllow for ad-hoc quick filtering of entity tables.
ecs_trigger_tA trigger reacts to events matching a single term
ecs_observer_tAn observer reacts to events matching multiple filter terms

Types used for creating API constructs

ecs_entity_desc_tUsed with ecs_entity_init
ecs_bulk_desc_tUsed with ecs_bulk_init
ecs_component_desc_tUsed with ecs_component_init.
ecs_type_desc_tUsed with ecs_type_init.
ecs_filter_desc_tUsed with ecs_filter_init.
ecs_query_desc_tUsed with ecs_query_init.
ecs_trigger_desc_tUsed with ecs_trigger_init.
ecs_observer_desc_tUsed with ecs_observer_init.

Builtin components

EcsIdentifierA (string) identifier
EcsComponentComponent information.
EcsTypeComponent that stores an ecs_type_t
EcsComponentLifecycleComponent that contains lifecycle callbacks for a component.
EcsTriggerComponent that stores reference to trigger
EcsObserverComponent that stores reference to observer
EcsQueryComponent for storing a query

Miscalleneous types

ecs_world_info_tType that contains information about the world.

Type Roles

ECS_ROLE (1ull << 63)

Role bit added to roles to differentiate between roles and generations

Builtin components & tags

ecs_id overloadBuiltin component ids
ecs_id overloadPipeline module component ids
ecs_id overloadTimer module component ids

EcsLastInternalComponentId (ecs_id(EcsSystem))

EcsFirstUserComponentId (32)

EcsFirstUserEntityId (ECS_HI_COMPONENT_ID + 128)

Mentioned in:

World API

ecs_initCreate a new world
ecs_miniSame as ecs_init, but with minimal set of modules loaded.
ecs_init_w_argsCreate a new world with arguments
ecs_finiDelete a world
ecs_atfiniRegister action to be executed when world is destroyed
ecs_run_post_frameRegister action to be executed once after frame
ecs_quitSignal exit This operation signals that the application should quit
ecs_should_quitReturn whether a quit has been signaled.
ecs_set_component_actions_w_idRegister ctor, dtor, copy & move actions for component.
ecs_set_contextSet a world context
ecs_get_contextGet the world context
ecs_get_world_infoGet world info.
ecs_dimDimension the world for a specified number of entities
ecs_set_entity_rangeSet a range for issueing new entity ids
ecs_enable_range_checkEnable/disable range limits
ecs_enable_lockingEnable world locking while in progress
ecs_lockLocks the world
ecs_unlockUnlocks the world
ecs_begin_waitWait until world becomes available
ecs_end_waitRelease world after calling ecs_begin_wait
ecs_tracing_enableEnable or disable tracing
ecs_tracing_color_enableEnable/disable tracing with colors
ecs_measure_frame_timeMeasure frame time
ecs_measure_system_timeMeasure system time
ecs_set_target_fpsSet target frames per second (FPS) for application
ecs_get_threadsGet current number of threads.

Creating Entities

ecs_new_idCreate new entity id
ecs_new_low_idCreate new low id
ecs_new_w_idCreate new entity
ecs_entity_initFind or create an entity
ecs_bulk_initBulk create/populate new entities
ecs_component_initFind or create a component
ecs_type_initCreate a new type entity
ecs_bulk_new_w_idCreate N new entities
ecs_cloneClone an entity This operation clones the components of one entity into another entity

Adding & Removing

ecs_add_idAdd an entity to an entity
ecs_remove_idRemove an entity from an entity

Enabling & Disabling components.

ecs_enable_component_w_idEnable or disable component
ecs_is_component_enabled_w_idTest if component is enabled

Pairs

ecs_make_pairMake a pair identifier

Deleting Entities and components

ecs_clearClear all components
ecs_deleteDelete an entity
ecs_delete_withDelete all entities with the specified id
ecs_remove_allRemove all instances of the specified id

Getting Components

ecs_get_idGet an immutable pointer to a component
ecs_get_ref_w_idGet an immutable reference to a component
ecs_get_caseGet case for switch

Setting Components

ecs_get_mut_idGet a mutable pointer to a component
ecs_emplace_idEmplace a component
ecs_modified_idSignal that a component has been modified
ecs_set_idSet the value of a component

Entity Metadata

ecs_is_validTest whether an entity is valid
ecs_is_aliveTest whether an entity is alive
ecs_strip_generationRemove generation from entity id.
ecs_get_aliveGet alive identifier
ecs_ensureEnsure id is alive
ecs_existsTest whether an entity exists
ecs_get_typeGet the type of an entity.
ecs_get_tableGet the table of an entity.
ecs_get_typeidGet the typeid of an entity.
ecs_get_nameGet the name of an entity
ecs_get_symbolGet the symbol of an entity
ecs_set_nameSet the name of an entity
ecs_set_symbolSet the symbol of an entity
ecs_role_strConvert type role to string
ecs_id_strConvert id to string
ecs_id_str_w_buf
ecs_has_idTest if an entity has an entity
ecs_get_objectGet the object of a relation
ecs_get_object_for_idGet the object of a relation for a given id
ecs_enableEnable or disable an entity
ecs_count_idCount entities that have the specified id

Lookups

ecs_lookupLookup an entity by name
ecs_lookup_childLookup a child entity by name
ecs_lookup_path_w_sepLookup an entity from a path
ecs_lookup_symbolLookup an entity by its symbol name
ecs_use

Paths

ecs_get_path_w_sepGet a path identifier for an entity
ecs_new_from_path_w_sepFind or create entity from path
ecs_add_path_w_sepAdd specified path to entity

Scopes

ecs_set_scopeSet the current scope
ecs_get_scopeGet the current scope
ecs_set_withSet current with id
ecs_get_withGet current with id
ecs_set_name_prefixSet a name prefix for newly created entities

Terms

ecs_term_iterIterator for a single (component) id
ecs_term_nextProgress the term iterator
ecs_term_id_is_setTest whether term id is set.
ecs_term_is_initializedTest whether a term is set
ecs_term_is_trivialTest whether a term is a trivial term
ecs_term_finalizeFinalize term
ecs_term_copyCopy resources of a term to another term
ecs_term_moveMove resources of a term to another term
ecs_term_finiFree resources of term
ecs_id_matchUtility to match an id with a pattern
ecs_id_is_pairUtility to check if id is a pair.
ecs_id_is_wildcardUtility to check if id is a wildcard.

Filters

ecs_filter_initInitialize filter A filter is a lightweight object that can be used to query for entities in a world
ecs_filter_finiDeinitialize filter
ecs_filter_finalizeFinalize filter
ecs_term_strConvert ter, to string expression
ecs_filter_strConvert filter to string expression
ecs_filter_iterReturn a filter iterator
ecs_filter_chain_iterReturn a chained filter iterator
ecs_filter_nextIterate tables matched by filter
ecs_filter_moveMove resources of one filter to another.
ecs_filter_copyCopy resources of one filter to another.

Queries

ecs_query_initCreate a query
ecs_query_finiDestroy a query
ecs_query_get_filterGet filter object of query
ecs_query_iterReturn a query iterator
ecs_query_iter_pageIterate over a query
ecs_query_nextProgress the query iterator
ecs_query_next_workerProgress the query iterator for a worker thread
ecs_query_changedReturns whether the query data changed since the last iteration
ecs_query_orphanedReturns whether query is orphaned

Iterators

ecs_term_w_sizeObtain data for a query term
ecs_term_is_readonlyTest whether the term is readonly This operation returns whether this is a readonly term
ecs_term_is_ownedTest whether the term is owned This operation returns whether the term is owned by the currently iterated entity
ecs_iter_strConvert iterator to string
ecs_iter_find_columnFind the column index for a given id
ecs_iter_column_w_sizeObtain data for a column index
ecs_iter_column_sizeObtain size for a column index

Staging

ecs_frame_beginBegin frame
ecs_frame_endEnd frame
ecs_staging_beginBegin staging
ecs_staging_endEnd staging
ecs_mergeMerge world or stage
ecs_defer_beginDefer operations until end of frame
ecs_is_deferredTest if deferring is enabled for current stage.
ecs_defer_endEnd block of operations to defer
ecs_set_automergeEnable/disable automerging for world or stage
ecs_set_stagesConfigure world to have N stages
ecs_get_stage_countGet number of configured stages
ecs_get_stage_idGet current stage id
ecs_get_stageGet stage-specific world pointer
ecs_get_worldGet actual world from world.
ecs_stage_is_readonlyTest whether the current world object is readonly
ecs_async_stage_newCreate asynchronous stage
ecs_async_stage_freeFree asynchronous stage
ecs_stage_is_asyncTest whether provided stage is asynchronous.

Public table operations

Low-level table functions. These functions are intended to enable the creation of higher-level operations. It is not recommended to use these operations directly in application code as they do not provide the same safety guarantees as the other APIs.

ecs_table_from_strFind or create table with specified component string
ecs_table_get_typeGet type for table.
ecs_table_get_storage_typeGet storage type for table.
ecs_table_storage_countGet number of storages for table.
ecs_table_type_to_storage_indexConvert index in table type to index in table storage type.
ecs_table_storage_to_type_indexConvert index in table storage type to index in table type.
ecs_table_countReturns the number of records in the table
ecs_table_add_idGet table that has all components of current table plus the specified id
ecs_table_remove_idGet table that has all components of current table minus the specified id
ecs_table_lockLock or unlock table
ecs_table_unlockUnlock a table
ecs_table_has_moduleReturns whether table is a module or contains module contents Returns true for tables that have module contents
ecs_commitCommit (move) entity to a table
ecs_record_findFind record for entity.
ecs_record_get_columnGet component pointer from column/record.

Macro's that help with creation of ECS objects.

ECS_ENTITY_DECLARE(id)
ecs_entity_t id;
ecs_entity_t ecs_id(id)

ECS_ENTITY_DEFINE(world,id,...)
id = ecs_entity_init(world, &(ecs_entity_desc_t){
.name = #id,
.add_expr = #__VA_ARGS__
});
ecs_assert(id != 0, ECS_INVALID_PARAMETER, NULL);
ecs_id(id) = id;
(void)id;
(void)ecs_id(id)

ECS_ENTITY(world,id,...)
ecs_entity_t ecs_id(id);
ecs_entity_t ECS_ENTITY_DEFINE(world, id, __VA_ARGS__);

Mentioned in:

ECS_TAG_DECLARE(id)
ECS_ENTITY_DECLARE(id)

ECS_TAG_DEFINE(world,id)
ECS_ENTITY_DEFINE(world, id, 0)

ECS_TAG(world,id)
ECS_ENTITY(world, id, 0)

Mentioned in:

ECS_PREFAB_DECLARE(id)
ECS_ENTITY_DECLARE(id)

ECS_PREFAB_DEFINE(world,id,...)
ECS_ENTITY_DEFINE(world, id, Prefab, __VA_ARGS__)

ECS_PREFAB(world,id,...)
ECS_ENTITY(world, id, Prefab, __VA_ARGS__)

Mentioned in:

ECS_COMPONENT_DECLARE(id)
ecs_entity_t ecs_id(id)

Mentioned in:

ECS_COMPONENT_DEFINE(world,id)
ecs_id(id) = ecs_component_init(world, &(ecs_component_desc_t){
.entity = {
.entity = ecs_id(id),
.name = #id,
.symbol = #id
},
.size = sizeof(id),
.alignment = ECS_ALIGNOF(id)
});
ecs_assert(ecs_id(id) != 0, ECS_INVALID_PARAMETER, NULL)

Mentioned in:

ECS_COMPONENT(world,id)
ecs_entity_t ecs_id(id) = 0;
ECS_COMPONENT_DEFINE(world, id);
(void)ecs_id(id)

Mentioned in:

ECS_TRIGGER(world,trigger_name,kind,component)
ecs_entity_t __F##trigger_name = ecs_trigger_init(world, &(ecs_trigger_desc_t){
.entity.name = #trigger_name,
.callback = trigger_name,
.expr = #component,
.events = {kind},
});
ecs_entity_t trigger_name = __F##trigger_name;
ecs_assert(trigger_name != 0, ECS_INVALID_PARAMETER, NULL);
(void)__F##trigger_name;
(void)trigger_name;

Mentioned in:

ECS_OBSERVER(world,observer_name,kind,...)
ecs_entity_t __F##observer_name = ecs_observer_init(world, &(ecs_observer_desc_t){
.entity.name = #observer_name,
.callback = observer_name,
.filter.expr = #__VA_ARGS__,
.events = {kind},
});
ecs_entity_t observer_name = __F##observer_name;
ecs_assert(observer_name != 0, ECS_INVALID_PARAMETER, NULL);
(void)__F##observer_name;
(void)observer_name;

Convenience macro's that wrap ECS operations

ecs_set_component_actions(world,T,...)
ecs_set_component_actions_w_id(world, ecs_id(T), &(EcsComponentLifecycle)__VA_ARGS__)

ecs_new(world,T)
ecs_new_w_id(world, ecs_id(T))

Mentioned in:

ecs_new_w_pair(world,relation,object)
ecs_new_w_id(world, ecs_pair(relation, object))

Mentioned in:

ecs_bulk_new(world,component,count)
ecs_bulk_new_w_id(world, ecs_id(component), count)

ecs_new_entity(world,n)
ecs_entity_init(world, &(ecs_entity_desc_t) {
.name = n,
})

ecs_new_prefab(world,n)
ecs_entity_init(world, &(ecs_entity_desc_t) {
.name = n,
.add = {EcsPrefab}
})

ecs_add(world,entity,T)
ecs_add_id(world, entity, ecs_id(T))

Mentioned in:

ecs_add_pair(world,subject,relation,object)
ecs_add_id(world, subject, ecs_pair(relation, object))

Mentioned in:

ecs_remove(world,entity,T)
ecs_remove_id(world, entity, ecs_id(T))

Mentioned in:

ecs_remove_pair(world,subject,relation,object)
ecs_remove_id(world, subject, ecs_pair(relation, object))

Mentioned in:

ecs_delete_children(world,parent)
ecs_delete_with(world, ecs_pair(EcsChildOf, parent))

ecs_set_ptr(world,entity,component,ptr)
ecs_set_id(world, entity, ecs_id(component), sizeof(component), ptr)

ecs_set(world,entity,component,...)
ecs_set_id(world, entity, ecs_id(component), sizeof(component), &(component)__VA_ARGS__)

Mentioned in:

ecs_set_pair(world,subject,relation,object,...)
ecs_set_id(world, subject,
ecs_pair(ecs_id(relation), object),
sizeof(relation), &(relation)__VA_ARGS__)

Mentioned in:

ecs_set_pair_object(world,subject,relation,object,...)
ecs_set_id(world, subject,
ecs_pair(relation, ecs_id(object)),
sizeof(object), &(object)__VA_ARGS__)

Mentioned in:

ecs_set_override(world,entity,T,...)
ecs_add_id(world, entity, ECS_OVERRIDE | ecs_id(T));
ecs_set(world, entity, T, __VA_ARGS__)

ecs_emplace(world,entity,T)
(ECS_CAST(T*, ecs_emplace_id(world, entity, ecs_id(T))))

ecs_get_ref(world,ref,entity,T)
(ECS_CAST(const T*, ecs_get_ref_w_id(world, ref, entity, ecs_id(T))))

ecs_get(world,entity,T)
(ECS_CAST(const T*, ecs_get_id(world, entity, ecs_id(T))))

Mentioned in:

ecs_get_pair(world,subject,relation,object)
(ECS_CAST(relation*, ecs_get_id(world, subject,
ecs_pair(ecs_id(relation), object))))

Mentioned in:

ecs_get_pair_object(world,subject,relation,object)
(ECS_CAST(object*, ecs_get_id(world, subject,
ecs_pair(relation, ecs_id(object)))))

Mentioned in:

ecs_get_mut(world,entity,T,is_added)
(ECS_CAST(T*, ecs_get_mut_id(world, entity, ecs_id(T), is_added)))

Mentioned in:

ecs_get_mut_pair(world,subject,relation,object,is_added)
(ECS_CAST(relation*, ecs_get_mut_id(world, subject,
ecs_pair(ecs_id(relation), object), is_added)))

ecs_get_mut_pair_object(world,subject,relation,object,is_added)
(ECS_CAST(object*, ecs_get_mut_id(world, subject,
ecs_pair(relation, ecs_id(object)), is_added)))

ecs_modified(world,entity,component)
ecs_modified_id(world, entity, ecs_id(component))

Mentioned in:

ecs_modified_pair(world,subject,relation,object)
ecs_modified_id(world, subject, ecs_pair(relation, object))

ecs_singleton_get(world,comp)
ecs_get(world, ecs_id(comp), comp)

ecs_singleton_set(world,comp,...)
ecs_set(world, ecs_id(comp), comp, __VA_ARGS__)

ecs_singleton_get_mut(world,comp)
ecs_get_mut(world, ecs_id(comp), comp, NULL)

ecs_singleton_modified(world,comp)
ecs_modified(world, ecs_id(comp), comp)

ecs_has(world,entity,T)
ecs_has_id(world, entity, ecs_id(T))

Mentioned in:

ecs_has_pair(world,entity,relation,object)
ecs_has_id(world, entity, ecs_pair(relation, object))

Mentioned in:

ecs_owns_id(world,entity,id)
ecs_type_has_id(world, ecs_get_type(world, entity), id, true)

ecs_owns_pair(world,entity,relation,object)
ecs_type_has_id(world, ecs_get_type(world, entity), ecs_pair(relation, object), true)

ecs_owns(world,entity,T)
ecs_type_has_id(world, ecs_get_type(world, entity), ecs_id(T), true)

ecs_shares_id(world,entity,id)
ecs_type_has_id(world, ecs_get_type(world, entity), id, false)

ecs_shares_pair(world,entity,relation,object)
ecs_type_has_id(world, ecs_get_type(world, entity), ecs_pair(relation, object), false)

ecs_shares(world,entity,T)
ecs_type_has_id(world, ecs_get_type(world, entity), ecs_id(T), false)

ecs_enable_component(world,entity,T,enable)
ecs_enable_component_w_id(world, entity, ecs_id(T), enable)

Mentioned in:

ecs_is_component_enabled(world,entity,T)
ecs_is_component_enabled_w_id(world, entity, ecs_id(T))

Mentioned in:

ecs_count(world,type)
ecs_count_id(world, ecs_id(type))

ecs_lookup_path(world,parent,path)
ecs_lookup_path_w_sep(world, parent, path, ".", NULL, true)

Mentioned in:

ecs_lookup_fullpath(world,path)
ecs_lookup_path_w_sep(world, 0, path, ".", NULL, true)

Mentioned in:

ecs_get_path(world,parent,child)
ecs_get_path_w_sep(world, parent, child, ".", NULL)

Mentioned in:

ecs_get_fullpath(world,child)
ecs_get_path_w_sep(world, 0, child, ".", NULL)

Mentioned in:

ecs_new_from_path(world,parent,path)
ecs_new_from_path_w_sep(world, parent, path, ".", NULL)

ecs_new_from_fullpath(world,path)
ecs_new_from_path_w_sep(world, 0, path, ".", NULL)

ecs_add_path(world,entity,parent,path)
ecs_add_path_w_sep(world, entity, parent, path, ".", NULL)

ecs_add_fullpath(world,entity,path)
ecs_add_path_w_sep(world, entity, 0, path, ".", NULL)

ecs_query_table_count(query)
ecs_vector_count(query->cache.tables)

ecs_query_empty_table_count(query)
ecs_vector_count(query->cache.empty_tables)

ecs_term_id(it,index)
((it)->ids[(index) - 1])

Mentioned in:

ecs_term_source(it,index)
((it)->subjects ? (it)->subjects[(index) - 1] : 0)

ecs_term_size(it,index)
((index) == 0 ? sizeof(ecs_entity_t) : ECS_CAST(size_t, (it)->sizes[(index) - 1]))

ecs_term_is_set(it,index)
((it)->columns[(index) - 1] != 0)

ecs_term(it,T,index)
(ECS_CAST(T*, ecs_term_w_size(it, sizeof(T), index)))

Mentioned in:

ecs_iter_column(it,T,index)
(ECS_CAST(T*, ecs_iter_column_w_size(it, sizeof(T), index)))

Utility macro's for commonly used operations

ecs_childof(parent)
ecs_pair(EcsChildOf, parent)

ecs_isa(base)
ecs_pair(EcsIsA, base)

Temp macro's for easing the transition to v3

ECS_CTOR(type,var,...)
ECS_XTOR_IMPL(type, ctor, var, __VA_ARGS__)

Declare a constructor. Example: ECS_CTOR(MyType, ptr, { ptr->value = NULL; });

ECS_DTOR(type,var,...)
ECS_XTOR_IMPL(type, dtor, var, __VA_ARGS__)

Declare a destructor. Example: ECS_DTOR(MyType, ptr, { free(ptr->value); });

ECS_COPY(type,dst_var,src_var,...)
ECS_COPY_IMPL(type, dst_var, src_var, __VA_ARGS__)

Declare a copy action. Example: ECS_COPY(MyType, dst, src, { dst->value = strdup(src->value); });

ECS_MOVE(type,dst_var,src_var,...)
ECS_MOVE_IMPL(type, dst_var, src_var, __VA_ARGS__)

Declare a move action. Example: ECS_MOVE(MyType, dst, src, { dst->value = src->value; src->value = 0; });

ECS_ON_SET(type,ptr,...)
ECS_ON_SET_IMPL(type, ptr, __VA_ARGS__)

Declare an on_set action. Example: ECS_ON_SET(MyType, ptr, { printf("%d
n", ptr->value); });

ecs_ctor(type)
type##_ctor

ecs_dtor(type)
type##_dtor

ecs_copy(type)
type##_copy

ecs_move(type)
type##_move

ecs_on_set(type)
type##_on_set

ecs_query_new(world,q_expr)
ecs_query_init(world, &(ecs_query_desc_t){
.filter.expr = q_expr
})

Mentioned in:

ECS_TYPE(world,id,...)
ecs_entity_t id = ecs_type_init(world, &(ecs_type_desc_t){
.entity.name = #id,
.ids_expr = #__VA_ARGS__
});
ecs_assert(id != 0, ECS_INVALID_PARAMETER, NULL);
(void)id;

Mentioned in:

Other Types

FLECS_API const ecs_id_t ECS_CASE

Cases are used to switch between mutually exclusive components

Mentioned in:

Manual / Type role

Manual / Type roles

Manual / Switchable tags

FLECS_API const ecs_id_t ECS_SWITCH

Switches allow for fast switching between mutually exclusive components

Mentioned in:

Manual / Type role

Manual / Type roles

Manual / Switchable tags

FLECS_API const ecs_id_t ECS_PAIR

The PAIR role indicates that the entity is a pair identifier.

FLECS_API const ecs_id_t ECS_OVERRIDE

Enforce ownership of a component

Mentioned in:

Manual / Type roles

Manual / Automatic overriding

FLECS_API const ecs_id_t ECS_DISABLED

Track whether component is enabled or not

FLECS_API const ecs_entity_t EcsFlecs

Root scope for builtin flecs entities

FLECS_API const ecs_entity_t EcsFlecsCore

FLECS_API const ecs_entity_t EcsWorld

Mentioned in:

FLECS_API const ecs_entity_t EcsWildcard

Mentioned in:

FLECS_API const ecs_entity_t EcsThis

Mentioned in:

FLECS_API const ecs_entity_t EcsTransitive

FLECS_API const ecs_entity_t EcsInclusive

FLECS_API const ecs_entity_t EcsFinal

Mentioned in:

FLECS_API const ecs_entity_t EcsTag

Mentioned in:

FLECS_API const ecs_entity_t EcsName

Mentioned in:

FLECS_API const ecs_entity_t EcsSymbol

FLECS_API const ecs_entity_t EcsChildOf

Mentioned in:

FLECS_API const ecs_entity_t EcsIsA

Mentioned in:

FLECS_API const ecs_entity_t EcsModule

FLECS_API const ecs_entity_t EcsPrefab

Mentioned in:

FLECS_API const ecs_entity_t EcsDisabled

FLECS_API const ecs_entity_t EcsOnAdd

Mentioned in:

FLECS_API const ecs_entity_t EcsOnRemove

FLECS_API const ecs_entity_t EcsOnSet

Mentioned in:

FLECS_API const ecs_entity_t EcsUnSet

FLECS_API const ecs_entity_t EcsMonitor

FLECS_API const ecs_entity_t EcsOnDelete

Mentioned in:

FLECS_API const ecs_entity_t EcsOnTableEmpty

FLECS_API const ecs_entity_t EcsOnTableNonEmpty

FLECS_API const ecs_entity_t EcsOnDeleteObject

Mentioned in:

FLECS_API const ecs_entity_t EcsRemove

Mentioned in:

FLECS_API const ecs_entity_t EcsDelete

Mentioned in:

FLECS_API const ecs_entity_t EcsThrow

Mentioned in:

FLECS_API const ecs_entity_t EcsInactive

FLECS_API const ecs_entity_t EcsPipeline

FLECS_API const ecs_entity_t EcsPreFrame

FLECS_API const ecs_entity_t EcsOnLoad

Mentioned in:

FLECS_API const ecs_entity_t EcsPostLoad

Mentioned in:

FLECS_API const ecs_entity_t EcsPreUpdate

Mentioned in:

FLECS_API const ecs_entity_t EcsOnUpdate

Mentioned in:

FLECS_API const ecs_entity_t EcsOnValidate

Mentioned in:

FLECS_API const ecs_entity_t EcsPostUpdate

Mentioned in:

FLECS_API const ecs_entity_t EcsPreStore

Mentioned in:

FLECS_API const ecs_entity_t EcsOnStore

Mentioned in:

FLECS_API const ecs_entity_t EcsPostFrame

ecs_trigger_initCreate trigger
ecs_get_trigger_ctxGet trigger context
ecs_get_trigger_binding_ctxSame as ecs_get_trigger_ctx, but for binding ctx
ecs_payload_kind_t
ecs_event_desc_t
ecs_emitSend event.
ecs_observer_initCreate observer
ecs_get_observer_ctx
ecs_get_observer_binding_ctx