-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
jpegoptim.h
99 lines (79 loc) · 2.47 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
/* jpegoptim.h
*
* JPEGoptim headers
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This file is part of JPEGoptim.
*
* JPEGoptim is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JPEGoptim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with JPEGoptim. If not, see <https://www.gnu.org/licenses/>.
*/
#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 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 *fgetstr(char *s, size_t size, FILE *stream);
char *splitdir(const char *pathname, char *buf, size_t size);
char *splitname(const char *pathname, char *buf, size_t size);
char *strncopy(char *dst, const char *src, size_t size);
char *strncatenate(char *dst, const char *src, size_t size);
char *str_add_list(char *dst, size_t size, const char *src, const char *delim);
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 */