mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00

See #137 for the issue. Every header in the proto directory was: * Given include guards in the form #ifndef NEOVIM_FILENAME_H #define NEOVIM_FILENAME_H ... #endif /* NEOVIM_FILENAM_H */ * Renamed from *.pro -> *.h * Moved from src/proto/ to src/ This would have caused conficts with some existing headers in src/; rather than merge these conflicts now (which is a whole other can of worms involving multiple and conditional inclusion), any header in src/ with a conflicting name was renamed from *.h -> *_defs.h (which may or may not actually describe its purpose, the change is purely a namespacing issue). Once all of these changes were made a script was developed to determine what #includes needed to be added to each source file to describe its dependencies and allow it to compile; because the script is so short and I'll just list it here: #! /bin/bash cd $(dirname $0) # Scrapes `make` output for provided error messages and outputs #includes # needed to resolve them. # $1 : part of the clang error message between filename and identifier list_missing_includes() { for file_missing_pair in $(CC=clang make 2>&1 >/dev/null | sed -n "s/\/\(.*\.[hc]\).*$1.*'\(.*\)'.*/\1:\2/p"); do fields=(${file_missing_pair//:/ }) source_file=${fields[0]} missing_func=${fields[1]} # Try to find the declaration of the missing function. echo $(basename $source_file) \ \#include \"$(grep -r "\b$missing_func __ARGS" | sed -n "s/.*\/\(.*\)\:.*/\1/p")\" # Remove duplicates done | sort | uniq } echo "Finding missing function prototypes..." list_missing_includes "implicit declaration of function" echo "Finding missing identifier declarations..." list_missing_includes "use of undeclared identifier" Each list of required headers was added by hand in the following format: #include "vim.h" #include "*_defs.h" #include "filename.h" /* All other includes in same module here, in alphabetical order. */ /* All includes from other modules (e.g. "os/*.h") here in alphabetical * order. */
102 lines
2.8 KiB
C
102 lines
2.8 KiB
C
/* vi:set ts=8 sts=4 sw=4:
|
|
*
|
|
* VIM - Vi IMproved by Bram Moolenaar
|
|
*
|
|
* Do ":help uganda" in Vim to read copying and usage conditions.
|
|
* Do ":help credits" in Vim to see a list of people who contributed.
|
|
*/
|
|
|
|
#ifndef NEOVIM_ASCII_H
|
|
#define NEOVIM_ASCII_H
|
|
|
|
/*
|
|
* Definitions of various common control characters.
|
|
* For EBCDIC we have to use different values.
|
|
*/
|
|
|
|
|
|
/* IF_EB(ASCII_constant, EBCDIC_constant) */
|
|
#define IF_EB(a, b) a
|
|
|
|
#define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a')
|
|
#define CharOrdLow(x) ((x) - 'a')
|
|
#define CharOrdUp(x) ((x) - 'A')
|
|
#define ROT13(c, a) (((((c) - (a)) + 13) % 26) + (a))
|
|
|
|
#define NUL '\000'
|
|
#define BELL '\007'
|
|
#define BS '\010'
|
|
#define TAB '\011'
|
|
#define NL '\012'
|
|
#define NL_STR (char_u *)"\012"
|
|
#define FF '\014'
|
|
#define CAR '\015' /* CR is used by Mac OS X */
|
|
#define ESC '\033'
|
|
#define ESC_STR (char_u *)"\033"
|
|
#define ESC_STR_nc "\033"
|
|
#define DEL 0x7f
|
|
#define DEL_STR (char_u *)"\177"
|
|
#define CSI 0x9b /* Control Sequence Introducer */
|
|
#define CSI_STR "\233"
|
|
#define DCS 0x90 /* Device Control String */
|
|
#define STERM 0x9c /* String Terminator */
|
|
|
|
#define POUND 0xA3
|
|
|
|
#define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) /* '?' -> DEL, '@' -> ^@, etc. */
|
|
#define Meta(x) ((x) | 0x80)
|
|
|
|
#define CTRL_F_STR "\006"
|
|
#define CTRL_H_STR "\010"
|
|
#define CTRL_V_STR "\026"
|
|
|
|
#define Ctrl_AT 0 /* @ */
|
|
#define Ctrl_A 1
|
|
#define Ctrl_B 2
|
|
#define Ctrl_C 3
|
|
#define Ctrl_D 4
|
|
#define Ctrl_E 5
|
|
#define Ctrl_F 6
|
|
#define Ctrl_G 7
|
|
#define Ctrl_H 8
|
|
#define Ctrl_I 9
|
|
#define Ctrl_J 10
|
|
#define Ctrl_K 11
|
|
#define Ctrl_L 12
|
|
#define Ctrl_M 13
|
|
#define Ctrl_N 14
|
|
#define Ctrl_O 15
|
|
#define Ctrl_P 16
|
|
#define Ctrl_Q 17
|
|
#define Ctrl_R 18
|
|
#define Ctrl_S 19
|
|
#define Ctrl_T 20
|
|
#define Ctrl_U 21
|
|
#define Ctrl_V 22
|
|
#define Ctrl_W 23
|
|
#define Ctrl_X 24
|
|
#define Ctrl_Y 25
|
|
#define Ctrl_Z 26
|
|
/* CTRL- [ Left Square Bracket == ESC*/
|
|
#define Ctrl_BSL 28 /* \ BackSLash */
|
|
#define Ctrl_RSB 29 /* ] Right Square Bracket */
|
|
#define Ctrl_HAT 30 /* ^ */
|
|
#define Ctrl__ 31
|
|
|
|
|
|
/*
|
|
* Character that separates dir names in a path.
|
|
* For MS-DOS, WIN32 and OS/2 we use a backslash. A slash mostly works
|
|
* fine, but there are places where it doesn't (e.g. in a command name).
|
|
* For Acorn we use a dot.
|
|
*/
|
|
#ifdef BACKSLASH_IN_FILENAME
|
|
# define PATHSEP psepc
|
|
# define PATHSEPSTR pseps
|
|
#else
|
|
# define PATHSEP '/'
|
|
# define PATHSEPSTR "/"
|
|
#endif
|
|
|
|
#endif /* NEOVIM_ASCII_H */
|