aboutsummaryrefslogtreecommitdiffstats
path: root/src/termcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/termcap.c')
-rw-r--r--src/termcap.c51
1 files changed, 16 insertions, 35 deletions
diff --git a/src/termcap.c b/src/termcap.c
index 9b4a7f657f6..5a6d9483a51 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -127,15 +127,14 @@ xrealloc (ptr, size)
127 for tgetnum, tgetflag and tgetstr to find. */ 127 for tgetnum, tgetflag and tgetstr to find. */
128static char *term_entry; 128static char *term_entry;
129 129
130static char *tgetst1 (); 130static char *tgetst1 (char *ptr, char **area);
131 131
132/* Search entry BP for capability CAP. 132/* Search entry BP for capability CAP.
133 Return a pointer to the capability (in BP) if found, 133 Return a pointer to the capability (in BP) if found,
134 0 if not found. */ 134 0 if not found. */
135 135
136static char * 136static char *
137find_capability (bp, cap) 137find_capability (register char *bp, register char *cap)
138 register char *bp, *cap;
139{ 138{
140 for (; *bp; bp++) 139 for (; *bp; bp++)
141 if (bp[0] == ':' 140 if (bp[0] == ':'
@@ -146,8 +145,7 @@ find_capability (bp, cap)
146} 145}
147 146
148int 147int
149tgetnum (cap) 148tgetnum (char *cap)
150 char *cap;
151{ 149{
152 register char *ptr = find_capability (term_entry, cap); 150 register char *ptr = find_capability (term_entry, cap);
153 if (!ptr || ptr[-1] != '#') 151 if (!ptr || ptr[-1] != '#')
@@ -156,8 +154,7 @@ tgetnum (cap)
156} 154}
157 155
158int 156int
159tgetflag (cap) 157tgetflag (char *cap)
160 char *cap;
161{ 158{
162 register char *ptr = find_capability (term_entry, cap); 159 register char *ptr = find_capability (term_entry, cap);
163 return ptr && ptr[-1] == ':'; 160 return ptr && ptr[-1] == ':';
@@ -169,9 +166,7 @@ tgetflag (cap)
169 If AREA is null, space is allocated with `malloc'. */ 166 If AREA is null, space is allocated with `malloc'. */
170 167
171char * 168char *
172tgetstr (cap, area) 169tgetstr (char *cap, char **area)
173 char *cap;
174 char **area;
175{ 170{
176 register char *ptr = find_capability (term_entry, cap); 171 register char *ptr = find_capability (term_entry, cap);
177 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) 172 if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
@@ -209,9 +204,7 @@ static const char esctab[]
209 or NULL if PTR is NULL. */ 204 or NULL if PTR is NULL. */
210 205
211static char * 206static char *
212tgetst1 (ptr, area) 207tgetst1 (char *ptr, char **area)
213 char *ptr;
214 char **area;
215{ 208{
216 register char *p, *r; 209 register char *p, *r;
217 register int c; 210 register int c;
@@ -357,10 +350,7 @@ static const int speeds[] =
357#endif /* not emacs */ 350#endif /* not emacs */
358 351
359void 352void
360tputs (str, nlines, outfun) 353tputs (register char *str, int nlines, register int (*outfun) (/* ??? */))
361 register char *str;
362 int nlines;
363 register int (*outfun) ();
364{ 354{
365 register int padcount = 0; 355 register int padcount = 0;
366 register int speed; 356 register int speed;
@@ -432,10 +422,10 @@ struct termcap_buffer
432 422
433/* Forward declarations of static functions. */ 423/* Forward declarations of static functions. */
434 424
435static int scan_file (); 425static int scan_file (char *str, int fd, register struct termcap_buffer *bufp);
436static char *gobble_line (); 426static char *gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end);
437static int compare_contin (); 427static int compare_contin (register char *str1, register char *str2);
438static int name_match (); 428static int name_match (char *line, char *name);
439 429
440#ifdef MSDOS /* MW, May 1993 */ 430#ifdef MSDOS /* MW, May 1993 */
441static int 431static int
@@ -460,8 +450,7 @@ valid_filename_p (fn)
460 in it, and some other value otherwise. */ 450 in it, and some other value otherwise. */
461 451
462int 452int
463tgetent (bp, name) 453tgetent (char *bp, char *name)
464 char *bp, *name;
465{ 454{
466 register char *termcap_name; 455 register char *termcap_name;
467 register int fd; 456 register int fd;
@@ -625,10 +614,7 @@ tgetent (bp, name)
625 or 0 if no entry is found in the file. */ 614 or 0 if no entry is found in the file. */
626 615
627static int 616static int
628scan_file (str, fd, bufp) 617scan_file (char *str, int fd, register struct termcap_buffer *bufp)
629 char *str;
630 int fd;
631 register struct termcap_buffer *bufp;
632{ 618{
633 register char *end; 619 register char *end;
634 620
@@ -665,8 +651,7 @@ scan_file (str, fd, bufp)
665 by termcap entry LINE. */ 651 by termcap entry LINE. */
666 652
667static int 653static int
668name_match (line, name) 654name_match (char *line, char *name)
669 char *line, *name;
670{ 655{
671 register char *tem; 656 register char *tem;
672 657
@@ -681,8 +666,7 @@ name_match (line, name)
681} 666}
682 667
683static int 668static int
684compare_contin (str1, str2) 669compare_contin (register char *str1, register char *str2)
685 register char *str1, *str2;
686{ 670{
687 register int c1, c2; 671 register int c1, c2;
688 while (1) 672 while (1)
@@ -722,10 +706,7 @@ compare_contin (str1, str2)
722 thing as one line. The caller decides when a line is continued. */ 706 thing as one line. The caller decides when a line is continued. */
723 707
724static char * 708static char *
725gobble_line (fd, bufp, append_end) 709gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end)
726 int fd;
727 register struct termcap_buffer *bufp;
728 char *append_end;
729{ 710{
730 register char *end; 711 register char *end;
731 register int nread; 712 register int nread;