libragephoto Version: 0.1.0
RagePhotoC.h
Go to the documentation of this file.
1/*****************************************************************************
2* libragephoto RAGE Photo Parser
3* Copyright (C) 2021 Syping
4*
5* Redistribution and use in source and binary forms, with or without modification,
6* are permitted provided that the following conditions are met:
7*
8* 1. Redistributions of source code must retain the above copyright notice,
9* this list of conditions and the following disclaimer.
10*
11* 2. Redistributions in binary form must reproduce the above copyright notice,
12* this list of conditions and the following disclaimer in the documentation
13* and/or other materials provided with the distribution.
14*
15* This software is provided as-is, no warranties are given to you, we are not
16* responsible for anything with use of the software, you are self responsible.
17*****************************************************************************/
18
19#ifndef RAGEPHOTOC_H
20#define RAGEPHOTOC_H
21
22#include "libragephoto_global.h"
23#include <stdint.h>
24#include <stdio.h>
25
26#ifdef LIBRAGEPHOTO_C_NOAPI
27#error "libragephoto was built without C API"
28#endif // LIBRAGEPHOTO_C_NOAPI
29
30#ifdef __cplusplus
31extern "C" {
32#endif // __cplusplus
35typedef void* ragephoto_t;
36
38LIBRAGEPHOTO_C_EXPORT ragephoto_t ragephoto_open();
39
43LIBRAGEPHOTO_C_EXPORT void ragephoto_clear(ragephoto_t instance);
44
50LIBRAGEPHOTO_C_EXPORT int ragephoto_load(ragephoto_t instance, const char *data, size_t size);
51
56LIBRAGEPHOTO_C_EXPORT int ragephoto_loadfile(ragephoto_t instance, const char *filename);
57
61LIBRAGEPHOTO_C_EXPORT uint8_t ragephoto_error(ragephoto_t instance);
62
64LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_defpbuf_gta5();
65
67LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_defpbuf_rdr2();
68
70LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_format_gta5();
71
73LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_format_rdr2();
74
78LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotodesc(ragephoto_t instance);
79
83LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_getphotoformat(ragephoto_t instance);
84
88LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotojpeg(ragephoto_t instance);
89
93LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotojson(ragephoto_t instance);
94
98LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphotoheader(ragephoto_t instance);
99
103LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_getphotosize(ragephoto_t instance);
104
108LIBRAGEPHOTO_C_EXPORT const char* ragephoto_getphototitle(ragephoto_t instance);
109
113LIBRAGEPHOTO_C_EXPORT size_t ragephoto_getsavesize(ragephoto_t instance);
114
119LIBRAGEPHOTO_C_EXPORT size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat);
120
125LIBRAGEPHOTO_C_EXPORT int ragephoto_save(ragephoto_t instance, char *data);
126
132LIBRAGEPHOTO_C_EXPORT int ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat);
133
138LIBRAGEPHOTO_C_EXPORT int ragephoto_savefile(ragephoto_t instance, const char *filename);
139
145LIBRAGEPHOTO_C_EXPORT int ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat);
146
150LIBRAGEPHOTO_C_EXPORT void ragephoto_setbufferdefault(ragephoto_t instance);
151
155LIBRAGEPHOTO_C_EXPORT void ragephoto_setbufferoffsets(ragephoto_t instance);
156
164LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize);
165
170LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat);
171
180LIBRAGEPHOTO_C_EXPORT int ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize);
181
189LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize);
190
192LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum);
193
201LIBRAGEPHOTO_C_EXPORT void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize);
202
206LIBRAGEPHOTO_C_EXPORT void ragephoto_close(ragephoto_t instance);
207
209LIBRAGEPHOTO_C_EXPORT const char* ragephoto_version();
210
211#ifdef __cplusplus
212}
213#endif // __cplusplus
214
215#endif // RAGEPHOTOC_H
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_getphotosize(ragephoto_t instance)
Definition: RagePhoto.cpp:1056
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_getphotoformat(ragephoto_t instance)
Definition: RagePhoto.cpp:1032
LIBRAGEPHOTO_C_EXPORT void ragephoto_close(ragephoto_t instance)
Definition: RagePhoto.cpp:1152
LIBRAGEPHOTO_C_EXPORT const char * ragephoto_getphotoheader(ragephoto_t instance)
Definition: RagePhoto.cpp:1050
LIBRAGEPHOTO_C_EXPORT const char * ragephoto_getphototitle(ragephoto_t instance)
Definition: RagePhoto.cpp:1062
LIBRAGEPHOTO_C_EXPORT int ragephoto_loadfile(ragephoto_t instance, const char *filename)
Definition: RagePhoto.cpp:994
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphototitle(ragephoto_t instance, const char *title, uint32_t bufferSize)
Definition: RagePhoto.cpp:1146
LIBRAGEPHOTO_C_EXPORT int ragephoto_load(ragephoto_t instance, const char *data, size_t size)
Definition: RagePhoto.cpp:988
void * ragephoto_t
Definition: RagePhotoC.h:35
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize)
Definition: RagePhoto.cpp:1116
LIBRAGEPHOTO_C_EXPORT int ragephoto_savefilef(ragephoto_t instance, const char *filename, uint32_t photoFormat)
Definition: RagePhoto.cpp:1098
LIBRAGEPHOTO_C_EXPORT size_t ragephoto_getsavesizef(ragephoto_t instance, uint32_t photoFormat)
Definition: RagePhoto.cpp:1074
LIBRAGEPHOTO_C_EXPORT int ragephoto_savefile(ragephoto_t instance, const char *filename)
Definition: RagePhoto.cpp:1092
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_defpbuf_rdr2()
Definition: RagePhoto.cpp:1011
LIBRAGEPHOTO_C_EXPORT void ragephoto_clear(ragephoto_t instance)
Definition: RagePhoto.cpp:982
LIBRAGEPHOTO_C_EXPORT ragephoto_t ragephoto_open()
Definition: RagePhoto.cpp:977
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotoformat(ragephoto_t instance, uint32_t photoFormat)
Definition: RagePhoto.cpp:1122
LIBRAGEPHOTO_C_EXPORT const char * ragephoto_getphotodesc(ragephoto_t instance)
Definition: RagePhoto.cpp:1026
LIBRAGEPHOTO_C_EXPORT void ragephoto_setbufferdefault(ragephoto_t instance)
Definition: RagePhoto.cpp:1104
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotojson(ragephoto_t instance, const char *json, uint32_t bufferSize)
Definition: RagePhoto.cpp:1134
LIBRAGEPHOTO_C_EXPORT const char * ragephoto_getphotojson(ragephoto_t instance)
Definition: RagePhoto.cpp:1044
LIBRAGEPHOTO_C_EXPORT void ragephoto_setbufferoffsets(ragephoto_t instance)
Definition: RagePhoto.cpp:1110
LIBRAGEPHOTO_C_EXPORT void ragephoto_setphotoheader(ragephoto_t instance, const char *header, uint32_t headerSum)
Definition: RagePhoto.cpp:1140
LIBRAGEPHOTO_C_EXPORT int ragephoto_savef(ragephoto_t instance, char *data, uint32_t photoFormat)
Definition: RagePhoto.cpp:1086
LIBRAGEPHOTO_C_EXPORT size_t ragephoto_getsavesize(ragephoto_t instance)
Definition: RagePhoto.cpp:1068
LIBRAGEPHOTO_C_EXPORT int ragephoto_setphotojpeg(ragephoto_t instance, const char *data, uint32_t size, uint32_t bufferSize)
Definition: RagePhoto.cpp:1128
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_format_gta5()
Definition: RagePhoto.cpp:1016
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_defpbuf_gta5()
Definition: RagePhoto.cpp:1006
LIBRAGEPHOTO_C_EXPORT const char * ragephoto_getphotojpeg(ragephoto_t instance)
Definition: RagePhoto.cpp:1038
LIBRAGEPHOTO_C_EXPORT int ragephoto_save(ragephoto_t instance, char *data)
Definition: RagePhoto.cpp:1080
LIBRAGEPHOTO_C_EXPORT const char * ragephoto_version()
Definition: RagePhoto.cpp:1158
LIBRAGEPHOTO_C_EXPORT uint8_t ragephoto_error(ragephoto_t instance)
Definition: RagePhoto.cpp:1000
LIBRAGEPHOTO_C_EXPORT uint32_t ragephoto_format_rdr2()
Definition: RagePhoto.cpp:1021