aboutsummaryrefslogtreecommitdiff
path: root/pkg/cl/clmodes.h
blob: 87d9f4aa165a058a31b8b32aff9249776ce1727b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * CLMODES.H -- Return a boolean result for the state of the various cl modes.
 * Done by referring to the pointers declared in modes.c.
 * The pointers are set up initially from the entry of the corresponding
 *   parameter in the cl's pfile. see setclmodes() in modes.c.
 *   abbreviations is hairy enough that is a real function in modes.c.
 * A NULL pointer results in false, as does an undefined or indefinite value.
 */

extern struct param *clecho;
#define	echocmds()	(clecho != NULL && \
			    !(clecho->p_type & (OT_UNDEF|OT_INDEF)) && \
			    clecho->p_val.v_i)

extern struct param *clnotify;
#define	notify()	(clnotify != NULL && \
			    !(clnotify->p_type & (OT_UNDEF|OT_INDEF)) && \
			    clnotify->p_val.v_i)

extern struct param *clmenus;
#define	menus()		(clmenus != NULL && \
			    !(clmenus->p_type & (OT_UNDEF|OT_INDEF)) && \
			    clmenus->p_val.v_i)

extern struct param *clshowtype;
#define	showtype()	(clshowtype != NULL && \
			    !(clshowtype->p_type & (OT_UNDEF|OT_INDEF)) && \
			    clshowtype->p_val.v_i)

extern struct param *clkeeplog;
#define	keeplog()	(clkeeplog != NULL && \
			    !(clkeeplog->p_type & (OT_UNDEF|OT_INDEF)) && \
			    clkeeplog->p_val.v_i)

extern struct param *cllexmodes;
#define	lexmodes()	(cllexmodes != NULL && \
			    !(cllexmodes->p_type & (OT_UNDEF|OT_INDEF)) && \
			    cllexmodes->p_val.v_i)

/* Return a pointer to the name of the logfile, or NULL if not defined.
 */
extern struct param *cllogfile;
#define	logfile() \
	((cllogfile == NULL || (cllogfile->p_type & (OT_UNDEF|OT_INDEF))) ? \
	NULL : cllogfile->p_val.v_s)

/* Flags and macros for logging control.
 */
extern int	cllogmode;		/* NOT a *(struct param), see modes.c */

#define log_commands()		(cllogmode & LOG_COMMANDS)
#define log_background() 	(cllogmode & LOG_BACKGROUND)
#define log_errors() 		(cllogmode & LOG_ERRORS)
#define log_trace() 		(cllogmode & LOG_TRACE)

#define LOG_COMMANDS   0001
#define LOG_BACKGROUND 0002
#define LOG_ERRORS     0004
#define LOG_TRACE      0010

/* CL parameters for Eparam and Ehistory options.
 */
extern int 	ep_standout, 
		ep_showall;
extern int	eh_standout,
		eh_verify, 
		eh_bol;