Deleted Added
full compact
options.h (223060) options.h (223281)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)options.h 8.2 (Berkeley) 5/4/95
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)options.h 8.2 (Berkeley) 5/4/95
33 * $FreeBSD: head/bin/sh/options.h 223060 2011-06-13 21:03:27Z jilles $
33 * $FreeBSD: head/bin/sh/options.h 223281 2011-06-18 23:43:28Z jilles $
34 */
35
36struct shparam {
37 int nparam; /* # of positional parameters (without $0) */
38 unsigned char malloc; /* if parameter list dynamically allocated */
39 unsigned char reset; /* if getopts has been reset */
40 char **p; /* parameter list */
41 char **optnext; /* next parameter to be processed by getopts */

--- 15 unchanged lines hidden (view full) ---

57#define Eflag optlist[10].val
58#define Cflag optlist[11].val
59#define aflag optlist[12].val
60#define bflag optlist[13].val
61#define uflag optlist[14].val
62#define privileged optlist[15].val
63#define Tflag optlist[16].val
64#define Pflag optlist[17].val
34 */
35
36struct shparam {
37 int nparam; /* # of positional parameters (without $0) */
38 unsigned char malloc; /* if parameter list dynamically allocated */
39 unsigned char reset; /* if getopts has been reset */
40 char **p; /* parameter list */
41 char **optnext; /* next parameter to be processed by getopts */

--- 15 unchanged lines hidden (view full) ---

57#define Eflag optlist[10].val
58#define Cflag optlist[11].val
59#define aflag optlist[12].val
60#define bflag optlist[13].val
61#define uflag optlist[14].val
62#define privileged optlist[15].val
63#define Tflag optlist[16].val
64#define Pflag optlist[17].val
65#define hflag optlist[18].val
65
66
66#define NOPTS 18
67#define NOPTS 19
67
68struct optent {
69 const char *name;
70 const char letter;
71 char val;
72};
73
74#ifdef DEFINE_OPTIONS

--- 11 unchanged lines hidden (view full) ---

86 { "emacs", 'E', 0 },
87 { "noclobber", 'C', 0 },
88 { "allexport", 'a', 0 },
89 { "notify", 'b', 0 },
90 { "nounset", 'u', 0 },
91 { "privileged", 'p', 0 },
92 { "trapsasync", 'T', 0 },
93 { "physical", 'P', 0 },
68
69struct optent {
70 const char *name;
71 const char letter;
72 char val;
73};
74
75#ifdef DEFINE_OPTIONS

--- 11 unchanged lines hidden (view full) ---

87 { "emacs", 'E', 0 },
88 { "noclobber", 'C', 0 },
89 { "allexport", 'a', 0 },
90 { "notify", 'b', 0 },
91 { "nounset", 'u', 0 },
92 { "privileged", 'p', 0 },
93 { "trapsasync", 'T', 0 },
94 { "physical", 'P', 0 },
95 { "trackall", 'h', 0 },
94};
95#else
96extern struct optent optlist[NOPTS];
97#endif
98
99
100extern char *minusc; /* argument to -c option */
101extern char *arg0; /* $0 */
102extern struct shparam shellparam; /* $@ */
103extern char **argptr; /* argument list for builtin commands */
104extern char *shoptarg; /* set by nextopt */
105extern char *nextopt_optptr; /* used by nextopt */
106
107void procargs(int, char **);
108void optschanged(void);
109void setparam(char **);
110void freeparam(struct shparam *);
111int nextopt(const char *);
112void getoptsreset(const char *);
96};
97#else
98extern struct optent optlist[NOPTS];
99#endif
100
101
102extern char *minusc; /* argument to -c option */
103extern char *arg0; /* $0 */
104extern struct shparam shellparam; /* $@ */
105extern char **argptr; /* argument list for builtin commands */
106extern char *shoptarg; /* set by nextopt */
107extern char *nextopt_optptr; /* used by nextopt */
108
109void procargs(int, char **);
110void optschanged(void);
111void setparam(char **);
112void freeparam(struct shparam *);
113int nextopt(const char *);
114void getoptsreset(const char *);