libragephoto: add typedefs for format parser

This commit is contained in:
Syping 2023-02-11 20:06:00 +01:00
parent 429f011cff
commit 0900feda84
2 changed files with 20 additions and 3 deletions

View file

@ -35,9 +35,6 @@ extern "C" {
/** RagePhoto C++ class typedef for C API. */
typedef void* ragephoto_t;
/** RagePhoto bool typedef for C API. */
typedef int32_t ragephoto_bool_t;
/** Opens a \p ragephoto_t instance. */
LIBRAGEPHOTO_C_BINDING ragephoto_t ragephoto_open();

View file

@ -48,6 +48,26 @@ typedef struct RagePhotoData {
uint32_t unnamedSum2; /**< 2nd unnamed checksum for Red Dead Redemption 2 */
} RagePhotoData;
/** RagePhoto bool typedef. */
typedef int32_t ragephoto_bool_t;
/** RagePhoto load function typedef. */
typedef ragephoto_bool_t (*ragephoto_loadfunc_t)(RagePhotoData*, const char*, size_t);
/** RagePhoto save function typedef (char* allocated by caller). */
typedef ragephoto_bool_t (*ragephoto_savefunc_t)(RagePhotoData*, char*, uint32_t);
/** RagePhoto save function typedef (char* allocated by function). */
typedef ragephoto_bool_t (*ragephoto_savepfunc_t)(RagePhotoData*, char**, uint32_t);
/** RagePhoto format parser struct for registering custom formats. */
typedef struct RagePhotoFormatParser {
uint32_t photoFormat; /**< Photo file format magic */
ragephoto_loadfunc_t funcLoad; /**< Pointer to load function */
ragephoto_savefunc_t funcSave; /**< Pointer to save function */
ragephoto_savepfunc_t funcSavep; /**< Pointer to savep function */
} RagePhotoFormatParser;
#ifdef __cplusplus
}
#endif // __cplusplus