Path: blob/master/dep/rcheevos/include/rc_api_editor.h
4804 views
#ifndef RC_API_EDITOR_H1#define RC_API_EDITOR_H23#include "rc_api_request.h"45#include <stdint.h>67RC_BEGIN_C_DECLS89/* --- Fetch Code Notes --- */1011/**12* API parameters for a fetch code notes request.13*/14typedef struct rc_api_fetch_code_notes_request_t {15/* The unique identifier of the game */16uint32_t game_id;17}18rc_api_fetch_code_notes_request_t;1920/* A code note definiton */21typedef struct rc_api_code_note_t {22/* The address the note is associated to */23uint32_t address;24/* The name of the use who last updated the note */25const char* author;26/* The contents of the note */27const char* note;28} rc_api_code_note_t;2930/**31* Response data for a fetch code notes request.32*/33typedef struct rc_api_fetch_code_notes_response_t {34/* An array of code notes for the game */35rc_api_code_note_t* notes;36/* The number of items in the notes array */37uint32_t num_notes;3839/* Common server-provided response information */40rc_api_response_t response;41}42rc_api_fetch_code_notes_response_t;4344RC_EXPORT int RC_CCONV rc_api_init_fetch_code_notes_request(rc_api_request_t* request, const rc_api_fetch_code_notes_request_t* api_params);45RC_EXPORT int RC_CCONV rc_api_init_fetch_code_notes_request_hosted(rc_api_request_t* request, const rc_api_fetch_code_notes_request_t* api_params, const rc_api_host_t* host);46/* [deprecated] use rc_api_process_fetch_code_notes_server_response instead */47RC_EXPORT int RC_CCONV rc_api_process_fetch_code_notes_response(rc_api_fetch_code_notes_response_t* response, const char* server_response);48RC_EXPORT int RC_CCONV rc_api_process_fetch_code_notes_server_response(rc_api_fetch_code_notes_response_t* response, const rc_api_server_response_t* server_response);49RC_EXPORT void RC_CCONV rc_api_destroy_fetch_code_notes_response(rc_api_fetch_code_notes_response_t* response);5051/* --- Update Code Note --- */5253/**54* API parameters for an update code note request.55*/56typedef struct rc_api_update_code_note_request_t {57/* The username of the developer */58const char* username;59/* The API token from the login request */60const char* api_token;61/* The unique identifier of the game */62uint32_t game_id;63/* The address the note is associated to */64uint32_t address;65/* The contents of the note (NULL or empty to delete a note) */66const char* note;67}68rc_api_update_code_note_request_t;6970/**71* Response data for an update code note request.72*/73typedef struct rc_api_update_code_note_response_t {74/* Common server-provided response information */75rc_api_response_t response;76}77rc_api_update_code_note_response_t;7879RC_EXPORT int RC_CCONV rc_api_init_update_code_note_request(rc_api_request_t* request, const rc_api_update_code_note_request_t* api_params);80RC_EXPORT int RC_CCONV rc_api_init_update_code_note_request_hosted(rc_api_request_t* request, const rc_api_update_code_note_request_t* api_params, const rc_api_host_t* host);81/* [deprecated] use rc_api_process_update_code_note_server_response instead */82RC_EXPORT int RC_CCONV rc_api_process_update_code_note_response(rc_api_update_code_note_response_t* response, const char* server_response);83RC_EXPORT int RC_CCONV rc_api_process_update_code_note_server_response(rc_api_update_code_note_response_t* response, const rc_api_server_response_t* server_response);84RC_EXPORT void RC_CCONV rc_api_destroy_update_code_note_response(rc_api_update_code_note_response_t* response);8586/* --- Update Achievement --- */8788/**89* API parameters for an update achievement request.90*/91typedef struct rc_api_update_achievement_request_t {92/* The username of the developer */93const char* username;94/* The API token from the login request */95const char* api_token;96/* The unique identifier of the achievement (0 to create a new achievement) */97uint32_t achievement_id;98/* The unique identifier of the game */99uint32_t game_id;100/* The name of the achievement */101const char* title;102/* The description of the achievement */103const char* description;104/* The badge name for the achievement */105const char* badge;106/* The serialized trigger for the achievement */107const char* trigger;108/* The number of points the achievement is worth */109uint32_t points;110/* The category of the achievement */111uint32_t category;112/* The type of the achievement */113uint32_t type;114}115rc_api_update_achievement_request_t;116117/**118* Response data for an update achievement request.119*/120typedef struct rc_api_update_achievement_response_t {121/* The unique identifier of the achievement */122uint32_t achievement_id;123124/* Common server-provided response information */125rc_api_response_t response;126}127rc_api_update_achievement_response_t;128129RC_EXPORT int RC_CCONV rc_api_init_update_achievement_request(rc_api_request_t* request, const rc_api_update_achievement_request_t* api_params);130RC_EXPORT int RC_CCONV rc_api_init_update_achievement_request_hosted(rc_api_request_t* request, const rc_api_update_achievement_request_t* api_params, const rc_api_host_t* host);131/* [deprecated] use rc_api_process_update_achievement_server_response instead */132RC_EXPORT int RC_CCONV rc_api_process_update_achievement_response(rc_api_update_achievement_response_t* response, const char* server_response);133RC_EXPORT int RC_CCONV rc_api_process_update_achievement_server_response(rc_api_update_achievement_response_t* response, const rc_api_server_response_t* server_response);134RC_EXPORT void RC_CCONV rc_api_destroy_update_achievement_response(rc_api_update_achievement_response_t* response);135136/* --- Update Leaderboard --- */137138/**139* API parameters for an update leaderboard request.140*/141typedef struct rc_api_update_leaderboard_request_t {142/* The username of the developer */143const char* username;144/* The API token from the login request */145const char* api_token;146/* The unique identifier of the leaderboard (0 to create a new leaderboard) */147uint32_t leaderboard_id;148/* The unique identifier of the game */149uint32_t game_id;150/* The name of the leaderboard */151const char* title;152/* The description of the leaderboard */153const char* description;154/* The start trigger for the leaderboard */155const char* start_trigger;156/* The submit trigger for the leaderboard */157const char* submit_trigger;158/* The cancel trigger for the leaderboard */159const char* cancel_trigger;160/* The value definition for the leaderboard */161const char* value_definition;162/* The format of leaderboard values */163const char* format;164/* Whether or not lower scores are better for the leaderboard */165uint32_t lower_is_better;166}167rc_api_update_leaderboard_request_t;168169/**170* Response data for an update leaderboard request.171*/172typedef struct rc_api_update_leaderboard_response_t {173/* The unique identifier of the leaderboard */174uint32_t leaderboard_id;175176/* Common server-provided response information */177rc_api_response_t response;178}179rc_api_update_leaderboard_response_t;180181RC_EXPORT int RC_CCONV rc_api_init_update_leaderboard_request(rc_api_request_t* request, const rc_api_update_leaderboard_request_t* api_params);182RC_EXPORT int RC_CCONV rc_api_init_update_leaderboard_request_hosted(rc_api_request_t* request, const rc_api_update_leaderboard_request_t* api_params, const rc_api_host_t* host);183/* [deprecated] use rc_api_process_update_leaderboard_server_response instead */184RC_EXPORT int RC_CCONV rc_api_process_update_leaderboard_response(rc_api_update_leaderboard_response_t* response, const char* server_response);185RC_EXPORT int RC_CCONV rc_api_process_update_leaderboard_server_response(rc_api_update_leaderboard_response_t* response, const rc_api_server_response_t* server_response);186RC_EXPORT void RC_CCONV rc_api_destroy_update_leaderboard_response(rc_api_update_leaderboard_response_t* response);187188/* --- Update Rich Presence --- */189190/**191* API parameters for an update rich presence request.192*/193typedef struct rc_api_update_rich_presence_request_t {194/* The username of the developer */195const char* username;196/* The API token from the login request */197const char* api_token;198/* The unique identifier of the game */199uint32_t game_id;200/* The script for the rich_presence */201const char* script;202}203rc_api_update_rich_presence_request_t;204205/**206* Response data for an update rich presence request.207*/208typedef struct rc_api_update_rich_presence_response_t {209/* Common server-provided response information */210rc_api_response_t response;211}212rc_api_update_rich_presence_response_t;213214RC_EXPORT int RC_CCONV rc_api_init_update_rich_presence_request(rc_api_request_t* request, const rc_api_update_rich_presence_request_t* api_params);215RC_EXPORT int RC_CCONV rc_api_init_update_rich_presence_request_hosted(rc_api_request_t* request, const rc_api_update_rich_presence_request_t* api_params, const rc_api_host_t* host);216RC_EXPORT int RC_CCONV rc_api_process_update_rich_presence_server_response(rc_api_update_rich_presence_response_t* response, const rc_api_server_response_t* server_response);217RC_EXPORT void RC_CCONV rc_api_destroy_update_rich_presence_response(rc_api_update_rich_presence_response_t* response);218219/* --- Fetch Badge Range --- */220221/**222* API parameters for a fetch badge range request.223*/224typedef struct rc_api_fetch_badge_range_request_t {225/* Unused */226uint32_t unused;227}228rc_api_fetch_badge_range_request_t;229230/**231* Response data for a fetch badge range request.232*/233typedef struct rc_api_fetch_badge_range_response_t {234/* The numeric identifier of the first valid badge ID */235uint32_t first_badge_id;236/* The numeric identifier of the first unassigned badge ID */237uint32_t next_badge_id;238239/* Common server-provided response information */240rc_api_response_t response;241}242rc_api_fetch_badge_range_response_t;243244RC_EXPORT int RC_CCONV rc_api_init_fetch_badge_range_request(rc_api_request_t* request, const rc_api_fetch_badge_range_request_t* api_params);245RC_EXPORT int RC_CCONV rc_api_init_fetch_badge_range_request_hosted(rc_api_request_t* request, const rc_api_fetch_badge_range_request_t* api_params, const rc_api_host_t* host);246/* [deprecated] use rc_api_process_fetch_badge_range_server_response instead */247RC_EXPORT int RC_CCONV rc_api_process_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response, const char* server_response);248RC_EXPORT int RC_CCONV rc_api_process_fetch_badge_range_server_response(rc_api_fetch_badge_range_response_t* response, const rc_api_server_response_t* server_response);249RC_EXPORT void RC_CCONV rc_api_destroy_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response);250251/* --- Add Game Hash --- */252253/**254* API parameters for an add game hash request.255*/256typedef struct rc_api_add_game_hash_request_t {257/* The username of the developer */258const char* username;259/* The API token from the login request */260const char* api_token;261/* The unique identifier of the game (0 to create a new game entry) */262uint32_t game_id;263/* The unique identifier of the console for the game */264uint32_t console_id;265/* The title of the game */266const char* title;267/* The hash being added */268const char* hash;269/* A description of the hash being added (usually the normalized ROM name) */270const char* hash_description;271}272rc_api_add_game_hash_request_t;273274/**275* Response data for an update code note request.276*/277typedef struct rc_api_add_game_hash_response_t {278/* The unique identifier of the game */279uint32_t game_id;280281/* Common server-provided response information */282rc_api_response_t response;283}284rc_api_add_game_hash_response_t;285286RC_EXPORT int RC_CCONV rc_api_init_add_game_hash_request(rc_api_request_t* request, const rc_api_add_game_hash_request_t* api_params);287RC_EXPORT int RC_CCONV rc_api_init_add_game_hash_request_hosted(rc_api_request_t* request, const rc_api_add_game_hash_request_t* api_params, const rc_api_host_t* host);288/* [deprecated] use rc_api_process_add_game_hash_server_response instead */289RC_EXPORT int RC_CCONV rc_api_process_add_game_hash_response(rc_api_add_game_hash_response_t* response, const char* server_response);290RC_EXPORT int RC_CCONV rc_api_process_add_game_hash_server_response(rc_api_add_game_hash_response_t* response, const rc_api_server_response_t* server_response);291RC_EXPORT void RC_CCONV rc_api_destroy_add_game_hash_response(rc_api_add_game_hash_response_t* response);292293RC_END_C_DECLS294295#endif /* RC_EDITOR_H */296297298