xref: /original-bsd/bin/pax/options.h (revision 7afc0fa3)
1 /*-
2  * Copyright (c) 1992 Keith Muller.
3  * Copyright (c) 1992, 1993
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * Keith Muller of the University of California, San Diego.
8  *
9  * %sccs.include.redist.c%
10  *
11  *	@(#)options.h	8.2 (Berkeley) 04/18/94
12  */
13 
14 /*
15  * argv[0] names. Used for tar and cpio emulation
16  */
17 
18 #define NM_TAR  "tar"
19 #define NM_CPIO "cpio"
20 #define NM_PAX  "pax"
21 
22 /*
23  * Constants used to specify the legal sets of flags in pax. For each major
24  * operation mode of pax, a set of illegal flags is defined. If any one of
25  * those illegal flags are found set, we scream and exit
26  */
27 #define NONE	"none"
28 
29 /*
30  * flags (one for each option).
31  */
32 #define	AF	0x00000001
33 #define	BF	0x00000002
34 #define	CF	0x00000004
35 #define	DF	0x00000008
36 #define	FF	0x00000010
37 #define	IF	0x00000020
38 #define	KF	0x00000040
39 #define	LF	0x00000080
40 #define	NF	0x00000100
41 #define	OF	0x00000200
42 #define	PF	0x00000400
43 #define	RF	0x00000800
44 #define	SF	0x00001000
45 #define	TF	0x00002000
46 #define	UF	0x00004000
47 #define	VF	0x00008000
48 #define	WF	0x00010000
49 #define	XF	0x00020000
50 #define	CBF	0x00040000	/* nonstandard extension */
51 #define	CDF	0x00080000	/* nonstandard extension */
52 #define	CEF	0x00100000	/* nonstandard extension */
53 #define	CGF	0x00200000	/* nonstandard extension */
54 #define	CHF	0x00400000	/* nonstandard extension */
55 #define	CLF	0x00800000	/* nonstandard extension */
56 #define	CPF	0x01000000	/* nonstandard extension */
57 #define	CTF	0x02000000	/* nonstandard extension */
58 #define	CUF	0x04000000	/* nonstandard extension */
59 #define	CXF	0x08000000
60 #define	CYF	0x10000000	/* nonstandard extension */
61 #define	CZF	0x20000000	/* nonstandard extension */
62 
63 /*
64  * ascii string indexed by bit position above (alter the above and you must
65  * alter this string) used to tell the user what flags caused us to complain
66  */
67 #define FLGCH	"abcdfiklnoprstuvwxBDEGHLPTUXYZ"
68 
69 /*
70  * legal pax operation bit patterns
71  */
72 
73 #define ISLIST(x)	(((x) & (RF|WF)) == 0)
74 #define	ISEXTRACT(x)	(((x) & (RF|WF)) == RF)
75 #define ISARCHIVE(x)	(((x) & (AF|RF|WF)) == WF)
76 #define ISAPPND(x)	(((x) & (AF|RF|WF)) == (AF|WF))
77 #define	ISCOPY(x)	(((x) & (RF|WF)) == (RF|WF))
78 #define	ISWRITE(x)	(((x) & (RF|WF)) == WF)
79 
80 /*
81  * Illegal option flag subsets based on pax operation
82  */
83 
84 #define	BDEXTR	(AF|BF|LF|TF|WF|XF|CBF|CHF|CLF|CPF|CXF)
85 #define	BDARCH	(CF|KF|LF|NF|PF|RF|CDF|CEF|CYF|CZF)
86 #define	BDCOPY	(AF|BF|FF|OF|XF|CBF|CEF)
87 #define	BDLIST (AF|BF|IF|KF|LF|OF|PF|RF|TF|UF|WF|XF|CBF|CDF|CHF|CLF|CPF|CXF|CYF|CZF)
88