2018-09-02 13:23:37 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2015-2018 - Andre Leiradella
|
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RARCH_CHEEVOS_PARSER_H
|
|
|
|
#define __RARCH_CHEEVOS_PARSER_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <boolean.h>
|
|
|
|
|
|
|
|
#include <retro_common_api.h>
|
|
|
|
|
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char* title;
|
|
|
|
const char* description;
|
|
|
|
const char* badge;
|
|
|
|
const char* memaddr;
|
|
|
|
unsigned points;
|
|
|
|
unsigned id;
|
2019-03-20 01:36:54 +00:00
|
|
|
} rcheevos_racheevo_t;
|
2018-09-02 13:23:37 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char* title;
|
|
|
|
const char* description;
|
|
|
|
const char* format;
|
|
|
|
const char* mem;
|
|
|
|
unsigned id;
|
2019-03-20 01:36:54 +00:00
|
|
|
} rcheevos_ralboard_t;
|
2018-09-02 13:23:37 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2020-01-05 23:53:59 +00:00
|
|
|
unsigned game_id;
|
2018-09-02 13:23:37 +00:00
|
|
|
unsigned console_id;
|
2020-02-15 03:12:49 +00:00
|
|
|
char* title;
|
2018-09-02 13:23:37 +00:00
|
|
|
|
2019-03-20 01:36:54 +00:00
|
|
|
rcheevos_racheevo_t* core;
|
|
|
|
rcheevos_racheevo_t* unofficial;
|
|
|
|
rcheevos_ralboard_t* lboards;
|
2020-01-05 23:53:59 +00:00
|
|
|
char* richpresence_script;
|
2018-09-02 13:23:37 +00:00
|
|
|
|
|
|
|
unsigned core_count;
|
|
|
|
unsigned unofficial_count;
|
|
|
|
unsigned lboard_count;
|
2019-03-20 01:36:54 +00:00
|
|
|
} rcheevos_rapatchdata_t;
|
2018-09-02 13:23:37 +00:00
|
|
|
|
2019-03-20 01:36:54 +00:00
|
|
|
typedef void (*rcheevos_unlock_cb_t)(unsigned id, void* userdata);
|
2018-09-02 13:23:37 +00:00
|
|
|
|
2020-02-23 03:58:11 +00:00
|
|
|
int rcheevos_get_json_error(const char* json, char* token, size_t length);
|
2019-03-20 01:36:54 +00:00
|
|
|
int rcheevos_get_token(const char* json, char* token, size_t length);
|
2018-09-02 13:23:37 +00:00
|
|
|
|
2019-03-20 01:36:54 +00:00
|
|
|
int rcheevos_get_patchdata(const char* json, rcheevos_rapatchdata_t* patchdata);
|
|
|
|
void rcheevos_free_patchdata(rcheevos_rapatchdata_t* patchdata);
|
2018-09-02 13:23:37 +00:00
|
|
|
|
2019-03-20 01:36:54 +00:00
|
|
|
void rcheevos_deactivate_unlocks(const char* json, rcheevos_unlock_cb_t unlock_cb, void* userdata);
|
2018-09-02 13:23:37 +00:00
|
|
|
|
|
|
|
unsigned chevos_get_gameid(const char* json);
|
|
|
|
|
|
|
|
RETRO_END_DECLS
|
|
|
|
|
|
|
|
#endif
|