EXIF library (libexif) API 0.6.22
exifutil.h
1
4/*
5 * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA.
21 */
22
23#ifndef __EXIF_UTILS_H__
24#define __EXIF_UTILS_H__
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30
31#if (defined(__MSHORT__) || defined(__PUREC__) || defined(__AHCC__)) && defined(EXIF_SLB) && (defined(__atarist__) || defined(__TOS__))
32typedef long exif_int_t;
33typedef unsigned long exif_uint_t;
34#define exif_enum(x) exif_int_t
35#else
36typedef int exif_int_t;
37typedef unsigned int exif_uint_t;
38#define exif_enum(x) x
39#endif
40#if defined(EXIF_SLB) && (defined(__atarist__) || defined(__TOS__))
41# include <features.h>
42# define EXIF_CALLBACK __CDECL
43# define EXIF_API(x) x __CDECL
44#else
45# define EXIF_API(x) x
46# define EXIF_CALLBACK
47#endif
48
49#include <libexif/exifbyte.h>
50#include <libexif/exifform.h>
51#include <stdint.h>
52
54typedef unsigned char ExifByte; /* 1 byte */
55
57typedef signed char ExifSByte; /* 1 byte */
58
60typedef char * ExifAscii;
61
63typedef uint16_t ExifShort; /* 2 bytes */
64
66typedef int16_t ExifSShort; /* 2 bytes */
67
69typedef uint32_t ExifLong; /* 4 bytes */
70
72typedef int32_t ExifSLong; /* 4 bytes */
73
75typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational;
76
77typedef char ExifUndefined; /* 1 byte */
78
79
81typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational;
82
83
90EXIF_API(ExifShort) exif_get_short (const unsigned char *b, exif_enum(ExifByteOrder) order);
91
98EXIF_API(ExifSShort) exif_get_sshort (const unsigned char *b, exif_enum(ExifByteOrder) order);
99
106EXIF_API(ExifLong) exif_get_long (const unsigned char *b, exif_enum(ExifByteOrder) order);
107
114EXIF_API(ExifSLong) exif_get_slong (const unsigned char *b, exif_enum(ExifByteOrder) order);
115
122EXIF_API(ExifRational) exif_get_rational (const unsigned char *b, exif_enum(ExifByteOrder) order);
123
130EXIF_API(ExifSRational) exif_get_srational (const unsigned char *b, exif_enum(ExifByteOrder) order);
131
138EXIF_API(void) exif_set_short(unsigned char *b, exif_enum(ExifByteOrder) order, exif_uint_t value);
139
146EXIF_API(void) exif_set_sshort(unsigned char *b, exif_enum(ExifByteOrder) order, exif_int_t value);
147
154EXIF_API(void) exif_set_long(unsigned char *b, exif_enum(ExifByteOrder) order, ExifLong value);
155
162EXIF_API(void) exif_set_slong(unsigned char *b, exif_enum(ExifByteOrder) order, ExifSLong value);
163
170EXIF_API(void) exif_set_rational(unsigned char *b, exif_enum(ExifByteOrder) order, const ExifRational *value);
171
178EXIF_API(void) exif_set_srational(unsigned char *b, exif_enum(ExifByteOrder order), const ExifSRational *value);
179
181EXIF_API(void) exif_convert_utf16_to_utf8 (char *out, const unsigned short *in, int32_t maxlen);
182
183/* Please do not use this function outside of the library. */
184
186EXIF_API(void) exif_array_set_byte_order (exif_enum(ExifFormat), unsigned char *, uint32_t, exif_enum(ExifByteOrder) o_orig, exif_enum(ExifByteOrder) o_new);
187
188#undef MIN
189#define MIN(a, b) (((a) < (b)) ? (a) : (b))
190
191#undef MAX
192#define MAX(a, b) (((a) > (b)) ? (a) : (b))
193
194/* For compatibility with older versions */
195
197#define EXIF_TAG_SUBSEC_TIME EXIF_TAG_SUB_SEC_TIME
198
199#ifdef __cplusplus
200}
201#endif /* __cplusplus */
202
203#if defined(EXIF_SLB) && (defined(__atarist__) || defined(__TOS__))
204#include <slb/exif.h>
205#endif
206
207#endif /* __EXIF_UTILS_H__ */
ExifFormat
EXIF tag data formats.
Definition: exif-format.h:32
signed char ExifSByte
EXIF Signed Byte data type.
Definition: exif-utils.h:57
unsigned char ExifByte
EXIF Unsigned Byte data type.
Definition: exif-utils.h:54
uint32_t ExifLong
EXIF Unsigned Long data type.
Definition: exif-utils.h:69
int32_t ExifSLong
EXIF Signed Long data type.
Definition: exif-utils.h:72
uint16_t ExifShort
EXIF Unsigned Short data type.
Definition: exif-utils.h:63
int16_t ExifSShort
EXIF Signed Short data type.
Definition: exif-utils.h:66
char * ExifAscii
EXIF Text String data type.
Definition: exif-utils.h:60
Defines the ExifByteOrder enum and the associated functions.
EXIF Unsigned Rational data type.
Definition: exif-utils.h:75
EXIF Signed Rational data type.
Definition: exif-utils.h:81