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

Subscriptions (C compatible)

Ahmed Castro edited this page Jan 29, 2018 · 11 revisions

modioSubscribeMod

void modioSubscribeMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response, ModioMod mod));

Wrapped by: Subscriptions#subscribemod

API endpoint used: Subscribe to Mod

Subscribe the authenticated user to a corresponding mod.

Function parameters

Name Type Description
object void* Context parameter.
mod_id u32 Mod's unique identifier.
callback void (*callback)(void* object, ModioResponse response, ModioMod mod) Function called once the process finished.

Callback parameters

ModioResponse* response, ModioMod* mods, u32 mods_size)

Name Type Description
object void* Context parameter.
response ModioResponse ModioResponse object that contains the mod.io response status.
mod ModioMod ModioMod object the user just subscribed to.

Example

void onModSubscribed(void* object, ModioResponse response, ModioMod mod)
{
  if(response.code == 201)
  {
    //Subscribed to mod successfully
  }
}

[...]

modioSubscribeMod(NULL, mod_id, &onModSubscribed);

modioUnsubscribeMod

void modioUnsubscribeMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response));

Wrapped by: Subscriptions#subscribemod

API endpoint used: Subscribe to Mod

Subscribe the authenticated user to a corresponding mod.

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

ModioResponse* response, ModioMod* mods, u32 mods_size)

Name Type Description
object void* Context parameter.
response ModioResponse ModioResponse object that contains the mod.io response status.

Example

void onModUnsubscribed(void* object, ModioResponse response)
{
  if(response.code == 204)
  {
    //Unsubscribed from mod successfully
  }
}

[...]

modioUnsubscribeMod(NULL, mod_id, &onModUnsubscribed);

Contents

Clone this wiki locally