-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathed_main.h
110 lines (98 loc) · 3.2 KB
/
ed_main.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
//
// Copyright 2015-2018 by Kevin L. Goodwin [[email protected]]; All rights reserved
//
// This file is part of K.
//
// K 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 of the License, or (at your option) any later
// version.
//
// K 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.
//
// You should have received a copy of the GNU General Public License along
// with K. If not, see <http://www.gnu.org/licenses/>.
//
#pragma once
#if !defined(WL)
// porting abbreviation tool
#if defined(_WIN32)
# define WL(ww,ll) ww
#else
# define WL(ww,ll) ll
#endif
#endif
#if defined(_WIN32)
// in order to use _stat64
// http://stackoverflow.com/questions/12539488/determine-64-bit-file-size-in-c-on-mingw-32-bit
// MUST be defined before any MINGW .h file is #included
#define __MSVCRT_VERSION__ 0x0601
#endif
#if defined(_WIN32)
// see https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/
// must define __USE_MINGW_ANSI_STDIO before ANY toolchain #includes
// though we're theoretically NOT supposed to be doing this http://mingw.5.n7.nabble.com/snprintf-and-USE-MINGW-ANSI-STDIO-td35399.html
#define __USE_MINGW_ANSI_STDIO 1
#endif
// std C/C++ headers
#include <cstddef>
#include <cstdarg>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#if defined(__USE_MINGW_ANSI_STDIO) && (__USE_MINGW_ANSI_STDIO != 0)
// for some reason, fprintf is excluded from the effect of __USE_MINGW_ANSI_STDIO in stdio.h ?
# define fprintf __mingw_fprintf
#endif
#include <cctype>
#include <ctime>
#include <climits>
// standard-ish C headers
#include <malloc.h> // for alloca()
#include <sys/stat.h> // for struct _stat
#if !defined(_WIN32)
// Linux-specific string fxns: strcasecmp, strncasecmp, etc.
#include "strings.h"
#endif
// std C++ headers
#include <memory>
#include <utility> // for std::move,std::swap
#include <algorithm>
#include <string>
#include <vector>
#include <array>
//***************** *****************
//***************** begin project-header includes *****************
//***************** *****************
// "feature-flags" for project-header includes
#define DEBUG_LOGGING 1
#define OLDGREP 0
#define DBGHILITE 0
#define MOUSE_SUPPORT WL(1,0)
#define VARIABLE_WINBORDER WL(1,0)
#define USE_STAT64 0
#if defined(_WIN32)
#else
#define _MAX_PATH 513
#endif
#include "my_types.h"
#include "ed_mem.h"
#include "my_strutils.h"
#include "filename.h"
#include "dlink.h"
#include "stringlist.h"
#include "krbtree.h"
#include "ed_core.h"
#include "ed_os_generic.h"
//---------------------------------
#define CMDTBL_H_CMD_TBL_PTR_MACROS
#include "cmdtbl.h"
#undef CMDTBL_H_CMD_TBL_PTR_MACROS
//---------------------------------
#include "ed_vars.h"
#include "ed_edkc.h"
#include "ed_protos.h"
#include "my_log.h"