1 /*  BMORE.H
2  *
3  * 1996-02-28  V 1.0.0
4  * 1999-01-21  V 1.1.0
5  * 1999-03-17  V 1.1.1
6  * 1999-07-01  V 1.2.0 beta
7  * 1999-08-21  V 1.2.0 final
8  * 2000-05-31  V 1.3.0 beta
9  * 2000-10-04  V 1.3.0 final
10  * 2002-01-16  V 1.3.1
11  * 2003-02-20  V 1.3.2
12  * 2010-03-28  V 1.3.4
13  *
14  *  NOTE: Edit this file with tabstop=4 !
15  *
16  * Copyright 1996-2010 by Gerhard Buergmann
17  * gerhard@puon.at
18  *
19  * This program is free software; you can redistribute it and/or modify it
20  * under the terms of the GNU General Public License as published by the
21  * Free Software Foundation; either version 2, or (at your option) any
22  * later version.
23  *
24  * This program is distributed in the hope that it will be useful, but
25  * WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27  * General Public License for more details.
28  *
29  * See file COPYING for information on distribution conditions.
30  */
31 
32 #include <stdio.h>
33 #include <string.h>
34 #include <stdlib.h>
35 #include <errno.h>
36 #include <ctype.h>
37 #include <signal.h>
38 #include <sys/stat.h>
39 #include <setjmp.h>
40 
41 #if defined(__MSDOS__) && !defined(DJGPP)
42 #	include "patchlev.h"
43 #	include "dosconf.h"
44 #   include <alloc.h>
45 #	include <conio.h>
46 #	include <bios.h>
47 #else
48 #	include "patchlevel.h"
49 #	include "config.h"
50 #	include <unistd.h>
51 # if HAVE_NCURSES_H
52 #   include <ncurses.h>
53 # else
54 #   include <curses.h>
55 # endif
56 # if HAVE_TERM_H
57 #	include <term.h>
58 # else
59 #  if HAVE_NCURSES_TERM_H
60 #	include <ncurses/term.h>
61 #  else
62 #	include <term.h>
63 #  endif
64 # endif
65 #endif
66 
67 
68 /* defines for filemode */
69 #define	ERROR				-1
70 #define REGULAR				0
71 #define NEW					1
72 #define DIRECTORY			2
73 #define CHARACTER_SPECIAL	3
74 #define BLOCK_SPECIAL		4
75 #define PARTIAL             5
76 
77 /* regular expressions */
78 #define END     0
79 #define ONE     1
80 #define STAR    2
81 
82 #define ASCII		1
83 #define FORWARD		0
84 #define BACKWARD	1
85 #define CR			'\r'
86 #define NL			'\n'
87 #define BS			8
88 #define	ESC			27
89 #define SEARCH		0
90 #define REPLACE		1
91 #define BVICTRL(n)		(n&0x1f)
92 
93 #ifndef NULL
94 #	define NULL		((void *)0)
95 #endif
96 
97 #ifndef TRUE
98 #	define TRUE		1
99 #	define FALSE	0
100 #endif
101 
102 #if defined(__MSDOS__) && !defined(DJGPP)
103 #	define ANSI
104 #	define PTR		char huge *
105 #	define off_t	long
106 #   define DELIM	'\\'
107 #   define  strncasecmp strnicmp
108 #   define  strcasecmp	stricmp
109 #else
110 #	define PTR		char *
111 #   define DELIM	'/'
112 #endif
113 
114 #define MAXCMD	255
115 #define BUFFER	1024
116 
117 
118 #ifdef DEBUG
119 	extern FILE *debug_fp;
120 #endif
121 
122 #ifndef HAVE_STRERROR
123 	extern  char    *sys_errlist[];
124 #endif
125 
126 extern	char	*version;
127 extern	int		maxx, maxy;
128 extern	int		ignore_case, magic;
129 extern	int		no_tty, no_intty;
130 
131 
132 
133 
134 #ifdef ANSI
135 	void	initterm(void), set_tty(void), reset_tty(void);
136 	void	cleartoeol(void), clearscreen(void), highlight(void);
137 	void	normal(void), bmbeep(void), home(void), sig(void);
138 	void	doshell(char *), emsg(char *);
139 	void	do_next(int);
140 	void	bmsearch(int);
141 	void	pushback(int, char *);
142 	int		open_file(void);
143 	int		printout(int), rdline(int, char *);
144 	int		nextchar(void), vgetc(void);
145 	int     sbracket(int, char *, int);
146 	int     bmregexec(char *);
147 	int		ascii_comp(char *, char *), hex_comp(char *, char *);
148 	void    putline(char *, int);
149 #else
150 	void	initterm(), set_tty(), reset_tty();
151 	void	cleartoeol(), clearscreen(), highlight();
152 	void	normal(), bmbeep(), home(), sig();
153 	void	doshell(), emsg();
154 	void	do_next();
155 	void	bmsearch();
156 	void	pushback();
157 	int		open_file();
158 	int		printout(), rdline();
159 	int		nextchar(), vgetc();
160 	int     sbracket();
161 	int     bmregexec();
162 	int		ascii_comp(), hex_comp();
163 	void    putline();
164 #endif
165