11556Srgrimes/*-
21556Srgrimes * Copyright (c) 1992 Keith Muller.
31556Srgrimes * Copyright (c) 1992, 1993
41556Srgrimes *	The Regents of the University of California.  All rights reserved.
51556Srgrimes *
61556Srgrimes * This code is derived from software contributed to Berkeley by
71556Srgrimes * Keith Muller of the University of California, San Diego.
81556Srgrimes *
91556Srgrimes * Redistribution and use in source and binary forms, with or without
101556Srgrimes * modification, are permitted provided that the following conditions
111556Srgrimes * are met:
121556Srgrimes * 1. Redistributions of source code must retain the above copyright
131556Srgrimes *    notice, this list of conditions and the following disclaimer.
141556Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
151556Srgrimes *    notice, this list of conditions and the following disclaimer in the
161556Srgrimes *    documentation and/or other materials provided with the distribution.
171556Srgrimes * 4. Neither the name of the University nor the names of its contributors
181556Srgrimes *    may be used to endorse or promote products derived from this software
191556Srgrimes *    without specific prior written permission.
201556Srgrimes *
211556Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221556Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231556Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241556Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251556Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261556Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271556Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281556Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291556Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301556Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311556Srgrimes * SUCH DAMAGE.
321556Srgrimes *
331556Srgrimes *	@(#)options.h	8.2 (Berkeley) 4/18/94
3450471Speter * $FreeBSD$
351556Srgrimes */
361556Srgrimes
371556Srgrimes/*
381556Srgrimes * argv[0] names. Used for tar and cpio emulation
391556Srgrimes */
401556Srgrimes
411556Srgrimes#define NM_TAR  "tar"
421556Srgrimes#define NM_CPIO "cpio"
431556Srgrimes#define NM_PAX  "pax"
441556Srgrimes
451556Srgrimes/*
461556Srgrimes * Constants used to specify the legal sets of flags in pax. For each major
471556Srgrimes * operation mode of pax, a set of illegal flags is defined. If any one of
481556Srgrimes * those illegal flags are found set, we scream and exit
491556Srgrimes */
501556Srgrimes#define NONE	"none"
511556Srgrimes
521556Srgrimes/*
531556Srgrimes * flags (one for each option).
541556Srgrimes */
551556Srgrimes#define	AF	0x00000001
561556Srgrimes#define	BF	0x00000002
571556Srgrimes#define	CF	0x00000004
581556Srgrimes#define	DF	0x00000008
591556Srgrimes#define	FF	0x00000010
601556Srgrimes#define	IF	0x00000020
611556Srgrimes#define	KF	0x00000040
621556Srgrimes#define	LF	0x00000080
631556Srgrimes#define	NF	0x00000100
641556Srgrimes#define	OF	0x00000200
651556Srgrimes#define	PF	0x00000400
661556Srgrimes#define	RF	0x00000800
671556Srgrimes#define	SF	0x00001000
681556Srgrimes#define	TF	0x00002000
691556Srgrimes#define	UF	0x00004000
701556Srgrimes#define	VF	0x00008000
711556Srgrimes#define	WF	0x00010000
721556Srgrimes#define	XF	0x00020000
731556Srgrimes#define	CBF	0x00040000	/* nonstandard extension */
741556Srgrimes#define	CDF	0x00080000	/* nonstandard extension */
751556Srgrimes#define	CEF	0x00100000	/* nonstandard extension */
761556Srgrimes#define	CGF	0x00200000	/* nonstandard extension */
771556Srgrimes#define	CHF	0x00400000	/* nonstandard extension */
781556Srgrimes#define	CLF	0x00800000	/* nonstandard extension */
791556Srgrimes#define	CPF	0x01000000	/* nonstandard extension */
801556Srgrimes#define	CTF	0x02000000	/* nonstandard extension */
811556Srgrimes#define	CUF	0x04000000	/* nonstandard extension */
821556Srgrimes#define	CXF	0x08000000
831556Srgrimes#define	CYF	0x10000000	/* nonstandard extension */
841556Srgrimes#define	CZF	0x20000000	/* nonstandard extension */
851556Srgrimes
861556Srgrimes/*
871556Srgrimes * ascii string indexed by bit position above (alter the above and you must
881556Srgrimes * alter this string) used to tell the user what flags caused us to complain
891556Srgrimes */
901556Srgrimes#define FLGCH	"abcdfiklnoprstuvwxBDEGHLPTUXYZ"
911556Srgrimes
921556Srgrimes/*
931556Srgrimes * legal pax operation bit patterns
941556Srgrimes */
951556Srgrimes
961556Srgrimes#define ISLIST(x)	(((x) & (RF|WF)) == 0)
971556Srgrimes#define	ISEXTRACT(x)	(((x) & (RF|WF)) == RF)
981556Srgrimes#define ISARCHIVE(x)	(((x) & (AF|RF|WF)) == WF)
991556Srgrimes#define ISAPPND(x)	(((x) & (AF|RF|WF)) == (AF|WF))
1001556Srgrimes#define	ISCOPY(x)	(((x) & (RF|WF)) == (RF|WF))
1011556Srgrimes#define	ISWRITE(x)	(((x) & (RF|WF)) == WF)
1021556Srgrimes
1031556Srgrimes/*
1041556Srgrimes * Illegal option flag subsets based on pax operation
1051556Srgrimes */
1061556Srgrimes
1071556Srgrimes#define	BDEXTR	(AF|BF|LF|TF|WF|XF|CBF|CHF|CLF|CPF|CXF)
1081556Srgrimes#define	BDARCH	(CF|KF|LF|NF|PF|RF|CDF|CEF|CYF|CZF)
1091556Srgrimes#define	BDCOPY	(AF|BF|FF|OF|XF|CBF|CEF)
1101556Srgrimes#define	BDLIST (AF|BF|IF|KF|LF|OF|PF|RF|TF|UF|WF|XF|CBF|CDF|CHF|CLF|CPF|CXF|CYF|CZF)
111