xref: /freebsd/contrib/tcsh/tc.h (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
1 /*
2  * tc.h: Tcsh includes
3  */
4 /*-
5  * Copyright (c) 1980, 1991 The Regents of the University of California.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the University nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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 #ifndef _h_tc
33 #define _h_tc
34 
35 #ifndef _h_tc_const
36 /* Don't include it while we are making it. */
37 # include "tc.const.h"
38 #endif /* _h_tc_const */
39 #include "tc.os.h"
40 #include "tc.sig.h"
41 #include "tc.decls.h"
42 
43 extern size_t tlength;
44 
45 #define FMT_PROMPT	0
46 #define FMT_WHO		1
47 #define FMT_HISTORY	2
48 #define FMT_SCHED	3
49 
50 struct strbuf {
51     char *s;
52     size_t len;			/* Valid characters */
53     size_t size;		/* Allocated characters */
54 };
55 
56 struct Strbuf {
57     Char *s;
58     size_t len;			/* Valid characters */
59     size_t size;		/* Allocated characters */
60 };
61 
62 /* We don't have explicit initializers for variables with static storage
63    duration, so these values should be equivalent to default initialization. */
64 #define strbuf_INIT { NULL, 0, 0 }
65 #define Strbuf_INIT { NULL, 0, 0 }
66 extern const struct strbuf strbuf_init;
67 extern const struct Strbuf Strbuf_init;
68 
69 /* A string vector in progress */
70 struct blk_buf
71 {
72     Char **vec;
73     size_t len;			/* Valid strings */
74     size_t size;		/* Allocated space for string pointers */
75 };
76 
77 #define BLK_BUF_INIT { NULL, 0, 0 }
78 
79 #endif /* _h_tc */
80