Mercurial > vim
comparison src/if_cscope.c @ 17986:5c8906f653f5 v8.1.1989
patch 8.1.1989: the evalfunc.c file is still too big
Commit: https://github.com/vim/vim/commit/af7645d3733fdd3cd2df03ec7b653601d26969ef
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 5 22:33:28 2019 +0200
patch 8.1.1989: the evalfunc.c file is still too big
Problem: The evalfunc.c file is still too big.
Solution: Move f_pathshorten() to filepath.c. Move f_cscope_connection() to
if_cscope.c. Move diff_ functions to diff.c. Move timer_
functions to ex_cmds2.c. move callback functions to evalvars.c.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 05 Sep 2019 22:45:04 +0200 |
parents | 46f95606b9ec |
children | 8976c3a3803a |
comparison
equal
deleted
inserted
replaced
17985:9b43688b26bf | 17986:5c8906f653f5 |
---|---|
382 * {dbpath} and {prepend}. | 382 * {dbpath} and {prepend}. |
383 * | 383 * |
384 * Note: All string comparisons are case sensitive! | 384 * Note: All string comparisons are case sensitive! |
385 */ | 385 */ |
386 #if defined(FEAT_EVAL) || defined(PROTO) | 386 #if defined(FEAT_EVAL) || defined(PROTO) |
387 int | 387 static int |
388 cs_connection(int num, char_u *dbpath, char_u *ppath) | 388 cs_connection(int num, char_u *dbpath, char_u *ppath) |
389 { | 389 { |
390 int i; | 390 int i; |
391 | 391 |
392 if (num < 0 || num > 4 || (num > 0 && !dbpath)) | 392 if (num < 0 || num > 4 || (num > 0 && !dbpath)) |
428 break; | 428 break; |
429 } | 429 } |
430 } | 430 } |
431 | 431 |
432 return FALSE; | 432 return FALSE; |
433 } /* cs_connection */ | 433 } |
434 | |
435 /* | |
436 * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function | |
437 * | |
438 * Checks the existence of a cscope connection. | |
439 */ | |
440 void | |
441 f_cscope_connection(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | |
442 { | |
443 #ifdef FEAT_CSCOPE | |
444 int num = 0; | |
445 char_u *dbpath = NULL; | |
446 char_u *prepend = NULL; | |
447 char_u buf[NUMBUFLEN]; | |
448 | |
449 if (argvars[0].v_type != VAR_UNKNOWN | |
450 && argvars[1].v_type != VAR_UNKNOWN) | |
451 { | |
452 num = (int)tv_get_number(&argvars[0]); | |
453 dbpath = tv_get_string(&argvars[1]); | |
454 if (argvars[2].v_type != VAR_UNKNOWN) | |
455 prepend = tv_get_string_buf(&argvars[2], buf); | |
456 } | |
457 | |
458 rettv->vval.v_number = cs_connection(num, dbpath, prepend); | |
459 #endif | |
460 } | |
461 | |
434 #endif | 462 #endif |
435 | 463 |
436 | 464 |
437 /* | 465 /* |
438 * PRIVATE functions | 466 * PRIVATE functions |