xref: /freebsd/contrib/tcsh/tw.h (revision 2be1a816b9ff69588e55be0a84cbe2a31efc0f2f)
1 /* $Header: /p/tcsh/cvsroot/tcsh/tw.h,v 3.25 2006/01/12 18:15:25 christos Exp $ */
2 /*
3  * tw.h: TwENEX functions headers
4  */
5 /*-
6  * Copyright (c) 1980, 1991 The Regents of the University of California.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  */
33 #ifndef _h_tw
34 #define _h_tw
35 
36 #define TW_PATH		0x1000
37 #define TW_ZERO		0x0fff
38 
39 #define TW_NONE		0x0000
40 #define TW_COMMAND	0x0001
41 #define TW_VARIABLE	0x0002
42 #define TW_LOGNAME	0x0003
43 #define TW_FILE		0x0004
44 #define TW_DIRECTORY	0x0005
45 #define TW_VARLIST	0x0006
46 #define TW_USER		0x0007
47 #define TW_COMPLETION	0x0008
48 #define TW_ALIAS	0x0009
49 #define TW_SHELLVAR	0x000a
50 #define TW_ENVVAR	0x000b
51 #define TW_BINDING	0x000c
52 #define TW_WORDLIST	0x000d
53 #define TW_LIMIT	0x000e
54 #define TW_SIGNAL	0x000f
55 #define TW_JOB		0x0010
56 #define TW_EXPLAIN	0x0011
57 #define TW_TEXT		0x0012
58 #define TW_GRPNAME	0x0013
59 
60 #define TW_EXEC_CHK	0x01
61 #define TW_DIR_CHK	0x02
62 #define TW_TEXT_CHK	0x04
63 
64 #define TW_DIR_OK	0x10
65 #define TW_PAT_OK	0x20
66 #define TW_IGN_OK	0x40
67 
68 #ifndef TRUE
69 # define TRUE		1
70 #endif
71 #ifndef FALSE
72 # define FALSE		0
73 #endif
74 #define ON		1
75 #define OFF		0
76 #define ESC             CTL_ESC('\033')
77 
78 #define is_set(var)	adrof(var)
79 #define ismetahash(a)	(ismeta(a) && (a) != '#')
80 
81 #define SEARCHLIST "HPATH"	/* Env. param for helpfile searchlist */
82 #define DEFAULTLIST ":/usr/man/cat1:/usr/man/cat8:/usr/man/cat6:/usr/local/man/cat1:/usr/local/man/cat8:/usr/local/man/cat6"	/* if no HPATH */
83 
84 typedef enum {
85     LIST, LIST_ALL, RECOGNIZE, RECOGNIZE_ALL, RECOGNIZE_SCROLL,
86     PRINT_HELP, SPELL, GLOB, GLOB_EXPAND, VARS_EXPAND, PATH_NORMALIZE,
87     COMMAND_NORMALIZE
88 } COMMAND;
89 
90 struct scroll_tab_list {
91 	Char *element;
92 	struct scroll_tab_list *next;
93 } ;
94 
95 extern struct scroll_tab_list *scroll_tab;
96 extern int curchoice;
97 
98 extern int non_unique_match;
99 
100 extern int match_unique_match;
101 
102 extern int InsideCompletion;
103 
104 extern struct varent completions;
105 
106 extern int color_context_ls;
107 
108 #include "tw.decls.h"
109 
110 #endif /* _h_tw */
111