-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathjpegoptim.h
104 lines (77 loc) · 2.23 KB
/
jpegoptim.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* jpegoptim.h
*
* JPEGoptim headers
*/
#ifndef JPEGOPTIM_H
#define JPEGOPTIM_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifdef WIN32
#include "win32_compat.h"
#define DIR_SEPARATOR_C '\\'
#define DIR_SEPARATOR_S "\\"
#else
#include <sys/param.h>
#include <utime.h>
#define DIR_SEPARATOR_C '/'
#define DIR_SEPARATOR_S "/"
#define set_filemode_binary(file) {}
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <jpeglib.h>
#ifdef BROKEN_METHODDEF
#undef METHODDEF
#define METHODDEF(x) static x
#endif
#ifndef HAVE_LABS
#define labs abs
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif
#define JFIF_JPEG_MARKER JPEG_APP0
#define JFIF_IDENT_STRING "JFIF\0"
#define JFIF_IDENT_STRING_SIZE 5
#define JFXX_JPEG_MARKER JPEG_APP0
#define JFXX_IDENT_STRING "JFXX\0"
#define JFXX_IDENT_STRING_SIZE 5
#define EXIF_JPEG_MARKER JPEG_APP0 + 1
#define EXIF_IDENT_STRING "Exif\000\000"
#define EXIF_IDENT_STRING_SIZE 6
#define IPTC_JPEG_MARKER JPEG_APP0 + 13
#define ICC_JPEG_MARKER JPEG_APP0 + 2
#define ICC_IDENT_STRING "ICC_PROFILE\0"
#define ICC_IDENT_STRING_SIZE 12
#define XMP_JPEG_MARKER JPEG_APP0 + 1
#define XMP_IDENT_STRING "http://ns.adobe.com/xap/1.0/\000"
#define XMP_IDENT_STRING_SIZE 29
#define ADOBE_JPEG_MARKER JPEG_APP0 + 14
#define ADOBE_IDENT_STRING "Adobe"
#define ADOBE_IDENT_STRING_SIZE 5
#define PROGRAMNAME "jpegoptim"
extern int verbose_mode;
extern int quiet_mode;
/* misc.c */
int delete_file(const char *name);
long file_size(FILE *fp);
int is_directory(const char *path);
int is_file(const char *filename, struct stat *st);
int file_exists(const char *pathname);
int rename_file(const char *old_path, const char *new_path);
int copy_file(const char *srcname, const char *dstname);
char *splitdir(const char *pathname, char *buf, int buflen);
char *splitname(const char *pathname, char *buf, int buflen);
void fatal(const char *format, ...);
void warn(const char *format, ...);
/* jpegdest.c */
void jpeg_memory_dest (j_compress_ptr cinfo, unsigned char **bufptr,
size_t *bufsizeptr, size_t incsize);
/* jpegsrc.c */
void jpeg_custom_src(j_decompress_ptr dinfo, FILE *infile,
unsigned char **bufptr, size_t *bufsizeptr, size_t *bufusedptr, size_t incsize);
#ifdef __cplusplus
}
#endif
#endif /* JPEGOPTIM_H */