1 /*
2 * compression.h: interface to finding decompressor / compression extension
3 *
4 * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
5 * Copyright (C) 2001-2022 Colin Watson.
6 *
7 * This file is part of man-db.
8 *
9 * man-db is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * man-db is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with man-db; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include <stdbool.h>
25
26 struct compression {
27 /* The following are const because they should be pointers to parts
28 * of strings allocated elsewhere and should not be written through
29 * or freed themselves.
30 */
31 const char *prog;
32 const char *ext;
33 /* The following should be freed when discarding an instance of this
34 * structure.
35 */
36 char *stem;
37 };
38
39 extern struct compression comp_list[];
40
41 extern struct compression *comp_info (const char *filename, bool want_stem);
42 extern struct compression *comp_file (const char *filename);