comparison src/evalfunc.c @ 17620:072efa9ca875 v8.1.1807

patch 8.1.1807: more functions can be used as a method commit https://github.com/vim/vim/commit/25e42231d3ee27feec2568fa4be2aa2bfba82ae5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 4 15:04:10 2019 +0200 patch 8.1.1807: more functions can be used as a method Problem: More functions can be used as a method. Solution: Add append(), appendbufline(), assert_equal(), etc. Also add the :eval command.
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Aug 2019 15:15:06 +0200
parents e259d11e2900
children 4c7097a980a5
comparison
equal deleted inserted replaced
17619:f9976baad617 17620:072efa9ca875
412 * Array with names and number of arguments of all internal functions 412 * Array with names and number of arguments of all internal functions
413 * MUST BE KEPT SORTED IN strcmp() ORDER FOR BINARY SEARCH! 413 * MUST BE KEPT SORTED IN strcmp() ORDER FOR BINARY SEARCH!
414 */ 414 */
415 typedef struct 415 typedef struct
416 { 416 {
417 char *f_name; /* function name */ 417 char *f_name; // function name
418 char f_min_argc; /* minimal number of arguments */ 418 char f_min_argc; // minimal number of arguments
419 char f_max_argc; /* maximal number of arguments */ 419 char f_max_argc; // maximal number of arguments
420 char f_argtype; // for method: FEARG_ values
420 void (*f_func)(typval_T *args, typval_T *rvar); 421 void (*f_func)(typval_T *args, typval_T *rvar);
421 /* implementation of function */ 422 // implementation of function
422 } funcentry_T; 423 } funcentry_T;
423 424
424 static funcentry_T global_functions[] = 425 static funcentry_T global_functions[] =
425 { 426 {
426 #ifdef FEAT_FLOAT 427 #ifdef FEAT_FLOAT
427 {"abs", 1, 1, f_abs}, 428 {"abs", 1, 1, 0, f_abs},
428 {"acos", 1, 1, f_acos}, /* WJMc */ 429 {"acos", 1, 1, 0, f_acos}, // WJMc
429 #endif 430 #endif
430 {"add", 2, 2, f_add}, 431 {"add", 2, 2, 0, f_add},
431 {"and", 2, 2, f_and}, 432 {"and", 2, 2, 0, f_and},
432 {"append", 2, 2, f_append}, 433 {"append", 2, 2, 0, f_append},
433 {"appendbufline", 3, 3, f_appendbufline}, 434 {"appendbufline", 3, 3, 0, f_appendbufline},
434 {"argc", 0, 1, f_argc}, 435 {"argc", 0, 1, 0, f_argc},
435 {"argidx", 0, 0, f_argidx}, 436 {"argidx", 0, 0, 0, f_argidx},
436 {"arglistid", 0, 2, f_arglistid}, 437 {"arglistid", 0, 2, 0, f_arglistid},
437 {"argv", 0, 2, f_argv}, 438 {"argv", 0, 2, 0, f_argv},
438 #ifdef FEAT_FLOAT 439 #ifdef FEAT_FLOAT
439 {"asin", 1, 1, f_asin}, /* WJMc */ 440 {"asin", 1, 1, 0, f_asin}, // WJMc
440 #endif 441 #endif
441 {"assert_beeps", 1, 2, f_assert_beeps}, 442 {"assert_beeps", 1, 2, 0, f_assert_beeps},
442 {"assert_equal", 2, 3, f_assert_equal}, 443 {"assert_equal", 2, 3, 0, f_assert_equal},
443 {"assert_equalfile", 2, 2, f_assert_equalfile}, 444 {"assert_equalfile", 2, 2, 0, f_assert_equalfile},
444 {"assert_exception", 1, 2, f_assert_exception}, 445 {"assert_exception", 1, 2, 0, f_assert_exception},
445 {"assert_fails", 1, 3, f_assert_fails}, 446 {"assert_fails", 1, 3, 0, f_assert_fails},
446 {"assert_false", 1, 2, f_assert_false}, 447 {"assert_false", 1, 2, 0, f_assert_false},
447 {"assert_inrange", 3, 4, f_assert_inrange}, 448 {"assert_inrange", 3, 4, 0, f_assert_inrange},
448 {"assert_match", 2, 3, f_assert_match}, 449 {"assert_match", 2, 3, 0, f_assert_match},
449 {"assert_notequal", 2, 3, f_assert_notequal}, 450 {"assert_notequal", 2, 3, 0, f_assert_notequal},
450 {"assert_notmatch", 2, 3, f_assert_notmatch}, 451 {"assert_notmatch", 2, 3, 0, f_assert_notmatch},
451 {"assert_report", 1, 1, f_assert_report}, 452 {"assert_report", 1, 1, 0, f_assert_report},
452 {"assert_true", 1, 2, f_assert_true}, 453 {"assert_true", 1, 2, 0, f_assert_true},
453 #ifdef FEAT_FLOAT 454 #ifdef FEAT_FLOAT
454 {"atan", 1, 1, f_atan}, 455 {"atan", 1, 1, 0, f_atan},
455 {"atan2", 2, 2, f_atan2}, 456 {"atan2", 2, 2, 0, f_atan2},
456 #endif 457 #endif
457 #ifdef FEAT_BEVAL 458 #ifdef FEAT_BEVAL
458 {"balloon_gettext", 0, 0, f_balloon_gettext}, 459 {"balloon_gettext", 0, 0, 0, f_balloon_gettext},
459 {"balloon_show", 1, 1, f_balloon_show}, 460 {"balloon_show", 1, 1, 0, f_balloon_show},
460 # if defined(FEAT_BEVAL_TERM) 461 # if defined(FEAT_BEVAL_TERM)
461 {"balloon_split", 1, 1, f_balloon_split}, 462 {"balloon_split", 1, 1, 0, f_balloon_split},
462 # endif 463 # endif
463 #endif 464 #endif
464 {"browse", 4, 4, f_browse}, 465 {"browse", 4, 4, 0, f_browse},
465 {"browsedir", 2, 2, f_browsedir}, 466 {"browsedir", 2, 2, 0, f_browsedir},
466 {"bufadd", 1, 1, f_bufadd}, 467 {"bufadd", 1, 1, 0, f_bufadd},
467 {"bufexists", 1, 1, f_bufexists}, 468 {"bufexists", 1, 1, 0, f_bufexists},
468 {"buffer_exists", 1, 1, f_bufexists}, /* obsolete */ 469 {"buffer_exists", 1, 1, 0, f_bufexists}, // obsolete
469 {"buffer_name", 1, 1, f_bufname}, /* obsolete */ 470 {"buffer_name", 1, 1, 0, f_bufname}, // obsolete
470 {"buffer_number", 1, 1, f_bufnr}, /* obsolete */ 471 {"buffer_number", 1, 1, 0, f_bufnr}, // obsolete
471 {"buflisted", 1, 1, f_buflisted}, 472 {"buflisted", 1, 1, 0, f_buflisted},
472 {"bufload", 1, 1, f_bufload}, 473 {"bufload", 1, 1, 0, f_bufload},
473 {"bufloaded", 1, 1, f_bufloaded}, 474 {"bufloaded", 1, 1, 0, f_bufloaded},
474 {"bufname", 1, 1, f_bufname}, 475 {"bufname", 1, 1, 0, f_bufname},
475 {"bufnr", 1, 2, f_bufnr}, 476 {"bufnr", 1, 2, 0, f_bufnr},
476 {"bufwinid", 1, 1, f_bufwinid}, 477 {"bufwinid", 1, 1, 0, f_bufwinid},
477 {"bufwinnr", 1, 1, f_bufwinnr}, 478 {"bufwinnr", 1, 1, 0, f_bufwinnr},
478 {"byte2line", 1, 1, f_byte2line}, 479 {"byte2line", 1, 1, 0, f_byte2line},
479 {"byteidx", 2, 2, f_byteidx}, 480 {"byteidx", 2, 2, 0, f_byteidx},
480 {"byteidxcomp", 2, 2, f_byteidxcomp}, 481 {"byteidxcomp", 2, 2, 0, f_byteidxcomp},
481 {"call", 2, 3, f_call}, 482 {"call", 2, 3, 0, f_call},
482 #ifdef FEAT_FLOAT 483 #ifdef FEAT_FLOAT
483 {"ceil", 1, 1, f_ceil}, 484 {"ceil", 1, 1, 0, f_ceil},
484 #endif 485 #endif
485 #ifdef FEAT_JOB_CHANNEL 486 #ifdef FEAT_JOB_CHANNEL
486 {"ch_canread", 1, 1, f_ch_canread}, 487 {"ch_canread", 1, 1, 0, f_ch_canread},
487 {"ch_close", 1, 1, f_ch_close}, 488 {"ch_close", 1, 1, 0, f_ch_close},
488 {"ch_close_in", 1, 1, f_ch_close_in}, 489 {"ch_close_in", 1, 1, 0, f_ch_close_in},
489 {"ch_evalexpr", 2, 3, f_ch_evalexpr}, 490 {"ch_evalexpr", 2, 3, 0, f_ch_evalexpr},
490 {"ch_evalraw", 2, 3, f_ch_evalraw}, 491 {"ch_evalraw", 2, 3, 0, f_ch_evalraw},
491 {"ch_getbufnr", 2, 2, f_ch_getbufnr}, 492 {"ch_getbufnr", 2, 2, 0, f_ch_getbufnr},
492 {"ch_getjob", 1, 1, f_ch_getjob}, 493 {"ch_getjob", 1, 1, 0, f_ch_getjob},
493 {"ch_info", 1, 1, f_ch_info}, 494 {"ch_info", 1, 1, 0, f_ch_info},
494 {"ch_log", 1, 2, f_ch_log}, 495 {"ch_log", 1, 2, 0, f_ch_log},
495 {"ch_logfile", 1, 2, f_ch_logfile}, 496 {"ch_logfile", 1, 2, 0, f_ch_logfile},
496 {"ch_open", 1, 2, f_ch_open}, 497 {"ch_open", 1, 2, 0, f_ch_open},
497 {"ch_read", 1, 2, f_ch_read}, 498 {"ch_read", 1, 2, 0, f_ch_read},
498 {"ch_readblob", 1, 2, f_ch_readblob}, 499 {"ch_readblob", 1, 2, 0, f_ch_readblob},
499 {"ch_readraw", 1, 2, f_ch_readraw}, 500 {"ch_readraw", 1, 2, 0, f_ch_readraw},
500 {"ch_sendexpr", 2, 3, f_ch_sendexpr}, 501 {"ch_sendexpr", 2, 3, 0, f_ch_sendexpr},
501 {"ch_sendraw", 2, 3, f_ch_sendraw}, 502 {"ch_sendraw", 2, 3, 0, f_ch_sendraw},
502 {"ch_setoptions", 2, 2, f_ch_setoptions}, 503 {"ch_setoptions", 2, 2, 0, f_ch_setoptions},
503 {"ch_status", 1, 2, f_ch_status}, 504 {"ch_status", 1, 2, 0, f_ch_status},
504 #endif 505 #endif
505 {"changenr", 0, 0, f_changenr}, 506 {"changenr", 0, 0, 0, f_changenr},
506 {"char2nr", 1, 2, f_char2nr}, 507 {"char2nr", 1, 2, 0, f_char2nr},
507 {"chdir", 1, 1, f_chdir}, 508 {"chdir", 1, 1, 0, f_chdir},
508 {"cindent", 1, 1, f_cindent}, 509 {"cindent", 1, 1, 0, f_cindent},
509 {"clearmatches", 0, 1, f_clearmatches}, 510 {"clearmatches", 0, 1, 0, f_clearmatches},
510 {"col", 1, 1, f_col}, 511 {"col", 1, 1, 0, f_col},
511 #if defined(FEAT_INS_EXPAND) 512 #if defined(FEAT_INS_EXPAND)
512 {"complete", 2, 2, f_complete}, 513 {"complete", 2, 2, 0, f_complete},
513 {"complete_add", 1, 1, f_complete_add}, 514 {"complete_add", 1, 1, 0, f_complete_add},
514 {"complete_check", 0, 0, f_complete_check}, 515 {"complete_check", 0, 0, 0, f_complete_check},
515 {"complete_info", 0, 1, f_complete_info}, 516 {"complete_info", 0, 1, 0, f_complete_info},
516 #endif 517 #endif
517 {"confirm", 1, 4, f_confirm}, 518 {"confirm", 1, 4, 0, f_confirm},
518 {"copy", 1, 1, f_copy}, 519 {"copy", 1, 1, 0, f_copy},
519 #ifdef FEAT_FLOAT 520 #ifdef FEAT_FLOAT
520 {"cos", 1, 1, f_cos}, 521 {"cos", 1, 1, 0, f_cos},
521 {"cosh", 1, 1, f_cosh}, 522 {"cosh", 1, 1, 0, f_cosh},
522 #endif 523 #endif
523 {"count", 2, 4, f_count}, 524 {"count", 2, 4, 0, f_count},
524 {"cscope_connection",0,3, f_cscope_connection}, 525 {"cscope_connection",0,3, 0, f_cscope_connection},
525 {"cursor", 1, 3, f_cursor}, 526 {"cursor", 1, 3, 0, f_cursor},
526 #ifdef MSWIN 527 #ifdef MSWIN
527 {"debugbreak", 1, 1, f_debugbreak}, 528 {"debugbreak", 1, 1, 0, f_debugbreak},
528 #endif 529 #endif
529 {"deepcopy", 1, 2, f_deepcopy}, 530 {"deepcopy", 1, 2, 0, f_deepcopy},
530 {"delete", 1, 2, f_delete}, 531 {"delete", 1, 2, 0, f_delete},
531 {"deletebufline", 2, 3, f_deletebufline}, 532 {"deletebufline", 2, 3, 0, f_deletebufline},
532 {"did_filetype", 0, 0, f_did_filetype}, 533 {"did_filetype", 0, 0, 0, f_did_filetype},
533 {"diff_filler", 1, 1, f_diff_filler}, 534 {"diff_filler", 1, 1, 0, f_diff_filler},
534 {"diff_hlID", 2, 2, f_diff_hlID}, 535 {"diff_hlID", 2, 2, 0, f_diff_hlID},
535 {"empty", 1, 1, f_empty}, 536 {"empty", 1, 1, 0, f_empty},
536 {"environ", 0, 0, f_environ}, 537 {"environ", 0, 0, 0, f_environ},
537 {"escape", 2, 2, f_escape}, 538 {"escape", 2, 2, 0, f_escape},
538 {"eval", 1, 1, f_eval}, 539 {"eval", 1, 1, 0, f_eval},
539 {"eventhandler", 0, 0, f_eventhandler}, 540 {"eventhandler", 0, 0, 0, f_eventhandler},
540 {"executable", 1, 1, f_executable}, 541 {"executable", 1, 1, 0, f_executable},
541 {"execute", 1, 2, f_execute}, 542 {"execute", 1, 2, 0, f_execute},
542 {"exepath", 1, 1, f_exepath}, 543 {"exepath", 1, 1, 0, f_exepath},
543 {"exists", 1, 1, f_exists}, 544 {"exists", 1, 1, 0, f_exists},
544 #ifdef FEAT_FLOAT 545 #ifdef FEAT_FLOAT
545 {"exp", 1, 1, f_exp}, 546 {"exp", 1, 1, 0, f_exp},
546 #endif 547 #endif
547 {"expand", 1, 3, f_expand}, 548 {"expand", 1, 3, 0, f_expand},
548 {"expandcmd", 1, 1, f_expandcmd}, 549 {"expandcmd", 1, 1, 0, f_expandcmd},
549 {"extend", 2, 3, f_extend}, 550 {"extend", 2, 3, 0, f_extend},
550 {"feedkeys", 1, 2, f_feedkeys}, 551 {"feedkeys", 1, 2, 0, f_feedkeys},
551 {"file_readable", 1, 1, f_filereadable}, /* obsolete */ 552 {"file_readable", 1, 1, 0, f_filereadable}, // obsolete
552 {"filereadable", 1, 1, f_filereadable}, 553 {"filereadable", 1, 1, 0, f_filereadable},
553 {"filewritable", 1, 1, f_filewritable}, 554 {"filewritable", 1, 1, 0, f_filewritable},
554 {"filter", 2, 2, f_filter}, 555 {"filter", 2, 2, 0, f_filter},
555 {"finddir", 1, 3, f_finddir}, 556 {"finddir", 1, 3, 0, f_finddir},
556 {"findfile", 1, 3, f_findfile}, 557 {"findfile", 1, 3, 0, f_findfile},
557 #ifdef FEAT_FLOAT 558 #ifdef FEAT_FLOAT
558 {"float2nr", 1, 1, f_float2nr}, 559 {"float2nr", 1, 1, 0, f_float2nr},
559 {"floor", 1, 1, f_floor}, 560 {"floor", 1, 1, 0, f_floor},
560 {"fmod", 2, 2, f_fmod}, 561 {"fmod", 2, 2, 0, f_fmod},
561 #endif 562 #endif
562 {"fnameescape", 1, 1, f_fnameescape}, 563 {"fnameescape", 1, 1, 0, f_fnameescape},
563 {"fnamemodify", 2, 2, f_fnamemodify}, 564 {"fnamemodify", 2, 2, 0, f_fnamemodify},
564 {"foldclosed", 1, 1, f_foldclosed}, 565 {"foldclosed", 1, 1, 0, f_foldclosed},
565 {"foldclosedend", 1, 1, f_foldclosedend}, 566 {"foldclosedend", 1, 1, 0, f_foldclosedend},
566 {"foldlevel", 1, 1, f_foldlevel}, 567 {"foldlevel", 1, 1, 0, f_foldlevel},
567 {"foldtext", 0, 0, f_foldtext}, 568 {"foldtext", 0, 0, 0, f_foldtext},
568 {"foldtextresult", 1, 1, f_foldtextresult}, 569 {"foldtextresult", 1, 1, 0, f_foldtextresult},
569 {"foreground", 0, 0, f_foreground}, 570 {"foreground", 0, 0, 0, f_foreground},
570 {"funcref", 1, 3, f_funcref}, 571 {"funcref", 1, 3, 0, f_funcref},
571 {"function", 1, 3, f_function}, 572 {"function", 1, 3, 0, f_function},
572 {"garbagecollect", 0, 1, f_garbagecollect}, 573 {"garbagecollect", 0, 1, 0, f_garbagecollect},
573 {"get", 2, 3, f_get}, 574 {"get", 2, 3, 0, f_get},
574 {"getbufinfo", 0, 1, f_getbufinfo}, 575 {"getbufinfo", 0, 1, 0, f_getbufinfo},
575 {"getbufline", 2, 3, f_getbufline}, 576 {"getbufline", 2, 3, 0, f_getbufline},
576 {"getbufvar", 2, 3, f_getbufvar}, 577 {"getbufvar", 2, 3, 0, f_getbufvar},
577 {"getchangelist", 1, 1, f_getchangelist}, 578 {"getchangelist", 1, 1, 0, f_getchangelist},
578 {"getchar", 0, 1, f_getchar}, 579 {"getchar", 0, 1, 0, f_getchar},
579 {"getcharmod", 0, 0, f_getcharmod}, 580 {"getcharmod", 0, 0, 0, f_getcharmod},
580 {"getcharsearch", 0, 0, f_getcharsearch}, 581 {"getcharsearch", 0, 0, 0, f_getcharsearch},
581 {"getcmdline", 0, 0, f_getcmdline}, 582 {"getcmdline", 0, 0, 0, f_getcmdline},
582 {"getcmdpos", 0, 0, f_getcmdpos}, 583 {"getcmdpos", 0, 0, 0, f_getcmdpos},
583 {"getcmdtype", 0, 0, f_getcmdtype}, 584 {"getcmdtype", 0, 0, 0, f_getcmdtype},
584 {"getcmdwintype", 0, 0, f_getcmdwintype}, 585 {"getcmdwintype", 0, 0, 0, f_getcmdwintype},
585 #if defined(FEAT_CMDL_COMPL) 586 #if defined(FEAT_CMDL_COMPL)
586 {"getcompletion", 2, 3, f_getcompletion}, 587 {"getcompletion", 2, 3, 0, f_getcompletion},
587 #endif 588 #endif
588 {"getcurpos", 0, 0, f_getcurpos}, 589 {"getcurpos", 0, 0, 0, f_getcurpos},
589 {"getcwd", 0, 2, f_getcwd}, 590 {"getcwd", 0, 2, 0, f_getcwd},
590 {"getenv", 1, 1, f_getenv}, 591 {"getenv", 1, 1, 0, f_getenv},
591 {"getfontname", 0, 1, f_getfontname}, 592 {"getfontname", 0, 1, 0, f_getfontname},
592 {"getfperm", 1, 1, f_getfperm}, 593 {"getfperm", 1, 1, 0, f_getfperm},
593 {"getfsize", 1, 1, f_getfsize}, 594 {"getfsize", 1, 1, 0, f_getfsize},
594 {"getftime", 1, 1, f_getftime}, 595 {"getftime", 1, 1, 0, f_getftime},
595 {"getftype", 1, 1, f_getftype}, 596 {"getftype", 1, 1, 0, f_getftype},
596 {"getjumplist", 0, 2, f_getjumplist}, 597 {"getjumplist", 0, 2, 0, f_getjumplist},
597 {"getline", 1, 2, f_getline}, 598 {"getline", 1, 2, 0, f_getline},
598 {"getloclist", 1, 2, f_getloclist}, 599 {"getloclist", 1, 2, 0, f_getloclist},
599 {"getmatches", 0, 1, f_getmatches}, 600 {"getmatches", 0, 1, 0, f_getmatches},
600 {"getpid", 0, 0, f_getpid}, 601 {"getpid", 0, 0, 0, f_getpid},
601 {"getpos", 1, 1, f_getpos}, 602 {"getpos", 1, 1, 0, f_getpos},
602 {"getqflist", 0, 1, f_getqflist}, 603 {"getqflist", 0, 1, 0, f_getqflist},
603 {"getreg", 0, 3, f_getreg}, 604 {"getreg", 0, 3, 0, f_getreg},
604 {"getregtype", 0, 1, f_getregtype}, 605 {"getregtype", 0, 1, 0, f_getregtype},
605 {"gettabinfo", 0, 1, f_gettabinfo}, 606 {"gettabinfo", 0, 1, 0, f_gettabinfo},
606 {"gettabvar", 2, 3, f_gettabvar}, 607 {"gettabvar", 2, 3, 0, f_gettabvar},
607 {"gettabwinvar", 3, 4, f_gettabwinvar}, 608 {"gettabwinvar", 3, 4, 0, f_gettabwinvar},
608 {"gettagstack", 0, 1, f_gettagstack}, 609 {"gettagstack", 0, 1, 0, f_gettagstack},
609 {"getwininfo", 0, 1, f_getwininfo}, 610 {"getwininfo", 0, 1, 0, f_getwininfo},
610 {"getwinpos", 0, 1, f_getwinpos}, 611 {"getwinpos", 0, 1, 0, f_getwinpos},
611 {"getwinposx", 0, 0, f_getwinposx}, 612 {"getwinposx", 0, 0, 0, f_getwinposx},
612 {"getwinposy", 0, 0, f_getwinposy}, 613 {"getwinposy", 0, 0, 0, f_getwinposy},
613 {"getwinvar", 2, 3, f_getwinvar}, 614 {"getwinvar", 2, 3, 0, f_getwinvar},
614 {"glob", 1, 4, f_glob}, 615 {"glob", 1, 4, 0, f_glob},
615 {"glob2regpat", 1, 1, f_glob2regpat}, 616 {"glob2regpat", 1, 1, 0, f_glob2regpat},
616 {"globpath", 2, 5, f_globpath}, 617 {"globpath", 2, 5, 0, f_globpath},
617 {"has", 1, 1, f_has}, 618 {"has", 1, 1, 0, f_has},
618 {"has_key", 2, 2, f_has_key}, 619 {"has_key", 2, 2, 0, f_has_key},
619 {"haslocaldir", 0, 2, f_haslocaldir}, 620 {"haslocaldir", 0, 2, 0, f_haslocaldir},
620 {"hasmapto", 1, 3, f_hasmapto}, 621 {"hasmapto", 1, 3, 0, f_hasmapto},
621 {"highlightID", 1, 1, f_hlID}, /* obsolete */ 622 {"highlightID", 1, 1, 0, f_hlID}, // obsolete
622 {"highlight_exists",1, 1, f_hlexists}, /* obsolete */ 623 {"highlight_exists",1, 1, 0, f_hlexists}, // obsolete
623 {"histadd", 2, 2, f_histadd}, 624 {"histadd", 2, 2, 0, f_histadd},
624 {"histdel", 1, 2, f_histdel}, 625 {"histdel", 1, 2, 0, f_histdel},
625 {"histget", 1, 2, f_histget}, 626 {"histget", 1, 2, 0, f_histget},
626 {"histnr", 1, 1, f_histnr}, 627 {"histnr", 1, 1, 0, f_histnr},
627 {"hlID", 1, 1, f_hlID}, 628 {"hlID", 1, 1, 0, f_hlID},
628 {"hlexists", 1, 1, f_hlexists}, 629 {"hlexists", 1, 1, 0, f_hlexists},
629 {"hostname", 0, 0, f_hostname}, 630 {"hostname", 0, 0, 0, f_hostname},
630 {"iconv", 3, 3, f_iconv}, 631 {"iconv", 3, 3, 0, f_iconv},
631 {"indent", 1, 1, f_indent}, 632 {"indent", 1, 1, 0, f_indent},
632 {"index", 2, 4, f_index}, 633 {"index", 2, 4, 0, f_index},
633 {"input", 1, 3, f_input}, 634 {"input", 1, 3, 0, f_input},
634 {"inputdialog", 1, 3, f_inputdialog}, 635 {"inputdialog", 1, 3, 0, f_inputdialog},
635 {"inputlist", 1, 1, f_inputlist}, 636 {"inputlist", 1, 1, 0, f_inputlist},
636 {"inputrestore", 0, 0, f_inputrestore}, 637 {"inputrestore", 0, 0, 0, f_inputrestore},
637 {"inputsave", 0, 0, f_inputsave}, 638 {"inputsave", 0, 0, 0, f_inputsave},
638 {"inputsecret", 1, 2, f_inputsecret}, 639 {"inputsecret", 1, 2, 0, f_inputsecret},
639 {"insert", 2, 3, f_insert}, 640 {"insert", 2, 3, 0, f_insert},
640 {"invert", 1, 1, f_invert}, 641 {"invert", 1, 1, 0, f_invert},
641 {"isdirectory", 1, 1, f_isdirectory}, 642 {"isdirectory", 1, 1, 0, f_isdirectory},
642 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) 643 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
643 {"isinf", 1, 1, f_isinf}, 644 {"isinf", 1, 1, 0, f_isinf},
644 #endif 645 #endif
645 {"islocked", 1, 1, f_islocked}, 646 {"islocked", 1, 1, 0, f_islocked},
646 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) 647 #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
647 {"isnan", 1, 1, f_isnan}, 648 {"isnan", 1, 1, 0, f_isnan},
648 #endif 649 #endif
649 {"items", 1, 1, f_items}, 650 {"items", 1, 1, 0, f_items},
650 #ifdef FEAT_JOB_CHANNEL 651 #ifdef FEAT_JOB_CHANNEL
651 {"job_getchannel", 1, 1, f_job_getchannel}, 652 {"job_getchannel", 1, 1, 0, f_job_getchannel},
652 {"job_info", 0, 1, f_job_info}, 653 {"job_info", 0, 1, 0, f_job_info},
653 {"job_setoptions", 2, 2, f_job_setoptions}, 654 {"job_setoptions", 2, 2, 0, f_job_setoptions},
654 {"job_start", 1, 2, f_job_start}, 655 {"job_start", 1, 2, 0, f_job_start},
655 {"job_status", 1, 1, f_job_status}, 656 {"job_status", 1, 1, 0, f_job_status},
656 {"job_stop", 1, 2, f_job_stop}, 657 {"job_stop", 1, 2, 0, f_job_stop},
657 #endif 658 #endif
658 {"join", 1, 2, f_join}, 659 {"join", 1, 2, 0, f_join},
659 {"js_decode", 1, 1, f_js_decode}, 660 {"js_decode", 1, 1, 0, f_js_decode},
660 {"js_encode", 1, 1, f_js_encode}, 661 {"js_encode", 1, 1, 0, f_js_encode},
661 {"json_decode", 1, 1, f_json_decode}, 662 {"json_decode", 1, 1, 0, f_json_decode},
662 {"json_encode", 1, 1, f_json_encode}, 663 {"json_encode", 1, 1, 0, f_json_encode},
663 {"keys", 1, 1, f_keys}, 664 {"keys", 1, 1, 0, f_keys},
664 {"last_buffer_nr", 0, 0, f_last_buffer_nr},/* obsolete */ 665 {"last_buffer_nr", 0, 0, 0, f_last_buffer_nr}, // obsolete
665 {"len", 1, 1, f_len}, 666 {"len", 1, 1, 0, f_len},
666 {"libcall", 3, 3, f_libcall}, 667 {"libcall", 3, 3, 0, f_libcall},
667 {"libcallnr", 3, 3, f_libcallnr}, 668 {"libcallnr", 3, 3, 0, f_libcallnr},
668 {"line", 1, 1, f_line}, 669 {"line", 1, 1, 0, f_line},
669 {"line2byte", 1, 1, f_line2byte}, 670 {"line2byte", 1, 1, 0, f_line2byte},
670 {"lispindent", 1, 1, f_lispindent}, 671 {"lispindent", 1, 1, 0, f_lispindent},
671 {"list2str", 1, 2, f_list2str}, 672 {"list2str", 1, 2, 0, f_list2str},
672 {"listener_add", 1, 2, f_listener_add}, 673 {"listener_add", 1, 2, 0, f_listener_add},
673 {"listener_flush", 0, 1, f_listener_flush}, 674 {"listener_flush", 0, 1, 0, f_listener_flush},
674 {"listener_remove", 1, 1, f_listener_remove}, 675 {"listener_remove", 1, 1, 0, f_listener_remove},
675 {"localtime", 0, 0, f_localtime}, 676 {"localtime", 0, 0, 0, f_localtime},
676 #ifdef FEAT_FLOAT 677 #ifdef FEAT_FLOAT
677 {"log", 1, 1, f_log}, 678 {"log", 1, 1, 0, f_log},
678 {"log10", 1, 1, f_log10}, 679 {"log10", 1, 1, 0, f_log10},
679 #endif 680 #endif
680 #ifdef FEAT_LUA 681 #ifdef FEAT_LUA
681 {"luaeval", 1, 2, f_luaeval}, 682 {"luaeval", 1, 2, 0, f_luaeval},
682 #endif 683 #endif
683 {"map", 2, 2, f_map}, 684 {"map", 2, 2, 0, f_map},
684 {"maparg", 1, 4, f_maparg}, 685 {"maparg", 1, 4, 0, f_maparg},
685 {"mapcheck", 1, 3, f_mapcheck}, 686 {"mapcheck", 1, 3, 0, f_mapcheck},
686 {"match", 2, 4, f_match}, 687 {"match", 2, 4, 0, f_match},
687 {"matchadd", 2, 5, f_matchadd}, 688 {"matchadd", 2, 5, 0, f_matchadd},
688 {"matchaddpos", 2, 5, f_matchaddpos}, 689 {"matchaddpos", 2, 5, 0, f_matchaddpos},
689 {"matcharg", 1, 1, f_matcharg}, 690 {"matcharg", 1, 1, 0, f_matcharg},
690 {"matchdelete", 1, 2, f_matchdelete}, 691 {"matchdelete", 1, 2, 0, f_matchdelete},
691 {"matchend", 2, 4, f_matchend}, 692 {"matchend", 2, 4, 0, f_matchend},
692 {"matchlist", 2, 4, f_matchlist}, 693 {"matchlist", 2, 4, 0, f_matchlist},
693 {"matchstr", 2, 4, f_matchstr}, 694 {"matchstr", 2, 4, 0, f_matchstr},
694 {"matchstrpos", 2, 4, f_matchstrpos}, 695 {"matchstrpos", 2, 4, 0, f_matchstrpos},
695 {"max", 1, 1, f_max}, 696 {"max", 1, 1, 0, f_max},
696 {"min", 1, 1, f_min}, 697 {"min", 1, 1, 0, f_min},
697 {"mkdir", 1, 3, f_mkdir}, 698 {"mkdir", 1, 3, 0, f_mkdir},
698 {"mode", 0, 1, f_mode}, 699 {"mode", 0, 1, 0, f_mode},
699 #ifdef FEAT_MZSCHEME 700 #ifdef FEAT_MZSCHEME
700 {"mzeval", 1, 1, f_mzeval}, 701 {"mzeval", 1, 1, 0, f_mzeval},
701 #endif 702 #endif
702 {"nextnonblank", 1, 1, f_nextnonblank}, 703 {"nextnonblank", 1, 1, 0, f_nextnonblank},
703 {"nr2char", 1, 2, f_nr2char}, 704 {"nr2char", 1, 2, 0, f_nr2char},
704 {"or", 2, 2, f_or}, 705 {"or", 2, 2, 0, f_or},
705 {"pathshorten", 1, 1, f_pathshorten}, 706 {"pathshorten", 1, 1, 0, f_pathshorten},
706 #ifdef FEAT_PERL 707 #ifdef FEAT_PERL
707 {"perleval", 1, 1, f_perleval}, 708 {"perleval", 1, 1, 0, f_perleval},
708 #endif 709 #endif
709 #ifdef FEAT_TEXT_PROP 710 #ifdef FEAT_TEXT_PROP
710 {"popup_atcursor", 2, 2, f_popup_atcursor}, 711 {"popup_atcursor", 2, 2, 0, f_popup_atcursor},
711 {"popup_beval", 2, 2, f_popup_beval}, 712 {"popup_beval", 2, 2, 0, f_popup_beval},
712 {"popup_clear", 0, 0, f_popup_clear}, 713 {"popup_clear", 0, 0, 0, f_popup_clear},
713 {"popup_close", 1, 2, f_popup_close}, 714 {"popup_close", 1, 2, 0, f_popup_close},
714 {"popup_create", 2, 2, f_popup_create}, 715 {"popup_create", 2, 2, 0, f_popup_create},
715 {"popup_dialog", 2, 2, f_popup_dialog}, 716 {"popup_dialog", 2, 2, 0, f_popup_dialog},
716 {"popup_filter_menu", 2, 2, f_popup_filter_menu}, 717 {"popup_filter_menu", 2, 2, 0, f_popup_filter_menu},
717 {"popup_filter_yesno", 2, 2, f_popup_filter_yesno}, 718 {"popup_filter_yesno", 2, 2, 0, f_popup_filter_yesno},
718 {"popup_getoptions", 1, 1, f_popup_getoptions}, 719 {"popup_getoptions", 1, 1, 0, f_popup_getoptions},
719 {"popup_getpos", 1, 1, f_popup_getpos}, 720 {"popup_getpos", 1, 1, 0, f_popup_getpos},
720 {"popup_getpreview", 0, 0, f_popup_getpreview}, 721 {"popup_getpreview", 0, 0, 0, f_popup_getpreview},
721 {"popup_hide", 1, 1, f_popup_hide}, 722 {"popup_hide", 1, 1, 0, f_popup_hide},
722 {"popup_locate", 2, 2, f_popup_locate}, 723 {"popup_locate", 2, 2, 0, f_popup_locate},
723 {"popup_menu", 2, 2, f_popup_menu}, 724 {"popup_menu", 2, 2, 0, f_popup_menu},
724 {"popup_move", 2, 2, f_popup_move}, 725 {"popup_move", 2, 2, 0, f_popup_move},
725 {"popup_notification", 2, 2, f_popup_notification}, 726 {"popup_notification", 2, 2, 0, f_popup_notification},
726 {"popup_setoptions", 2, 2, f_popup_setoptions}, 727 {"popup_setoptions", 2, 2, 0, f_popup_setoptions},
727 {"popup_settext", 2, 2, f_popup_settext}, 728 {"popup_settext", 2, 2, 0, f_popup_settext},
728 {"popup_show", 1, 1, f_popup_show}, 729 {"popup_show", 1, 1, 0, f_popup_show},
729 #endif 730 #endif
730 #ifdef FEAT_FLOAT 731 #ifdef FEAT_FLOAT
731 {"pow", 2, 2, f_pow}, 732 {"pow", 2, 2, 0, f_pow},
732 #endif 733 #endif
733 {"prevnonblank", 1, 1, f_prevnonblank}, 734 {"prevnonblank", 1, 1, 0, f_prevnonblank},
734 {"printf", 1, 19, f_printf}, 735 {"printf", 1, 19, 0, f_printf},
735 #ifdef FEAT_JOB_CHANNEL 736 #ifdef FEAT_JOB_CHANNEL
736 {"prompt_setcallback", 2, 2, f_prompt_setcallback}, 737 {"prompt_setcallback", 2, 2, 0, f_prompt_setcallback},
737 {"prompt_setinterrupt", 2, 2, f_prompt_setinterrupt}, 738 {"prompt_setinterrupt", 2, 2, 0, f_prompt_setinterrupt},
738 {"prompt_setprompt", 2, 2, f_prompt_setprompt}, 739 {"prompt_setprompt", 2, 2, 0, f_prompt_setprompt},
739 #endif 740 #endif
740 #ifdef FEAT_TEXT_PROP 741 #ifdef FEAT_TEXT_PROP
741 {"prop_add", 3, 3, f_prop_add}, 742 {"prop_add", 3, 3, 0, f_prop_add},
742 {"prop_clear", 1, 3, f_prop_clear}, 743 {"prop_clear", 1, 3, 0, f_prop_clear},
743 {"prop_list", 1, 2, f_prop_list}, 744 {"prop_list", 1, 2, 0, f_prop_list},
744 {"prop_remove", 1, 3, f_prop_remove}, 745 {"prop_remove", 1, 3, 0, f_prop_remove},
745 {"prop_type_add", 2, 2, f_prop_type_add}, 746 {"prop_type_add", 2, 2, 0, f_prop_type_add},
746 {"prop_type_change", 2, 2, f_prop_type_change}, 747 {"prop_type_change", 2, 2, 0, f_prop_type_change},
747 {"prop_type_delete", 1, 2, f_prop_type_delete}, 748 {"prop_type_delete", 1, 2, 0, f_prop_type_delete},
748 {"prop_type_get", 1, 2, f_prop_type_get}, 749 {"prop_type_get", 1, 2, 0, f_prop_type_get},
749 {"prop_type_list", 0, 1, f_prop_type_list}, 750 {"prop_type_list", 0, 1, 0, f_prop_type_list},
750 #endif 751 #endif
751 {"pumvisible", 0, 0, f_pumvisible}, 752 {"pumvisible", 0, 0, 0, f_pumvisible},
752 #ifdef FEAT_PYTHON3 753 #ifdef FEAT_PYTHON3
753 {"py3eval", 1, 1, f_py3eval}, 754 {"py3eval", 1, 1, 0, f_py3eval},
754 #endif 755 #endif
755 #ifdef FEAT_PYTHON 756 #ifdef FEAT_PYTHON
756 {"pyeval", 1, 1, f_pyeval}, 757 {"pyeval", 1, 1, 0, f_pyeval},
757 #endif 758 #endif
758 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) 759 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
759 {"pyxeval", 1, 1, f_pyxeval}, 760 {"pyxeval", 1, 1, 0, f_pyxeval},
760 #endif 761 #endif
761 {"range", 1, 3, f_range}, 762 {"range", 1, 3, 0, f_range},
762 {"readdir", 1, 2, f_readdir}, 763 {"readdir", 1, 2, 0, f_readdir},
763 {"readfile", 1, 3, f_readfile}, 764 {"readfile", 1, 3, 0, f_readfile},
764 {"reg_executing", 0, 0, f_reg_executing}, 765 {"reg_executing", 0, 0, 0, f_reg_executing},
765 {"reg_recording", 0, 0, f_reg_recording}, 766 {"reg_recording", 0, 0, 0, f_reg_recording},
766 {"reltime", 0, 2, f_reltime}, 767 {"reltime", 0, 2, 0, f_reltime},
767 #ifdef FEAT_FLOAT 768 #ifdef FEAT_FLOAT
768 {"reltimefloat", 1, 1, f_reltimefloat}, 769 {"reltimefloat", 1, 1, 0, f_reltimefloat},
769 #endif 770 #endif
770 {"reltimestr", 1, 1, f_reltimestr}, 771 {"reltimestr", 1, 1, 0, f_reltimestr},
771 {"remote_expr", 2, 4, f_remote_expr}, 772 {"remote_expr", 2, 4, 0, f_remote_expr},
772 {"remote_foreground", 1, 1, f_remote_foreground}, 773 {"remote_foreground", 1, 1, 0, f_remote_foreground},
773 {"remote_peek", 1, 2, f_remote_peek}, 774 {"remote_peek", 1, 2, 0, f_remote_peek},
774 {"remote_read", 1, 2, f_remote_read}, 775 {"remote_read", 1, 2, 0, f_remote_read},
775 {"remote_send", 2, 3, f_remote_send}, 776 {"remote_send", 2, 3, 0, f_remote_send},
776 {"remote_startserver", 1, 1, f_remote_startserver}, 777 {"remote_startserver", 1, 1, 0, f_remote_startserver},
777 {"remove", 2, 3, f_remove}, 778 {"remove", 2, 3, 0, f_remove},
778 {"rename", 2, 2, f_rename}, 779 {"rename", 2, 2, 0, f_rename},
779 {"repeat", 2, 2, f_repeat}, 780 {"repeat", 2, 2, 0, f_repeat},
780 {"resolve", 1, 1, f_resolve}, 781 {"resolve", 1, 1, 0, f_resolve},
781 {"reverse", 1, 1, f_reverse}, 782 {"reverse", 1, 1, 0, f_reverse},
782 #ifdef FEAT_FLOAT 783 #ifdef FEAT_FLOAT
783 {"round", 1, 1, f_round}, 784 {"round", 1, 1, 0, f_round},
784 #endif 785 #endif
785 #ifdef FEAT_RUBY 786 #ifdef FEAT_RUBY
786 {"rubyeval", 1, 1, f_rubyeval}, 787 {"rubyeval", 1, 1, 0, f_rubyeval},
787 #endif 788 #endif
788 {"screenattr", 2, 2, f_screenattr}, 789 {"screenattr", 2, 2, 0, f_screenattr},
789 {"screenchar", 2, 2, f_screenchar}, 790 {"screenchar", 2, 2, 0, f_screenchar},
790 {"screenchars", 2, 2, f_screenchars}, 791 {"screenchars", 2, 2, 0, f_screenchars},
791 {"screencol", 0, 0, f_screencol}, 792 {"screencol", 0, 0, 0, f_screencol},
792 {"screenpos", 3, 3, f_screenpos}, 793 {"screenpos", 3, 3, 0, f_screenpos},
793 {"screenrow", 0, 0, f_screenrow}, 794 {"screenrow", 0, 0, 0, f_screenrow},
794 {"screenstring", 2, 2, f_screenstring}, 795 {"screenstring", 2, 2, 0, f_screenstring},
795 {"search", 1, 4, f_search}, 796 {"search", 1, 4, 0, f_search},
796 {"searchdecl", 1, 3, f_searchdecl}, 797 {"searchdecl", 1, 3, 0, f_searchdecl},
797 {"searchpair", 3, 7, f_searchpair}, 798 {"searchpair", 3, 7, 0, f_searchpair},
798 {"searchpairpos", 3, 7, f_searchpairpos}, 799 {"searchpairpos", 3, 7, 0, f_searchpairpos},
799 {"searchpos", 1, 4, f_searchpos}, 800 {"searchpos", 1, 4, 0, f_searchpos},
800 {"server2client", 2, 2, f_server2client}, 801 {"server2client", 2, 2, 0, f_server2client},
801 {"serverlist", 0, 0, f_serverlist}, 802 {"serverlist", 0, 0, 0, f_serverlist},
802 {"setbufline", 3, 3, f_setbufline}, 803 {"setbufline", 3, 3, 0, f_setbufline},
803 {"setbufvar", 3, 3, f_setbufvar}, 804 {"setbufvar", 3, 3, 0, f_setbufvar},
804 {"setcharsearch", 1, 1, f_setcharsearch}, 805 {"setcharsearch", 1, 1, 0, f_setcharsearch},
805 {"setcmdpos", 1, 1, f_setcmdpos}, 806 {"setcmdpos", 1, 1, 0, f_setcmdpos},
806 {"setenv", 2, 2, f_setenv}, 807 {"setenv", 2, 2, 0, f_setenv},
807 {"setfperm", 2, 2, f_setfperm}, 808 {"setfperm", 2, 2, 0, f_setfperm},
808 {"setline", 2, 2, f_setline}, 809 {"setline", 2, 2, 0, f_setline},
809 {"setloclist", 2, 4, f_setloclist}, 810 {"setloclist", 2, 4, 0, f_setloclist},
810 {"setmatches", 1, 2, f_setmatches}, 811 {"setmatches", 1, 2, 0, f_setmatches},
811 {"setpos", 2, 2, f_setpos}, 812 {"setpos", 2, 2, 0, f_setpos},
812 {"setqflist", 1, 3, f_setqflist}, 813 {"setqflist", 1, 3, 0, f_setqflist},
813 {"setreg", 2, 3, f_setreg}, 814 {"setreg", 2, 3, 0, f_setreg},
814 {"settabvar", 3, 3, f_settabvar}, 815 {"settabvar", 3, 3, 0, f_settabvar},
815 {"settabwinvar", 4, 4, f_settabwinvar}, 816 {"settabwinvar", 4, 4, 0, f_settabwinvar},
816 {"settagstack", 2, 3, f_settagstack}, 817 {"settagstack", 2, 3, 0, f_settagstack},
817 {"setwinvar", 3, 3, f_setwinvar}, 818 {"setwinvar", 3, 3, 0, f_setwinvar},
818 #ifdef FEAT_CRYPT 819 #ifdef FEAT_CRYPT
819 {"sha256", 1, 1, f_sha256}, 820 {"sha256", 1, 1, 0, f_sha256},
820 #endif 821 #endif
821 {"shellescape", 1, 2, f_shellescape}, 822 {"shellescape", 1, 2, 0, f_shellescape},
822 {"shiftwidth", 0, 1, f_shiftwidth}, 823 {"shiftwidth", 0, 1, 0, f_shiftwidth},
823 #ifdef FEAT_SIGNS 824 #ifdef FEAT_SIGNS
824 {"sign_define", 1, 2, f_sign_define}, 825 {"sign_define", 1, 2, 0, f_sign_define},
825 {"sign_getdefined", 0, 1, f_sign_getdefined}, 826 {"sign_getdefined", 0, 1, 0, f_sign_getdefined},
826 {"sign_getplaced", 0, 2, f_sign_getplaced}, 827 {"sign_getplaced", 0, 2, 0, f_sign_getplaced},
827 {"sign_jump", 3, 3, f_sign_jump}, 828 {"sign_jump", 3, 3, 0, f_sign_jump},
828 {"sign_place", 4, 5, f_sign_place}, 829 {"sign_place", 4, 5, 0, f_sign_place},
829 {"sign_placelist", 1, 1, f_sign_placelist}, 830 {"sign_placelist", 1, 1, 0, f_sign_placelist},
830 {"sign_undefine", 0, 1, f_sign_undefine}, 831 {"sign_undefine", 0, 1, 0, f_sign_undefine},
831 {"sign_unplace", 1, 2, f_sign_unplace}, 832 {"sign_unplace", 1, 2, 0, f_sign_unplace},
832 {"sign_unplacelist", 1, 2, f_sign_unplacelist}, 833 {"sign_unplacelist", 1, 2, 0, f_sign_unplacelist},
833 #endif 834 #endif
834 {"simplify", 1, 1, f_simplify}, 835 {"simplify", 1, 1, 0, f_simplify},
835 #ifdef FEAT_FLOAT 836 #ifdef FEAT_FLOAT
836 {"sin", 1, 1, f_sin}, 837 {"sin", 1, 1, 0, f_sin},
837 {"sinh", 1, 1, f_sinh}, 838 {"sinh", 1, 1, 0, f_sinh},
838 #endif 839 #endif
839 {"sort", 1, 3, f_sort}, 840 {"sort", 1, 3, 0, f_sort},
840 #ifdef FEAT_SOUND 841 #ifdef FEAT_SOUND
841 {"sound_clear", 0, 0, f_sound_clear}, 842 {"sound_clear", 0, 0, 0, f_sound_clear},
842 {"sound_playevent", 1, 2, f_sound_playevent}, 843 {"sound_playevent", 1, 2, 0, f_sound_playevent},
843 {"sound_playfile", 1, 2, f_sound_playfile}, 844 {"sound_playfile", 1, 2, 0, f_sound_playfile},
844 {"sound_stop", 1, 1, f_sound_stop}, 845 {"sound_stop", 1, 1, 0, f_sound_stop},
845 #endif 846 #endif
846 {"soundfold", 1, 1, f_soundfold}, 847 {"soundfold", 1, 1, 0, f_soundfold},
847 {"spellbadword", 0, 1, f_spellbadword}, 848 {"spellbadword", 0, 1, 0, f_spellbadword},
848 {"spellsuggest", 1, 3, f_spellsuggest}, 849 {"spellsuggest", 1, 3, 0, f_spellsuggest},
849 {"split", 1, 3, f_split}, 850 {"split", 1, 3, 0, f_split},
850 #ifdef FEAT_FLOAT 851 #ifdef FEAT_FLOAT
851 {"sqrt", 1, 1, f_sqrt}, 852 {"sqrt", 1, 1, 0, f_sqrt},
852 {"str2float", 1, 1, f_str2float}, 853 {"str2float", 1, 1, 0, f_str2float},
853 #endif 854 #endif
854 {"str2list", 1, 2, f_str2list}, 855 {"str2list", 1, 2, 0, f_str2list},
855 {"str2nr", 1, 2, f_str2nr}, 856 {"str2nr", 1, 2, 0, f_str2nr},
856 {"strcharpart", 2, 3, f_strcharpart}, 857 {"strcharpart", 2, 3, 0, f_strcharpart},
857 {"strchars", 1, 2, f_strchars}, 858 {"strchars", 1, 2, 0, f_strchars},
858 {"strdisplaywidth", 1, 2, f_strdisplaywidth}, 859 {"strdisplaywidth", 1, 2, 0, f_strdisplaywidth},
859 #ifdef HAVE_STRFTIME 860 #ifdef HAVE_STRFTIME
860 {"strftime", 1, 2, f_strftime}, 861 {"strftime", 1, 2, 0, f_strftime},
861 #endif 862 #endif
862 {"strgetchar", 2, 2, f_strgetchar}, 863 {"strgetchar", 2, 2, 0, f_strgetchar},
863 {"stridx", 2, 3, f_stridx}, 864 {"stridx", 2, 3, 0, f_stridx},
864 {"string", 1, 1, f_string}, 865 {"string", 1, 1, 0, f_string},
865 {"strlen", 1, 1, f_strlen}, 866 {"strlen", 1, 1, 0, f_strlen},
866 {"strpart", 2, 3, f_strpart}, 867 {"strpart", 2, 3, 0, f_strpart},
867 {"strridx", 2, 3, f_strridx}, 868 {"strridx", 2, 3, 0, f_strridx},
868 {"strtrans", 1, 1, f_strtrans}, 869 {"strtrans", 1, 1, 0, f_strtrans},
869 {"strwidth", 1, 1, f_strwidth}, 870 {"strwidth", 1, 1, 0, f_strwidth},
870 {"submatch", 1, 2, f_submatch}, 871 {"submatch", 1, 2, 0, f_submatch},
871 {"substitute", 4, 4, f_substitute}, 872 {"substitute", 4, 4, 0, f_substitute},
872 {"swapinfo", 1, 1, f_swapinfo}, 873 {"swapinfo", 1, 1, 0, f_swapinfo},
873 {"swapname", 1, 1, f_swapname}, 874 {"swapname", 1, 1, 0, f_swapname},
874 {"synID", 3, 3, f_synID}, 875 {"synID", 3, 3, 0, f_synID},
875 {"synIDattr", 2, 3, f_synIDattr}, 876 {"synIDattr", 2, 3, 0, f_synIDattr},
876 {"synIDtrans", 1, 1, f_synIDtrans}, 877 {"synIDtrans", 1, 1, 0, f_synIDtrans},
877 {"synconcealed", 2, 2, f_synconcealed}, 878 {"synconcealed", 2, 2, 0, f_synconcealed},
878 {"synstack", 2, 2, f_synstack}, 879 {"synstack", 2, 2, 0, f_synstack},
879 {"system", 1, 2, f_system}, 880 {"system", 1, 2, 0, f_system},
880 {"systemlist", 1, 2, f_systemlist}, 881 {"systemlist", 1, 2, 0, f_systemlist},
881 {"tabpagebuflist", 0, 1, f_tabpagebuflist}, 882 {"tabpagebuflist", 0, 1, 0, f_tabpagebuflist},
882 {"tabpagenr", 0, 1, f_tabpagenr}, 883 {"tabpagenr", 0, 1, 0, f_tabpagenr},
883 {"tabpagewinnr", 1, 2, f_tabpagewinnr}, 884 {"tabpagewinnr", 1, 2, 0, f_tabpagewinnr},
884 {"tagfiles", 0, 0, f_tagfiles}, 885 {"tagfiles", 0, 0, 0, f_tagfiles},
885 {"taglist", 1, 2, f_taglist}, 886 {"taglist", 1, 2, 0, f_taglist},
886 #ifdef FEAT_FLOAT 887 #ifdef FEAT_FLOAT
887 {"tan", 1, 1, f_tan}, 888 {"tan", 1, 1, 0, f_tan},
888 {"tanh", 1, 1, f_tanh}, 889 {"tanh", 1, 1, 0, f_tanh},
889 #endif 890 #endif
890 {"tempname", 0, 0, f_tempname}, 891 {"tempname", 0, 0, 0, f_tempname},
891 #ifdef FEAT_TERMINAL 892 #ifdef FEAT_TERMINAL
892 {"term_dumpdiff", 2, 3, f_term_dumpdiff}, 893 {"term_dumpdiff", 2, 3, 0, f_term_dumpdiff},
893 {"term_dumpload", 1, 2, f_term_dumpload}, 894 {"term_dumpload", 1, 2, 0, f_term_dumpload},
894 {"term_dumpwrite", 2, 3, f_term_dumpwrite}, 895 {"term_dumpwrite", 2, 3, 0, f_term_dumpwrite},
895 {"term_getaltscreen", 1, 1, f_term_getaltscreen}, 896 {"term_getaltscreen", 1, 1, 0, f_term_getaltscreen},
896 # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) 897 # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
897 {"term_getansicolors", 1, 1, f_term_getansicolors}, 898 {"term_getansicolors", 1, 1, 0, f_term_getansicolors},
898 # endif 899 # endif
899 {"term_getattr", 2, 2, f_term_getattr}, 900 {"term_getattr", 2, 2, 0, f_term_getattr},
900 {"term_getcursor", 1, 1, f_term_getcursor}, 901 {"term_getcursor", 1, 1, 0, f_term_getcursor},
901 {"term_getjob", 1, 1, f_term_getjob}, 902 {"term_getjob", 1, 1, 0, f_term_getjob},
902 {"term_getline", 2, 2, f_term_getline}, 903 {"term_getline", 2, 2, 0, f_term_getline},
903 {"term_getscrolled", 1, 1, f_term_getscrolled}, 904 {"term_getscrolled", 1, 1, 0, f_term_getscrolled},
904 {"term_getsize", 1, 1, f_term_getsize}, 905 {"term_getsize", 1, 1, 0, f_term_getsize},
905 {"term_getstatus", 1, 1, f_term_getstatus}, 906 {"term_getstatus", 1, 1, 0, f_term_getstatus},
906 {"term_gettitle", 1, 1, f_term_gettitle}, 907 {"term_gettitle", 1, 1, 0, f_term_gettitle},
907 {"term_gettty", 1, 2, f_term_gettty}, 908 {"term_gettty", 1, 2, 0, f_term_gettty},
908 {"term_list", 0, 0, f_term_list}, 909 {"term_list", 0, 0, 0, f_term_list},
909 {"term_scrape", 2, 2, f_term_scrape}, 910 {"term_scrape", 2, 2, 0, f_term_scrape},
910 {"term_sendkeys", 2, 2, f_term_sendkeys}, 911 {"term_sendkeys", 2, 2, 0, f_term_sendkeys},
911 # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) 912 # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
912 {"term_setansicolors", 2, 2, f_term_setansicolors}, 913 {"term_setansicolors", 2, 2, 0, f_term_setansicolors},
913 # endif 914 # endif
914 {"term_setkill", 2, 2, f_term_setkill}, 915 {"term_setkill", 2, 2, 0, f_term_setkill},
915 {"term_setrestore", 2, 2, f_term_setrestore}, 916 {"term_setrestore", 2, 2, 0, f_term_setrestore},
916 {"term_setsize", 3, 3, f_term_setsize}, 917 {"term_setsize", 3, 3, 0, f_term_setsize},
917 {"term_start", 1, 2, f_term_start}, 918 {"term_start", 1, 2, 0, f_term_start},
918 {"term_wait", 1, 2, f_term_wait}, 919 {"term_wait", 1, 2, 0, f_term_wait},
919 #endif 920 #endif
920 {"test_alloc_fail", 3, 3, f_test_alloc_fail}, 921 {"test_alloc_fail", 3, 3, 0, f_test_alloc_fail},
921 {"test_autochdir", 0, 0, f_test_autochdir}, 922 {"test_autochdir", 0, 0, 0, f_test_autochdir},
922 {"test_feedinput", 1, 1, f_test_feedinput}, 923 {"test_feedinput", 1, 1, 0, f_test_feedinput},
923 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, 924 {"test_garbagecollect_now", 0, 0, 0, f_test_garbagecollect_now},
924 {"test_garbagecollect_soon", 0, 0, f_test_garbagecollect_soon}, 925 {"test_garbagecollect_soon", 0, 0, 0, f_test_garbagecollect_soon},
925 {"test_getvalue", 1, 1, f_test_getvalue}, 926 {"test_getvalue", 1, 1, 0, f_test_getvalue},
926 {"test_ignore_error", 1, 1, f_test_ignore_error}, 927 {"test_ignore_error", 1, 1, 0, f_test_ignore_error},
927 {"test_null_blob", 0, 0, f_test_null_blob}, 928 {"test_null_blob", 0, 0, 0, f_test_null_blob},
928 #ifdef FEAT_JOB_CHANNEL 929 #ifdef FEAT_JOB_CHANNEL
929 {"test_null_channel", 0, 0, f_test_null_channel}, 930 {"test_null_channel", 0, 0, 0, f_test_null_channel},
930 #endif 931 #endif
931 {"test_null_dict", 0, 0, f_test_null_dict}, 932 {"test_null_dict", 0, 0, 0, f_test_null_dict},
932 #ifdef FEAT_JOB_CHANNEL 933 #ifdef FEAT_JOB_CHANNEL
933 {"test_null_job", 0, 0, f_test_null_job}, 934 {"test_null_job", 0, 0, 0, f_test_null_job},
934 #endif 935 #endif
935 {"test_null_list", 0, 0, f_test_null_list}, 936 {"test_null_list", 0, 0, 0, f_test_null_list},
936 {"test_null_partial", 0, 0, f_test_null_partial}, 937 {"test_null_partial", 0, 0, 0, f_test_null_partial},
937 {"test_null_string", 0, 0, f_test_null_string}, 938 {"test_null_string", 0, 0, 0, f_test_null_string},
938 {"test_option_not_set", 1, 1, f_test_option_not_set}, 939 {"test_option_not_set", 1, 1, 0, f_test_option_not_set},
939 {"test_override", 2, 2, f_test_override}, 940 {"test_override", 2, 2, 0, f_test_override},
940 {"test_refcount", 1, 1, f_test_refcount}, 941 {"test_refcount", 1, 1, 0, f_test_refcount},
941 #ifdef FEAT_GUI 942 #ifdef FEAT_GUI
942 {"test_scrollbar", 3, 3, f_test_scrollbar}, 943 {"test_scrollbar", 3, 3, 0, f_test_scrollbar},
943 #endif 944 #endif
944 #ifdef FEAT_MOUSE 945 #ifdef FEAT_MOUSE
945 {"test_setmouse", 2, 2, f_test_setmouse}, 946 {"test_setmouse", 2, 2, 0, f_test_setmouse},
946 #endif 947 #endif
947 {"test_settime", 1, 1, f_test_settime}, 948 {"test_settime", 1, 1, 0, f_test_settime},
948 #ifdef FEAT_TIMERS 949 #ifdef FEAT_TIMERS
949 {"timer_info", 0, 1, f_timer_info}, 950 {"timer_info", 0, 1, 0, f_timer_info},
950 {"timer_pause", 2, 2, f_timer_pause}, 951 {"timer_pause", 2, 2, 0, f_timer_pause},
951 {"timer_start", 2, 3, f_timer_start}, 952 {"timer_start", 2, 3, 0, f_timer_start},
952 {"timer_stop", 1, 1, f_timer_stop}, 953 {"timer_stop", 1, 1, 0, f_timer_stop},
953 {"timer_stopall", 0, 0, f_timer_stopall}, 954 {"timer_stopall", 0, 0, 0, f_timer_stopall},
954 #endif 955 #endif
955 {"tolower", 1, 1, f_tolower}, 956 {"tolower", 1, 1, 0, f_tolower},
956 {"toupper", 1, 1, f_toupper}, 957 {"toupper", 1, 1, 0, f_toupper},
957 {"tr", 3, 3, f_tr}, 958 {"tr", 3, 3, 0, f_tr},
958 {"trim", 1, 2, f_trim}, 959 {"trim", 1, 2, 0, f_trim},
959 #ifdef FEAT_FLOAT 960 #ifdef FEAT_FLOAT
960 {"trunc", 1, 1, f_trunc}, 961 {"trunc", 1, 1, 0, f_trunc},
961 #endif 962 #endif
962 {"type", 1, 1, f_type}, 963 {"type", 1, 1, 0, f_type},
963 {"undofile", 1, 1, f_undofile}, 964 {"undofile", 1, 1, 0, f_undofile},
964 {"undotree", 0, 0, f_undotree}, 965 {"undotree", 0, 0, 0, f_undotree},
965 {"uniq", 1, 3, f_uniq}, 966 {"uniq", 1, 3, 0, f_uniq},
966 {"values", 1, 1, f_values}, 967 {"values", 1, 1, 0, f_values},
967 {"virtcol", 1, 1, f_virtcol}, 968 {"virtcol", 1, 1, 0, f_virtcol},
968 {"visualmode", 0, 1, f_visualmode}, 969 {"visualmode", 0, 1, 0, f_visualmode},
969 {"wildmenumode", 0, 0, f_wildmenumode}, 970 {"wildmenumode", 0, 0, 0, f_wildmenumode},
970 {"win_execute", 2, 3, f_win_execute}, 971 {"win_execute", 2, 3, 0, f_win_execute},
971 {"win_findbuf", 1, 1, f_win_findbuf}, 972 {"win_findbuf", 1, 1, 0, f_win_findbuf},
972 {"win_getid", 0, 2, f_win_getid}, 973 {"win_getid", 0, 2, 0, f_win_getid},
973 {"win_gotoid", 1, 1, f_win_gotoid}, 974 {"win_gotoid", 1, 1, 0, f_win_gotoid},
974 {"win_id2tabwin", 1, 1, f_win_id2tabwin}, 975 {"win_id2tabwin", 1, 1, 0, f_win_id2tabwin},
975 {"win_id2win", 1, 1, f_win_id2win}, 976 {"win_id2win", 1, 1, 0, f_win_id2win},
976 {"win_screenpos", 1, 1, f_win_screenpos}, 977 {"win_screenpos", 1, 1, 0, f_win_screenpos},
977 {"winbufnr", 1, 1, f_winbufnr}, 978 {"winbufnr", 1, 1, 0, f_winbufnr},
978 {"wincol", 0, 0, f_wincol}, 979 {"wincol", 0, 0, 0, f_wincol},
979 {"winheight", 1, 1, f_winheight}, 980 {"winheight", 1, 1, 0, f_winheight},
980 {"winlayout", 0, 1, f_winlayout}, 981 {"winlayout", 0, 1, 0, f_winlayout},
981 {"winline", 0, 0, f_winline}, 982 {"winline", 0, 0, 0, f_winline},
982 {"winnr", 0, 1, f_winnr}, 983 {"winnr", 0, 1, 0, f_winnr},
983 {"winrestcmd", 0, 0, f_winrestcmd}, 984 {"winrestcmd", 0, 0, 0, f_winrestcmd},
984 {"winrestview", 1, 1, f_winrestview}, 985 {"winrestview", 1, 1, 0, f_winrestview},
985 {"winsaveview", 0, 0, f_winsaveview}, 986 {"winsaveview", 0, 0, 0, f_winsaveview},
986 {"winwidth", 1, 1, f_winwidth}, 987 {"winwidth", 1, 1, 0, f_winwidth},
987 {"wordcount", 0, 0, f_wordcount}, 988 {"wordcount", 0, 0, 0, f_wordcount},
988 {"writefile", 2, 3, f_writefile}, 989 {"writefile", 2, 3, 0, f_writefile},
989 {"xor", 2, 2, f_xor}, 990 {"xor", 2, 2, 0, f_xor},
990 }; 991 };
991 992
993 // values for f_argtype
994 #define FEARG_LAST 1 // base is the last argument
995 #define FEARG_2 2 // base is the second argument
996
992 /* 997 /*
993 * Methods that call the internal function with the base as the first argument. 998 * Methods that call the internal function with the base as the first argument.
994 */ 999 */
995 static funcentry_T base_methods[] = 1000 static funcentry_T base_methods[] =
996 { 1001 {
997 {"add", 1, 1, f_add}, 1002 {"add", 1, 1, 0, f_add},
998 {"copy", 0, 0, f_copy}, 1003 {"append", 1, 1, FEARG_LAST, f_append},
999 {"count", 1, 3, f_count}, 1004 {"appendbufline", 2, 2, FEARG_LAST, f_appendbufline},
1000 {"empty", 0, 0, f_empty}, 1005 {"assert_equal", 1, 2, FEARG_2, f_assert_equal},
1001 {"extend", 1, 2, f_extend}, 1006 {"assert_notequal", 1, 2, FEARG_2, f_assert_notequal},
1002 {"filter", 1, 1, f_filter}, 1007 {"copy", 0, 0, 0, f_copy},
1003 {"get", 1, 2, f_get}, 1008 {"count", 1, 3, 0, f_count},
1004 {"index", 1, 3, f_index}, 1009 {"empty", 0, 0, 0, f_empty},
1005 {"insert", 1, 2, f_insert}, 1010 {"eval", 0, 0, 0, f_eval},
1006 {"items", 0, 0, f_items}, 1011 {"extend", 1, 2, 0, f_extend},
1007 {"join", 0, 1, f_join}, 1012 {"filter", 1, 1, 0, f_filter},
1008 {"keys", 0, 0, f_keys}, 1013 {"get", 1, 2, 0, f_get},
1009 {"len", 0, 0, f_len}, 1014 {"index", 1, 3, 0, f_index},
1010 {"map", 1, 1, f_map}, 1015 {"insert", 1, 2, 0, f_insert},
1011 {"max", 0, 0, f_max}, 1016 {"items", 0, 0, 0, f_items},
1012 {"min", 0, 0, f_min}, 1017 {"join", 0, 1, 0, f_join},
1013 {"remove", 1, 2, f_remove}, 1018 {"keys", 0, 0, 0, f_keys},
1014 {"repeat", 1, 1, f_repeat}, 1019 {"len", 0, 0, 0, f_len},
1015 {"reverse", 0, 0, f_reverse}, 1020 {"map", 1, 1, 0, f_map},
1016 {"sort", 0, 2, f_sort}, 1021 {"max", 0, 0, 0, f_max},
1017 {"string", 0, 0, f_string}, 1022 {"min", 0, 0, 0, f_min},
1018 {"type", 0, 0, f_type}, 1023 {"remove", 1, 2, 0, f_remove},
1019 {"uniq", 0, 2, f_uniq}, 1024 {"repeat", 1, 1, 0, f_repeat},
1020 {"values", 0, 0, f_values}, 1025 {"reverse", 0, 0, 0, f_reverse},
1026 {"sort", 0, 2, 0, f_sort},
1027 {"string", 0, 0, 0, f_string},
1028 {"type", 0, 0, 0, f_type},
1029 {"uniq", 0, 2, 0, f_uniq},
1030 {"values", 0, 0, 0, f_values},
1021 }; 1031 };
1022 1032
1023 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) 1033 #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
1024 1034
1025 /* 1035 /*
1157 if (argcount < base_methods[fi].f_min_argc) 1167 if (argcount < base_methods[fi].f_min_argc)
1158 return ERROR_TOOFEW; 1168 return ERROR_TOOFEW;
1159 if (argcount > base_methods[fi].f_max_argc) 1169 if (argcount > base_methods[fi].f_max_argc)
1160 return ERROR_TOOMANY; 1170 return ERROR_TOOMANY;
1161 1171
1162 argv[0] = *basetv; 1172 if (base_methods[fi].f_argtype == FEARG_LAST)
1163 for (i = 0; i < argcount; ++i) 1173 {
1164 argv[i + 1] = argvars[i]; 1174 // base value goes last
1175 for (i = 0; i < argcount; ++i)
1176 argv[i] = argvars[i];
1177 argv[argcount] = *basetv;
1178 }
1179 else if (base_methods[fi].f_argtype == FEARG_2)
1180 {
1181 // base value goes second
1182 argv[0] = argvars[0];
1183 argv[1] = *basetv;
1184 for (i = 1; i < argcount; ++i)
1185 argv[i + 1] = argvars[i];
1186 }
1187 else
1188 {
1189 argv[0] = *basetv;
1190 for (i = 0; i < argcount; ++i)
1191 argv[i + 1] = argvars[i];
1192 }
1165 argv[argcount + 1].v_type = VAR_UNKNOWN; 1193 argv[argcount + 1].v_type = VAR_UNKNOWN;
1166 1194
1167 base_methods[fi].f_func(argv, rettv); 1195 base_methods[fi].f_func(argv, rettv);
1168 return ERROR_NONE; 1196 return ERROR_NONE;
1169 } 1197 }