improve C header compatibility
This commit is contained in:
parent
24335a0a1f
commit
9ea02d5cb1
9 changed files with 151 additions and 165 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue