Mods (C compatible) - modio/modio-sdk-legacy GitHub Wiki
modioGetAllMods
void modioGetAllMods(void* object, ModioFilterCreator* filter, void (*callback)(void* object, ModioResponse response, ModioMod* mods, u32 mods_size));
Wrapped by: Mods#getallmods
API endpoint used: Get All Mods
Browse mods on mod.io, can be filtered using the ModioFilterCreator.
Function parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
filter | ModioFilterCreator* |
ModioFilterCreator object to be customized. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mods, u32 mods_size) |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mods | ModioMod* |
ModioMod array containing the returned mods. |
mods_size | u32 |
Mod array size. |
Example
void onGetAllMods(void* object, ModioResponse response, ModioMod* mods, u32 mods_size)
{
if(response.code == 200)
{
//Mods retrieved successfully
}
}
[...]
ModioFilterCreator filter;
modioInitFilter(&filter);
modioSetFilterLimit(&filter,3);
modioGetAllMods(NULL,filter, &onGetAllMods);
modioGetMod
void modioGetMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response, ModioMod mod));
Wrapped by: Mods#getmod
API endpoint used: Get Mod
Get a mod by providing its id.
Function parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique id. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod mod) |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mod | ModioMod |
ModioMod object returned. |
Example
void onModGet(void* object, ModioResponse response, ModioMod mod)
{
if(response.code == 200)
{
//Mod retrieved successfully
}
}
[...]
modioGetMod(NULL, mod_id, &onModGet);
modioAddMod
void MODIO_DLL modioAddMod(void* object, ModioModCreator* mod_creator, void (*callback)(void* object, ModioResponse response, ModioMod* mod));
Wrapped by: Mods#addmod
API endpoint used: Add Mod
Adds a new Mod to mod.io. Use the ModioModCreator to set the mods fields before uploading.
Function parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_creator | ModioModCreator* |
ModioModCreator object containing the data that will be added. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mod) |
Function called once the process finished. |
Calback parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mod | ModioMod* |
Resulting ModioMod object. |
Example
void onModAdded(void* object, ModioResponse response, ModioMod mod)
{
if(response.code == 201)
{
//Mod added successfully
}
}
[..]
ModioModCreator mod_creator;
modioInitModCreator(&mod_creator);
modioSetModCreatorLogoPath(&mod_creator, (char*)"ModExample/logo.png");
modioSetModCreatorName(&mod_creator, (char*)"Example Mod Test");
modioSetModCreatorHomepage(&mod_creator, (char*)"http://www.webpage.com");
modioSetModCreatorSummary(&mod_creator, (char*)"Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples.");
modioAddTag(&mod_creator, (char*)"Easy");
modioAddTag(&mod_creator, (char*)"Medium");
modioSetModCreatorPrice(&mod_creator, 1.99);
modioSetModCreatorStock(&mod_creator, 25);
modioSetModCreatorDescription(&mod_creator, (char*)"This mod description was added via the SDK examples. This mod description was added via the SDK examples.");
modioSetModCreatorMetadata(&mod_creator, (char*)"Optional metadata");
modioAddMod(NULL, mod_creator, &onModAdded);
modioEditMod
void MODIO_DLL modioEditMod(void* object, u32 mod_id, ModioModEditor* mod_editor, void (*callback)(void* object, ModioResponse response, ModioMod* mod));
Wrapped by: Mods#editmod
API endpoint used: Edit Mod
Updates the details of a corresponding mod. TODO explain the media functions
Function parameters
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
mod_id | u32 |
Mod's unique identifier. |
mod_editor | ModioModEditor* |
ModioModEditor object containing the data that will be edited. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mod) |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mod | ModioMod* |
Resulting ModioMod object. |
Example
void onModEdited(void* object, ModioResponse response, ModioMod mod)
{
if(response.code == 200)
{
//Mod edited successfully
}
}
[...]
ModioModEditor mod_editor;
modioInitModEditor(&mod_editor);
modioSetModEditorName(&mod_editor, (char*)"Update Example");
modioSetModEditorHomepage(&mod_editor, (char*)"http://www.updated.com");
modioSetModEditorSummary(&mod_editor, (char*)"Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples.");
modioAddTag(&mod_editor, (char*)"Easy");
modioSetModEditorPrice(&mod_editor, 2.99);
modioSetModEditorDescription(&mod_editor, (char*)"This mod description was updated via the SDK examples. This mod description was updated via the SDK examples.");
modioSetModEditorMetadata(&mod_editor, (char*)"Optional updated metadata");
modioEditMod(NULL, mod.id, mod_editor, &onModEdited);
modioDeleteMod
void MODIO_DLL modioDeleteMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response));
Wrapped by: Mods#deletemod
API endpoint used: Delete Mod
Deletes a mod profile.
Function parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique identifier. |
callback | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Callback parameters
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
Example
void onModDeleted(void* object, ModioResponse response)
{
if(response.code == 204)
{
//Mod deleted successfully
}
}
[...]
modioDeleteMod(NULL, mod.id, &onModDeleted);