tw.h revision 100616
11556Srgrimes/* $Header: /src/pub/tcsh/tw.h,v 3.22 2002/03/08 17:36:47 christos Exp $ */
21556Srgrimes/*
31556Srgrimes * tw.h: TwENEX functions headers
41556Srgrimes */
51556Srgrimes/*-
61556Srgrimes * Copyright (c) 1980, 1991 The Regents of the University of California.
71556Srgrimes * All rights reserved.
81556Srgrimes *
91556Srgrimes * Redistribution and use in source and binary forms, with or without
101556Srgrimes * modification, are permitted provided that the following conditions
111556Srgrimes * are met:
121556Srgrimes * 1. Redistributions of source code must retain the above copyright
131556Srgrimes *    notice, this list of conditions and the following disclaimer.
141556Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
151556Srgrimes *    notice, this list of conditions and the following disclaimer in the
161556Srgrimes *    documentation and/or other materials provided with the distribution.
171556Srgrimes * 3. Neither the name of the University nor the names of its contributors
181556Srgrimes *    may be used to endorse or promote products derived from this software
191556Srgrimes *    without specific prior written permission.
201556Srgrimes *
211556Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221556Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231556Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241556Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251556Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261556Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271556Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281556Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291556Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301556Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311556Srgrimes * SUCH DAMAGE.
321556Srgrimes */
331556Srgrimes#ifndef _h_tw
341556Srgrimes#define _h_tw
353044Sdg
3620425Ssteve#define TW_PATH		0x1000
371556Srgrimes#define TW_ZERO		0x0fff
381556Srgrimes
391556Srgrimes#define TW_NONE		0x0000
4020425Ssteve#define TW_COMMAND	0x0001
411556Srgrimes#define TW_VARIABLE	0x0002
421556Srgrimes#define TW_LOGNAME	0x0003
4317987Speter#define TW_FILE		0x0004
4417987Speter#define TW_DIRECTORY	0x0005
4517987Speter#define TW_VARLIST	0x0006
461556Srgrimes#define TW_USER		0x0007
471556Srgrimes#define TW_COMPLETION	0x0008
481556Srgrimes#define TW_ALIAS	0x0009
491556Srgrimes#define TW_SHELLVAR	0x000a
501556Srgrimes#define TW_ENVVAR	0x000b
511556Srgrimes#define TW_BINDING	0x000c
521556Srgrimes#define TW_WORDLIST	0x000d
531556Srgrimes#define TW_LIMIT	0x000e
541556Srgrimes#define TW_SIGNAL	0x000f
551556Srgrimes#define TW_JOB		0x0010
561556Srgrimes#define TW_EXPLAIN	0x0011
571556Srgrimes#define TW_TEXT		0x0012
581556Srgrimes#define TW_GRPNAME	0x0013
591556Srgrimes
601556Srgrimes#define TW_EXEC_CHK	0x01
611556Srgrimes#define TW_DIR_CHK	0x02
621556Srgrimes#define TW_TEXT_CHK	0x04
631556Srgrimes
641556Srgrimes#define TW_DIR_OK	0x10
651556Srgrimes#define TW_PAT_OK	0x20
661556Srgrimes#define TW_IGN_OK	0x40
6717987Speter
681556Srgrimes#ifndef TRUE
6917987Speter# define TRUE		1
701556Srgrimes#endif
7117987Speter#ifndef FALSE
721556Srgrimes# define FALSE		0
731556Srgrimes#endif
741556Srgrimes#define ON		1
751556Srgrimes#define OFF		0
761556Srgrimes#define FILSIZ		BUFSIZE	/* Max reasonable file name length */
771556Srgrimes#define ESC             CTL_ESC('\033')
781556Srgrimes#define equal(a, b)	(strcmp(a, b) == 0)
791556Srgrimes
801556Srgrimes#define is_set(var)	adrof(var)
811556Srgrimes#define ismetahash(a)	(ismeta(a) && (a) != '#')
821556Srgrimes
831556Srgrimes#define SEARCHLIST "HPATH"	/* Env. param for helpfile searchlist */
841556Srgrimes#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 */
851556Srgrimes
861556Srgrimestypedef enum {
871556Srgrimes    LIST, LIST_ALL, RECOGNIZE, RECOGNIZE_ALL, RECOGNIZE_SCROLL,
8817987Speter    PRINT_HELP, SPELL, GLOB, GLOB_EXPAND, VARS_EXPAND, PATH_NORMALIZE,
891556Srgrimes    COMMAND_NORMALIZE
901556Srgrimes} COMMAND;
9117987Speter
9217987Speterstruct scroll_tab_list {
9317987Speter	Char *element;
9417987Speter	struct scroll_tab_list *next;
9517987Speter} ;
9617987Speter
9717987Speterextern struct scroll_tab_list *scroll_tab;
9817987Speterextern int curchoice;
991556Srgrimes
1001556Srgrimesextern int non_unique_match;
1011556Srgrimes
1021556Srgrimesextern int match_unique_match;
1031556Srgrimes
1041556Srgrimes#include "tw.decls.h"
1051556Srgrimes
1061556Srgrimes#endif /* _h_tw */
1071556Srgrimes