From 0fdbf66470fd6477bc34e9995baa77eef87f2748 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sat, 14 Mar 2020 11:04:28 +1100 Subject: [PATCH] sysapp: Add PFID functions, rename APP_ID_UPDATER -> APP_ID_HOME_MENU, other system app funcs --- include/sysapp/title.h | 40 +++++++++++++++++++++++++++++++++++++++- include/wut.h | 10 ++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/include/sysapp/title.h b/include/sysapp/title.h index ac6b65d..9e72fb1 100644 --- a/include/sysapp/title.h +++ b/include/sysapp/title.h @@ -1,5 +1,6 @@ #pragma once #include +#include /** * \defgroup sysapp_title SYSAPP Title @@ -16,7 +17,7 @@ extern "C" { typedef enum SYSTEM_APP_ID { - SYSTEM_APP_ID_UPDATER = 0, + SYSTEM_APP_ID_HOME_MENU = 0, SYSTEM_APP_ID_SYSTEM_SETTINGS = 1, SYSTEM_APP_ID_PARENTAL_CONTROLS = 2, SYSTEM_APP_ID_USER_SETTINGS = 3, @@ -30,6 +31,10 @@ typedef enum SYSTEM_APP_ID SYSTEM_APP_ID_SOFTWARE_DATA_TRANSFER = 11, } SYSTEM_APP_ID; +// for compatibility +WUT_DEPRECATED("This enum name is misleading and incorrect. Please use SYSTEM_APP_ID_HOME_MENU") +static const SYSTEM_APP_ID SYSTEM_APP_ID_UPDATER = SYSTEM_APP_ID_HOME_MENU; + /** * Check if a given title exists and is installed on the system. * @@ -72,6 +77,24 @@ SYSGetPFIDFromTitleID(uint64_t TitleId); int32_t SYSGetUPIDFromTitleID(uint64_t TitleId); +/** + * Gets the PFID/UPID of the calling (current) application. + * + * \note + * This function is identical to \link SYSGetCallerPFID \endlink. + */ +int32_t +SYSGetCallerUPID(); + +/** + * Gets the PFID/UPID of the calling (current) application. + * + * \note + * This function is identical to \link SYSGetCallerUPID \endlink. + */ +int32_t +SYSGetCallerPFID(); + /** * Gets the title id for a given SYSTEM_APP_ID. * @@ -79,6 +102,21 @@ SYSGetUPIDFromTitleID(uint64_t TitleId); uint64_t _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID id); +/** + * Gets the title id for a given SYSTEM_APP_ID in the given region. + * + */ +uint64_t +_SYSGetSystemApplicationTitleIdByProdArea(SYSTEM_APP_ID id, + MCPRegion prod_area); + +/** + * Gets the title id of the calling (current) application. + * + */ +uint64_t +SYSGetCallerTitleId(); + #ifdef __cplusplus } #endif diff --git a/include/wut.h b/include/wut.h index 4c4695d..4bce603 100644 --- a/include/wut.h +++ b/include/wut.h @@ -9,3 +9,13 @@ #include "wut_structsize.h" #include "wut_types.h" #include "wut_rplwrap.h" + +#ifdef __GNUC__ + +#define WUT_DEPRECATED(reason) __attribute__((deprecated(reason))) + +#else // not __GNUC__ + +#define WUT_DEPRECATED(reason) + +#endif //__GNUC__