C API: bool -> int, size_t included

This commit is contained in:
Syping 2021-10-29 12:33:43 +02:00
parent 48f8d12246
commit 6b262e2ddc
2 changed files with 3 additions and 3 deletions

View File

@ -865,14 +865,13 @@ inline void RagePhoto::uInt32ToCharLE(uint32_t x, char *y)
y[3] = x >> 24;
}
// C API
#ifdef LIBRAGEPHOTO_C_API
ragephoto_t ragephoto_open()
{
return new RagePhoto;
}
bool ragephoto_load(ragephoto_t instance, const char *data, size_t size)
int ragephoto_load(ragephoto_t instance, const char *data, size_t size)
{
RagePhoto *ragePhoto = static_cast<RagePhoto*>(instance);
return ragePhoto->load(data, size);

View File

@ -176,6 +176,7 @@ extern "C" {
#else
#include "libragephoto_global.h"
#include <stdint.h>
#include <stdio.h>
#endif
typedef void* ragephoto_t;
@ -189,7 +190,7 @@ LIBRAGEPHOTO_EXPORT ragephoto_t ragephoto_open();
* \param data Photo data
* \param size Photo data size
*/
LIBRAGEPHOTO_EXPORT bool ragephoto_load(ragephoto_t instance, const char *data, size_t size);
LIBRAGEPHOTO_EXPORT int ragephoto_load(ragephoto_t instance, const char *data, size_t size);
/** Returns the Photo JPEG data.
* \param instance \p ragephoto_t instance