C API: bool -> int, size_t included

test
Syping 1 year ago
parent 48f8d12246
commit 6b262e2ddc
  1. 3
      src/RagePhoto.cpp
  2. 3
      src/RagePhoto.h

@ -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);

@ -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

Loading…
Cancel
Save