0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.0.0081

Problem:    Inconsistent function names.
Solution:   Rename do_cscope to ex_cscope.  Clean up comments.
This commit is contained in:
Bram Moolenaar
2016-11-12 19:16:46 +01:00
parent b6be3ea45b
commit d4db7719bd
5 changed files with 46 additions and 107 deletions

View File

@@ -391,10 +391,10 @@ EX(CMD_cquit, "cquit", ex_cquit,
EX(CMD_crewind, "crewind", ex_cc, EX(CMD_crewind, "crewind", ex_cc,
RANGE|NOTADR|COUNT|TRLBAR|BANG, RANGE|NOTADR|COUNT|TRLBAR|BANG,
ADDR_LINES), ADDR_LINES),
EX(CMD_cscope, "cscope", do_cscope, EX(CMD_cscope, "cscope", ex_cscope,
EXTRA|NOTRLCOM|XFILE, EXTRA|NOTRLCOM|XFILE,
ADDR_LINES), ADDR_LINES),
EX(CMD_cstag, "cstag", do_cstag, EX(CMD_cstag, "cstag", ex_cstag,
BANG|TRLBAR|WORD1, BANG|TRLBAR|WORD1,
ADDR_LINES), ADDR_LINES),
EX(CMD_cunmap, "cunmap", ex_unmap, EX(CMD_cunmap, "cunmap", ex_unmap,
@@ -745,7 +745,7 @@ EX(CMD_lchdir, "lchdir", ex_cd,
EX(CMD_lclose, "lclose", ex_cclose, EX(CMD_lclose, "lclose", ex_cclose,
RANGE|NOTADR|COUNT|TRLBAR, RANGE|NOTADR|COUNT|TRLBAR,
ADDR_LINES), ADDR_LINES),
EX(CMD_lcscope, "lcscope", do_cscope, EX(CMD_lcscope, "lcscope", ex_cscope,
EXTRA|NOTRLCOM|XFILE, EXTRA|NOTRLCOM|XFILE,
ADDR_LINES), ADDR_LINES),
EX(CMD_ldo, "ldo", ex_listdo, EX(CMD_ldo, "ldo", ex_listdo,
@@ -1249,7 +1249,7 @@ EX(CMD_scriptnames, "scriptnames", ex_scriptnames,
EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding, EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,
WORD1|TRLBAR|CMDWIN, WORD1|TRLBAR|CMDWIN,
ADDR_LINES), ADDR_LINES),
EX(CMD_scscope, "scscope", do_scscope, EX(CMD_scscope, "scscope", ex_scscope,
EXTRA|NOTRLCOM, EXTRA|NOTRLCOM,
ADDR_LINES), ADDR_LINES),
EX(CMD_set, "set", ex_set, EX(CMD_set, "set", ex_set,

View File

@@ -243,9 +243,9 @@ static void ex_popup(exarg_T *eap);
# define ex_helpfind ex_ni # define ex_helpfind ex_ni
#endif #endif
#ifndef FEAT_CSCOPE #ifndef FEAT_CSCOPE
# define do_cscope ex_ni # define ex_cscope ex_ni
# define do_scscope ex_ni # define ex_scscope ex_ni
# define do_cstag ex_ni # define ex_cstag ex_ni
#endif #endif
#ifndef FEAT_SYN_HL #ifndef FEAT_SYN_HL
# define ex_syntax ex_ni # define ex_syntax ex_ni
@@ -10427,7 +10427,7 @@ ex_tag_cmd(exarg_T *eap, char_u *name)
#ifdef FEAT_CSCOPE #ifdef FEAT_CSCOPE
if (p_cst && *eap->arg != NUL) if (p_cst && *eap->arg != NUL)
{ {
do_cstag(eap); ex_cstag(eap);
return; return;
} }
#endif #endif

View File

@@ -201,8 +201,6 @@ set_context_in_cscope_cmd(
#endif /* FEAT_CMDL_COMPL */ #endif /* FEAT_CMDL_COMPL */
/* /*
* PRIVATE: do_cscope_general
*
* Find the command, print help if invalid, and then call the corresponding * Find the command, print help if invalid, and then call the corresponding
* command function. * command function.
*/ */
@@ -242,31 +240,28 @@ do_cscope_general(
} }
/* /*
* PUBLIC: do_cscope * Implementation of ":cscope" and ":lcscope"
*/ */
void void
do_cscope(exarg_T *eap) ex_cscope(exarg_T *eap)
{ {
do_cscope_general(eap, FALSE); do_cscope_general(eap, FALSE);
} }
/* /*
* PUBLIC: do_scscope * Implementation of ":scscope". Same as ex_cscope(), but splits window, too.
*
* same as do_cscope, but splits window, too.
*/ */
void void
do_scscope(exarg_T *eap) ex_scscope(exarg_T *eap)
{ {
do_cscope_general(eap, TRUE); do_cscope_general(eap, TRUE);
} }
/* /*
* PUBLIC: do_cstag * Implementation of ":cstag"
*
*/ */
void void
do_cstag(exarg_T *eap) ex_cstag(exarg_T *eap)
{ {
int ret = FALSE; int ret = FALSE;
@@ -336,13 +331,11 @@ do_cstag(exarg_T *eap)
#endif #endif
} }
} /* do_cscope */ }
/* /*
* PUBLIC: cs_find * This simulates a vim_fgets(), but for cscope, returns the next line
*
* this simulates a vim_fgets(), but for cscope, returns the next line
* from the cscope output. should only be called from find_tags() * from the cscope output. should only be called from find_tags()
* *
* returns TRUE if eof, FALSE otherwise * returns TRUE if eof, FALSE otherwise
@@ -361,9 +354,7 @@ cs_fgets(char_u *buf, int size)
/* /*
* PUBLIC: cs_free_tags * Called only from do_tag(), when popping the tag stack.
*
* called only from do_tag(), when popping the tag stack
*/ */
void void
cs_free_tags(void) cs_free_tags(void)
@@ -373,9 +364,7 @@ cs_free_tags(void)
/* /*
* PUBLIC: cs_print_tags * Called from do_tag().
*
* called from do_tag()
*/ */
void void
cs_print_tags(void) cs_print_tags(void)
@@ -467,12 +456,8 @@ cs_connection(int num, char_u *dbpath, char_u *ppath)
****************************************************************************/ ****************************************************************************/
/* /*
* PRIVATE: cs_add * Add cscope database or a directory name (to look for cscope.out)
* * to the cscope connection list.
* add cscope database or a directory name (to look for cscope.out)
* to the cscope connection list
*
* MAXPATHL 256
*/ */
static int static int
cs_add(exarg_T *eap UNUSED) cs_add(exarg_T *eap UNUSED)
@@ -508,10 +493,8 @@ cs_stat_emsg(char *fname)
/* /*
* PRIVATE: cs_add_common * The common routine to add a new cscope connection. Called by
* * cs_add() and cs_reset(). I really don't like to do this, but this
* the common routine to add a new cscope connection. called by
* cs_add() and cs_reset(). i really don't like to do this, but this
* routine uses a number of goto statements. * routine uses a number of goto statements.
*/ */
static int static int
@@ -666,9 +649,7 @@ cs_check_for_tags(void)
/* /*
* PRIVATE: cs_cnt_connections * Count the number of cscope connections.
*
* count the number of cscope connections
*/ */
static int static int
cs_cnt_connections(void) cs_cnt_connections(void)
@@ -693,9 +674,7 @@ cs_reading_emsg(
#define CSREAD_BUFSIZE 2048 #define CSREAD_BUFSIZE 2048
/* /*
* PRIVATE: cs_cnt_matches * Count the number of matches for a given cscope connection.
*
* count the number of matches for a given cscope connection.
*/ */
static int static int
cs_cnt_matches(int idx) cs_cnt_matches(int idx)
@@ -754,8 +733,6 @@ cs_cnt_matches(int idx)
/* /*
* PRIVATE: cs_create_cmd
*
* Creates the actual cscope command query from what the user entered. * Creates the actual cscope command query from what the user entered.
*/ */
static char * static char *
@@ -817,8 +794,6 @@ cs_create_cmd(char *csoption, char *pattern)
/* /*
* PRIVATE: cs_create_connection
*
* This piece of code was taken/adapted from nvi. do we need to add * This piece of code was taken/adapted from nvi. do we need to add
* the BSD license notice? * the BSD license notice?
*/ */
@@ -1056,8 +1031,6 @@ err_closing:
/* /*
* PRIVATE: cs_find
*
* Query cscope using command line interface. Parse the output and use tselect * Query cscope using command line interface. Parse the output and use tselect
* to allow choices. Like Nvi, creates a pipe to send to/from query/cscope. * to allow choices. Like Nvi, creates a pipe to send to/from query/cscope.
* *
@@ -1102,9 +1075,7 @@ cs_find(exarg_T *eap)
/* /*
* PRIVATE: cs_find_common * Common code for cscope find, shared by cs_find() and ex_cstag().
*
* common code for cscope find, shared by cs_find() and do_cstag()
*/ */
static int static int
cs_find_common( cs_find_common(
@@ -1323,9 +1294,7 @@ cs_find_common(
} /* cs_find_common */ } /* cs_find_common */
/* /*
* PRIVATE: cs_help * Print help.
*
* print help
*/ */
static int static int
cs_help(exarg_T *eap UNUSED) cs_help(exarg_T *eap UNUSED)
@@ -1408,9 +1377,7 @@ GetWin32Error(void)
#endif #endif
/* /*
* PRIVATE: cs_insert_filelist * Insert a new cscope database filename into the filelist.
*
* insert a new cscope database filename into the filelist
*/ */
static int static int
cs_insert_filelist( cs_insert_filelist(
@@ -1551,9 +1518,7 @@ cs_insert_filelist(
/* /*
* PRIVATE: cs_lookup_cmd * Find cscope command in command table.
*
* find cscope command in command table
*/ */
static cscmd_T * static cscmd_T *
cs_lookup_cmd(exarg_T *eap) cs_lookup_cmd(exarg_T *eap)
@@ -1582,9 +1547,7 @@ cs_lookup_cmd(exarg_T *eap)
/* /*
* PRIVATE: cs_kill * Nuke em.
*
* nuke em
*/ */
static int static int
cs_kill(exarg_T *eap UNUSED) cs_kill(exarg_T *eap UNUSED)
@@ -1639,8 +1602,6 @@ cs_kill(exarg_T *eap UNUSED)
/* /*
* PRIVATE: cs_kill_execute
*
* Actually kills a specific cscope connection. * Actually kills a specific cscope connection.
*/ */
static void static void
@@ -1659,22 +1620,20 @@ cs_kill_execute(
/* /*
* PRIVATE: cs_make_vim_style_matches * Convert the cscope output into a ctags style entry (as might be found
*
* convert the cscope output into a ctags style entry (as might be found
* in a ctags tags file). there's one catch though: cscope doesn't tell you * in a ctags tags file). there's one catch though: cscope doesn't tell you
* the type of the tag you are looking for. for example, in Darren Hiebert's * the type of the tag you are looking for. for example, in Darren Hiebert's
* ctags (the one that comes with vim), #define's use a line number to find the * ctags (the one that comes with vim), #define's use a line number to find the
* tag in a file while function definitions use a regexp search pattern. * tag in a file while function definitions use a regexp search pattern.
* *
* i'm going to always use the line number because cscope does something * I'm going to always use the line number because cscope does something
* quirky (and probably other things i don't know about): * quirky (and probably other things i don't know about):
* *
* if you have "# define" in your source file, which is * if you have "# define" in your source file, which is
* perfectly legal, cscope thinks you have "#define". this * perfectly legal, cscope thinks you have "#define". this
* will result in a failed regexp search. :( * will result in a failed regexp search. :(
* *
* besides, even if this particular case didn't happen, the search pattern * Besides, even if this particular case didn't happen, the search pattern
* would still have to be modified to escape all the special regular expression * would still have to be modified to escape all the special regular expression
* characters to comply with ctags formatting. * characters to comply with ctags formatting.
*/ */
@@ -1721,9 +1680,7 @@ cs_make_vim_style_matches(
/* /*
* PRIVATE: cs_manage_matches * This is kind of hokey, but i don't see an easy way round this.
*
* this is kind of hokey, but i don't see an easy way round this..
* *
* Store: keep a ptr to the (malloc'd) memory of matches originally * Store: keep a ptr to the (malloc'd) memory of matches originally
* generated from cs_find(). the matches are originally lines directly * generated from cs_find(). the matches are originally lines directly
@@ -1801,9 +1758,7 @@ cs_manage_matches(
/* /*
* PRIVATE: cs_parse_results * Parse cscope output.
*
* parse cscope output
*/ */
static char * static char *
cs_parse_results( cs_parse_results(
@@ -1864,9 +1819,7 @@ cs_parse_results(
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
/* /*
* PRIVATE: cs_file_results * Write cscope find results to file.
*
* write cscope find results to file
*/ */
static void static void
cs_file_results(FILE *f, int *nummatches_a) cs_file_results(FILE *f, int *nummatches_a)
@@ -1919,10 +1872,8 @@ cs_file_results(FILE *f, int *nummatches_a)
#endif #endif
/* /*
* PRIVATE: cs_fill_results * Get parsed cscope output and calls cs_make_vim_style_matches to convert
* * into ctags format.
* get parsed cscope output and calls cs_make_vim_style_matches to convert
* into ctags format
* When there are no matches sets "*matches_p" to NULL. * When there are no matches sets "*matches_p" to NULL.
*/ */
static void static void
@@ -2032,9 +1983,7 @@ cs_pathcomponents(char *path)
} }
/* /*
* PRIVATE: cs_print_tags_priv * Called from cs_manage_matches().
*
* called from cs_manage_matches()
*/ */
static void static void
cs_print_tags_priv(char **matches, char **cntxts, int num_matches) cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
@@ -2182,9 +2131,7 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
/* /*
* PRIVATE: cs_read_prompt * Read a cscope prompt (basically, skip over the ">> ").
*
* read a cscope prompt (basically, skip over the ">> ")
*/ */
static int static int
cs_read_prompt(int i) cs_read_prompt(int i)
@@ -2280,8 +2227,6 @@ sig_handler SIGDEFARG(sigarg)
#endif #endif
/* /*
* PRIVATE: cs_release_csp
*
* Does the actual free'ing for the cs ptr with an optional flag of whether * Does the actual free'ing for the cs ptr with an optional flag of whether
* or not to free the filename. Called by cs_kill and cs_reset. * or not to free the filename. Called by cs_kill and cs_reset.
*/ */
@@ -2408,9 +2353,7 @@ cs_release_csp(int i, int freefnpp)
/* /*
* PRIVATE: cs_reset * Calls cs_kill on all cscope connections then reinits.
*
* calls cs_kill on all cscope connections then reinits
*/ */
static int static int
cs_reset(exarg_T *eap UNUSED) cs_reset(exarg_T *eap UNUSED)
@@ -2474,8 +2417,6 @@ cs_reset(exarg_T *eap UNUSED)
/* /*
* PRIVATE: cs_resolve_file
*
* Construct the full pathname to a file found in the cscope database. * Construct the full pathname to a file found in the cscope database.
* (Prepends ppath, if there is one and if it's not already prepended, * (Prepends ppath, if there is one and if it's not already prepended,
* otherwise just uses the name found.) * otherwise just uses the name found.)
@@ -2544,9 +2485,7 @@ cs_resolve_file(int i, char *name)
/* /*
* PRIVATE: cs_show * Show all cscope connections.
*
* show all cscope connections
*/ */
static int static int
cs_show(exarg_T *eap UNUSED) cs_show(exarg_T *eap UNUSED)
@@ -2579,8 +2518,6 @@ cs_show(exarg_T *eap UNUSED)
/* /*
* PUBLIC: cs_end
*
* Only called when VIM exits to quit any cscope sessions. * Only called when VIM exits to quit any cscope sessions.
*/ */
void void

View File

@@ -1,9 +1,9 @@
/* if_cscope.c */ /* if_cscope.c */
char_u *get_cscope_name(expand_T *xp, int idx); char_u *get_cscope_name(expand_T *xp, int idx);
void set_context_in_cscope_cmd(expand_T *xp, char_u *arg, cmdidx_T cmdidx); void set_context_in_cscope_cmd(expand_T *xp, char_u *arg, cmdidx_T cmdidx);
void do_cscope(exarg_T *eap); void ex_cscope(exarg_T *eap);
void do_scscope(exarg_T *eap); void ex_scscope(exarg_T *eap);
void do_cstag(exarg_T *eap); void ex_cstag(exarg_T *eap);
int cs_fgets(char_u *buf, int size); int cs_fgets(char_u *buf, int size);
void cs_free_tags(void); void cs_free_tags(void);
void cs_print_tags(void); void cs_print_tags(void);

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
81,
/**/ /**/
80, 80,
/**/ /**/