Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Dependencies (C compatible)

Ahmed Castro edited this page Feb 26, 2018 · 2 revisions

modioGetAllModDependencies

void modioGetAllModDependencies(void* object, u32 mod_id, void(*callback)(void* object, ModioResponse response, ModioDependency* dependencies_array, u32 dependencies_array_size));

Wrapped by: Dependencies#getallmoddependencies

API endpoint used: Get All Mod Dependencies

Get all dependencies the chosen mod has selected. This is useful if a mod requires other mods be installed for it to run.

Function parameters

Name Type Description
object void* Context parameter.
mod_id u32 Mod unique identifier.
callback void(*callback)(void* object, ModioResponse response, ModioDependency* dependencies_array, u32 dependencies_array_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.
dependencies_array ModioDependency* ModioDependency array containing the returned dependencies.
dependencies_array_size u32 Dependencies array size.

Example

void onGetAllDependencies(void* object, ModioResponse response, ModioDependency* dependencies_array, u32 dependencies_array_size)
{
  if(response.code == 200)
  {
    //Dependencies retrieved successfully
  }
}

[...]

modioGetAllModDependencies(NULL, mod_id, &onGetAllDependencies);

modioAddModDependencies

void modioAddModDependencies(void* object, u32 mod_id, u32* dependencies_array, u32 dependencies_array_size, void(*callback)(void* object, ModioResponse response));

Wrapped by: Dependencies#addmoddependencies

API endpoint used: Add Mod Dependencies

Add mod dependencies required by the corresponding mod.

Function parameters

Name Type Description
object void* Context parameter.
mod_id u32 Mod unique identifier.
dependencies_array u32* Array containing the returned dependencies ids.
dependencies_array_size u32 Dependencies array size.
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 onAddModDepencies(void* object, ModioResponse response)
{
  if(response.code == 201)
  {
    //Dependencies retrieved successfully
  }
}

[...]

u32 dependencies_array_size = 2;
u32* dependencies_array = (u32*)malloc(dependencies_array_size);
dependencies_array[0] = 501;
dependencies_array[1] = 502;

modioAddModDependencies(NULL, mod_id, dependencies_array, dependencies_array_size, &onAddModDepencies);

modioDeleteModDependencies

void modioDeleteModDependencies(void* object, u32 mod_id, u32* dependencies_array, u32 dependencies_array_size, void(*callback)(void* object, ModioResponse response));

Wrapped by: Dependencies#deletemoddependencies

API endpoint used: Delete Mod Dependencies

Add mod dependencies required by the corresponding mod.

Function parameters

Name Type Description
object void* Context parameter.
mod_id u32 Mod unique identifier.
dependencies_array u32* Array containing the returned dependencies ids.
dependencies_array_size u32 Dependencies array size.
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 onDeleteModDepencies(void* object, ModioResponse response)
{
  if(response.code == 204)
  {
    //Dependencies deleted successfully
  }
}

[...]

u32 dependencies_array_size = 2;
u32* dependencies_array = (u32*)malloc(dependencies_array_size);
dependencies_array[0] = 501;
dependencies_array[1] = 502;

modioDeleteModDependencies(NULL, mod_id, dependencies_array, dependencies_array_size, &onAddModDepencies);

Contents

Clone this wiki locally