Skip to content
Permalink
Browse files

now using the c/ModioC.h header on the c code samples

  • Loading branch information...
Turupawn committed May 24, 2019
1 parent ad6869c commit bbacd1df05c862ec957118b4a4414b37896f555d
Showing with 81 additions and 749 deletions.
  1. +2 −1 .vscode/settings.json
  2. +1 −1 examples/code-samples/c/01_Authentication.c
  3. +1 −1 examples/code-samples/c/02_BrowseMods.c
  4. +1 −1 examples/code-samples/c/03_GetUserMods.c
  5. +1 −1 examples/code-samples/c/04_ErrorResponse.c
  6. +1 −1 examples/code-samples/c/05_DownloadModfile.c
  7. +1 −1 examples/code-samples/c/06_DownloadImages.c
  8. +1 −1 examples/code-samples/c/07_RemoveModfile.c
  9. +1 −1 examples/code-samples/c/08_AddMod.c
  10. +1 −1 examples/code-samples/c/09_GetMod.c
  11. +1 −1 examples/code-samples/c/10_AddModfile.c
  12. +1 −1 examples/code-samples/c/11_EditMod.c
  13. +1 −1 examples/code-samples/c/12_EditModfile.c
  14. +1 −1 examples/code-samples/c/13_DeleteModfile.c
  15. +1 −1 examples/code-samples/c/14_AddModLogo.c
  16. +2 −2 examples/code-samples/c/15_AddModImages.c
  17. +2 −2 examples/code-samples/c/16_AddModYoutubeLinks.c
  18. +2 −2 examples/code-samples/c/17_AddModSketchfabLinks.c
  19. +2 −2 examples/code-samples/c/18_DeleteModImages.c
  20. +2 −2 examples/code-samples/c/19_DeleteModYoutubeLinks.c
  21. +2 −2 examples/code-samples/c/20_DeleteModSketchfabLinks.c
  22. +1 −1 examples/code-samples/c/21_DeleteMod.c
  23. +1 −1 examples/code-samples/c/22_GetTags.c
  24. +2 −2 examples/code-samples/c/23_AddTags.c
  25. +2 −2 examples/code-samples/c/24_DeleteTags.c
  26. +1 −1 examples/code-samples/c/25_SubscribeToMod.c
  27. +1 −1 examples/code-samples/c/26_UnsubscribeFromMod.c
  28. +1 −1 examples/code-samples/c/27_Ratings.c
  29. +1 −1 examples/code-samples/c/28_GetMetadataKVP.c
  30. +2 −2 examples/code-samples/c/29_AddMetadataKVP.c
  31. +2 −2 examples/code-samples/c/30_DeleteMetadataKVP.c
  32. +1 −1 examples/code-samples/c/31_EventsListener.c
  33. +1 −1 examples/code-samples/c/32_GetModEvents.c
  34. +1 −1 examples/code-samples/c/33_GetAllModEvents.c
  35. +1 −1 examples/code-samples/c/34_GetModfile.c
  36. +1 −1 examples/code-samples/c/35_GetModfiles.c
  37. +1 −1 examples/code-samples/c/36_GetAuthenticatedUser.c
  38. +1 −1 examples/code-samples/c/37_GetUserSubscriptions.c
  39. +1 −1 examples/code-samples/c/38_GetUserGames.c
  40. +1 −1 examples/code-samples/c/39_GetUserMods.c
  41. +1 −1 examples/code-samples/c/40_GetUserModfiles.c
  42. +1 −1 examples/code-samples/c/41_GetUserEvents.c
  43. +1 −1 examples/code-samples/c/42_GetUserRatings.c
  44. +1 −1 examples/code-samples/c/43_GetAllModDependencies.c
  45. +1 −1 examples/code-samples/c/44_AddModDependencies.c
  46. +1 −1 examples/code-samples/c/45_DeleteModDependencies.c
  47. +1 −1 examples/code-samples/c/46_GetAllModComments.c
  48. +1 −1 examples/code-samples/c/47_GetModComment.c
  49. +1 −1 examples/code-samples/c/48_DeleteModComment.c
  50. +1 −1 examples/code-samples/c/49_SubmitReport.c
  51. +1 −1 examples/code-samples/c/50_DownloadsControl.c
  52. +1 −1 examples/code-samples/c/51_GetModStats.c
  53. +1 −1 examples/code-samples/c/52_GetAllModStats.c
  54. +1 −1 examples/code-samples/c/53_GetAuthenticatedUser.c
  55. +1 −1 examples/code-samples/c/54_SteamAuth.c
  56. +1 −1 examples/code-samples/c/55_GalaxyAuth.c
  57. +1 −1 examples/code-samples/c/56_LinkExternalAccount.c
  58. +0 −674 examples/code-samples/c/modio_c.h
  59. +5 −0 include/c/ModioC.h
  60. +6 −6 src/c++/methods/MediaInstanceMethods.cpp
  61. +2 −2 src/c++/methods/TagsInstanceMethods.cpp
@@ -76,6 +76,7 @@
"stdio.h": "c",
"set": "cpp",
"unordered_set": "cpp",
"stdlib.h": "c"
"stdlib.h": "c",
"modio.h": "c"
}
}
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onExchange(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllMods(void *object, ModioResponse response, ModioMod *mods, u32 mods_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllMods(void *object, ModioResponse response, ModioMod *mods, u32 mods_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllMods(void *object, ModioResponse response, ModioMod *mods, u32 mods_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

bool wait = true;

@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDownloadImage(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

int main(void)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddMod(void *object, ModioResponse response, ModioMod mod)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetMod(void *object, ModioResponse response, ModioMod mod)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

bool wait = true;

@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onEditMod(void *object, ModioResponse response, ModioMod mod)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onEditModfile(void *object, ModioResponse response, ModioModfile modfile)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModfile(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModLogo(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModImages(void *object, ModioResponse response)
{
@@ -27,7 +27,7 @@ int main(void)
strcpy(images_array[0], "../ModExample/logo.png\0");

printf("Getting mod...\n");
modioAddModImages(&wait, mod_id, images_array, 1, &onAddModImages);
modioAddModImages(&wait, mod_id, (char const* const* )images_array, 1, &onAddModImages);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModYoutubeLinks(void *object, ModioResponse response)
{
@@ -27,7 +27,7 @@ int main(void)
strcpy(youtube_links_array[0], "https://www.youtube.com/watch?v=dQw4w9WgXcQ\0");

printf("Getting mod...\n");
modioAddModYoutubeLinks(&wait, mod_id, youtube_links_array, 1, &onAddModYoutubeLinks);
modioAddModYoutubeLinks(&wait, mod_id, (char const* const* )youtube_links_array, 1, &onAddModYoutubeLinks);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModSketchfabLinks(void *object, ModioResponse response)
{
@@ -27,7 +27,7 @@ int main(void)
strcpy(sketchfab_links_array[0], "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74\0");

printf("Getting mod...\n");
modioAddModSketchfabLinks(&wait, mod_id, sketchfab_links_array, 1, &onAddModSketchfabLinks);
modioAddModSketchfabLinks(&wait, mod_id, (char const* const* )sketchfab_links_array, 1, &onAddModSketchfabLinks);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModImages(void *object, ModioResponse response)
{
@@ -27,7 +27,7 @@ int main(void)
strcpy(images_array[0], "example.png\0");

printf("Getting mod...\n");
modioDeleteModImages(&wait, mod_id, images_array, 1, &onDeleteModImages);
modioDeleteModImages(&wait, mod_id, (char const* const* )images_array, 1, &onDeleteModImages);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModYoutubeLinks(void *object, ModioResponse response)
{
@@ -27,7 +27,7 @@ int main(void)
strcpy(youtube_links_array[0], "https://www.youtube.com/watch?v=dQw4w9WgXcQ\0");

printf("Getting mod...\n");
modioDeleteModYoutubeLinks(&wait, mod_id, youtube_links_array, 1, &onDeleteModYoutubeLinks);
modioDeleteModYoutubeLinks(&wait, mod_id, (char const* const* )youtube_links_array, 1, &onDeleteModYoutubeLinks);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModSketchfabLinks(void *object, ModioResponse response)
{
@@ -27,7 +27,7 @@ int main(void)
strcpy(sketchfab_links_array[0], "https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74\0");

printf("Getting mod...\n");
modioDeleteModSketchfabLinks(&wait, mod_id, sketchfab_links_array, 1, &onDeleteModSketchfabLinks);
modioDeleteModSketchfabLinks(&wait, mod_id, (char const* const* )sketchfab_links_array, 1, &onDeleteModSketchfabLinks);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onModDeleted(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetModTags(void *object, ModioResponse response, ModioTag *tags_array, u32 tags_array_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModTags(void *object, ModioResponse response)
{
@@ -29,7 +29,7 @@ int main(void)
strcpy(tags_array[0], "Hard\0");

// We add tags to a mod by providing the tag names. Remember, they must be valid tags allowed by the parrent game
modioAddModTags(&wait, mod_id, (char **)tags_array, 1, &onAddModTags);
modioAddModTags(&wait, mod_id, (char const* const* )tags_array, 1, &onAddModTags);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModTags(void *object, ModioResponse response)
{
@@ -29,7 +29,7 @@ int main(void)
strcpy(tags_array[0], "Hard\0");

// We delete tags by providing the selected Mod id and the tag names
modioDeleteModTags(&wait, mod_id, (char **)tags_array, 1, &onDeleteModTags);
modioDeleteModTags(&wait, mod_id, (char const* const*)tags_array, 1, &onDeleteModTags);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onSubscribeToMod(void *object, ModioResponse response, ModioMod mod)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onModUnsubscribed(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModRating(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllMetadataKVP(void *object, ModioResponse response, ModioMetadataKVP *metadata_kvp_array, u32 metadata_kvp_array_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddMetadataKVP(void *object, ModioResponse response)
{
@@ -29,7 +29,7 @@ int main(void)
strcpy(metadata_kvp_array[0], "pistol-dmg:800\0");

// We add metadata key value pairs to a mod by providing the key and the value on a string separated by a colon :
modioAddMetadataKVP(&wait, mod_id, (char **)metadata_kvp_array, 1, &onAddMetadataKVP);
modioAddMetadataKVP(&wait, mod_id, (char const* const* )metadata_kvp_array, 1, &onAddMetadataKVP);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteMetadataKVP(void *object, ModioResponse response)
{
@@ -30,7 +30,7 @@ int main(void)

// We delete metadata key value pairs from a mod by providing a string with the same format we added it
// Keep in mind the value can be omited, in that case all the values with the key provided will be deleted
modioDeleteMetadataKVP(&wait, mod_id, (char **)metadata_kvp_array, 1, &onDeleteMetadataKVP);
modioDeleteMetadataKVP(&wait, mod_id, (char const* const* )metadata_kvp_array, 1, &onDeleteMetadataKVP);

while (wait)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onEvent(ModioResponse response, ModioModEvent *events_array, u32 events_array_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"
#include <time.h>

void onGetEvents(void *object, ModioResponse response, ModioModEvent *events_array, u32 events_array_size)
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"
#include <time.h>

void onGetAllEvents(void *object, ModioResponse response, ModioModEvent *events_array, u32 events_array_size)
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetModfile(void *object, ModioResponse response, ModioModfile modfile)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllModfiles(void *object, ModioResponse response, ModioModfile modfiles[], u32 modfiles_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAuthenticatedUser(void *object, ModioResponse response, ModioUser user)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetUserSubscriptions(void *object, ModioResponse response, ModioMod *mods, u32 mods_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetUserGames(void *object, ModioResponse response, ModioGame *games, u32 games_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetUserMods(void *object, ModioResponse response, ModioMod *mods, u32 mods_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetUserModfiles(void *object, ModioResponse response, ModioModfile *modfiles, u32 modfiles_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"
#include <time.h>

void onGetUserEvents(void *object, ModioResponse response, ModioUserEvent *events_array, u32 events_array_size)
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"
#include <time.h>

void onGetUserRatings(void *object, ModioResponse response, ModioRating *ratings_array, u32 ratings_array_size)
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllDependencies(void *object, ModioResponse response, ModioDependency *dependencies_array, u32 dependencies_array_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onAddModDepencies(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModDepencies(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetAllModComments(void *object, ModioResponse response, ModioComment comments[], u32 comments_size)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onGetModComment(void *object, ModioResponse response, ModioComment comment)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onDeleteModComment(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

void onSubmitReport(void *object, ModioResponse response)
{
@@ -1,4 +1,4 @@
#include "modio_c.h"
#include "c/ModioC.h"

bool finish = false;

0 comments on commit bbacd1d

Please sign in to comment.
You can’t perform that action at this time.