Path: blob/master/dep/rcheevos/include/rc_api_editor.h
4246 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/* --- Fetch Badge Range --- */189190/**191* API parameters for a fetch badge range request.192*/193typedef struct rc_api_fetch_badge_range_request_t {194/* Unused */195uint32_t unused;196}197rc_api_fetch_badge_range_request_t;198199/**200* Response data for a fetch badge range request.201*/202typedef struct rc_api_fetch_badge_range_response_t {203/* The numeric identifier of the first valid badge ID */204uint32_t first_badge_id;205/* The numeric identifier of the first unassigned badge ID */206uint32_t next_badge_id;207208/* Common server-provided response information */209rc_api_response_t response;210}211rc_api_fetch_badge_range_response_t;212213RC_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);214RC_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);215/* [deprecated] use rc_api_process_fetch_badge_range_server_response instead */216RC_EXPORT int RC_CCONV rc_api_process_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response, const char* server_response);217RC_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);218RC_EXPORT void RC_CCONV rc_api_destroy_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response);219220/* --- Add Game Hash --- */221222/**223* API parameters for an add game hash request.224*/225typedef struct rc_api_add_game_hash_request_t {226/* The username of the developer */227const char* username;228/* The API token from the login request */229const char* api_token;230/* The unique identifier of the game (0 to create a new game entry) */231uint32_t game_id;232/* The unique identifier of the console for the game */233uint32_t console_id;234/* The title of the game */235const char* title;236/* The hash being added */237const char* hash;238/* A description of the hash being added (usually the normalized ROM name) */239const char* hash_description;240}241rc_api_add_game_hash_request_t;242243/**244* Response data for an update code note request.245*/246typedef struct rc_api_add_game_hash_response_t {247/* The unique identifier of the game */248uint32_t game_id;249250/* Common server-provided response information */251rc_api_response_t response;252}253rc_api_add_game_hash_response_t;254255RC_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);256RC_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);257/* [deprecated] use rc_api_process_add_game_hash_server_response instead */258RC_EXPORT int RC_CCONV rc_api_process_add_game_hash_response(rc_api_add_game_hash_response_t* response, const char* server_response);259RC_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);260RC_EXPORT void RC_CCONV rc_api_destroy_add_game_hash_response(rc_api_add_game_hash_response_t* response);261262RC_END_C_DECLS263264#endif /* RC_EDITOR_H */265266267