mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
Remove remaining declarations with new script: finddeclarations.pl
This commit is contained in:
parent
70929f7e16
commit
6498b281fa
50
scripts/finddeclarations.pl
Executable file
50
scripts/finddeclarations.pl
Executable file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
if ($ARGV[0] eq '--help') {
|
||||
print << "EOF";
|
||||
Usage:
|
||||
|
||||
$0 definitions.c
|
||||
EOF
|
||||
exit;
|
||||
}
|
||||
|
||||
my ($cfname, $sfname, $gfname, $cpp) = @ARGV;
|
||||
|
||||
my $F;
|
||||
|
||||
open $F, "<", $cfname;
|
||||
|
||||
my $text = join "", <$F>;
|
||||
|
||||
close $F;
|
||||
|
||||
my $s = qr/(?>\s*)/aso;
|
||||
my $w = qr/(?>\w+)/aso;
|
||||
my $argname = qr/$w(?:\[(?>\w+)\])?/aso;
|
||||
my $type_regex = qr/(?:$w$s\**$s)+/aso;
|
||||
my $arg_regex = qr/(?:$type_regex$s$argname)/aso;
|
||||
|
||||
while ($text =~ /
|
||||
(?<=\n) # Definition starts at the start of line
|
||||
$type_regex # Return type
|
||||
$s$w # Function name
|
||||
$s\($s
|
||||
(?:
|
||||
$arg_regex(?:$s,$s$arg_regex)*+
|
||||
($s,$s\.\.\.)? # varargs function
|
||||
|void
|
||||
)?
|
||||
$s\)
|
||||
(?:$s FUNC_ATTR_$w(?:\((?>[^)]*)\))?)*+ # Optional attributes
|
||||
(?=$s;) # Ending semicolon
|
||||
/axsogp) {
|
||||
my $match = "${^MATCH}";
|
||||
my $s = "${^PREMATCH}";
|
||||
$s =~ s/[^\n]++//g;
|
||||
my $line = 1 + length $s;
|
||||
print "${cfname}:${line}: $match\n";
|
||||
}
|
@ -2372,8 +2372,6 @@ int source_level(void *cookie)
|
||||
|
||||
#if (defined(WIN32) && defined(FEAT_CSCOPE)) || defined(HAVE_FD_CLOEXEC)
|
||||
# define USE_FOPEN_NOINH
|
||||
static FILE *fopen_noinh_readbin(char *filename);
|
||||
|
||||
/*
|
||||
* Special function to open a file without handle inheritance.
|
||||
* When possible the handle is closed on exec().
|
||||
@ -3244,8 +3242,6 @@ char_u *get_mess_lang(void)
|
||||
|
||||
/* Complicated #if; matches with where get_mess_env() is used below. */
|
||||
#ifdef HAVE_WORKING_LIBINTL
|
||||
static char_u *get_mess_env(void);
|
||||
|
||||
/*
|
||||
* Get the language used for messages from the environment.
|
||||
*/
|
||||
@ -3406,9 +3402,6 @@ void ex_language(exarg_T *eap)
|
||||
static char_u **locales = NULL; /* Array of all available locales */
|
||||
static int did_init_locales = FALSE;
|
||||
|
||||
static void init_locales(void);
|
||||
static char_u **find_locales(void);
|
||||
|
||||
/*
|
||||
* Lazy initialization of all available locales.
|
||||
*/
|
||||
|
@ -1153,8 +1153,6 @@ static void clear_csinfo(int i)
|
||||
}
|
||||
|
||||
#ifndef UNIX
|
||||
static char *GetWin32Error(void);
|
||||
|
||||
static char *GetWin32Error(void)
|
||||
{
|
||||
char *msg = NULL;
|
||||
@ -1168,7 +1166,6 @@ static char *GetWin32Error(void)
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -98,8 +98,6 @@ typedef struct {
|
||||
#define EDIT_TAG 3 /* tag name argument given, use tagname */
|
||||
#define EDIT_QF 4 /* start in quickfix mode */
|
||||
|
||||
#if defined(UNIX) && !defined(NO_VIM_MAIN)
|
||||
#endif
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "main.c.generated.h"
|
||||
#endif
|
||||
@ -134,7 +132,7 @@ static char *(main_errors[]) =
|
||||
};
|
||||
|
||||
#ifndef NO_VIM_MAIN /* skip this for unittests */
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char_u *fname = NULL; /* file name from command line */
|
||||
mparm_T params; /* various parameters passed between
|
||||
|
@ -3018,10 +3018,6 @@ int vim_dialog_yesnoallcancel(int type, char_u *title, char_u *message, int dflt
|
||||
|
||||
static char *e_printf = N_("E766: Insufficient arguments for printf()");
|
||||
|
||||
static long tv_nr(typval_T *tvs, int *idxp);
|
||||
static char *tv_str(typval_T *tvs, int *idxp);
|
||||
static double tv_float(typval_T *tvs, int *idxp);
|
||||
|
||||
/*
|
||||
* Get number argument from "idxp" entry in "tvs". First entry is 1.
|
||||
*/
|
||||
|
@ -343,14 +343,6 @@ static int nfa_ll_index = 0;
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "regexp_nfa.c.generated.h"
|
||||
#endif
|
||||
#ifdef REGEXP_DEBUG
|
||||
static void nfa_set_code(int c);
|
||||
static void nfa_postfix_dump(char_u *expr, int retval);
|
||||
static void nfa_print_state(FILE *debugf, nfa_state_T *state);
|
||||
static void nfa_print_state2(FILE *debugf, nfa_state_T *state,
|
||||
garray_T *indent);
|
||||
static void nfa_dump(nfa_regprog_T *prog);
|
||||
#endif
|
||||
|
||||
/* helper functions used when doing re2post() ... regatom() parsing */
|
||||
#define EMIT(c) do { \
|
||||
@ -3396,10 +3388,6 @@ static void nfa_postprocess(nfa_regprog_T *prog)
|
||||
|
||||
|
||||
#ifdef REGEXP_DEBUG
|
||||
static void log_subsexpr(regsubs_T *subs);
|
||||
static void log_subexpr(regsub_T *sub);
|
||||
static char *pim_info(nfa_pim_T *pim);
|
||||
|
||||
static void log_subsexpr(regsubs_T *subs)
|
||||
{
|
||||
log_subexpr(&subs->norm);
|
||||
|
@ -146,7 +146,6 @@ char *UP, *BC, PC;
|
||||
|
||||
# define TGETSTR(s, p) vim_tgetstr((s), (p))
|
||||
# define TGETENT(b, t) tgetent((char *)(b), (char *)(t))
|
||||
static char_u *vim_tgetstr(char *s, char_u **pp);
|
||||
#endif /* HAVE_TGETENT */
|
||||
|
||||
static int detected_8bit = FALSE; /* detected 8-bit terminal */
|
||||
|
Loading…
Reference in New Issue
Block a user