Skip to content

Commit

Permalink
dep: Bump rcheevos to 3af1e2fc5188d6e932ee379942f4049ea877e648
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Aug 9, 2023
1 parent 56ac3d6 commit 5d750a8
Show file tree
Hide file tree
Showing 41 changed files with 9,440 additions and 564 deletions.
6 changes: 6 additions & 0 deletions dep/rcheevos/include/rc_api_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ rc_api_fetch_code_notes_response_t;

int rc_api_init_fetch_code_notes_request(rc_api_request_t* request, const rc_api_fetch_code_notes_request_t* api_params);
int rc_api_process_fetch_code_notes_response(rc_api_fetch_code_notes_response_t* response, const char* server_response);
int rc_api_process_fetch_code_notes_server_response(rc_api_fetch_code_notes_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_code_notes_response(rc_api_fetch_code_notes_response_t* response);

/* --- Update Code Note --- */
Expand Down Expand Up @@ -76,6 +77,7 @@ rc_api_update_code_note_response_t;

int rc_api_init_update_code_note_request(rc_api_request_t* request, const rc_api_update_code_note_request_t* api_params);
int rc_api_process_update_code_note_response(rc_api_update_code_note_response_t* response, const char* server_response);
int rc_api_process_update_code_note_server_response(rc_api_update_code_note_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_update_code_note_response(rc_api_update_code_note_response_t* response);

/* --- Update Achievement --- */
Expand Down Expand Up @@ -121,6 +123,7 @@ rc_api_update_achievement_response_t;

int rc_api_init_update_achievement_request(rc_api_request_t* request, const rc_api_update_achievement_request_t* api_params);
int rc_api_process_update_achievement_response(rc_api_update_achievement_response_t* response, const char* server_response);
int rc_api_process_update_achievement_server_response(rc_api_update_achievement_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_update_achievement_response(rc_api_update_achievement_response_t* response);

/* --- Update Leaderboard --- */
Expand Down Expand Up @@ -170,6 +173,7 @@ rc_api_update_leaderboard_response_t;

int rc_api_init_update_leaderboard_request(rc_api_request_t* request, const rc_api_update_leaderboard_request_t* api_params);
int rc_api_process_update_leaderboard_response(rc_api_update_leaderboard_response_t* response, const char* server_response);
int rc_api_process_update_leaderboard_server_response(rc_api_update_leaderboard_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_update_leaderboard_response(rc_api_update_leaderboard_response_t* response);

/* --- Fetch Badge Range --- */
Expand Down Expand Up @@ -199,6 +203,7 @@ rc_api_fetch_badge_range_response_t;

int rc_api_init_fetch_badge_range_request(rc_api_request_t* request, const rc_api_fetch_badge_range_request_t* api_params);
int rc_api_process_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response, const char* server_response);
int rc_api_process_fetch_badge_range_server_response(rc_api_fetch_badge_range_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_badge_range_response(rc_api_fetch_badge_range_response_t* response);

/* --- Add Game Hash --- */
Expand Down Expand Up @@ -238,6 +243,7 @@ rc_api_add_game_hash_response_t;

int rc_api_init_add_game_hash_request(rc_api_request_t* request, const rc_api_add_game_hash_request_t* api_params);
int rc_api_process_add_game_hash_response(rc_api_add_game_hash_response_t* response, const char* server_response);
int rc_api_process_add_game_hash_server_response(rc_api_add_game_hash_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_add_game_hash_response(rc_api_add_game_hash_response_t* response);

#ifdef __cplusplus
Expand Down
3 changes: 3 additions & 0 deletions dep/rcheevos/include/rc_api_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ rc_api_fetch_achievement_info_response_t;

int rc_api_init_fetch_achievement_info_request(rc_api_request_t* request, const rc_api_fetch_achievement_info_request_t* api_params);
int rc_api_process_fetch_achievement_info_response(rc_api_fetch_achievement_info_response_t* response, const char* server_response);
int rc_api_process_fetch_achievement_info_server_response(rc_api_fetch_achievement_info_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_achievement_info_response(rc_api_fetch_achievement_info_response_t* response);

/* --- Fetch Leaderboard Info --- */
Expand Down Expand Up @@ -135,6 +136,7 @@ rc_api_fetch_leaderboard_info_response_t;

int rc_api_init_fetch_leaderboard_info_request(rc_api_request_t* request, const rc_api_fetch_leaderboard_info_request_t* api_params);
int rc_api_process_fetch_leaderboard_info_response(rc_api_fetch_leaderboard_info_response_t* response, const char* server_response);
int rc_api_process_fetch_leaderboard_info_server_response(rc_api_fetch_leaderboard_info_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_leaderboard_info_response(rc_api_fetch_leaderboard_info_response_t* response);

/* --- Fetch Games List --- */
Expand Down Expand Up @@ -173,6 +175,7 @@ rc_api_fetch_games_list_response_t;

int rc_api_init_fetch_games_list_request(rc_api_request_t* request, const rc_api_fetch_games_list_request_t* api_params);
int rc_api_process_fetch_games_list_response(rc_api_fetch_games_list_response_t* response, const char* server_response);
int rc_api_process_fetch_games_list_server_response(rc_api_fetch_games_list_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_games_list_response(rc_api_fetch_games_list_response_t* response);

#ifdef __cplusplus
Expand Down
33 changes: 28 additions & 5 deletions dep/rcheevos/include/rc_api_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@

#include "rc_error.h"

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* A block of memory for variable length data (like strings and arrays).
*/
typedef struct rc_api_buffer_t {
typedef struct rc_api_buffer_chunk_t {
/* The current location where data is being written */
char* write;
/* The first byte past the end of data where writing cannot occur */
char* end;
/* The first byte of the data */
char* start;
/* The next block in the allocated memory chain */
struct rc_api_buffer_t* next;
/* The buffer containing the data. The actual size may be larger than 256 bytes for buffers allocated in
* the next chain. The 256 byte size specified is for the initial allocation within the container object. */
struct rc_api_buffer_chunk_t* next;
}
rc_api_buffer_chunk_t;

/**
* A preallocated block of memory for variable length data (like strings and arrays).
*/
typedef struct rc_api_buffer_t {
/* The chunk data (will point at the local data member) */
struct rc_api_buffer_chunk_t chunk;
/* Small chunk of memory pre-allocated for the chunk */
char data[256];
}
rc_api_buffer_t;
Expand All @@ -31,6 +43,8 @@ typedef struct rc_api_request_t {
const char* url;
/* Additional query args that should be sent via a POST command. If null, GET may be used */
const char* post_data;
/* The HTTP Content-Type of the POST data. */
const char* content_type;

/* Storage for the url and post_data */
rc_api_buffer_t buffer;
Expand All @@ -41,7 +55,7 @@ rc_api_request_t;
* Common attributes for all server responses.
*/
typedef struct rc_api_response_t {
/* Server-provided success indicator (non-zero on failure) */
/* Server-provided success indicator (non-zero on success, zero on failure) */
int succeeded;
/* Server-provided message associated to the failure */
const char* error_message;
Expand All @@ -56,6 +70,15 @@ void rc_api_destroy_request(rc_api_request_t* request);
void rc_api_set_host(const char* hostname);
void rc_api_set_image_host(const char* hostname);

typedef struct rc_api_server_response_t {
/* Pointer to the data returned from the server */
const char* body;
/* Length of data returned from the server (Content-Length) */
size_t body_length;
/* HTTP status code returned from the server */
int http_status_code;
} rc_api_server_response_t;

#ifdef __cplusplus
}
#endif
Expand Down
7 changes: 7 additions & 0 deletions dep/rcheevos/include/rc_api_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ rc_api_resolve_hash_response_t;

int rc_api_init_resolve_hash_request(rc_api_request_t* request, const rc_api_resolve_hash_request_t* api_params);
int rc_api_process_resolve_hash_response(rc_api_resolve_hash_response_t* response, const char* server_response);
int rc_api_process_resolve_hash_server_response(rc_api_resolve_hash_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_resolve_hash_response(rc_api_resolve_hash_response_t* response);

/* --- Fetch Game Data --- */
Expand Down Expand Up @@ -155,6 +156,7 @@ rc_api_fetch_game_data_response_t;

int rc_api_init_fetch_game_data_request(rc_api_request_t* request, const rc_api_fetch_game_data_request_t* api_params);
int rc_api_process_fetch_game_data_response(rc_api_fetch_game_data_response_t* response, const char* server_response);
int rc_api_process_fetch_game_data_server_response(rc_api_fetch_game_data_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_game_data_response(rc_api_fetch_game_data_response_t* response);

/* --- Ping --- */
Expand Down Expand Up @@ -185,6 +187,7 @@ rc_api_ping_response_t;

int rc_api_init_ping_request(rc_api_request_t* request, const rc_api_ping_request_t* api_params);
int rc_api_process_ping_response(rc_api_ping_response_t* response, const char* server_response);
int rc_api_process_ping_server_response(rc_api_ping_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_ping_response(rc_api_ping_response_t* response);

/* --- Award Achievement --- */
Expand Down Expand Up @@ -214,6 +217,8 @@ typedef struct rc_api_award_achievement_response_t {
unsigned awarded_achievement_id;
/* The updated player score */
unsigned new_player_score;
/* The updated player softcore score */
unsigned new_player_score_softcore;
/* The number of achievements the user has not yet unlocked for this game
* (in hardcore/non-hardcore per hardcore flag in request) */
unsigned achievements_remaining;
Expand All @@ -225,6 +230,7 @@ rc_api_award_achievement_response_t;

int rc_api_init_award_achievement_request(rc_api_request_t* request, const rc_api_award_achievement_request_t* api_params);
int rc_api_process_award_achievement_response(rc_api_award_achievement_response_t* response, const char* server_response);
int rc_api_process_award_achievement_server_response(rc_api_award_achievement_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_award_achievement_response(rc_api_award_achievement_response_t* response);

/* --- Submit Leaderboard Entry --- */
Expand Down Expand Up @@ -282,6 +288,7 @@ rc_api_submit_lboard_entry_response_t;

int rc_api_init_submit_lboard_entry_request(rc_api_request_t* request, const rc_api_submit_lboard_entry_request_t* api_params);
int rc_api_process_submit_lboard_entry_response(rc_api_submit_lboard_entry_response_t* response, const char* server_response);
int rc_api_process_submit_lboard_entry_server_response(rc_api_submit_lboard_entry_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_submit_lboard_entry_response(rc_api_submit_lboard_entry_response_t* response);

#ifdef __cplusplus
Expand Down
5 changes: 5 additions & 0 deletions dep/rcheevos/include/rc_api_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ typedef struct rc_api_login_response_t {
const char* api_token;
/* The current score of the player */
unsigned score;
/* The current softcore score of the player */
unsigned score_softcore;
/* The number of unread messages waiting for the player on the web site */
unsigned num_unread_messages;
/* The preferred name to display for the player */
Expand All @@ -45,6 +47,7 @@ rc_api_login_response_t;

int rc_api_init_login_request(rc_api_request_t* request, const rc_api_login_request_t* api_params);
int rc_api_process_login_response(rc_api_login_response_t* response, const char* server_response);
int rc_api_process_login_server_response(rc_api_login_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_login_response(rc_api_login_response_t* response);

/* --- Start Session --- */
Expand Down Expand Up @@ -73,6 +76,7 @@ rc_api_start_session_response_t;

int rc_api_init_start_session_request(rc_api_request_t* request, const rc_api_start_session_request_t* api_params);
int rc_api_process_start_session_response(rc_api_start_session_response_t* response, const char* server_response);
int rc_api_process_start_session_server_response(rc_api_start_session_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_start_session_response(rc_api_start_session_response_t* response);

/* --- Fetch User Unlocks --- */
Expand Down Expand Up @@ -108,6 +112,7 @@ rc_api_fetch_user_unlocks_response_t;

int rc_api_init_fetch_user_unlocks_request(rc_api_request_t* request, const rc_api_fetch_user_unlocks_request_t* api_params);
int rc_api_process_fetch_user_unlocks_response(rc_api_fetch_user_unlocks_response_t* response, const char* server_response);
int rc_api_process_fetch_user_unlocks_server_response(rc_api_fetch_user_unlocks_response_t* response, const rc_api_server_response_t* server_response);
void rc_api_destroy_fetch_user_unlocks_response(rc_api_fetch_user_unlocks_response_t* response);

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 5d750a8

Please sign in to comment.