Function ecs_search


#include <include/flecs.h>

FLECS_API int32_t ecs_search(const ecs_world_t *world, const ecs_table_t *table, ecs_id_t id, ecs_id_t *id_out)


Search for component id in table type. This operation returns the index of first occurrance of the id in the table type. The id may be a wildcard.

When id_out is provided, the function will assign it with the found id. The found id may be different from the provided id if it is a wildcard.

This is a constant time operation.


world - The world.

table - The table.

id - The id to search for.

id_out - If provided, it will be set to the found id (optional).

The index of the id in the table type.

Mentioned in


Line 4457 in include/flecs.h.