mirror of
https://github.com/libretro/RetroArch
synced 2025-04-25 09:02:44 +00:00
Add get_name function to frontend context
This commit is contained in:
parent
febdd2bc8a
commit
0b076883d6
@ -41,6 +41,7 @@ typedef struct frontend_ctx_driver
|
|||||||
int (*process_events)(void *data);
|
int (*process_events)(void *data);
|
||||||
void (*exec)(const char *, bool);
|
void (*exec)(const char *, bool);
|
||||||
void (*shutdown)(bool);
|
void (*shutdown)(bool);
|
||||||
|
int (*get_name)(char *, size_t);
|
||||||
int (*get_rating)(void);
|
int (*get_rating)(void);
|
||||||
|
|
||||||
// Human readable string.
|
// Human readable string.
|
||||||
|
@ -701,13 +701,16 @@ static void frontend_android_shutdown(bool unused)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void frontend_android_get_name(char *name, size_t sizeof_name)
|
||||||
|
{
|
||||||
|
int len = __system_property_get("ro.product.model", name);
|
||||||
|
(void)len;
|
||||||
|
}
|
||||||
|
|
||||||
static int frontend_android_get_rating(void)
|
static int frontend_android_get_rating(void)
|
||||||
{
|
{
|
||||||
char model_id[PROP_VALUE_MAX];
|
char model_id[PROP_VALUE_MAX];
|
||||||
int len;
|
frontend_android_get_name(&model_id, sizeof(model_id));
|
||||||
|
|
||||||
len = __system_property_get("ro.product.model", model_id);
|
|
||||||
(void)len;
|
|
||||||
|
|
||||||
RARCH_LOG("ro.product.model: (%s).\n", model_id);
|
RARCH_LOG("ro.product.model: (%s).\n", model_id);
|
||||||
|
|
||||||
@ -729,6 +732,7 @@ const frontend_ctx_driver_t frontend_ctx_android = {
|
|||||||
frontend_android_process_events, /* process_events */
|
frontend_android_process_events, /* process_events */
|
||||||
NULL, /* exec */
|
NULL, /* exec */
|
||||||
frontend_android_shutdown, /* shutdown */
|
frontend_android_shutdown, /* shutdown */
|
||||||
|
frontend_android_get_name, /* get_name */
|
||||||
frontend_android_get_rating, /* get_rating */
|
frontend_android_get_rating, /* get_rating */
|
||||||
"android",
|
"android",
|
||||||
};
|
};
|
||||||
|
@ -131,6 +131,7 @@ const frontend_ctx_driver_t frontend_ctx_apple = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
NULL, /* exec */
|
NULL, /* exec */
|
||||||
NULL, /* shutdown */
|
NULL, /* shutdown */
|
||||||
|
NULL, /* get_name */
|
||||||
frontend_apple_get_rating, /* get_rating */
|
frontend_apple_get_rating, /* get_rating */
|
||||||
"apple",
|
"apple",
|
||||||
};
|
};
|
||||||
|
@ -339,6 +339,7 @@ const frontend_ctx_driver_t frontend_ctx_gx = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
frontend_gx_exec, /* exec */
|
frontend_gx_exec, /* exec */
|
||||||
NULL, /* shutdown */
|
NULL, /* shutdown */
|
||||||
|
NULL, /* get_name */
|
||||||
frontend_gx_get_rating, /* get_rating */
|
frontend_gx_get_rating, /* get_rating */
|
||||||
"gx",
|
"gx",
|
||||||
};
|
};
|
||||||
|
@ -21,12 +21,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static int frontend_null_get_rating(void)
|
|
||||||
{
|
|
||||||
/* TODO/FIXME: Determine rating */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const frontend_ctx_driver_t frontend_ctx_null = {
|
const frontend_ctx_driver_t frontend_ctx_null = {
|
||||||
NULL, /* environment_get */
|
NULL, /* environment_get */
|
||||||
NULL, /* init */
|
NULL, /* init */
|
||||||
@ -36,6 +30,7 @@ const frontend_ctx_driver_t frontend_ctx_null = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
NULL, /* exec */
|
NULL, /* exec */
|
||||||
NULL, /* shutdown */
|
NULL, /* shutdown */
|
||||||
frontend_null_get_rating, /* get_rating */
|
NULL, /* get_name */
|
||||||
|
NULL, /* get_rating */
|
||||||
"null",
|
"null",
|
||||||
};
|
};
|
||||||
|
@ -440,6 +440,7 @@ const frontend_ctx_driver_t frontend_ctx_ps3 = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
frontend_ps3_exec, /* exec */
|
frontend_ps3_exec, /* exec */
|
||||||
NULL, /* shutdown */
|
NULL, /* shutdown */
|
||||||
|
NULL, /* get_name */
|
||||||
frontend_ps3_get_rating, /* get_rating */
|
frontend_ps3_get_rating, /* get_rating */
|
||||||
"ps3",
|
"ps3",
|
||||||
};
|
};
|
||||||
|
@ -217,6 +217,7 @@ const frontend_ctx_driver_t frontend_ctx_psp = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
frontend_psp_exec, /* exec */
|
frontend_psp_exec, /* exec */
|
||||||
frontend_psp_shutdown, /* shutdown */
|
frontend_psp_shutdown, /* shutdown */
|
||||||
|
NULL, /* get_name */
|
||||||
frontend_psp_get_rating, /* get_rating */
|
frontend_psp_get_rating, /* get_rating */
|
||||||
"psp",
|
"psp",
|
||||||
};
|
};
|
||||||
|
@ -51,6 +51,7 @@ const frontend_ctx_driver_t frontend_ctx_qnx = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
NULL, /* exec */
|
NULL, /* exec */
|
||||||
frontend_qnx_shutdown, /* shutdown */
|
frontend_qnx_shutdown, /* shutdown */
|
||||||
|
NULL, /* get_name */
|
||||||
frontend_qnx_get_rating, /* get_rating */
|
frontend_qnx_get_rating, /* get_rating */
|
||||||
"qnx",
|
"qnx",
|
||||||
};
|
};
|
||||||
|
@ -302,8 +302,6 @@ static int frontend_xdk_get_rating(void)
|
|||||||
return 11;
|
return 11;
|
||||||
#elif defined(_XBOX1)
|
#elif defined(_XBOX1)
|
||||||
return 7;
|
return 7;
|
||||||
#else
|
|
||||||
return -1;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,6 +314,7 @@ const frontend_ctx_driver_t frontend_ctx_xdk = {
|
|||||||
NULL, /* process_events */
|
NULL, /* process_events */
|
||||||
frontend_xdk_exec, /* exec */
|
frontend_xdk_exec, /* exec */
|
||||||
NULL, /* shutdown */
|
NULL, /* shutdown */
|
||||||
|
NULL, /* get_name */
|
||||||
frontend_xdk_get_rating, /* get_rating */
|
frontend_xdk_get_rating, /* get_rating */
|
||||||
"xdk",
|
"xdk",
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user