xref: /freebsd/bin/pax/options.h (revision fbbd9655e5107c68e4e0146ff22b73d7350475bc)
14b88c807SRodney W. Grimes /*-
24b88c807SRodney W. Grimes  * Copyright (c) 1992 Keith Muller.
34b88c807SRodney W. Grimes  * Copyright (c) 1992, 1993
44b88c807SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
54b88c807SRodney W. Grimes  *
64b88c807SRodney W. Grimes  * This code is derived from software contributed to Berkeley by
74b88c807SRodney W. Grimes  * Keith Muller of the University of California, San Diego.
84b88c807SRodney W. Grimes  *
94b88c807SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
104b88c807SRodney W. Grimes  * modification, are permitted provided that the following conditions
114b88c807SRodney W. Grimes  * are met:
124b88c807SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
134b88c807SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
144b88c807SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
154b88c807SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
164b88c807SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
17*fbbd9655SWarner Losh  * 3. Neither the name of the University nor the names of its contributors
184b88c807SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
194b88c807SRodney W. Grimes  *    without specific prior written permission.
204b88c807SRodney W. Grimes  *
214b88c807SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
224b88c807SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
234b88c807SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
244b88c807SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
254b88c807SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
264b88c807SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
274b88c807SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
284b88c807SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
294b88c807SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
304b88c807SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
314b88c807SRodney W. Grimes  * SUCH DAMAGE.
324b88c807SRodney W. Grimes  *
334b88c807SRodney W. Grimes  *	@(#)options.h	8.2 (Berkeley) 4/18/94
342a456239SPeter Wemm  * $FreeBSD$
354b88c807SRodney W. Grimes  */
364b88c807SRodney W. Grimes 
374b88c807SRodney W. Grimes /*
384b88c807SRodney W. Grimes  * argv[0] names. Used for tar and cpio emulation
394b88c807SRodney W. Grimes  */
404b88c807SRodney W. Grimes 
414b88c807SRodney W. Grimes #define NM_TAR  "tar"
424b88c807SRodney W. Grimes #define NM_CPIO "cpio"
434b88c807SRodney W. Grimes #define NM_PAX  "pax"
444b88c807SRodney W. Grimes 
454b88c807SRodney W. Grimes /*
464b88c807SRodney W. Grimes  * Constants used to specify the legal sets of flags in pax. For each major
474b88c807SRodney W. Grimes  * operation mode of pax, a set of illegal flags is defined. If any one of
484b88c807SRodney W. Grimes  * those illegal flags are found set, we scream and exit
494b88c807SRodney W. Grimes  */
504b88c807SRodney W. Grimes #define NONE	"none"
514b88c807SRodney W. Grimes 
524b88c807SRodney W. Grimes /*
534b88c807SRodney W. Grimes  * flags (one for each option).
544b88c807SRodney W. Grimes  */
554b88c807SRodney W. Grimes #define	AF	0x00000001
564b88c807SRodney W. Grimes #define	BF	0x00000002
574b88c807SRodney W. Grimes #define	CF	0x00000004
584b88c807SRodney W. Grimes #define	DF	0x00000008
594b88c807SRodney W. Grimes #define	FF	0x00000010
604b88c807SRodney W. Grimes #define	IF	0x00000020
614b88c807SRodney W. Grimes #define	KF	0x00000040
624b88c807SRodney W. Grimes #define	LF	0x00000080
634b88c807SRodney W. Grimes #define	NF	0x00000100
644b88c807SRodney W. Grimes #define	OF	0x00000200
654b88c807SRodney W. Grimes #define	PF	0x00000400
664b88c807SRodney W. Grimes #define	RF	0x00000800
674b88c807SRodney W. Grimes #define	SF	0x00001000
684b88c807SRodney W. Grimes #define	TF	0x00002000
694b88c807SRodney W. Grimes #define	UF	0x00004000
704b88c807SRodney W. Grimes #define	VF	0x00008000
714b88c807SRodney W. Grimes #define	WF	0x00010000
724b88c807SRodney W. Grimes #define	XF	0x00020000
734b88c807SRodney W. Grimes #define	CBF	0x00040000	/* nonstandard extension */
744b88c807SRodney W. Grimes #define	CDF	0x00080000	/* nonstandard extension */
754b88c807SRodney W. Grimes #define	CEF	0x00100000	/* nonstandard extension */
764b88c807SRodney W. Grimes #define	CGF	0x00200000	/* nonstandard extension */
774b88c807SRodney W. Grimes #define	CHF	0x00400000	/* nonstandard extension */
784b88c807SRodney W. Grimes #define	CLF	0x00800000	/* nonstandard extension */
794b88c807SRodney W. Grimes #define	CPF	0x01000000	/* nonstandard extension */
804b88c807SRodney W. Grimes #define	CTF	0x02000000	/* nonstandard extension */
814b88c807SRodney W. Grimes #define	CUF	0x04000000	/* nonstandard extension */
824b88c807SRodney W. Grimes #define	CXF	0x08000000
834b88c807SRodney W. Grimes #define	CYF	0x10000000	/* nonstandard extension */
844b88c807SRodney W. Grimes #define	CZF	0x20000000	/* nonstandard extension */
854b88c807SRodney W. Grimes 
864b88c807SRodney W. Grimes /*
874b88c807SRodney W. Grimes  * ascii string indexed by bit position above (alter the above and you must
884b88c807SRodney W. Grimes  * alter this string) used to tell the user what flags caused us to complain
894b88c807SRodney W. Grimes  */
904b88c807SRodney W. Grimes #define FLGCH	"abcdfiklnoprstuvwxBDEGHLPTUXYZ"
914b88c807SRodney W. Grimes 
924b88c807SRodney W. Grimes /*
934b88c807SRodney W. Grimes  * legal pax operation bit patterns
944b88c807SRodney W. Grimes  */
954b88c807SRodney W. Grimes 
964b88c807SRodney W. Grimes #define ISLIST(x)	(((x) & (RF|WF)) == 0)
974b88c807SRodney W. Grimes #define	ISEXTRACT(x)	(((x) & (RF|WF)) == RF)
984b88c807SRodney W. Grimes #define ISARCHIVE(x)	(((x) & (AF|RF|WF)) == WF)
994b88c807SRodney W. Grimes #define ISAPPND(x)	(((x) & (AF|RF|WF)) == (AF|WF))
1004b88c807SRodney W. Grimes #define	ISCOPY(x)	(((x) & (RF|WF)) == (RF|WF))
1014b88c807SRodney W. Grimes #define	ISWRITE(x)	(((x) & (RF|WF)) == WF)
1024b88c807SRodney W. Grimes 
1034b88c807SRodney W. Grimes /*
1044b88c807SRodney W. Grimes  * Illegal option flag subsets based on pax operation
1054b88c807SRodney W. Grimes  */
1064b88c807SRodney W. Grimes 
1074b88c807SRodney W. Grimes #define	BDEXTR	(AF|BF|LF|TF|WF|XF|CBF|CHF|CLF|CPF|CXF)
1084b88c807SRodney W. Grimes #define	BDARCH	(CF|KF|LF|NF|PF|RF|CDF|CEF|CYF|CZF)
1094b88c807SRodney W. Grimes #define	BDCOPY	(AF|BF|FF|OF|XF|CBF|CEF)
1104b88c807SRodney W. Grimes #define	BDLIST (AF|BF|IF|KF|LF|OF|PF|RF|TF|UF|WF|XF|CBF|CDF|CHF|CLF|CPF|CXF|CYF|CZF)
111