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

Me (C compatible)

Ahmed Castro edited this page Feb 13, 2018 · 9 revisions

modioGetAuthenticatedUser

void modioGetAuthenticatedUser(void* object, void (*callback)(void* object, ModioResponse response, ModioUser user));

Wrapped by: Me#modiogetauthenticateduser

API endpoint used: Get Authenticated User

Get the authenticated user details. Successful request will return a User Object.

Function parameters

Name Type Description
object void* Context parameter.
callback void (*callback)(void* object, ModioResponse response, ModioUser user) 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.
user ModioUser ModioUser object returned.

Example

void onGetAuthenticatedUser(void* object, ModioResponse response, ModioUser user)
{
  if(response.code == 200)
  {
    //Mod retrieved successfully
  }
}

[...]

modioGetAuthenticatedUser(NULL, &onGetAuthenticatedUser);

modioGetUserSubscriptions

void modioGetUserSubscriptions(void* object, ModioFilterCreator filter, void (*callback)(void* object, ModioResponse response, ModioMod mods[], u32 mods_size));

Wrapped by: Mods#getusersubscriptions

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 onGetUserSubscriptions(void* object, ModioResponse response, ModioMod* mods, u32 mods_size)
{
  if(response.code == 200)
  {
    //Mods retrieved successfully
  }
}

[...]

ModioFilterCreator filter;
modioInitFilter(&filter);
modioSetFilterLimit(&filter,3);

modioGetUserSubscriptions(NULL, filter, &onGetUserSubscriptions);

modioGetUserGames

void modioGetUserGames(void* object, ModioFilterCreator filter, void (*callback)(void* object, ModioResponse response, ModioGame games[], u32 games_size));

Wrapped by: Mods#modiogetusergames

API endpoint used: Get User Games

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, ModioGame games[], u32 games_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.
games ModioGame[] ModioGame array.
mods_size u32 Game array size.

Example

void onGetUserGames(void* object, ModioResponse response, ModioGame* games, u32 games_size)
{
  if(response.code == 200)
  {
    //User games retrieved successfully
  }
}

[...]

ModioFilterCreator filter;
modioInitFilter(&filter);
modioSetFilterLimit(&filter,3);

modioGetUserGames(NULL, filter, &onGetUserGames);

Contents

Clone this wiki locally