-
Notifications
You must be signed in to change notification settings - Fork 1
/
bmore.h
165 lines (147 loc) · 3.5 KB
/
bmore.h
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* BMORE.H
*
* 1996-02-28 V 1.0.0
* 1999-01-21 V 1.1.0
* 1999-03-17 V 1.1.1
* 1999-07-01 V 1.2.0 beta
* 1999-08-21 V 1.2.0 final
* 2000-05-31 V 1.3.0 beta
* 2000-10-04 V 1.3.0 final
* 2002-01-16 V 1.3.1
* 2003-02-20 V 1.3.2
* 2010-03-28 V 1.3.4
* 2019-01-22 V 1.4.1
*
* NOTE: Edit this file with tabstop=4 !
*
* Copyright 1996-2019 by Gerhard Buergmann
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* See file COPYING for information on distribution conditions.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <signal.h>
#include <sys/stat.h>
#include <setjmp.h>
#if defined(__MSDOS__) && !defined(DJGPP)
# include "patchlev.h"
# include "dosconf.h"
# include <alloc.h>
# include <conio.h>
# include <bios.h>
#else
# include "patchlevel.h"
# include "config.h"
# include <unistd.h>
# if HAVE_NCURSES_H
# include <ncurses.h>
# else
# include <curses.h>
# endif
# if HAVE_TERM_H
# include <term.h>
# else
# if HAVE_NCURSES_TERM_H
# include <ncurses/term.h>
# else
# include <term.h>
# endif
# endif
#endif
/* defines for filemode */
#define ERROR -1
#define REGULAR 0
#define NEW 1
#define DIRECTORY 2
#define CHARACTER_SPECIAL 3
#define BLOCK_SPECIAL 4
#define PARTIAL 5
/* regular expressions */
#define END 0
#define ONE 1
#define STAR 2
#define ASCII 1
#define FORWARD 0
#define BACKWARD 1
#define CR '\r'
#define NL '\n'
#define BS 8
#define ESC 27
#define SEARCH 0
#define REPLACE 1
#define BVICTRL(n) (n&0x1f)
#ifndef NULL
# define NULL ((void *)0)
#endif
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#if defined(__MSDOS__) && !defined(DJGPP)
# define ANSI
# define PTR char huge *
# define off_t long
# define DELIM '\\'
# define strncasecmp strnicmp
# define strcasecmp stricmp
#else
# define PTR char *
# define DELIM '/'
#endif
#define MAXCMD 255
#define BUFFER 1024
#ifdef DEBUG
extern FILE *debug_fp;
#endif
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#endif
extern char *version;
extern int maxx, maxy;
extern int ignore_case, magic;
extern int no_tty, no_intty;
#ifdef ANSI
void initterm(void), set_tty(void), reset_tty(void);
void cleartoeol(void), clearscreen(void), highlight(void);
void normal(void), bmbeep(void), home(void), sig(void);
void doshell(char *), emsg(char *);
void do_next(int);
void bmsearch(int);
void pushback(int, char *);
int open_file(void);
int printout(int), rdline(int, char *);
int nextchar(void), vgetc(void);
int sbracket(int, char *, int);
int bmregexec(char *);
int ascii_comp(char *, char *), hex_comp(char *, char *);
void putline(char *, int);
#else
void initterm(), set_tty(), reset_tty();
void cleartoeol(), clearscreen(), highlight();
void normal(), bmbeep(), home(), sig();
void doshell(), emsg();
void do_next();
void bmsearch();
void pushback();
int open_file();
int printout(), rdline();
int nextchar(), vgetc();
int sbracket();
int bmregexec();
int ascii_comp(), hex_comp();
void putline();
#endif