1*10898Sroland.mainz@nrubsig.org /***********************************************************************
2*10898Sroland.mainz@nrubsig.org *                                                                      *
3*10898Sroland.mainz@nrubsig.org *               This software is part of the ast package               *
4*10898Sroland.mainz@nrubsig.org *          Copyright (c) 1982-2009 AT&T Intellectual Property          *
5*10898Sroland.mainz@nrubsig.org *                      and is licensed under the                       *
6*10898Sroland.mainz@nrubsig.org *                  Common Public License, Version 1.0                  *
7*10898Sroland.mainz@nrubsig.org *                    by AT&T Intellectual Property                     *
8*10898Sroland.mainz@nrubsig.org *                                                                      *
9*10898Sroland.mainz@nrubsig.org *                A copy of the License is available at                 *
10*10898Sroland.mainz@nrubsig.org *            http://www.opensource.org/licenses/cpl1.0.txt             *
11*10898Sroland.mainz@nrubsig.org *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12*10898Sroland.mainz@nrubsig.org *                                                                      *
13*10898Sroland.mainz@nrubsig.org *              Information and Software Systems Research               *
14*10898Sroland.mainz@nrubsig.org *                            AT&T Research                             *
15*10898Sroland.mainz@nrubsig.org *                           Florham Park NJ                            *
16*10898Sroland.mainz@nrubsig.org *                                                                      *
17*10898Sroland.mainz@nrubsig.org *                  David Korn <dgk@research.att.com>                   *
18*10898Sroland.mainz@nrubsig.org *                                                                      *
19*10898Sroland.mainz@nrubsig.org ***********************************************************************/
20*10898Sroland.mainz@nrubsig.org #pragma prototyped
21*10898Sroland.mainz@nrubsig.org /*
22*10898Sroland.mainz@nrubsig.org  * David Korn
23*10898Sroland.mainz@nrubsig.org  * AT&T Labs
24*10898Sroland.mainz@nrubsig.org  *
25*10898Sroland.mainz@nrubsig.org  * Shell interface private definitions
26*10898Sroland.mainz@nrubsig.org  *
27*10898Sroland.mainz@nrubsig.org  */
28*10898Sroland.mainz@nrubsig.org 
29*10898Sroland.mainz@nrubsig.org #ifndef _REGRESS_H
30*10898Sroland.mainz@nrubsig.org #define _REGRESS_H		1
31*10898Sroland.mainz@nrubsig.org 
32*10898Sroland.mainz@nrubsig.org #if SHOPT_REGRESS
33*10898Sroland.mainz@nrubsig.org 
34*10898Sroland.mainz@nrubsig.org typedef struct Regress_s
35*10898Sroland.mainz@nrubsig.org {
36*10898Sroland.mainz@nrubsig.org 	Shopt_t	options;
37*10898Sroland.mainz@nrubsig.org } Regress_t;
38*10898Sroland.mainz@nrubsig.org 
39*10898Sroland.mainz@nrubsig.org #define sh_isregress(r)		is_option(&sh.regress->options,r)
40*10898Sroland.mainz@nrubsig.org #define sh_onregress(r)		on_option(&sh.regress->options,r)
41*10898Sroland.mainz@nrubsig.org #define sh_offregress(r)	off_option(&sh.regress->options,r)
42*10898Sroland.mainz@nrubsig.org 
43*10898Sroland.mainz@nrubsig.org #define REGRESS(r,i,f)		do { if (sh_isregress(REGRESS_##r)) sh_regress(REGRESS_##r, i, sfprints f, __LINE__, __FILE__); } while (0)
44*10898Sroland.mainz@nrubsig.org 
45*10898Sroland.mainz@nrubsig.org #define REGRESS_egid		1
46*10898Sroland.mainz@nrubsig.org #define REGRESS_euid		2
47*10898Sroland.mainz@nrubsig.org #define REGRESS_p_suid		3
48*10898Sroland.mainz@nrubsig.org #define REGRESS_source		4
49*10898Sroland.mainz@nrubsig.org #define REGRESS_etc		5
50*10898Sroland.mainz@nrubsig.org 
51*10898Sroland.mainz@nrubsig.org #undef	SHOPT_P_SUID
52*10898Sroland.mainz@nrubsig.org #define SHOPT_P_SUID		sh_regress_p_suid(__LINE__, __FILE__)
53*10898Sroland.mainz@nrubsig.org 
54*10898Sroland.mainz@nrubsig.org extern int			b___regress__(int, char**, void*);
55*10898Sroland.mainz@nrubsig.org extern void			sh_regress_init(Shell_t*);
56*10898Sroland.mainz@nrubsig.org extern void			sh_regress(unsigned int, const char*, const char*, unsigned int, const char*);
57*10898Sroland.mainz@nrubsig.org extern uid_t			sh_regress_p_suid(unsigned int, const char*);
58*10898Sroland.mainz@nrubsig.org extern char*			sh_regress_etc(const char*, unsigned int, const char*);
59*10898Sroland.mainz@nrubsig.org 
60*10898Sroland.mainz@nrubsig.org #else
61*10898Sroland.mainz@nrubsig.org 
62*10898Sroland.mainz@nrubsig.org #define REGRESS(r,i,f)
63*10898Sroland.mainz@nrubsig.org 
64*10898Sroland.mainz@nrubsig.org #endif /* SHOPT_REGRESS */
65*10898Sroland.mainz@nrubsig.org 
66*10898Sroland.mainz@nrubsig.org #endif /* _REGRESS_H */
67