xref: /freebsd/contrib/libarchive/unzip/bsdunzip.h (revision bd66c1b43e33540205dbc1187c2f2a15c58b57ba)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2023, Martin Matuska
5  * All rights reserved.
6  */
7 
8 #ifndef BSDUNZIP_H_INCLUDED
9 #define BSDUNZIP_H_INCLUDED
10 
11 #if defined(PLATFORM_CONFIG_H)
12 /* Use hand-built config.h in environments that need it. */
13 #include PLATFORM_CONFIG_H
14 #else
15 /* Not having a config.h of some sort is a serious problem. */
16 #include "config.h"
17 #endif
18 
19 #include <archive.h>
20 #include <archive_entry.h>
21 
22 struct bsdunzip {
23 	/* Option parser state */
24 	int		  getopt_state;
25 	char		 *getopt_word;
26 
27 	/* Miscellaneous state information */
28 	int		  argc;
29 	char		**argv;
30 	const char	 *argument;
31 };
32 
33 enum {
34 	OPTION_NONE,
35 	OPTION_VERSION
36 };
37 
38 int bsdunzip_getopt(struct bsdunzip *);
39 
40 extern int bsdunzip_optind;
41 
42 #endif
43