add src/ikarus subdir and make names unique for objects per scope

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
Folling 2024-01-30 09:31:08 +01:00 committed by Folling
parent c65211e4ff
commit 5dce2ced94
No known key found for this signature in database
51 changed files with 590 additions and 735 deletions

View file

@ -80,29 +80,6 @@ IKA_API void ikarus_project_set_name(IkarusProject * project, char const * new_n
/// \remark Ownership remains with libikarus, must not be freed.
IKA_API char const * ikarus_project_get_path(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Gets the blueprints of a project.
/// \param project The project to get the blueprints of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param blueprints_out The buffer to write the blueprints to.
/// \pre \li Must not be null.
/// \param blueprints_out_size The size of the buffer.
/// \param error_out \see errors.h
IKA_API void ikarus_project_get_blueprints(
IkarusProject * project,
struct IkarusBlueprint ** blueprints_out,
size_t blueprints_out_size,
IkarusErrorData * error_out
);
/// \brief Gets the number of blueprints of a project.
/// \param project The project to get the number of blueprints of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The number of blueprints or undefined if an error occurs.
IKA_API size_t ikarus_project_get_blueprint_count(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Gets the entities of a project.
/// \param project The project to get the entities of.
/// \pre \li Must not be null.
@ -126,6 +103,71 @@ IKA_API void ikarus_project_get_entities(
/// \return The number of entities or undefined if an error occurs.
IKA_API size_t ikarus_project_get_entity_count(IkarusProject * project, IkarusErrorData * error_out);
/// \brief Gets the blueprints of a project.
/// \param project The project to get the blueprints of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param blueprints_out The buffer to write the blueprints to.
/// \pre \li Must not be null.
/// \param blueprints_out_size The size of the buffer.
/// \param error_out \see errors.h
IKA_API void ikarus_project_get_blueprints(
IkarusProject * project,
struct IkarusBlueprint ** blueprints_out,
size_t blueprints_out_size,
IkarusErrorData * error_out
);
/// \brief Gets the number of blueprints of a project.
/// \param project The project to get the number of blueprints of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The number of blueprints or undefined if an error occurs.
IKA_API size_t ikarus_project_get_blueprint_count(IkarusProject const * project, IkarusErrorData * error_out);
/// \brief Finds an entity by a given name.
/// \param project The project to search.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param name The name to search for.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \param error_out \see errors.h
/// \return The entity with the given name or null if none was found.
IKA_API struct IkarusEntity* get_entity_by_name(
IkarusProject const * project,
char const * name,
IkarusErrorData * error_out
);
/// \brief Finds a property by a given name.
/// \param project The project to search.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param scope The scope of the property.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \remark Property names are unique only within their scope.
/// \param name The name to search for.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \param error_out \see errors.h
/// \return The property with the given name or null if none was found.
IKA_API struct IkarusProperty *
get_property_by_name(IkarusProject const * project, struct IkarusPropertyScope * scope, char const * name, IkarusErrorData * error_out);
/// \brief Finds a blueprint by a given name.
/// \param project The project to search.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param name The name to search for.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \param error_out \see errors.h
/// \return The blueprint with the given name or null if none was found.
IKA_API struct IkarusBlueprint * get_blueprints_by_name(IkarusProject const * project, char const * name, IkarusErrorData * error_out);
IKARUS_END_HEADER
/// @}