1 /*
2      ATP QWK MAIL READER FOR READING AND REPLYING TO QWK MAIL PACKETS.
3      Copyright (C) 1992, 1993, 1997  Thomas McWilliams
4      Copyright (C) 1990  Rene Cougnenc
5 
6      This program is free software; you can redistribute it and/or modify
7      it under the terms of the GNU General Public License as published by
8      the Free Software Foundation; either version 2, or (at your option)
9      any later version.
10 
11      This program is distributed in the hope that it will be useful,
12      but WITHOUT ANY WARRANTY; without even the implied warranty of
13      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14      GNU General Public License for more details.
15 
16      You should have received a copy of the GNU General Public License
17      along with this program; if not, write to the Free Software
18      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 
20 */
21 
22 /*
23 ansi.h
24 */
25 
26 #ifndef _ATP_ANSI_H
27 #define _ATP_ANSI_H 1
28 
29 #if defined(HAVE_TERMCAP_H)
30 #  include <termcap.h>
31 #elif defined(SYS_UNIX)
32 
33 #if !defined(EXTERNC)
34 # if defined(__cplusplus)
35 #   define EXTERNC extern "C"
36 # else
37 #   define EXTERNC extern
38 # endif
39 #endif
40 
41 extern char PC;
42 extern char *UP;
43 extern char *BC;
44 extern short ospeed;
45 EXTERNC int tgetnum (const char *name);
46 EXTERNC int tgetflag (const char *name);
47 EXTERNC char *tgetstr (const char *name, char **area);
48 EXTERNC int tgetent (char *buffer, const char *trment);
49 EXTERNC char *tgoto (const char *cstring, int hpos, int vpos);
50 EXTERNC void tputs (const char *string, int nlines, int (*outfun)(int));
51 EXTERNC char *tparam (const char *ctlstring, char *buffer, int size, ...);
52 #endif
53 
54 /* termcap pointers in editline.c */
55 #if 0
56 /* not extern for this module */
57 extern char *backspace ;
58 extern char *home ;
59 #endif
60 extern char *blink_on  ;
61 extern char *bold_on ;
62 extern char *clear_attr ;
63 extern char *clear_scr ;
64 extern char *cur_right ;
65 extern char *del_eol;
66 extern char *rev_on    ;
67 extern char *rev_off   ;
68 
69 /***** externals in ansi.c *******/
70 #ifndef _ATP_READLIB_H
71 /* attributes used by atp */
72 extern  void blink(void );
73 extern  void clear(void );
74 extern  void cls(void );
75 extern  void deleol(void );
76 extern  void high(void );
77 
78 
79 /* colors used in atp */
80 extern  void blue(void );
81 extern  void bblack(void );
82 extern  void cyan(void );
83 extern  void green(void );
84 extern  void magenta(void );
85 extern  void red(void );
86 extern  void white(void );
87 extern  void yellow(void );
88 
89 extern atp_BOOL_T graph_togl(atp_BOOL_T);
90 extern void sig_init( void );
91 extern void sig_chwin( void );
92 extern void sig_chint( void );
93 extern void sig_stopfind( void );
94 extern void sig_ignore( int signo );
95 
96 extern int    tputs_cat ( char *bfr, char *attr );
97 extern char * tputs_ptr ( char *attr );
98 extern int    tputs_cpy ( char *bfr, char *attr );
99 extern char * tputs_dup ( char *attr );
100 #endif
101 
102 /* define prompts and ansi sequences for prompts */
103 
104 #ifndef SRMPT
105 #define	SRMPT  "%s [ %s ] > "  /* format string for simple prompt  */
106 #define PFROM  "      From: "
107 #define PRTO   "        To: "
108 #define PSUBJ  "   Subject: "
109 #define PSECR  "  Security: "
110 #define PTAIL  "[  ]        "
111 #define A_BLINK  "\33[5m"
112 #define A_CLEAR  "\33[0m"
113 #define A_GREEN  "\33[32m"
114 #define A_HIGH   "\33[1m"
115 #define A_WHIT   "\33[37m"
116 #define A_REV_ON "\33[7m"
117 #define A_REV_OFF "\33[m"
118 #define VT220_REV_OFF "\33[27m"
119 #define LEFT35 "\33[35D"
120 #define RGHT25 "\33[25C"
121 #define LEFT57 "\33[57D"
122 #define RGHT54 "\33[54C"
123 #define PRVERR "\155\145\162\144\145"
124 #define PRTAIL "[ " RGHT25 " ]        " LEFT35 A_WHIT
125 #define LRTAIL "[ " RGHT54 " ] " LEFT57 A_WHIT
126 
127 #ifdef no_proto
128 #define PRMT1  "\33[32m\33[1m%s [ %s ] > "
129 #define PRMT2  "\33[32m\33[1m%s [ \33[5m%s\33[0m\33[32m\33[1m ] > "
130 #define PRMTTO  "\33[32m        To: [ \33[25C ]        \33[35D\33[37m"
131 #define PRMTFR  "\33[32m      From: [ \33[25C ]        \33[35D\33[37m"
132 #define PRMTSB  "\33[32m   Subject: [ \33[25C ]        \33[35D\33[37m"
133 #define PRMTSL  "\33[32m   Subject: [ \33[54C ] \33[57D\33[37m"
134 #define PRMTSC  "\33[32m  Security: [ \33[25C ]        \33[35D\33[37m"
135 #else /* ANSI C compiler */
136 #define PRMT1  A_GREEN A_HIGH SRMPT
137 #define PRMT2  A_GREEN A_HIGH "%s [ " A_BLINK "%s" A_CLEAR A_GREEN A_HIGH " ] > "
138 #define PRMTFR A_GREEN PFROM PRTAIL
139 #define PRMTTO A_GREEN PRTO  PRTAIL
140 #define PRMTSB A_GREEN PSUBJ PRTAIL
141 #define PRMTSL A_GREEN PSUBJ LRTAIL
142 #define PRMTSC A_GREEN PSECR PRTAIL
143 #endif
144 
145 #define SRMTFR "      From: "
146 #define SRMTTO "        To: "
147 #define SRMTSB "   Subject: "
148 #define SRMTSC "  Security: "
149 
150 #endif
151 
152 
153 /* not used in atp */
154 #if 0
155 extern  void reverse(void );
156 extern  void black(void );
157 extern  void bred(void );
158 extern  void bgreen(void );
159 extern  void byellow(void );
160 extern  void bblue(void );
161 extern  void bmagenta(void );
162 extern  void bcyan(void );
163 extern  void bwhite(void );
164 extern  void locate(int x,int y);
165 extern  void up(int nb);
166 extern  void dn(int nb);
167 extern  void right(int nb);
168 extern  void left(int nb);
169 #endif
170 
171 #endif /* _ATP_ANSI_H */
172