improve C header compatibility
This commit is contained in:
parent
24335a0a1f
commit
9ea02d5cb1
9 changed files with 151 additions and 165 deletions
|
|
@ -4,6 +4,7 @@
|
|||
/// \author Folling <mail@folling.io>
|
||||
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \addtogroup errors Errors
|
||||
/// \brief Error handling within libikarus
|
||||
|
|
@ -116,11 +117,11 @@ IKA_API char const * ikarus_error_info_get_name(enum IkarusErrorInfo info);
|
|||
/// \brief Checks if an error data is a success.
|
||||
/// \param data The error data to check.
|
||||
/// \return True if the error data is a success, false otherwise.
|
||||
IKA_API bool ikarus_error_data_is_success(IkarusErrorData const * data);
|
||||
IKA_API bool ikarus_error_data_is_success(struct IkarusErrorData const * data);
|
||||
/// \brief Checks if an error data is an error.
|
||||
/// \param data The error data to check.
|
||||
/// \return True if the error data is an error, false otherwise.
|
||||
IKA_API bool ikarus_error_data_is_error(IkarusErrorData const * data);
|
||||
IKA_API bool ikarus_error_data_is_error(struct IkarusErrorData const * data);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,17 @@
|
|||
/// \file blueprint.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
/// \defgroup blueprints Blueprints
|
||||
/// \brief Blueprints are templates for entities.
|
||||
/// @{
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \defgroup blueprints Blueprints
|
||||
/// \brief Blueprints are templates for entities.
|
||||
/// @{
|
||||
struct IkarusProject;
|
||||
struct IkarusEntity;
|
||||
struct IkarusProperty;
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
|
|
@ -25,7 +29,7 @@ struct IkarusBlueprint;
|
|||
/// \pre \li Must not be null.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return True if the blueprint exists, false otherwise or if an error occurs.
|
||||
IKA_API bool ikarus_blueprint_exists(IkarusBlueprint * blueprint, IkarusErrorData * error_out);
|
||||
IKA_API bool ikarus_blueprint_exists(struct IkarusBlueprint * blueprint, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for creating a blueprint.
|
||||
enum IkarusBlueprintCreateFlags {
|
||||
|
|
@ -44,10 +48,10 @@ enum IkarusBlueprintCreateFlags {
|
|||
/// \return The created blueprint or null if an error occurs.
|
||||
/// \param error_out \see errors.h
|
||||
/// \remark Ownership remains with libikarus.
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_create(
|
||||
IKA_API struct IkarusBlueprint * ikarus_blueprint_create(
|
||||
struct IkarusProject * project,
|
||||
char const * name,
|
||||
IkarusBlueprintCreateFlags flags,
|
||||
enum IkarusBlueprintCreateFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
|
|
@ -68,10 +72,10 @@ enum IkarusBlueprintCreateFromEntityFlags {
|
|||
/// \param flags Flags for creating the blueprint.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The created blueprint or null if an error occurs.
|
||||
IKA_API IkarusBlueprint * ikarus_blueprint_create_from_entity(
|
||||
IKA_API struct IkarusBlueprint * ikarus_blueprint_create_from_entity(
|
||||
struct IkarusEntity * entity,
|
||||
char const * name,
|
||||
IkarusBlueprintCreateFromEntityFlags flags,
|
||||
enum IkarusBlueprintCreateFromEntityFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
|
|
@ -90,7 +94,7 @@ enum IkarusBlueprintCopyFlags {
|
|||
/// \return The copied blueprint or null if an error occurs.
|
||||
IKA_API struct IkarusBlueprint * ikarus_blueprint_copy(
|
||||
struct IkarusBlueprint * blueprint,
|
||||
IkarusBlueprintCopyFlags flags,
|
||||
enum IkarusBlueprintCopyFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
|
|
@ -109,8 +113,8 @@ enum IkarusBlueprintDeleteFlags {
|
|||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_blueprint_delete(
|
||||
struct IkarusBlueprint * blueprint,
|
||||
IkarusBlueprintDeleteFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusBlueprintDeleteFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets the project a blueprint belongs to.
|
||||
|
|
@ -150,7 +154,7 @@ enum IkarusBlueprintSetNameFlags {
|
|||
IKA_API void ikarus_blueprint_set_name(
|
||||
struct IkarusBlueprint * blueprint,
|
||||
char const * name,
|
||||
IkarusBlueprintSetNameFlags flags,
|
||||
enum IkarusBlueprintSetNameFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \file entity.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
/// \defgroup entities Entities
|
||||
/// \brief Entities are the core building blocks of Ikarus.
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
struct IkarusProject;
|
||||
struct IkarusEntity;
|
||||
struct IkarusProperty;
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief Entities are the core building blocks of Ikarus.
|
||||
|
|
@ -38,8 +42,7 @@ enum IkarusEntityCreateFlags {
|
|||
/// \pre \li Must not be null.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return True if the entity exists, false otherwise or if an error occurs.
|
||||
IKA_API bool
|
||||
ikarus_entity_exists(IkarusEntity * entity, IkarusErrorData * error_out);
|
||||
IKA_API bool ikarus_entity_exists(struct IkarusEntity * entity, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Creates a new entity.
|
||||
/// \param project The project to create the entity in.
|
||||
|
|
@ -51,11 +54,11 @@ ikarus_entity_exists(IkarusEntity * entity, IkarusErrorData * error_out);
|
|||
/// \param flags Flags for creating the entity.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The created entity or null if an error occurs.
|
||||
IKA_API IkarusEntity * ikarus_entity_create(
|
||||
IKA_API struct IkarusEntity * ikarus_entity_create(
|
||||
struct IkarusProject * project,
|
||||
char const * name,
|
||||
IkarusEntityCreateFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntityCreateFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for deleting an entity.
|
||||
|
|
@ -71,9 +74,9 @@ enum IkarusEntityDeleteFlags {
|
|||
/// \param flags Flags for deleting the entity.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_delete(
|
||||
IkarusEntity * entity,
|
||||
IkarusEntityDeleteFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusEntity * entity,
|
||||
enum IkarusEntityDeleteFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for copying an entity.
|
||||
|
|
@ -89,11 +92,8 @@ enum IkarusEntityCopyFlags {
|
|||
/// \param flags Flags for copying the entity.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The copied entity or null if an error occurs.
|
||||
IKA_API IkarusEntity * ikarus_entity_copy(
|
||||
IkarusEntity * entity,
|
||||
IkarusEntityCopyFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API struct IkarusEntity *
|
||||
ikarus_entity_copy(struct IkarusEntity * entity, enum IkarusEntityCopyFlags flags, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets the project an entity belongs to.
|
||||
/// \param entity The entity to get the project of.
|
||||
|
|
@ -102,7 +102,7 @@ IKA_API IkarusEntity * ikarus_entity_copy(
|
|||
/// \param error_out \see errors.h
|
||||
/// \return The project the entity belongs to.
|
||||
IKA_API struct IkarusProject *
|
||||
ikarus_entity_get_project(IkarusEntity * entity, IkarusErrorData * error_out);
|
||||
ikarus_entity_get_project(struct IkarusEntity * entity, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets the name of an entity.
|
||||
/// \param entity The entity to get the name of.
|
||||
|
|
@ -110,8 +110,7 @@ ikarus_entity_get_project(IkarusEntity * entity, IkarusErrorData * error_out);
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The name of the entity.
|
||||
IKA_API char const *
|
||||
ikarus_entity_get_name(IkarusEntity * entity, IkarusErrorData * error_out);
|
||||
IKA_API char const * ikarus_entity_get_name(struct IkarusEntity * entity, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for setting the name of an entity.
|
||||
enum IkarusEntitySetNameFlags {
|
||||
|
|
@ -129,10 +128,10 @@ enum IkarusEntitySetNameFlags {
|
|||
/// \param flags Flags for setting the name of the entity.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_set_name(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
char const * name,
|
||||
IkarusEntitySetNameFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntitySetNameFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets whether an entity is linked to a blueprint.
|
||||
|
|
@ -146,9 +145,9 @@ IKA_API void ikarus_entity_set_name(
|
|||
/// \param error_out \see errors.h
|
||||
/// \return True if the entity is linked to the blueprint, false otherwise or if an error occurs.
|
||||
IKA_API bool ikarus_entity_is_linked_to_blueprint(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusBlueprint * blueprint,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets the blueprints an entity is linked to.
|
||||
|
|
@ -159,9 +158,9 @@ IKA_API bool ikarus_entity_is_linked_to_blueprint(
|
|||
/// or undefined if an error occurs.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API struct IkarusBlueprint ** ikarus_entity_get_linked_blueprints(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
size_t * size_out,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets the number of blueprints an entity is linked to.
|
||||
|
|
@ -170,10 +169,8 @@ IKA_API struct IkarusBlueprint ** ikarus_entity_get_linked_blueprints(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The number of linked blueprints or 0 if an error occurs.
|
||||
IKA_API size_t ikarus_entity_get_linked_blueprints_count(
|
||||
IkarusEntity * entity,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API size_t
|
||||
ikarus_entity_get_linked_blueprints_count(struct IkarusEntity * entity, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for linking an entity to a blueprint.
|
||||
enum IkarusEntityLinkBlueprintFlags {
|
||||
|
|
@ -195,10 +192,10 @@ enum IkarusEntityLinkBlueprintFlags {
|
|||
/// \param flags Flags for linking the entity to the blueprint.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_link_blueprint(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusBlueprint * blueprint,
|
||||
IkarusEntityLinkBlueprintFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntityLinkBlueprintFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for unlinking an entity from a blueprint.
|
||||
|
|
@ -220,10 +217,10 @@ enum IkarusEntityUnlinkBlueprintFlags {
|
|||
/// \param flags Flags for unlinking the entity from the blueprint.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_unlink_blueprint(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusBlueprint * blueprint,
|
||||
IkarusEntityUnlinkBlueprintFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntityUnlinkBlueprintFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets whether an entity has a value.
|
||||
|
|
@ -234,11 +231,8 @@ IKA_API void ikarus_entity_unlink_blueprint(
|
|||
/// \pre \li Must not be null.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return True if the entity has a value with the name, false otherwise or if an error occurs.
|
||||
IKA_API bool ikarus_entity_has_value(
|
||||
IkarusEntity * entity,
|
||||
char const * name,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API bool
|
||||
ikarus_entity_has_value(struct IkarusEntity * entity, char const * name, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Struct for an entity value.
|
||||
struct IkarusEntityValue {
|
||||
|
|
@ -256,11 +250,8 @@ struct IkarusEntityValue {
|
|||
/// or undefined if an error occurs.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The values or null if an error occurs.
|
||||
IKA_API IkarusEntityValue * ikarus_entity_get_values(
|
||||
IkarusEntity * entity,
|
||||
size_t * size_out,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API struct IkarusEntityValue *
|
||||
ikarus_entity_get_values(struct IkarusEntity * entity, size_t * size_out, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets a value of an entity.
|
||||
/// \param entity The entity to get the value of.
|
||||
|
|
@ -271,11 +262,8 @@ IKA_API IkarusEntityValue * ikarus_entity_get_values(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The value, in json format of or null if an error occurs. \see value.h
|
||||
IKA_API char const * ikarus_entity_get_value(
|
||||
IkarusEntity * entity,
|
||||
char const * name,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API char const *
|
||||
ikarus_entity_get_value(struct IkarusEntity * entity, char const * name, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for setting a value of an entity.
|
||||
enum IkarusEntitySetValueFlags {
|
||||
|
|
@ -297,11 +285,11 @@ enum IkarusEntitySetValueFlags {
|
|||
/// \param flags Flags for setting the value.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_set_value(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
char const * name,
|
||||
char const * value,
|
||||
IkarusEntitySetValueFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntitySetValueFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for deleting a value of an entity.
|
||||
|
|
@ -320,10 +308,10 @@ enum IkarusEntityDeleteValueFlags {
|
|||
/// \param flags Flags for deleting the value.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_delete_value(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
char const * name,
|
||||
IkarusEntityDeleteValueFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntityDeleteValueFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets whether an entity has a property value.
|
||||
|
|
@ -337,9 +325,9 @@ IKA_API void ikarus_entity_delete_value(
|
|||
/// \param error_out \see errors.h
|
||||
/// \return True if the entity has a value for the property, false otherwise or if an error occurs.
|
||||
IKA_API bool ikarus_entity_has_property_value(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusProperty * property,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Struct for an entity property value.
|
||||
|
|
@ -358,11 +346,8 @@ struct IkarusEntityPropertyValue {
|
|||
/// returned array or undefined if an error occurs.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The property values, or null if an error occurs.
|
||||
IKA_API IkarusEntityPropertyValue * ikarus_entity_get_property_values(
|
||||
IkarusEntity * entity,
|
||||
size_t * size_out,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API struct IkarusEntityPropertyValue *
|
||||
ikarus_entity_get_property_values(struct IkarusEntity * entity, size_t * size_out, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets the value of a property of an entity.
|
||||
/// \param entity The entity to get the value of.
|
||||
|
|
@ -376,9 +361,9 @@ IKA_API IkarusEntityPropertyValue * ikarus_entity_get_property_values(
|
|||
/// \return The value, in json format of or null if an error occurs. \see
|
||||
/// value.h
|
||||
IKA_API char const * ikarus_entity_get_property_value(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusProperty * property,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for setting the value of a property of an entity.
|
||||
|
|
@ -403,11 +388,11 @@ enum IkarusEntitySetPropertyValueFlags {
|
|||
/// \param flags Flags for setting the property value.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_set_property_value(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusProperty * property,
|
||||
char const * value,
|
||||
IkarusEntitySetPropertyValueFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntitySetPropertyValueFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for clearing the value of a property of an entity.
|
||||
|
|
@ -427,10 +412,10 @@ enum IkarusEntityClearPropertyValueFlags {
|
|||
/// \param flags Flags for clearing the property value.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_entity_clear_property_value(
|
||||
IkarusEntity * entity,
|
||||
struct IkarusEntity * entity,
|
||||
struct IkarusProperty * property,
|
||||
IkarusEntitySetPropertyValueFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusEntitySetPropertyValueFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@
|
|||
/// \file property.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
/// \defgroup properties Properties
|
||||
/// \brief Properties define the structure and types of data.
|
||||
/// @{
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \defgroup properties Properties
|
||||
/// \brief Properties define the structure and types of data.
|
||||
/// @{
|
||||
struct IkarusProject;
|
||||
struct IkarusBlueprint;
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
|
|
@ -41,7 +44,7 @@ struct IkarusProperty;
|
|||
/// \pre \li Must not be null.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return True if the property exists, false otherwise or if an error occurs.
|
||||
IKA_API bool ikarus_property_exists(IkarusProperty * property, IkarusErrorData * error_out);
|
||||
IKA_API bool ikarus_property_exists(struct IkarusProperty * property, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for creating a property.
|
||||
enum IkarusPropertyCreateFlags {
|
||||
|
|
@ -69,13 +72,13 @@ enum IkarusPropertyCreateFlags {
|
|||
/// \param error_out \see errors.h
|
||||
/// \return The created property or NULL if an error occurred.
|
||||
/// \remark Must only be deleted with #ikarus_property_delete.
|
||||
IKA_API IkarusProperty * ikarus_property_create(
|
||||
IKA_API struct IkarusProperty * ikarus_property_create(
|
||||
struct IkarusBlueprint * blueprint,
|
||||
char const * name,
|
||||
char const * schema,
|
||||
char const * default_value,
|
||||
IkarusPropertyCreateFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusPropertyCreateFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for copying a property.
|
||||
|
|
@ -91,8 +94,11 @@ enum IkarusPropertyCopyFlags {
|
|||
/// \param flags Flags for copying the property.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The copied property or NULL if an error occurred.
|
||||
IKA_API IkarusProperty *
|
||||
ikarus_property_copy(IkarusProperty * property, IkarusPropertyCopyFlags flags, IkarusErrorData * error_out);
|
||||
IKA_API struct IkarusProperty * ikarus_property_copy(
|
||||
struct IkarusProperty * property,
|
||||
enum IkarusPropertyCopyFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for deleting a property.
|
||||
enum IkarusPropertyDeleteFlags {
|
||||
|
|
@ -104,8 +110,11 @@ enum IkarusPropertyDeleteFlags {
|
|||
/// \param property The property to delete.
|
||||
/// \param flags Flags for deleting the property.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void
|
||||
ikarus_property_delete(IkarusProperty * property, IkarusPropertyDeleteFlags flags, IkarusErrorData * error_out);
|
||||
IKA_API void ikarus_property_delete(
|
||||
struct IkarusProperty * property,
|
||||
enum IkarusPropertyDeleteFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Get the project a property belongs to.
|
||||
/// \param property The property to get the project of.
|
||||
|
|
@ -114,7 +123,8 @@ ikarus_property_delete(IkarusProperty * property, IkarusPropertyDeleteFlags flag
|
|||
/// \param error_out \see errors.h
|
||||
/// \return The project the property belongs to or null if an error occurred.
|
||||
/// \remark Ownership remains with libikarus.
|
||||
IKA_API struct IkarusProject * ikarus_property_get_project(IkarusProperty * property, IkarusErrorData * error_out);
|
||||
IKA_API struct IkarusProject *
|
||||
ikarus_property_get_project(struct IkarusProperty * property, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Get the name of a property.
|
||||
/// \param property The property to get the name of.
|
||||
|
|
@ -123,7 +133,7 @@ IKA_API struct IkarusProject * ikarus_property_get_project(IkarusProperty * prop
|
|||
/// \param error_out \see errors.h
|
||||
/// \return The name of the property or null if an error occurred.
|
||||
/// \remark Ownership remains with libikarus.
|
||||
IKA_API char const * ikarus_property_get_name(IkarusProperty * property, IkarusErrorData * error_out);
|
||||
IKA_API char const * ikarus_property_get_name(struct IkarusProperty * property, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for setting the name of a property.
|
||||
enum IkarusPropertySetNameFlags {
|
||||
|
|
@ -142,10 +152,10 @@ enum IkarusPropertySetNameFlags {
|
|||
/// \param error_out \see errors.h
|
||||
/// \remark Ownership remains with the caller.
|
||||
IKA_API void ikarus_property_set_name(
|
||||
IkarusProperty * property,
|
||||
struct IkarusProperty * property,
|
||||
char const * name,
|
||||
IkarusPropertySetNameFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusPropertySetNameFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Get the schema of a property.
|
||||
|
|
@ -154,7 +164,7 @@ IKA_API void ikarus_property_set_name(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The schema of the property in JSON format or null if an error occurred. \see schema.h
|
||||
IKA_API char const * ikarus_property_get_schema(IkarusProperty * property, IkarusErrorData * error_out);
|
||||
IKA_API char const * ikarus_property_get_schema(struct IkarusProperty * property, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for setting the schema of a property.
|
||||
enum IkarusPropertySetSchemaFlags {
|
||||
|
|
@ -176,11 +186,11 @@ enum IkarusPropertySetSchemaFlags {
|
|||
/// \param flags Flags for setting the schema of the property.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_property_set_schema(
|
||||
IkarusProperty * property,
|
||||
struct IkarusProperty * property,
|
||||
char const * schema,
|
||||
char const * new_default_value,
|
||||
IkarusPropertySetSchemaFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusPropertySetSchemaFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Get the default value of a property.
|
||||
|
|
@ -189,7 +199,8 @@ IKA_API void ikarus_property_set_schema(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The default value data of the property in JSON format or null if an error occurred. \see data.h
|
||||
IKA_API char const * ikarus_property_get_default_value(IkarusProperty * property, IkarusErrorData * error_out);
|
||||
IKA_API char const *
|
||||
ikarus_property_get_default_value(struct IkarusProperty * property, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \details The default value must match the schema of the property.
|
||||
|
||||
|
|
@ -210,10 +221,10 @@ enum IkarusPropertySetDefaultValueFlags {
|
|||
/// \param flags Flags for setting the default value of the property.
|
||||
/// \param error_out \see errors.h
|
||||
IKA_API void ikarus_property_set_default_value(
|
||||
IkarusProperty * property,
|
||||
struct IkarusProperty * property,
|
||||
char const * value,
|
||||
IkarusPropertySetDefaultValueFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusPropertySetDefaultValueFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets all values for a property.
|
||||
|
|
|
|||
|
|
@ -3,17 +3,15 @@
|
|||
/// \file project.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \defgroup projects Projects
|
||||
/// \brief Projects are the persistence mechanism of Ikarus. Each project contains a set of objects.
|
||||
/// \details Projects are stored on the filesystem. Each project has a name.
|
||||
/// @{
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief An Ikarus project.
|
||||
|
|
@ -44,8 +42,8 @@ enum IkarusProjectCreateFlags {
|
|||
IKA_API struct IkarusProject * ikarus_project_create(
|
||||
char const * path,
|
||||
char const * name,
|
||||
IkarusProjectCreateFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusProjectCreateFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for creating a project in memory.
|
||||
|
|
@ -64,8 +62,8 @@ enum IkarusProjectCreateInMemoryFlags {
|
|||
/// \remark Must be closed with #ikarus_project_close.
|
||||
IKA_API struct IkarusProject * ikarus_project_create_in_memory(
|
||||
char const * name,
|
||||
IkarusProjectCreateInMemoryFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusProjectCreateInMemoryFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for opening a project.
|
||||
|
|
@ -82,11 +80,8 @@ enum IkarusProjectOpenFlags {
|
|||
/// \param error_out \see errors.h
|
||||
/// \return The opened project or null if an error occurs.
|
||||
/// \remark Must be closed with #ikarus_project_close.
|
||||
IKA_API struct IkarusProject * ikarus_project_open(
|
||||
char const * path,
|
||||
IkarusProjectOpenFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API struct IkarusProject *
|
||||
ikarus_project_open(char const * path, enum IkarusProjectOpenFlags flags, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Flags for closing a project in memory.
|
||||
enum IkarusProjectCloseFlags {
|
||||
|
|
@ -105,8 +100,8 @@ enum IkarusProjectCloseFlags {
|
|||
/// \remark Mutually exclusive with #ikarus_project_delete.
|
||||
IKA_API void ikarus_project_close(
|
||||
struct IkarusProject * project,
|
||||
IkarusProjectCloseFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusProjectCloseFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Flags for deleting a project.
|
||||
|
|
@ -125,8 +120,8 @@ enum IkarusProjectDeleteFlags {
|
|||
/// \remark Mutually exclusive with #ikarus_project_close.
|
||||
IKA_API void ikarus_project_delete(
|
||||
struct IkarusProject * project,
|
||||
IkarusProjectDeleteFlags flags,
|
||||
IkarusErrorData * error_out
|
||||
enum IkarusProjectDeleteFlags flags,
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets the name of a project.
|
||||
|
|
@ -135,10 +130,7 @@ IKA_API void ikarus_project_delete(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \returns The name of the project or null if an error occurs.
|
||||
IKA_API char const * ikarus_project_get_name(
|
||||
struct IkarusProject const * project,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API char const * ikarus_project_get_name(struct IkarusProject const * project, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets the path of a project.
|
||||
/// \param project The project to delete.
|
||||
|
|
@ -146,10 +138,7 @@ IKA_API char const * ikarus_project_get_name(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \returns The path of the project or null if an error occurs.
|
||||
IKA_API char const * ikarus_project_get_path(
|
||||
struct IkarusProject const * project,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API char const * ikarus_project_get_path(struct IkarusProject const * project, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets all entities in a project.
|
||||
/// \param project The project from which to get the entities.
|
||||
|
|
@ -162,7 +151,7 @@ IKA_API char const * ikarus_project_get_path(
|
|||
IKA_API struct IkarusEntity ** ikarus_project_get_entities(
|
||||
struct IkarusProject const * project,
|
||||
size_t * size_out,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets how many entities in a project there are.
|
||||
|
|
@ -171,10 +160,8 @@ IKA_API struct IkarusEntity ** ikarus_project_get_entities(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The count or 0 if an error occurs.
|
||||
IKA_API size_t ikarus_project_get_entities_count(
|
||||
IkarusProject const * project,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API size_t
|
||||
ikarus_project_get_entities_count(struct IkarusProject const * project, struct IkarusErrorData * error_out);
|
||||
|
||||
/// \brief Gets all blueprints from a project.
|
||||
/// \param project The project from which to get the blueprints.
|
||||
|
|
@ -187,7 +174,7 @@ IKA_API size_t ikarus_project_get_entities_count(
|
|||
IKA_API struct IkarusBlueprint ** ikarus_project_get_blueprints(
|
||||
struct IkarusProject const * project,
|
||||
size_t * size_out,
|
||||
IkarusErrorData * error_out
|
||||
struct IkarusErrorData * error_out
|
||||
);
|
||||
|
||||
/// \brief Gets how many blueprints in a project there are.
|
||||
|
|
@ -196,10 +183,8 @@ IKA_API struct IkarusBlueprint ** ikarus_project_get_blueprints(
|
|||
/// \pre \li Must exist.
|
||||
/// \param error_out \see errors.h
|
||||
/// \return The count or 0 if an error occurs.
|
||||
IKA_API size_t ikarus_project_get_blueprints_count(
|
||||
IkarusProject const * project,
|
||||
IkarusErrorData * error_out
|
||||
);
|
||||
IKA_API size_t
|
||||
ikarus_project_get_blueprints_count(struct IkarusProject const * project, struct IkarusErrorData * error_out);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
using std::size_t;
|
||||
#else
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \file data.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
/// \addtogroup values Values
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief Data stores the actual information of a value.
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \file schema.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
/// \addtogroup values Values
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief Schemas define the type of value.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
/// \file value.h
|
||||
/// \author Folling <mail@folling.io>
|
||||
|
||||
/// \defgroup entities Entities
|
||||
/// \brief Entities are the core building blocks of Ikarus.
|
||||
|
||||
#include <ikarus/errors.h>
|
||||
#include <ikarus/macros.h>
|
||||
#include <ikarus/stdtypes.h>
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
/// \brief Values are data containers for entities.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue