1 /*
2 * filenames.h: Interface to composing and dissecting man page file names
3 *
4 * Copyright (C) 2001-2022 Colin Watson.
5 *
6 * This file is part of man-db.
7 *
8 * man-db is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * man-db is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with man-db; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #ifndef MAN_FILENAMES_H
24 #define MAN_FILENAMES_H
25
26 #include <stdbool.h>
27
28 #include "timespec.h"
29
30 struct mandata {
31 /* Name of page, if not equal to the key. */
32 char *name;
33 /* Filename extension without compression extension. */
34 char *ext;
35 /* Section name/number. */
36 char *sec;
37 /* ID (i.e. type) of this entry. */
38 char id;
39 /* ID-related file pointer. */
40 char *pointer;
41 /* Compression extension. */
42 char *comp;
43 /* Filters needed for the page. */
44 char *filter;
45 /* Whatis description for the page. */
46 char *whatis;
47 /* Modification time for file. */
48 struct timespec mtime;
49 };
50
51 extern char *make_filename (const char *path, const char *name,
52 struct mandata *in, const char *type);
53 extern struct mandata *filename_info (const char *file, bool warn_if_bogus);
54 extern void free_mandata_struct (struct mandata *pinfo);
55
56 #endif /* MAN_FILENAMES_H */