diff options
author | Reiko Asakura | 2021-03-26 12:19:39 -0400 |
---|---|---|
committer | Reiko Asakura | 2021-03-26 12:19:39 -0400 |
commit | ffb17c2ef2fdf320a81508a7076bb778f8dbb4e6 (patch) | |
tree | 2af693a7a59a632a37f4bd2962bc8f7960ab712d | |
parent | Change GLES2 header install path (diff) | |
download | vds-libraries-ffb17c2ef2fdf320a81508a7076bb778f8dbb4e6.tar.gz |
Changes to SceIniFileProcessor
-rw-r--r-- | include/user/ini_file_processor.h | 69 | ||||
-rw-r--r-- | nids/360/SceIniFileProcessor.yml | 7 |
2 files changed, 46 insertions, 30 deletions
diff --git a/include/user/ini_file_processor.h b/include/user/ini_file_processor.h index 0cc1589..869fbd7 100644 --- a/include/user/ini_file_processor.h +++ b/include/user/ini_file_processor.h @@ -5,13 +5,21 @@ #ifndef _VDSUITE_USER_INI_FILE_PROCESSOR_H #define _VDSUITE_USER_INI_FILE_PROCESSOR_H -#define SCE_INI_FILE_PROCESSOR_ERROR_MODE ((int)0x80840002) -#define SCE_INI_FILE_PROCESSOR_ERROR_EOF ((int)0x80840005) -#define SCE_INI_FILE_PROCESSOR_ERROR_READ_ONLY ((int)0x80840007) -#define SCE_INI_FILE_PROCESSOR_ERROR_FILE_NOT_FOUND ((int)0x80840009) -#define SCE_INI_FILE_PROCESSOR_ERROR_KEY_NOT_FOUND ((int)0x80840010) +#define SCE_INI_FILE_PROCESSOR_ERROR_NO_MEMORY (-2138832895) /* 0x80840001 */ +#define SCE_INI_FILE_PROCESSOR_ERROR_UNINITIALIZED (-2138832894) /* 0x80840002 */ +#define SCE_INI_FILE_PROCESSOR_ERROR_EOF (-2138832891) /* 0x80840005 */ +#define SCE_INI_FILE_PROCESSOR_ERROR_INVALID_ARGUMENT (-2138832890) /* 0x80840006 */ +#define SCE_INI_FILE_PROCESSOR_ERROR_READ_ONLY (-2138832889) /* 0x80840007 */ +#define SCE_INI_FILE_PROCESSOR_ERROR_FILE_NOT_FOUND (-2138832887) /* 0x80840009 */ +#define SCE_INI_FILE_PROCESSOR_ERROR_INVALID_KEY (-2138832882) /* 0x8084000E */ +#define SCE_INI_FILE_PROCESSOR_ERROR_KEY_NOT_FOUND (-2138832880) /* 0x80840010 */ -#define SCE_INI_FILE_PROCESSOR_PARSE_COMPLETED 0x00840001 +#define SCE_INI_FILE_PROCESSOR_PARSE_COMPLETED (0x840001) + +#define SCE_INI_FILE_PROCESSOR_OPEN_FLAG_UNK_20 (1 << 20) /* Sets sceIoOpen flag to 0x10001 */ +#define SCE_INI_FILE_PROCESSOR_OPEN_FLAG_WITH_MODE (1 << 21) /* Sets sceIoOpen mode to (flags & 0xFFFF) */ + +#define SCE_INI_FILE_PROCESSOR_KEY_BUFFER_SIZE (0x80) #ifdef __cplusplus @@ -61,54 +69,61 @@ public: int terminate(); /** - * Terminate INI file processor when file could not be opened + * Returns the last IO error number. * - * @return 0 on success, < 0 on error. + * @return 0 or error number. */ - int terminateForError(); + int getLastIoError(); /** - * Get INI as a string. The returned buffer is not null-terminated. + * Serialize INI data into a string * - * @param[out] ini - memory where INI data is stored - * @param[out] size - size of the INI data + * @param[out] ini - string data + * @param[out] size - length of the output string * * @return 0 on success, < 0 on error. */ int serialize(const char** ini, size_t* size); /** - * Process INI as a string. Size is without null-terminator. + * Frees the memory allocated for serialize. + * + * @return 0 on success, < 0 on error. + */ + int free(); + + /** + * Deserialize INI data from a string * - * @param[in] ini - memory where INI data is stored - * @param[in] size - size of the INI data + * @param[in] ini - string data + * @param[in] size - length of the input string * * @return 0 on success, < 0 on error. */ int deserialize(const char* ini, size_t size); /** - * Open INI file + * Create a new INI file or open an existing INI file. * * @param[in] path - path to the INI file to open - * @param[in] mode - file open mode - * @param[in] unk - unknown, set to 0 + * @param[in] mode - file open mode, "r" or "rw" + * @param[in] flags - bitwise OR of open flags * * @return 0 on success, < 0 on error. */ - int open(const char* path, const char* mode, int unk); + int open(const char* path, const char* mode, int flags); /** - * Create new INI file and open it. If file is already present, it will be overwritten + * Create new INI file. If the file already exists, it will be truncated. * * @param[in] path - path to the INI file to open - * @param[in] mode - file open mode - * @param[in] unk - unknown, set to 0 + * @param[in] mode - set to "rw", this argument has no effect + * @param[in] flags - bitwise OR of open flags * * @return 0 on success, < 0 on error. * */ - int create(const char* path, const char* mode, int unk); + int openNew(const char* path, const char* mode, int flags); /** * Close INI file @@ -118,11 +133,11 @@ public: int close(); /** - * Cleanup temp files + * Flush changes to file. * * @return 0 on success, < 0 on error. */ - int cleanup(); + int flush(); /** * Get total number of keys in the opened INI file @@ -175,9 +190,9 @@ public: /** * Parse key and corresponding value, one key per call until eof * - * @param[out] key - buffer to store key string, must have size at least 0x80 + * @param[out] key - buffer to store key string * @param[out] val - buffer to store value string - * @param[in] size - max string size that can fit in val, not including the null terminator + * @param[in] size - size of the output value buffer * * @return 0 on success, < 0 on error. * diff --git a/nids/360/SceIniFileProcessor.yml b/nids/360/SceIniFileProcessor.yml index a5d4c9f..b895770 100644 --- a/nids/360/SceIniFileProcessor.yml +++ b/nids/360/SceIniFileProcessor.yml @@ -9,18 +9,19 @@ modules: _ZN3sce3Ini13InitParameterC2Ev: 0x9F8FC03F _ZN3sce3Ini16IniFileProcessor10initializeEPKNS0_13InitParameterE: 0x0975D396 _ZN3sce3Ini16IniFileProcessor11deserializeEPKcj: 0xB785FE67 - _ZN3sce3Ini16IniFileProcessor17terminateForErrorEv: 0x48A6BDCB + _ZN3sce3Ini16IniFileProcessor14getLastIoErrorEv: 0x48A6BDCB _ZN3sce3Ini16IniFileProcessor3addEPKcS3_: 0x703E1BAE _ZN3sce3Ini16IniFileProcessor3delEPKc: 0xC2B3A41C _ZN3sce3Ini16IniFileProcessor3getEPKcPcjj: 0x7F22CED1 _ZN3sce3Ini16IniFileProcessor3setEPKcS3_: 0xDBC5F9A8 + _ZN3sce3Ini16IniFileProcessor4freeEv: 0x655D31C6 _ZN3sce3Ini16IniFileProcessor4openEPKcS3_i: 0x51B791E8 _ZN3sce3Ini16IniFileProcessor4sizeEv: 0xD7648B61 _ZN3sce3Ini16IniFileProcessor5closeEv: 0xEDFAD6B4 + _ZN3sce3Ini16IniFileProcessor5flushEv: 0xA51840C7 _ZN3sce3Ini16IniFileProcessor5parseEPcS2_j: 0xD5C7B3EE _ZN3sce3Ini16IniFileProcessor5resetEv: 0xB48C756B - _ZN3sce3Ini16IniFileProcessor6createEPKcS3_i: 0xFD8DE2F8 - _ZN3sce3Ini16IniFileProcessor7cleanupEv: 0xA51840C7 + _ZN3sce3Ini16IniFileProcessor7openNewEPKcS3_i: 0xFD8DE2F8 _ZN3sce3Ini16IniFileProcessor9serializeEPPKcPj: 0x109B4E83 _ZN3sce3Ini16IniFileProcessor9terminateEv: 0x2BEF7391 _ZN3sce3Ini16IniFileProcessorC1Ev: 0xA0F71A2C |