File: tcurses.h

package info (click to toggle)
tin 981002-2
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 3,088 kB
  • ctags: 4,969
  • sloc: ansic: 46,800; sh: 1,655; makefile: 1,144; yacc: 699; perl: 103
file content (104 lines) | stat: -rw-r--r-- 2,551 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
 *  Project   : tin - a Usenet reader
 *  Module    : tcurses.h
 *  Author    : Thomas Dickey <dickey@clark.net>
 *  Created   : 02.03.1997
 *  Updated   : 02.03.1997
 *  Notes     : #include files, #defines & struct's
 *  Copyright : (c) Copyright 1997 by Thomas Dickey
 *	             You may  freely  copy or  redistribute  this software,
 *	             so  long as there is no profit made from its use, sale
 *	             trade or  reproduction.  You may not change this copy-
 *	             right notice, and it must be included in any copy made
 */

#ifndef TCURSES_H
#define TCURSES_H 1


#if defined(USE_CURSES) || defined(NEED_CURSES_H)
#	ifdef HAVE_NCURSES_H
#		include <ncurses.h>
#	else
#		undef TRUE
#		undef FALSE
#		include <curses.h>
#		ifndef TRUE
#			define	TRUE	1
#		endif
#		ifndef FALSE
#			define	FALSE	0
#		endif
#	endif
#endif

#ifdef USE_CURSES

#ifdef USE_TRACE
#	ifdef HAVE_NOMACROS_H
#		include <nomacros.h>
#	endif
#endif /* USE_TRACE */

#if 0	/* FIXME: this has prototypes, but opens up new problems! */
#ifdef HAVE_TERM_H
#	include <term.h>
#endif
#endif /* 0 */

#define cCRLF				"\n"
#define my_flush()			my_fflush(stdout)
#define ClearScreen()			my_erase()
#define CleartoEOLN()			clrtoeol()
#define CleartoEOS()			clrtobot()
#define WriteLine(row,buffer)		write_line(row,buffer)

#define HpGlitch(func)			/*nothing*/

extern int cmdReadCh (void);

extern char *screen_contents(int row, int col, char *buffer);
extern void MoveCursor(int row,int col);
extern void my_erase(void);
extern void my_fflush(FILE *stream);
extern void my_fputc(int ch, FILE *stream);
extern void my_fputs(const char *str, FILE *stream);
extern void my_fprintf(FILE *stream, const char *fmt, ...)
#ifdef __GNUC__
	__attribute__((format(printf,2,3)))
#endif
	;
extern void my_printf(const char *fmt, ...)
#ifdef __GNUC__
	__attribute__((format(printf,1,2)))
#endif
	;
extern void my_retouch(void);
extern void refresh_color(void);
extern void write_line(int row, char *buffer);

#else	/* !USE_CURSES */

#ifdef HAVE_TERMCAP_H
#	include <termcap.h>
#endif

#define cCRLF				"\r\n"

#define	my_fputc(ch, stream)		fputc (ch, stream)
#define	my_fputs(str, stream)		fputs (str, stream)

#define my_printf			printf
#define my_fprintf			fprintf
#define my_flush()			fflush(stdout)
#define my_fflush(stream)		fflush(stream)
#define my_retouch()			ClearScreen()
#define WriteLine(row,buffer)		/*nothing*/

#define HpGlitch(func)			if (_hp_glitch) func

#endif	/* USE_CURSES/!USE_CURSES */

extern void my_dummy(void);

#endif /* !TCURSES_H */