comparison src/if_cscope.c @ 17990:8976c3a3803a v8.1.1991

patch 8.1.1991: still cannot build with eval but without cscope Commit: https://github.com/vim/vim/commit/6f72e90dd843a7342395b31f31c2073a3859869d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 5 23:04:02 2019 +0200 patch 8.1.1991: still cannot build with eval but without cscope Problem: Still cannot build with eval but without cscope. Solution: Move f_cscope_connection() outside of #ifdef.
author Bram Moolenaar <Bram@vim.org>
date Thu, 05 Sep 2019 23:15:03 +0200
parents 5c8906f653f5
children f0f9692d4487
comparison
equal deleted inserted replaced
17989:2acb695046e1 17990:8976c3a3803a
430 } 430 }
431 431
432 return FALSE; 432 return FALSE;
433 } 433 }
434 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
462 #endif 435 #endif
463 436
464 437
465 /* 438 /*
466 * PRIVATE functions 439 * PRIVATE functions
2525 csinfo_size = 0; 2498 csinfo_size = 0;
2526 } 2499 }
2527 2500
2528 #endif /* FEAT_CSCOPE */ 2501 #endif /* FEAT_CSCOPE */
2529 2502
2530 /* the end */ 2503 #if defined(FEAT_EVAL) || defined(PROTO)
2504
2505 /*
2506 * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function
2507 *
2508 * Checks the existence of a cscope connection.
2509 */
2510 void
2511 f_cscope_connection(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
2512 {
2513 # ifdef FEAT_CSCOPE
2514 int num = 0;
2515 char_u *dbpath = NULL;
2516 char_u *prepend = NULL;
2517 char_u buf[NUMBUFLEN];
2518
2519 if (argvars[0].v_type != VAR_UNKNOWN
2520 && argvars[1].v_type != VAR_UNKNOWN)
2521 {
2522 num = (int)tv_get_number(&argvars[0]);
2523 dbpath = tv_get_string(&argvars[1]);
2524 if (argvars[2].v_type != VAR_UNKNOWN)
2525 prepend = tv_get_string_buf(&argvars[2], buf);
2526 }
2527
2528 rettv->vval.v_number = cs_connection(num, dbpath, prepend);
2529 # endif
2530 }
2531
2532 #endif // FEAT_EVAL