rc_api_editor.h (9925B)
1 #ifndef RC_API_EDITOR_H 2 #define RC_API_EDITOR_H 3 4 #include "rc_api_request.h" 5 6 #include <stdint.h> 7 8 RC_BEGIN_C_DECLS 9 10 /* --- Fetch Code Notes --- */ 11 12 /** 13 * API parameters for a fetch code notes request. 14 */ 15 typedef struct rc_api_fetch_code_notes_request_t { 16 /* The unique identifier of the game */ 17 uint32_t game_id; 18 } 19 rc_api_fetch_code_notes_request_t; 20 21 /* A code note definiton */ 22 typedef struct rc_api_code_note_t { 23 /* The address the note is associated to */ 24 uint32_t address; 25 /* The name of the use who last updated the note */ 26 const char* author; 27 /* The contents of the note */ 28 const char* note; 29 } rc_api_code_note_t; 30 31 /** 32 * Response data for a fetch code notes request. 33 */ 34 typedef struct rc_api_fetch_code_notes_response_t { 35 /* An array of code notes for the game */ 36 rc_api_code_note_t* notes; 37 /* The number of items in the notes array */ 38 uint32_t num_notes; 39 40 /* Common server-provided response information */ 41 rc_api_response_t response; 42 } 43 rc_api_fetch_code_notes_response_t; 44 45 RC_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); 46 /* [deprecated] use rc_api_process_fetch_code_notes_server_response instead */ 47 RC_EXPORT int RC_CCONV rc_api_process_fetch_code_notes_response(rc_api_fetch_code_notes_response_t* response, const char* server_response); 48 RC_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); 49 RC_EXPORT void RC_CCONV rc_api_destroy_fetch_code_notes_response(rc_api_fetch_code_notes_response_t* response); 50 51 /* --- Update Code Note --- */ 52 53 /** 54 * API parameters for an update code note request. 55 */ 56 typedef struct rc_api_update_code_note_request_t { 57 /* The username of the developer */ 58 const char* username; 59 /* The API token from the login request */ 60 const char* api_token; 61 /* The unique identifier of the game */ 62 uint32_t game_id; 63 /* The address the note is associated to */ 64 uint32_t address; 65 /* The contents of the note (NULL or empty to delete a note) */ 66 const char* note; 67 } 68 rc_api_update_code_note_request_t; 69 70 /** 71 * Response data for an update code note request. 72 */ 73 typedef struct rc_api_update_code_note_response_t { 74 /* Common server-provided response information */ 75 rc_api_response_t response; 76 } 77 rc_api_update_code_note_response_t; 78 79 RC_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); 80 /* [deprecated] use rc_api_process_update_code_note_server_response instead */ 81 RC_EXPORT int RC_CCONV rc_api_process_update_code_note_response(rc_api_update_code_note_response_t* response, const char* server_response); 82 RC_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); 83 RC_EXPORT void RC_CCONV rc_api_destroy_update_code_note_response(rc_api_update_code_note_response_t* response); 84 85 /* --- Update Achievement --- */ 86 87 /** 88 * API parameters for an update achievement request. 89 */ 90 typedef struct rc_api_update_achievement_request_t { 91 /* The username of the developer */ 92 const char* username; 93 /* The API token from the login request */ 94 const char* api_token; 95 /* The unique identifier of the achievement (0 to create a new achievement) */ 96 uint32_t achievement_id; 97 /* The unique identifier of the game */ 98 uint32_t game_id; 99 /* The name of the achievement */ 100 const char* title; 101 /* The description of the achievement */ 102 const char* description; 103 /* The badge name for the achievement */ 104 const char* badge; 105 /* The serialized trigger for the achievement */ 106 const char* trigger; 107 /* The number of points the achievement is worth */ 108 uint32_t points; 109 /* The category of the achievement */ 110 uint32_t category; 111 /* The type of the achievement */ 112 uint32_t type; 113 } 114 rc_api_update_achievement_request_t; 115 116 /** 117 * Response data for an update achievement request. 118 */ 119 typedef struct rc_api_update_achievement_response_t { 120 /* The unique identifier of the achievement */ 121 uint32_t achievement_id; 122 123 /* Common server-provided response information */ 124 rc_api_response_t response; 125 } 126 rc_api_update_achievement_response_t; 127 128 RC_EXPORT int RC_CCONV rc_api_init_update_achievement_request(rc_api_request_t* request, const rc_api_update_achievement_request_t* api_params); 129 /* [deprecated] use rc_api_process_update_achievement_server_response instead */ 130 RC_EXPORT int RC_CCONV rc_api_process_update_achievement_response(rc_api_update_achievement_response_t* response, const char* server_response); 131 RC_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); 132 RC_EXPORT void RC_CCONV rc_api_destroy_update_achievement_response(rc_api_update_achievement_response_t* response); 133 134 /* --- Update Leaderboard --- */ 135 136 /** 137 * API parameters for an update leaderboard request. 138 */ 139 typedef struct rc_api_update_leaderboard_request_t { 140 /* The username of the developer */ 141 const char* username; 142 /* The API token from the login request */ 143 const char* api_token; 144 /* The unique identifier of the leaderboard (0 to create a new leaderboard) */ 145 uint32_t leaderboard_id; 146 /* The unique identifier of the game */ 147 uint32_t game_id; 148 /* The name of the leaderboard */ 149 const char* title; 150 /* The description of the leaderboard */ 151 const char* description; 152 /* The start trigger for the leaderboard */ 153 const char* start_trigger; 154 /* The submit trigger for the leaderboard */ 155 const char* submit_trigger; 156 /* The cancel trigger for the leaderboard */ 157 const char* cancel_trigger; 158 /* The value definition for the leaderboard */ 159 const char* value_definition; 160 /* The format of leaderboard values */ 161 const char* format; 162 /* Whether or not lower scores are better for the leaderboard */ 163 uint32_t lower_is_better; 164 } 165 rc_api_update_leaderboard_request_t; 166 167 /** 168 * Response data for an update leaderboard request. 169 */ 170 typedef struct rc_api_update_leaderboard_response_t { 171 /* The unique identifier of the leaderboard */ 172 uint32_t leaderboard_id; 173 174 /* Common server-provided response information */ 175 rc_api_response_t response; 176 } 177 rc_api_update_leaderboard_response_t; 178 179 RC_EXPORT int RC_CCONV rc_api_init_update_leaderboard_request(rc_api_request_t* request, const rc_api_update_leaderboard_request_t* api_params); 180 /* [deprecated] use rc_api_process_update_leaderboard_server_response instead */ 181 RC_EXPORT int RC_CCONV rc_api_process_update_leaderboard_response(rc_api_update_leaderboard_response_t* response, const char* server_response); 182 RC_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); 183 RC_EXPORT void RC_CCONV rc_api_destroy_update_leaderboard_response(rc_api_update_leaderboard_response_t* response); 184 185 /* --- Fetch Badge Range --- */ 186 187 /** 188 * API parameters for a fetch badge range request. 189 */ 190 typedef struct rc_api_fetch_badge_range_request_t { 191 /* Unused */ 192 uint32_t unused; 193 } 194 rc_api_fetch_badge_range_request_t; 195 196 /** 197 * Response data for a fetch badge range request. 198 */ 199 typedef struct rc_api_fetch_badge_range_response_t { 200 /* The numeric identifier of the first valid badge ID */ 201 uint32_t first_badge_id; 202 /* The numeric identifier of the first unassigned badge ID */ 203 uint32_t next_badge_id; 204 205 /* Common server-provided response information */ 206 rc_api_response_t response; 207 } 208 rc_api_fetch_badge_range_response_t; 209 210 RC_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); 211 /* [deprecated] use rc_api_process_fetch_badge_range_server_response instead */ 212 RC_EXPORT int RC_CCONV rc_api_process_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response, const char* server_response); 213 RC_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); 214 RC_EXPORT void RC_CCONV rc_api_destroy_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response); 215 216 /* --- Add Game Hash --- */ 217 218 /** 219 * API parameters for an add game hash request. 220 */ 221 typedef struct rc_api_add_game_hash_request_t { 222 /* The username of the developer */ 223 const char* username; 224 /* The API token from the login request */ 225 const char* api_token; 226 /* The unique identifier of the game (0 to create a new game entry) */ 227 uint32_t game_id; 228 /* The unique identifier of the console for the game */ 229 uint32_t console_id; 230 /* The title of the game */ 231 const char* title; 232 /* The hash being added */ 233 const char* hash; 234 /* A description of the hash being added (usually the normalized ROM name) */ 235 const char* hash_description; 236 } 237 rc_api_add_game_hash_request_t; 238 239 /** 240 * Response data for an update code note request. 241 */ 242 typedef struct rc_api_add_game_hash_response_t { 243 /* The unique identifier of the game */ 244 uint32_t game_id; 245 246 /* Common server-provided response information */ 247 rc_api_response_t response; 248 } 249 rc_api_add_game_hash_response_t; 250 251 RC_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); 252 /* [deprecated] use rc_api_process_add_game_hash_server_response instead */ 253 RC_EXPORT int RC_CCONV rc_api_process_add_game_hash_response(rc_api_add_game_hash_response_t* response, const char* server_response); 254 RC_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); 255 RC_EXPORT void RC_CCONV rc_api_destroy_add_game_hash_response(rc_api_add_game_hash_response_t* response); 256 257 RC_END_C_DECLS 258 259 #endif /* RC_EDITOR_H */