xref: /csrg-svn/bin/pax/options.h (revision 66890)
157117Smuller /*-
257117Smuller  * Copyright (c) 1992 Keith Muller.
360676Sbostic  * Copyright (c) 1992, 1993
460676Sbostic  *	The Regents of the University of California.  All rights reserved.
557117Smuller  *
657117Smuller  * This code is derived from software contributed to Berkeley by
757117Smuller  * Keith Muller of the University of California, San Diego.
857117Smuller  *
957117Smuller  * %sccs.include.redist.c%
1057117Smuller  *
11*66890Sbostic  *	@(#)options.h	8.2 (Berkeley) 04/18/94
1257117Smuller  */
1357117Smuller 
1457117Smuller /*
15*66890Sbostic  * argv[0] names. Used for tar and cpio emulation
16*66890Sbostic  */
17*66890Sbostic 
18*66890Sbostic #define NM_TAR  "tar"
19*66890Sbostic #define NM_CPIO "cpio"
20*66890Sbostic #define NM_PAX  "pax"
21*66890Sbostic 
22*66890Sbostic /*
2357117Smuller  * Constants used to specify the legal sets of flags in pax. For each major
2457117Smuller  * operation mode of pax, a set of illegal flags is defined. If any one of
2557117Smuller  * those illegal flags are found set, we scream and exit
2657117Smuller  */
2757117Smuller #define NONE	"none"
2857117Smuller 
2957117Smuller /*
3057117Smuller  * flags (one for each option).
3157117Smuller  */
3257117Smuller #define	AF	0x00000001
3357117Smuller #define	BF	0x00000002
3457117Smuller #define	CF	0x00000004
3557117Smuller #define	DF	0x00000008
3657117Smuller #define	FF	0x00000010
3757117Smuller #define	IF	0x00000020
3857117Smuller #define	KF	0x00000040
3957117Smuller #define	LF	0x00000080
4057117Smuller #define	NF	0x00000100
4157117Smuller #define	OF	0x00000200
4257117Smuller #define	PF	0x00000400
4357117Smuller #define	RF	0x00000800
4457117Smuller #define	SF	0x00001000
4557117Smuller #define	TF	0x00002000
4657117Smuller #define	UF	0x00004000
4757117Smuller #define	VF	0x00008000
4857117Smuller #define	WF	0x00010000
4957117Smuller #define	XF	0x00020000
5057117Smuller #define	CBF	0x00040000	/* nonstandard extension */
5157541Smuller #define	CDF	0x00080000	/* nonstandard extension */
5257541Smuller #define	CEF	0x00100000	/* nonstandard extension */
5357541Smuller #define	CGF	0x00200000	/* nonstandard extension */
5457541Smuller #define	CHF	0x00400000	/* nonstandard extension */
55*66890Sbostic #define	CLF	0x00800000	/* nonstandard extension */
56*66890Sbostic #define	CPF	0x01000000	/* nonstandard extension */
57*66890Sbostic #define	CTF	0x02000000	/* nonstandard extension */
58*66890Sbostic #define	CUF	0x04000000	/* nonstandard extension */
59*66890Sbostic #define	CXF	0x08000000
60*66890Sbostic #define	CYF	0x10000000	/* nonstandard extension */
61*66890Sbostic #define	CZF	0x20000000	/* nonstandard extension */
6257117Smuller 
6357117Smuller /*
6457117Smuller  * ascii string indexed by bit position above (alter the above and you must
6557117Smuller  * alter this string) used to tell the user what flags caused us to complain
6657117Smuller  */
67*66890Sbostic #define FLGCH	"abcdfiklnoprstuvwxBDEGHLPTUXYZ"
6857117Smuller 
6957117Smuller /*
7057117Smuller  * legal pax operation bit patterns
7157117Smuller  */
7257117Smuller 
7357117Smuller #define ISLIST(x)	(((x) & (RF|WF)) == 0)
7457117Smuller #define	ISEXTRACT(x)	(((x) & (RF|WF)) == RF)
7557117Smuller #define ISARCHIVE(x)	(((x) & (AF|RF|WF)) == WF)
7657117Smuller #define ISAPPND(x)	(((x) & (AF|RF|WF)) == (AF|WF))
7757117Smuller #define	ISCOPY(x)	(((x) & (RF|WF)) == (RF|WF))
7857117Smuller #define	ISWRITE(x)	(((x) & (RF|WF)) == WF)
7957117Smuller 
8057117Smuller /*
8157117Smuller  * Illegal option flag subsets based on pax operation
8257117Smuller  */
8357117Smuller 
84*66890Sbostic #define	BDEXTR	(AF|BF|LF|TF|WF|XF|CBF|CHF|CLF|CPF|CXF)
8557541Smuller #define	BDARCH	(CF|KF|LF|NF|PF|RF|CDF|CEF|CYF|CZF)
8657117Smuller #define	BDCOPY	(AF|BF|FF|OF|XF|CBF|CEF)
87*66890Sbostic #define	BDLIST (AF|BF|IF|KF|LF|OF|PF|RF|TF|UF|WF|XF|CBF|CDF|CHF|CLF|CPF|CXF|CYF|CZF)
88