From 143aa8241b91020d8109421648c277ec15431a6d Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Mon, 21 Nov 2016 17:19:35 -0600 Subject: Added promoterutil --- include/user/promoterutil.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/user/promoterutil.h (limited to 'include/user/promoterutil.h') diff --git a/include/user/promoterutil.h b/include/user/promoterutil.h new file mode 100644 index 0000000..374141f --- /dev/null +++ b/include/user/promoterutil.h @@ -0,0 +1,28 @@ +#ifndef _PSP2_PROMOTERUTIL_H_ +#define _PSP2_PROMOTERUTIL_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ScePromoterUtilityLAUpdate { + char titleid[12]; // target app + char path[128]; // directory of extracted LA update data +} ScePromoterUtilityLAUpdate; + +int scePromoterUtilityInit(void); +int scePromoterUtilityExit(void); +int scePromoterUtilityDeletePkg(void *unk); +int scePromoterUtilityUpdateLiveArea(ScePromoterUtilityLAUpdate *args); +int scePromoterUtilityPromotePkg(char *path, int unk); +int scePromoterUtilityPromotePkgWithRif(const char *path, int unk); +int scePromoterUtilityGetState(int *state); +int scePromoterUtilityGetResult(int *res); + +#ifdef __cplusplus +} +#endif + +#endif /* _PSP2_PROMOTERUTIL_H_ */ -- cgit v1.2.3 From 9cf74281e9bd50e6def5bd263f688dff8e44bba8 Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Mon, 21 Nov 2016 17:29:39 -0600 Subject: Added const to path for scePromoterUtilityPromotePkg --- include/user/promoterutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/user/promoterutil.h') diff --git a/include/user/promoterutil.h b/include/user/promoterutil.h index 374141f..e6244d0 100644 --- a/include/user/promoterutil.h +++ b/include/user/promoterutil.h @@ -16,7 +16,7 @@ int scePromoterUtilityInit(void); int scePromoterUtilityExit(void); int scePromoterUtilityDeletePkg(void *unk); int scePromoterUtilityUpdateLiveArea(ScePromoterUtilityLAUpdate *args); -int scePromoterUtilityPromotePkg(char *path, int unk); +int scePromoterUtilityPromotePkg(const char *path, int unk); int scePromoterUtilityPromotePkgWithRif(const char *path, int unk); int scePromoterUtilityGetState(int *state); int scePromoterUtilityGetResult(int *res); -- cgit v1.2.3 From fa2455df2400a5bc674856290ddb2b327c00b2b0 Mon Sep 17 00:00:00 2001 From: devnoname120 Date: Tue, 22 Nov 2016 01:24:56 +0100 Subject: Add documentation for promoterutil.h --- include/user/promoterutil.h | 67 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) (limited to 'include/user/promoterutil.h') diff --git a/include/user/promoterutil.h b/include/user/promoterutil.h index e6244d0..c3d2009 100644 --- a/include/user/promoterutil.h +++ b/include/user/promoterutil.h @@ -7,18 +7,81 @@ extern "C" { #endif +/** Parameters for scePromoterUtilityUpdateLiveArea() */ typedef struct ScePromoterUtilityLAUpdate { - char titleid[12]; // target app - char path[128]; // directory of extracted LA update data + char titleid[12]; //!< Target app. + char path[128]; //!< Directory of extracted LA update data. } ScePromoterUtilityLAUpdate; +/** + * Init the promoter utility. + * \note Needs to be called before using the other functions. + * + * @return 0 on success. + */ int scePromoterUtilityInit(void); + +/** + * Deinit the promoter utility. + * + * @return 0 on success. + */ int scePromoterUtilityExit(void); + +/** + * Delete a package from the LiveArea. + * + * @return 0 on success. + */ int scePromoterUtilityDeletePkg(void *unk); + +/** + * Update the LiveArea ressources of an app + * + * @param[in] *args - see ::ScePromoterUtilityLAUpdate + * + * @return 0 on success. + */ int scePromoterUtilityUpdateLiveArea(ScePromoterUtilityLAUpdate *args); + +/** + * Install a package from a directory, and add an icon on the LiveArea. + * \note It is an asynchronous function. + * + * @param[in] *path - the path of the directory where the extracted content of the package is + * @param unk - unknown, pass 0 + * + * @return 0 on success. + */ int scePromoterUtilityPromotePkg(const char *path, int unk); + +/** + * Install a package from a directory and generate a rif. + * \note It is an asynchronous function. + * + * @param[in] *path - the path of the directory where the extracted content of the package is + * @param unk - unknown, pass 0 + * + * @return 0 on success. + */ int scePromoterUtilityPromotePkgWithRif(const char *path, int unk); + +/** + * Returns the state of an operation. + * + * @param[out] *state - the current status, 0 when finished + * + * @return <0 if failed. + */ int scePromoterUtilityGetState(int *state); + +/** + * Returns the result of a finished operation + * + * @param[out] *res - the result, 0 on success + * + * @return <0 if failed. + */ int scePromoterUtilityGetResult(int *res); #ifdef __cplusplus -- cgit v1.2.3 From 5a379b428b1c56ae78833aa3b35da30a22cfa190 Mon Sep 17 00:00:00 2001 From: Sunguk Lee Date: Tue, 29 Nov 2016 00:19:05 +0900 Subject: Rename argument of scePromoterUtilityDeletePkg `void *unk` to `const char *titleid` https://github.com/vitasdk/vita-headers/pull/101#discussion_r89012646 --- include/user/promoterutil.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/user/promoterutil.h') diff --git a/include/user/promoterutil.h b/include/user/promoterutil.h index c3d2009..117b4c3 100644 --- a/include/user/promoterutil.h +++ b/include/user/promoterutil.h @@ -31,9 +31,11 @@ int scePromoterUtilityExit(void); /** * Delete a package from the LiveArea. * + * @param[in] *titleid + * * @return 0 on success. */ -int scePromoterUtilityDeletePkg(void *unk); +int scePromoterUtilityDeletePkg(const char *titleid); /** * Update the LiveArea ressources of an app -- cgit v1.2.3