1 /*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992 The Regents of the University of California. 4 * 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 1.2 (Berkeley) 01/14/93 12 */ 13 14 /* 15 * Constants used to specify the legal sets of flags in pax. For each major 16 * operation mode of pax, a set of illegal flags is defined. If any one of 17 * those illegal flags are found set, we scream and exit 18 */ 19 #define NONE "none" 20 21 /* 22 * flags (one for each option). 23 */ 24 #define AF 0x00000001 25 #define BF 0x00000002 26 #define CF 0x00000004 27 #define DF 0x00000008 28 #define FF 0x00000010 29 #define IF 0x00000020 30 #define KF 0x00000040 31 #define LF 0x00000080 32 #define NF 0x00000100 33 #define OF 0x00000200 34 #define PF 0x00000400 35 #define RF 0x00000800 36 #define SF 0x00001000 37 #define TF 0x00002000 38 #define UF 0x00004000 39 #define VF 0x00008000 40 #define WF 0x00010000 41 #define XF 0x00020000 42 #define CBF 0x00040000 /* nonstandard extension */ 43 #define CDF 0x00080000 /* nonstandard extension */ 44 #define CEF 0x00100000 /* nonstandard extension */ 45 #define CGF 0x00200000 /* nonstandard extension */ 46 #define CHF 0x00400000 /* nonstandard extension */ 47 #define CLF 0x00800000 48 #define CTF 0x01000000 /* nonstandard extension */ 49 #define CUF 0x02000000 /* nonstandard extension */ 50 #define CXF 0x04000000 51 #define CYF 0x08000000 /* nonstandard extension */ 52 #define CZF 0x10000000 /* nonstandard extension */ 53 54 /* 55 * ascii string indexed by bit position above (alter the above and you must 56 * alter this string) used to tell the user what flags caused us to complain 57 */ 58 #define FLGCH "abcdfiklnoprstuvwxBDEGHLTUXYZ" 59 60 /* 61 * legal pax operation bit patterns 62 */ 63 64 #define ISLIST(x) (((x) & (RF|WF)) == 0) 65 #define ISEXTRACT(x) (((x) & (RF|WF)) == RF) 66 #define ISARCHIVE(x) (((x) & (AF|RF|WF)) == WF) 67 #define ISAPPND(x) (((x) & (AF|RF|WF)) == (AF|WF)) 68 #define ISCOPY(x) (((x) & (RF|WF)) == (RF|WF)) 69 #define ISWRITE(x) (((x) & (RF|WF)) == WF) 70 71 /* 72 * Illegal option flag subsets based on pax operation 73 */ 74 75 #define BDEXTR (AF|BF|LF|TF|WF|XF|CBF|CHF|CLF|CXF) 76 #define BDARCH (CF|KF|LF|NF|PF|RF|CDF|CEF|CYF|CZF) 77 #define BDCOPY (AF|BF|FF|OF|XF|CBF|CEF) 78 #define BDLIST (AF|BF|IF|KF|LF|OF|PF|RF|TF|UF|WF|XF|CBF|CDF|CHF|CLF|CXF|CYF|CZF) 79