GearLoader 1.1.0
Mod loader for GGXXACPR
Loading...
Searching...
No Matches
GearLoaderApi Struct Reference

Data Fields

uint32_t size
 The size of this struct.
uint32_t version
 The version of this struct's layout.
int32_t __stdcall(* RetrieveModApi )(GearLoaderContext *ctx, const char *name, const char *versionConstraint, const void **pApi, SemanticVersion *retrievedVersion)
 Retrieves an exported API of another loaded mod.
int32_t __stdcall(* RegisterApi )(GearLoaderContext *ctx, const void *api, const char *name, SemanticVersion version)
 Registers an API with the mod loader.
uint32_t __stdcall(* Log )(GearLoaderContext *ctx, uint32_t logLevel, const char *str)
 Logs the given string to the GearLoader.log file.

Field Documentation

◆ Log

uint32_t __stdcall(* GearLoaderApi::Log) (GearLoaderContext *ctx, uint32_t logLevel, const char *str)

Logs the given string to the GearLoader.log file.

Logs will be prefixed with a timestamp, a [DEBUG] label, and a [mod-name] label where "mod-name" is the calling mod's name provided in its config.json file.

Parameters
ctxA context pointer owned and used by the mod loader. Simply forward this from the Init function's parameter of the same name.
logLevelEnum GearLoaderLogLevel. Verbose calls only get logged when running with the -GearLoaderVerbose launch option.
strThe string to be logged.
Returns
An error code if an error occurred, otherwise 0.

◆ RegisterApi

int32_t __stdcall(* GearLoaderApi::RegisterApi) (GearLoaderContext *ctx, const void *api, const char *name, SemanticVersion version)

Registers an API with the mod loader.

APIs are given by a generic pointer and expected to be reinterpreted by other mods that retrieve it. The registering mod still owns the underlying API struct and is expected to keep it alive for the duration of the application's lifetime. A mod may register multiple APIs differing by name and/or version. Registering a mod with the same name and version will not override the previous API and will result in an error.

Parameters
ctxA context pointer owned and used by the mod loader. Simply forward this from the Init function's parameter of the same name.
apiA pointer the the API struct to be registered.
nameThe name of the registered API. This same name will need to be passed to RetrieveModApi.
versionThe version of the registered API. Used when resolving the version constraint passed to RetrieveModApi.
Returns
An error code if an error occurred, otherwise 0.

◆ RetrieveModApi

int32_t __stdcall(* GearLoaderApi::RetrieveModApi) (GearLoaderContext *ctx, const char *name, const char *versionConstraint, const void **pApi, SemanticVersion *retrievedVersion)

Retrieves an exported API of another loaded mod.

To ensure the requested mod is installed and loaded, list it in your mod's config.json file.

Parameters
ctxA context pointer owned and used by the mod loader. Simply forward this from the Init function's parameter of the same name.
nameThe name of the requested API.
versionConstraintA constraint on the API version to retrieve. Takes the form of "[operator][semanticVersion]" where operator may be any of ["<", "<=", "=", ">=", ">"]. Examples: ">=0.1.0" or "1.0.0"
pApiA pointer to a pointer variable that receives the API pointer.
retrievedVersionA pointer to a SemanticVersion structure that receives version information of the received version.
Returns
An error code if an error occurred, otherwise 0.

The documentation for this struct was generated from the following file: