comparison src/evalfunc.c @ 22655:eabe2c1444ea v8.2.1876

patch 8.2.1876: Vim9: argument types are not checked at compile time Commit: https://github.com/vim/vim/commit/94738d8fab09c5563e1512f1695e047c715ad274 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 21 14:25:07 2020 +0200 patch 8.2.1876: Vim9: argument types are not checked at compile time Problem: Vim9: argument types for builtin functions are not checked at compile time. Solution: Add an argument type checking mechanism. Implement type checks for one function.
author Bram Moolenaar <Bram@vim.org>
date Wed, 21 Oct 2020 14:30:04 +0200
parents b5d68d8a5187
children 3ccd2fa6b713
comparison
equal deleted inserted replaced
22654:ce95914cd5f2 22655:eabe2c1444ea
257 static void f_windowsversion(typval_T *argvars, typval_T *rettv); 257 static void f_windowsversion(typval_T *argvars, typval_T *rettv);
258 static void f_wordcount(typval_T *argvars, typval_T *rettv); 258 static void f_wordcount(typval_T *argvars, typval_T *rettv);
259 static void f_xor(typval_T *argvars, typval_T *rettv); 259 static void f_xor(typval_T *argvars, typval_T *rettv);
260 260
261 261
262 /*
263 * Functions that check the argument type of a builtin function.
264 * Each function returns FAIL and gives an error message if the type is wrong.
265 */
266
267 // Context passed to an arg_ function.
268 typedef struct {
269 int arg_count; // actual argument count
270 int arg_idx; // current argument index (first arg is zero)
271 } argcontext_T;
272
273 // A function to check one argument type. The first argument is the type to
274 // check. If needed, other argument types can be obtained with the context.
275 // E.g. if "arg_idx" is 1, then (type - 1) is the first argument type.
276 typedef int (*argcheck_T)(type_T *, argcontext_T *);
277
278 static int
279 arg_float_or_nr(type_T *type, argcontext_T *context)
280 {
281 if (type->tt_type == VAR_FLOAT || type->tt_type == VAR_NUMBER)
282 return OK;
283 arg_type_mismatch(&t_number, type, context->arg_idx + 1);
284 return FAIL;
285 }
286
287 /*
288 * Lists of functions that check the argument types of a builtin function.
289 */
290 argcheck_T arg1_float_or_nr[] = {arg_float_or_nr};
291
292 /*
293 * Functions that return the return type of a builtin function.
294 */
262 static type_T * 295 static type_T *
263 ret_void(int argcount UNUSED, type_T **argtypes UNUSED) 296 ret_void(int argcount UNUSED, type_T **argtypes UNUSED)
264 { 297 {
265 return &t_void; 298 return &t_void;
266 } 299 }
430 { 463 {
431 char *f_name; // function name 464 char *f_name; // function name
432 char f_min_argc; // minimal number of arguments 465 char f_min_argc; // minimal number of arguments
433 char f_max_argc; // maximal number of arguments 466 char f_max_argc; // maximal number of arguments
434 char f_argtype; // for method: FEARG_ values 467 char f_argtype; // for method: FEARG_ values
468 argcheck_T *f_argcheck; // list of functions to check argument types
435 type_T *(*f_retfunc)(int argcount, type_T **argtypes); 469 type_T *(*f_retfunc)(int argcount, type_T **argtypes);
436 // return type function 470 // return type function
437 void (*f_func)(typval_T *args, typval_T *rvar); 471 void (*f_func)(typval_T *args, typval_T *rvar);
438 // implementation of function 472 // implementation of function
439 } funcentry_T; 473 } funcentry_T;
486 # define TERM_FUNC(name) NULL 520 # define TERM_FUNC(name) NULL
487 #endif 521 #endif
488 522
489 static funcentry_T global_functions[] = 523 static funcentry_T global_functions[] =
490 { 524 {
491 {"abs", 1, 1, FEARG_1, ret_any, FLOAT_FUNC(f_abs)}, 525 {"abs", 1, 1, FEARG_1, arg1_float_or_nr,
492 {"acos", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_acos)}, 526 ret_any, FLOAT_FUNC(f_abs)},
493 {"add", 2, 2, FEARG_1, ret_first_arg, f_add}, 527 {"acos", 1, 1, FEARG_1, NULL,
494 {"and", 2, 2, FEARG_1, ret_number, f_and}, 528 ret_float, FLOAT_FUNC(f_acos)},
495 {"append", 2, 2, FEARG_2, ret_number, f_append}, 529 {"add", 2, 2, FEARG_1, NULL,
496 {"appendbufline", 3, 3, FEARG_3, ret_number, f_appendbufline}, 530 ret_first_arg, f_add},
497 {"argc", 0, 1, 0, ret_number, f_argc}, 531 {"and", 2, 2, FEARG_1, NULL,
498 {"argidx", 0, 0, 0, ret_number, f_argidx}, 532 ret_number, f_and},
499 {"arglistid", 0, 2, 0, ret_number, f_arglistid}, 533 {"append", 2, 2, FEARG_2, NULL,
500 {"argv", 0, 2, 0, ret_argv, f_argv}, 534 ret_number, f_append},
501 {"asin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_asin)}, 535 {"appendbufline", 3, 3, FEARG_3, NULL,
502 {"assert_beeps", 1, 2, FEARG_1, ret_number, f_assert_beeps}, 536 ret_number, f_appendbufline},
503 {"assert_equal", 2, 3, FEARG_2, ret_number, f_assert_equal}, 537 {"argc", 0, 1, 0, NULL,
504 {"assert_equalfile", 2, 3, FEARG_1, ret_number, f_assert_equalfile}, 538 ret_number, f_argc},
505 {"assert_exception", 1, 2, 0, ret_number, f_assert_exception}, 539 {"argidx", 0, 0, 0, NULL,
506 {"assert_fails", 1, 5, FEARG_1, ret_number, f_assert_fails}, 540 ret_number, f_argidx},
507 {"assert_false", 1, 2, FEARG_1, ret_number, f_assert_false}, 541 {"arglistid", 0, 2, 0, NULL,
508 {"assert_inrange", 3, 4, FEARG_3, ret_number, f_assert_inrange}, 542 ret_number, f_arglistid},
509 {"assert_match", 2, 3, FEARG_2, ret_number, f_assert_match}, 543 {"argv", 0, 2, 0, NULL,
510 {"assert_notequal", 2, 3, FEARG_2, ret_number, f_assert_notequal}, 544 ret_argv, f_argv},
511 {"assert_notmatch", 2, 3, FEARG_2, ret_number, f_assert_notmatch}, 545 {"asin", 1, 1, FEARG_1, NULL,
512 {"assert_report", 1, 1, FEARG_1, ret_number, f_assert_report}, 546 ret_float, FLOAT_FUNC(f_asin)},
513 {"assert_true", 1, 2, FEARG_1, ret_number, f_assert_true}, 547 {"assert_beeps", 1, 2, FEARG_1, NULL,
514 {"atan", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_atan)}, 548 ret_number, f_assert_beeps},
515 {"atan2", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_atan2)}, 549 {"assert_equal", 2, 3, FEARG_2, NULL,
516 {"balloon_gettext", 0, 0, 0, ret_string, 550 ret_number, f_assert_equal},
551 {"assert_equalfile", 2, 3, FEARG_1, NULL,
552 ret_number, f_assert_equalfile},
553 {"assert_exception", 1, 2, 0, NULL,
554 ret_number, f_assert_exception},
555 {"assert_fails", 1, 5, FEARG_1, NULL,
556 ret_number, f_assert_fails},
557 {"assert_false", 1, 2, FEARG_1, NULL,
558 ret_number, f_assert_false},
559 {"assert_inrange", 3, 4, FEARG_3, NULL,
560 ret_number, f_assert_inrange},
561 {"assert_match", 2, 3, FEARG_2, NULL,
562 ret_number, f_assert_match},
563 {"assert_notequal", 2, 3, FEARG_2, NULL,
564 ret_number, f_assert_notequal},
565 {"assert_notmatch", 2, 3, FEARG_2, NULL,
566 ret_number, f_assert_notmatch},
567 {"assert_report", 1, 1, FEARG_1, NULL,
568 ret_number, f_assert_report},
569 {"assert_true", 1, 2, FEARG_1, NULL,
570 ret_number, f_assert_true},
571 {"atan", 1, 1, FEARG_1, NULL,
572 ret_float, FLOAT_FUNC(f_atan)},
573 {"atan2", 2, 2, FEARG_1, NULL,
574 ret_float, FLOAT_FUNC(f_atan2)},
575 {"balloon_gettext", 0, 0, 0, NULL,
576 ret_string,
517 #ifdef FEAT_BEVAL 577 #ifdef FEAT_BEVAL
518 f_balloon_gettext 578 f_balloon_gettext
519 #else 579 #else
520 NULL 580 NULL
521 #endif 581 #endif
522 }, 582 },
523 {"balloon_show", 1, 1, FEARG_1, ret_void, 583 {"balloon_show", 1, 1, FEARG_1, NULL,
584 ret_void,
524 #ifdef FEAT_BEVAL 585 #ifdef FEAT_BEVAL
525 f_balloon_show 586 f_balloon_show
526 #else 587 #else
527 NULL 588 NULL
528 #endif 589 #endif
529 }, 590 },
530 {"balloon_split", 1, 1, FEARG_1, ret_list_string, 591 {"balloon_split", 1, 1, FEARG_1, NULL,
592 ret_list_string,
531 #if defined(FEAT_BEVAL_TERM) 593 #if defined(FEAT_BEVAL_TERM)
532 f_balloon_split 594 f_balloon_split
533 #else 595 #else
534 NULL 596 NULL
535 #endif 597 #endif
536 }, 598 },
537 {"browse", 4, 4, 0, ret_string, f_browse}, 599 {"browse", 4, 4, 0, NULL,
538 {"browsedir", 2, 2, 0, ret_string, f_browsedir}, 600 ret_string, f_browse},
539 {"bufadd", 1, 1, FEARG_1, ret_number, f_bufadd}, 601 {"browsedir", 2, 2, 0, NULL,
540 {"bufexists", 1, 1, FEARG_1, ret_number, f_bufexists}, 602 ret_string, f_browsedir},
541 {"buffer_exists", 1, 1, FEARG_1, ret_number, f_bufexists}, // obsolete 603 {"bufadd", 1, 1, FEARG_1, NULL,
542 {"buffer_name", 0, 1, FEARG_1, ret_string, f_bufname}, // obsolete 604 ret_number, f_bufadd},
543 {"buffer_number", 0, 1, FEARG_1, ret_number, f_bufnr}, // obsolete 605 {"bufexists", 1, 1, FEARG_1, NULL,
544 {"buflisted", 1, 1, FEARG_1, ret_number, f_buflisted}, 606 ret_number, f_bufexists},
545 {"bufload", 1, 1, FEARG_1, ret_void, f_bufload}, 607 {"buffer_exists", 1, 1, FEARG_1, NULL,
546 {"bufloaded", 1, 1, FEARG_1, ret_number, f_bufloaded}, 608 ret_number, f_bufexists}, // obsolete
547 {"bufname", 0, 1, FEARG_1, ret_string, f_bufname}, 609 {"buffer_name", 0, 1, FEARG_1, NULL,
548 {"bufnr", 0, 2, FEARG_1, ret_number, f_bufnr}, 610 ret_string, f_bufname}, // obsolete
549 {"bufwinid", 1, 1, FEARG_1, ret_number, f_bufwinid}, 611 {"buffer_number", 0, 1, FEARG_1, NULL,
550 {"bufwinnr", 1, 1, FEARG_1, ret_number, f_bufwinnr}, 612 ret_number, f_bufnr}, // obsolete
551 {"byte2line", 1, 1, FEARG_1, ret_number, f_byte2line}, 613 {"buflisted", 1, 1, FEARG_1, NULL,
552 {"byteidx", 2, 2, FEARG_1, ret_number, f_byteidx}, 614 ret_number, f_buflisted},
553 {"byteidxcomp", 2, 2, FEARG_1, ret_number, f_byteidxcomp}, 615 {"bufload", 1, 1, FEARG_1, NULL,
554 {"call", 2, 3, FEARG_1, ret_any, f_call}, 616 ret_void, f_bufload},
555 {"ceil", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_ceil)}, 617 {"bufloaded", 1, 1, FEARG_1, NULL,
556 {"ch_canread", 1, 1, FEARG_1, ret_number, JOB_FUNC(f_ch_canread)}, 618 ret_number, f_bufloaded},
557 {"ch_close", 1, 1, FEARG_1, ret_void, JOB_FUNC(f_ch_close)}, 619 {"bufname", 0, 1, FEARG_1, NULL,
558 {"ch_close_in", 1, 1, FEARG_1, ret_void, JOB_FUNC(f_ch_close_in)}, 620 ret_string, f_bufname},
559 {"ch_evalexpr", 2, 3, FEARG_1, ret_any, JOB_FUNC(f_ch_evalexpr)}, 621 {"bufnr", 0, 2, FEARG_1, NULL,
560 {"ch_evalraw", 2, 3, FEARG_1, ret_any, JOB_FUNC(f_ch_evalraw)}, 622 ret_number, f_bufnr},
561 {"ch_getbufnr", 2, 2, FEARG_1, ret_number, JOB_FUNC(f_ch_getbufnr)}, 623 {"bufwinid", 1, 1, FEARG_1, NULL,
562 {"ch_getjob", 1, 1, FEARG_1, ret_job, JOB_FUNC(f_ch_getjob)}, 624 ret_number, f_bufwinid},
563 {"ch_info", 1, 1, FEARG_1, ret_dict_any, JOB_FUNC(f_ch_info)}, 625 {"bufwinnr", 1, 1, FEARG_1, NULL,
564 {"ch_log", 1, 2, FEARG_1, ret_void, JOB_FUNC(f_ch_log)}, 626 ret_number, f_bufwinnr},
565 {"ch_logfile", 1, 2, FEARG_1, ret_void, JOB_FUNC(f_ch_logfile)}, 627 {"byte2line", 1, 1, FEARG_1, NULL,
566 {"ch_open", 1, 2, FEARG_1, ret_channel, JOB_FUNC(f_ch_open)}, 628 ret_number, f_byte2line},
567 {"ch_read", 1, 2, FEARG_1, ret_string, JOB_FUNC(f_ch_read)}, 629 {"byteidx", 2, 2, FEARG_1, NULL,
568 {"ch_readblob", 1, 2, FEARG_1, ret_blob, JOB_FUNC(f_ch_readblob)}, 630 ret_number, f_byteidx},
569 {"ch_readraw", 1, 2, FEARG_1, ret_string, JOB_FUNC(f_ch_readraw)}, 631 {"byteidxcomp", 2, 2, FEARG_1, NULL,
570 {"ch_sendexpr", 2, 3, FEARG_1, ret_void, JOB_FUNC(f_ch_sendexpr)}, 632 ret_number, f_byteidxcomp},
571 {"ch_sendraw", 2, 3, FEARG_1, ret_void, JOB_FUNC(f_ch_sendraw)}, 633 {"call", 2, 3, FEARG_1, NULL,
572 {"ch_setoptions", 2, 2, FEARG_1, ret_void, JOB_FUNC(f_ch_setoptions)}, 634 ret_any, f_call},
573 {"ch_status", 1, 2, FEARG_1, ret_string, JOB_FUNC(f_ch_status)}, 635 {"ceil", 1, 1, FEARG_1, NULL,
574 {"changenr", 0, 0, 0, ret_number, f_changenr}, 636 ret_float, FLOAT_FUNC(f_ceil)},
575 {"char2nr", 1, 2, FEARG_1, ret_number, f_char2nr}, 637 {"ch_canread", 1, 1, FEARG_1, NULL,
576 {"charclass", 1, 1, FEARG_1, ret_number, f_charclass}, 638 ret_number, JOB_FUNC(f_ch_canread)},
577 {"chdir", 1, 1, FEARG_1, ret_string, f_chdir}, 639 {"ch_close", 1, 1, FEARG_1, NULL,
578 {"cindent", 1, 1, FEARG_1, ret_number, f_cindent}, 640 ret_void, JOB_FUNC(f_ch_close)},
579 {"clearmatches", 0, 1, FEARG_1, ret_void, f_clearmatches}, 641 {"ch_close_in", 1, 1, FEARG_1, NULL,
580 {"col", 1, 1, FEARG_1, ret_number, f_col}, 642 ret_void, JOB_FUNC(f_ch_close_in)},
581 {"complete", 2, 2, FEARG_2, ret_void, f_complete}, 643 {"ch_evalexpr", 2, 3, FEARG_1, NULL,
582 {"complete_add", 1, 1, FEARG_1, ret_number, f_complete_add}, 644 ret_any, JOB_FUNC(f_ch_evalexpr)},
583 {"complete_check", 0, 0, 0, ret_number, f_complete_check}, 645 {"ch_evalraw", 2, 3, FEARG_1, NULL,
584 {"complete_info", 0, 1, FEARG_1, ret_dict_any, f_complete_info}, 646 ret_any, JOB_FUNC(f_ch_evalraw)},
585 {"confirm", 1, 4, FEARG_1, ret_number, f_confirm}, 647 {"ch_getbufnr", 2, 2, FEARG_1, NULL,
586 {"copy", 1, 1, FEARG_1, ret_first_arg, f_copy}, 648 ret_number, JOB_FUNC(f_ch_getbufnr)},
587 {"cos", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_cos)}, 649 {"ch_getjob", 1, 1, FEARG_1, NULL,
588 {"cosh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_cosh)}, 650 ret_job, JOB_FUNC(f_ch_getjob)},
589 {"count", 2, 4, FEARG_1, ret_number, f_count}, 651 {"ch_info", 1, 1, FEARG_1, NULL,
590 {"cscope_connection",0,3, 0, ret_number, f_cscope_connection}, 652 ret_dict_any, JOB_FUNC(f_ch_info)},
591 {"cursor", 1, 3, FEARG_1, ret_number, f_cursor}, 653 {"ch_log", 1, 2, FEARG_1, NULL,
592 {"debugbreak", 1, 1, FEARG_1, ret_number, 654 ret_void, JOB_FUNC(f_ch_log)},
655 {"ch_logfile", 1, 2, FEARG_1, NULL,
656 ret_void, JOB_FUNC(f_ch_logfile)},
657 {"ch_open", 1, 2, FEARG_1, NULL,
658 ret_channel, JOB_FUNC(f_ch_open)},
659 {"ch_read", 1, 2, FEARG_1, NULL,
660 ret_string, JOB_FUNC(f_ch_read)},
661 {"ch_readblob", 1, 2, FEARG_1, NULL,
662 ret_blob, JOB_FUNC(f_ch_readblob)},
663 {"ch_readraw", 1, 2, FEARG_1, NULL,
664 ret_string, JOB_FUNC(f_ch_readraw)},
665 {"ch_sendexpr", 2, 3, FEARG_1, NULL,
666 ret_void, JOB_FUNC(f_ch_sendexpr)},
667 {"ch_sendraw", 2, 3, FEARG_1, NULL,
668 ret_void, JOB_FUNC(f_ch_sendraw)},
669 {"ch_setoptions", 2, 2, FEARG_1, NULL,
670 ret_void, JOB_FUNC(f_ch_setoptions)},
671 {"ch_status", 1, 2, FEARG_1, NULL,
672 ret_string, JOB_FUNC(f_ch_status)},
673 {"changenr", 0, 0, 0, NULL,
674 ret_number, f_changenr},
675 {"char2nr", 1, 2, FEARG_1, NULL,
676 ret_number, f_char2nr},
677 {"charclass", 1, 1, FEARG_1, NULL,
678 ret_number, f_charclass},
679 {"chdir", 1, 1, FEARG_1, NULL,
680 ret_string, f_chdir},
681 {"cindent", 1, 1, FEARG_1, NULL,
682 ret_number, f_cindent},
683 {"clearmatches", 0, 1, FEARG_1, NULL,
684 ret_void, f_clearmatches},
685 {"col", 1, 1, FEARG_1, NULL,
686 ret_number, f_col},
687 {"complete", 2, 2, FEARG_2, NULL,
688 ret_void, f_complete},
689 {"complete_add", 1, 1, FEARG_1, NULL,
690 ret_number, f_complete_add},
691 {"complete_check", 0, 0, 0, NULL,
692 ret_number, f_complete_check},
693 {"complete_info", 0, 1, FEARG_1, NULL,
694 ret_dict_any, f_complete_info},
695 {"confirm", 1, 4, FEARG_1, NULL,
696 ret_number, f_confirm},
697 {"copy", 1, 1, FEARG_1, NULL,
698 ret_first_arg, f_copy},
699 {"cos", 1, 1, FEARG_1, NULL,
700 ret_float, FLOAT_FUNC(f_cos)},
701 {"cosh", 1, 1, FEARG_1, NULL,
702 ret_float, FLOAT_FUNC(f_cosh)},
703 {"count", 2, 4, FEARG_1, NULL,
704 ret_number, f_count},
705 {"cscope_connection",0,3, 0, NULL,
706 ret_number, f_cscope_connection},
707 {"cursor", 1, 3, FEARG_1, NULL,
708 ret_number, f_cursor},
709 {"debugbreak", 1, 1, FEARG_1, NULL,
710 ret_number,
593 #ifdef MSWIN 711 #ifdef MSWIN
594 f_debugbreak 712 f_debugbreak
595 #else 713 #else
596 NULL 714 NULL
597 #endif 715 #endif
598 }, 716 },
599 {"deepcopy", 1, 2, FEARG_1, ret_first_arg, f_deepcopy}, 717 {"deepcopy", 1, 2, FEARG_1, NULL,
600 {"delete", 1, 2, FEARG_1, ret_number, f_delete}, 718 ret_first_arg, f_deepcopy},
601 {"deletebufline", 2, 3, FEARG_1, ret_number, f_deletebufline}, 719 {"delete", 1, 2, FEARG_1, NULL,
602 {"did_filetype", 0, 0, 0, ret_number, f_did_filetype}, 720 ret_number, f_delete},
603 {"diff_filler", 1, 1, FEARG_1, ret_number, f_diff_filler}, 721 {"deletebufline", 2, 3, FEARG_1, NULL,
604 {"diff_hlID", 2, 2, FEARG_1, ret_number, f_diff_hlID}, 722 ret_number, f_deletebufline},
605 {"echoraw", 1, 1, FEARG_1, ret_number, f_echoraw}, 723 {"did_filetype", 0, 0, 0, NULL,
606 {"empty", 1, 1, FEARG_1, ret_number, f_empty}, 724 ret_number, f_did_filetype},
607 {"environ", 0, 0, 0, ret_dict_string, f_environ}, 725 {"diff_filler", 1, 1, FEARG_1, NULL,
608 {"escape", 2, 2, FEARG_1, ret_string, f_escape}, 726 ret_number, f_diff_filler},
609 {"eval", 1, 1, FEARG_1, ret_any, f_eval}, 727 {"diff_hlID", 2, 2, FEARG_1, NULL,
610 {"eventhandler", 0, 0, 0, ret_number, f_eventhandler}, 728 ret_number, f_diff_hlID},
611 {"executable", 1, 1, FEARG_1, ret_number, f_executable}, 729 {"echoraw", 1, 1, FEARG_1, NULL,
612 {"execute", 1, 2, FEARG_1, ret_string, f_execute}, 730 ret_number, f_echoraw},
613 {"exepath", 1, 1, FEARG_1, ret_string, f_exepath}, 731 {"empty", 1, 1, FEARG_1, NULL,
614 {"exists", 1, 1, FEARG_1, ret_number, f_exists}, 732 ret_number, f_empty},
615 {"exp", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_exp)}, 733 {"environ", 0, 0, 0, NULL,
616 {"expand", 1, 3, FEARG_1, ret_any, f_expand}, 734 ret_dict_string, f_environ},
617 {"expandcmd", 1, 1, FEARG_1, ret_string, f_expandcmd}, 735 {"escape", 2, 2, FEARG_1, NULL,
618 {"extend", 2, 3, FEARG_1, ret_first_arg, f_extend}, 736 ret_string, f_escape},
619 {"feedkeys", 1, 2, FEARG_1, ret_void, f_feedkeys}, 737 {"eval", 1, 1, FEARG_1, NULL,
620 {"file_readable", 1, 1, FEARG_1, ret_number, f_filereadable}, // obsolete 738 ret_any, f_eval},
621 {"filereadable", 1, 1, FEARG_1, ret_number, f_filereadable}, 739 {"eventhandler", 0, 0, 0, NULL,
622 {"filewritable", 1, 1, FEARG_1, ret_number, f_filewritable}, 740 ret_number, f_eventhandler},
623 {"filter", 2, 2, FEARG_1, ret_first_arg, f_filter}, 741 {"executable", 1, 1, FEARG_1, NULL,
624 {"finddir", 1, 3, FEARG_1, ret_string, f_finddir}, 742 ret_number, f_executable},
625 {"findfile", 1, 3, FEARG_1, ret_string, f_findfile}, 743 {"execute", 1, 2, FEARG_1, NULL,
626 {"flatten", 1, 2, FEARG_1, ret_list_any, f_flatten}, 744 ret_string, f_execute},
627 {"float2nr", 1, 1, FEARG_1, ret_number, FLOAT_FUNC(f_float2nr)}, 745 {"exepath", 1, 1, FEARG_1, NULL,
628 {"floor", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_floor)}, 746 ret_string, f_exepath},
629 {"fmod", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_fmod)}, 747 {"exists", 1, 1, FEARG_1, NULL,
630 {"fnameescape", 1, 1, FEARG_1, ret_string, f_fnameescape}, 748 ret_number, f_exists},
631 {"fnamemodify", 2, 2, FEARG_1, ret_string, f_fnamemodify}, 749 {"exp", 1, 1, FEARG_1, NULL,
632 {"foldclosed", 1, 1, FEARG_1, ret_number, f_foldclosed}, 750 ret_float, FLOAT_FUNC(f_exp)},
633 {"foldclosedend", 1, 1, FEARG_1, ret_number, f_foldclosedend}, 751 {"expand", 1, 3, FEARG_1, NULL,
634 {"foldlevel", 1, 1, FEARG_1, ret_number, f_foldlevel}, 752 ret_any, f_expand},
635 {"foldtext", 0, 0, 0, ret_string, f_foldtext}, 753 {"expandcmd", 1, 1, FEARG_1, NULL,
636 {"foldtextresult", 1, 1, FEARG_1, ret_string, f_foldtextresult}, 754 ret_string, f_expandcmd},
637 {"foreground", 0, 0, 0, ret_void, f_foreground}, 755 {"extend", 2, 3, FEARG_1, NULL,
638 {"funcref", 1, 3, FEARG_1, ret_func_any, f_funcref}, 756 ret_first_arg, f_extend},
639 {"function", 1, 3, FEARG_1, ret_f_function, f_function}, 757 {"feedkeys", 1, 2, FEARG_1, NULL,
640 {"garbagecollect", 0, 1, 0, ret_void, f_garbagecollect}, 758 ret_void, f_feedkeys},
641 {"get", 2, 3, FEARG_1, ret_any, f_get}, 759 {"file_readable", 1, 1, FEARG_1, NULL,
642 {"getbufinfo", 0, 1, FEARG_1, ret_list_dict_any, f_getbufinfo}, 760 ret_number, f_filereadable}, // obsolete
643 {"getbufline", 2, 3, FEARG_1, ret_list_string, f_getbufline}, 761 {"filereadable", 1, 1, FEARG_1, NULL,
644 {"getbufvar", 2, 3, FEARG_1, ret_any, f_getbufvar}, 762 ret_number, f_filereadable},
645 {"getchangelist", 0, 1, FEARG_1, ret_list_any, f_getchangelist}, 763 {"filewritable", 1, 1, FEARG_1, NULL,
646 {"getchar", 0, 1, 0, ret_number, f_getchar}, 764 ret_number, f_filewritable},
647 {"getcharmod", 0, 0, 0, ret_number, f_getcharmod}, 765 {"filter", 2, 2, FEARG_1, NULL,
648 {"getcharsearch", 0, 0, 0, ret_dict_any, f_getcharsearch}, 766 ret_first_arg, f_filter},
649 {"getcmdline", 0, 0, 0, ret_string, f_getcmdline}, 767 {"finddir", 1, 3, FEARG_1, NULL,
650 {"getcmdpos", 0, 0, 0, ret_number, f_getcmdpos}, 768 ret_string, f_finddir},
651 {"getcmdtype", 0, 0, 0, ret_string, f_getcmdtype}, 769 {"findfile", 1, 3, FEARG_1, NULL,
652 {"getcmdwintype", 0, 0, 0, ret_string, f_getcmdwintype}, 770 ret_string, f_findfile},
653 {"getcompletion", 2, 3, FEARG_1, ret_list_string, f_getcompletion}, 771 {"flatten", 1, 2, FEARG_1, NULL,
654 {"getcurpos", 0, 1, FEARG_1, ret_list_number, f_getcurpos}, 772 ret_list_any, f_flatten},
655 {"getcwd", 0, 2, FEARG_1, ret_string, f_getcwd}, 773 {"float2nr", 1, 1, FEARG_1, NULL,
656 {"getenv", 1, 1, FEARG_1, ret_string, f_getenv}, 774 ret_number, FLOAT_FUNC(f_float2nr)},
657 {"getfontname", 0, 1, 0, ret_string, f_getfontname}, 775 {"floor", 1, 1, FEARG_1, NULL,
658 {"getfperm", 1, 1, FEARG_1, ret_string, f_getfperm}, 776 ret_float, FLOAT_FUNC(f_floor)},
659 {"getfsize", 1, 1, FEARG_1, ret_number, f_getfsize}, 777 {"fmod", 2, 2, FEARG_1, NULL,
660 {"getftime", 1, 1, FEARG_1, ret_number, f_getftime}, 778 ret_float, FLOAT_FUNC(f_fmod)},
661 {"getftype", 1, 1, FEARG_1, ret_string, f_getftype}, 779 {"fnameescape", 1, 1, FEARG_1, NULL,
662 {"getimstatus", 0, 0, 0, ret_number, f_getimstatus}, 780 ret_string, f_fnameescape},
663 {"getjumplist", 0, 2, FEARG_1, ret_list_any, f_getjumplist}, 781 {"fnamemodify", 2, 2, FEARG_1, NULL,
664 {"getline", 1, 2, FEARG_1, ret_f_getline, f_getline}, 782 ret_string, f_fnamemodify},
665 {"getloclist", 1, 2, 0, ret_list_or_dict_1, f_getloclist}, 783 {"foldclosed", 1, 1, FEARG_1, NULL,
666 {"getmarklist", 0, 1, FEARG_1, ret_list_dict_any, f_getmarklist}, 784 ret_number, f_foldclosed},
667 {"getmatches", 0, 1, 0, ret_list_dict_any, f_getmatches}, 785 {"foldclosedend", 1, 1, FEARG_1, NULL,
668 {"getmousepos", 0, 0, 0, ret_dict_number, f_getmousepos}, 786 ret_number, f_foldclosedend},
669 {"getpid", 0, 0, 0, ret_number, f_getpid}, 787 {"foldlevel", 1, 1, FEARG_1, NULL,
670 {"getpos", 1, 1, FEARG_1, ret_list_number, f_getpos}, 788 ret_number, f_foldlevel},
671 {"getqflist", 0, 1, 0, ret_list_or_dict_0, f_getqflist}, 789 {"foldtext", 0, 0, 0, NULL,
672 {"getreg", 0, 3, FEARG_1, ret_getreg, f_getreg}, 790 ret_string, f_foldtext},
673 {"getreginfo", 0, 1, FEARG_1, ret_dict_any, f_getreginfo}, 791 {"foldtextresult", 1, 1, FEARG_1, NULL,
674 {"getregtype", 0, 1, FEARG_1, ret_string, f_getregtype}, 792 ret_string, f_foldtextresult},
675 {"gettabinfo", 0, 1, FEARG_1, ret_list_dict_any, f_gettabinfo}, 793 {"foreground", 0, 0, 0, NULL,
676 {"gettabvar", 2, 3, FEARG_1, ret_any, f_gettabvar}, 794 ret_void, f_foreground},
677 {"gettabwinvar", 3, 4, FEARG_1, ret_any, f_gettabwinvar}, 795 {"funcref", 1, 3, FEARG_1, NULL,
678 {"gettagstack", 0, 1, FEARG_1, ret_dict_any, f_gettagstack}, 796 ret_func_any, f_funcref},
679 {"gettext", 1, 1, FEARG_1, ret_string, f_gettext}, 797 {"function", 1, 3, FEARG_1, NULL,
680 {"getwininfo", 0, 1, FEARG_1, ret_list_dict_any, f_getwininfo}, 798 ret_f_function, f_function},
681 {"getwinpos", 0, 1, FEARG_1, ret_list_number, f_getwinpos}, 799 {"garbagecollect", 0, 1, 0, NULL,
682 {"getwinposx", 0, 0, 0, ret_number, f_getwinposx}, 800 ret_void, f_garbagecollect},
683 {"getwinposy", 0, 0, 0, ret_number, f_getwinposy}, 801 {"get", 2, 3, FEARG_1, NULL,
684 {"getwinvar", 2, 3, FEARG_1, ret_any, f_getwinvar}, 802 ret_any, f_get},
685 {"glob", 1, 4, FEARG_1, ret_any, f_glob}, 803 {"getbufinfo", 0, 1, FEARG_1, NULL,
686 {"glob2regpat", 1, 1, FEARG_1, ret_string, f_glob2regpat}, 804 ret_list_dict_any, f_getbufinfo},
687 {"globpath", 2, 5, FEARG_2, ret_any, f_globpath}, 805 {"getbufline", 2, 3, FEARG_1, NULL,
688 {"has", 1, 2, 0, ret_number, f_has}, 806 ret_list_string, f_getbufline},
689 {"has_key", 2, 2, FEARG_1, ret_number, f_has_key}, 807 {"getbufvar", 2, 3, FEARG_1, NULL,
690 {"haslocaldir", 0, 2, FEARG_1, ret_number, f_haslocaldir}, 808 ret_any, f_getbufvar},
691 {"hasmapto", 1, 3, FEARG_1, ret_number, f_hasmapto}, 809 {"getchangelist", 0, 1, FEARG_1, NULL,
692 {"highlightID", 1, 1, FEARG_1, ret_number, f_hlID}, // obsolete 810 ret_list_any, f_getchangelist},
693 {"highlight_exists",1, 1, FEARG_1, ret_number, f_hlexists}, // obsolete 811 {"getchar", 0, 1, 0, NULL,
694 {"histadd", 2, 2, FEARG_2, ret_number, f_histadd}, 812 ret_number, f_getchar},
695 {"histdel", 1, 2, FEARG_1, ret_number, f_histdel}, 813 {"getcharmod", 0, 0, 0, NULL,
696 {"histget", 1, 2, FEARG_1, ret_string, f_histget}, 814 ret_number, f_getcharmod},
697 {"histnr", 1, 1, FEARG_1, ret_number, f_histnr}, 815 {"getcharsearch", 0, 0, 0, NULL,
698 {"hlID", 1, 1, FEARG_1, ret_number, f_hlID}, 816 ret_dict_any, f_getcharsearch},
699 {"hlexists", 1, 1, FEARG_1, ret_number, f_hlexists}, 817 {"getcmdline", 0, 0, 0, NULL,
700 {"hostname", 0, 0, 0, ret_string, f_hostname}, 818 ret_string, f_getcmdline},
701 {"iconv", 3, 3, FEARG_1, ret_string, f_iconv}, 819 {"getcmdpos", 0, 0, 0, NULL,
702 {"indent", 1, 1, FEARG_1, ret_number, f_indent}, 820 ret_number, f_getcmdpos},
703 {"index", 2, 4, FEARG_1, ret_number, f_index}, 821 {"getcmdtype", 0, 0, 0, NULL,
704 {"input", 1, 3, FEARG_1, ret_string, f_input}, 822 ret_string, f_getcmdtype},
705 {"inputdialog", 1, 3, FEARG_1, ret_string, f_inputdialog}, 823 {"getcmdwintype", 0, 0, 0, NULL,
706 {"inputlist", 1, 1, FEARG_1, ret_number, f_inputlist}, 824 ret_string, f_getcmdwintype},
707 {"inputrestore", 0, 0, 0, ret_number, f_inputrestore}, 825 {"getcompletion", 2, 3, FEARG_1, NULL,
708 {"inputsave", 0, 0, 0, ret_number, f_inputsave}, 826 ret_list_string, f_getcompletion},
709 {"inputsecret", 1, 2, FEARG_1, ret_string, f_inputsecret}, 827 {"getcurpos", 0, 1, FEARG_1, NULL,
710 {"insert", 2, 3, FEARG_1, ret_first_arg, f_insert}, 828 ret_list_number, f_getcurpos},
711 {"interrupt", 0, 0, 0, ret_void, f_interrupt}, 829 {"getcwd", 0, 2, FEARG_1, NULL,
712 {"invert", 1, 1, FEARG_1, ret_number, f_invert}, 830 ret_string, f_getcwd},
713 {"isdirectory", 1, 1, FEARG_1, ret_number, f_isdirectory}, 831 {"getenv", 1, 1, FEARG_1, NULL,
714 {"isinf", 1, 1, FEARG_1, ret_number, MATH_FUNC(f_isinf)}, 832 ret_string, f_getenv},
715 {"islocked", 1, 1, FEARG_1, ret_number, f_islocked}, 833 {"getfontname", 0, 1, 0, NULL,
716 {"isnan", 1, 1, FEARG_1, ret_number, MATH_FUNC(f_isnan)}, 834 ret_string, f_getfontname},
717 {"items", 1, 1, FEARG_1, ret_list_any, f_items}, 835 {"getfperm", 1, 1, FEARG_1, NULL,
718 {"job_getchannel", 1, 1, FEARG_1, ret_channel, JOB_FUNC(f_job_getchannel)}, 836 ret_string, f_getfperm},
719 {"job_info", 0, 1, FEARG_1, ret_dict_any, JOB_FUNC(f_job_info)}, 837 {"getfsize", 1, 1, FEARG_1, NULL,
720 {"job_setoptions", 2, 2, FEARG_1, ret_void, JOB_FUNC(f_job_setoptions)}, 838 ret_number, f_getfsize},
721 {"job_start", 1, 2, FEARG_1, ret_job, JOB_FUNC(f_job_start)}, 839 {"getftime", 1, 1, FEARG_1, NULL,
722 {"job_status", 1, 1, FEARG_1, ret_string, JOB_FUNC(f_job_status)}, 840 ret_number, f_getftime},
723 {"job_stop", 1, 2, FEARG_1, ret_number, JOB_FUNC(f_job_stop)}, 841 {"getftype", 1, 1, FEARG_1, NULL,
724 {"join", 1, 2, FEARG_1, ret_string, f_join}, 842 ret_string, f_getftype},
725 {"js_decode", 1, 1, FEARG_1, ret_any, f_js_decode}, 843 {"getimstatus", 0, 0, 0, NULL,
726 {"js_encode", 1, 1, FEARG_1, ret_string, f_js_encode}, 844 ret_number, f_getimstatus},
727 {"json_decode", 1, 1, FEARG_1, ret_any, f_json_decode}, 845 {"getjumplist", 0, 2, FEARG_1, NULL,
728 {"json_encode", 1, 1, FEARG_1, ret_string, f_json_encode}, 846 ret_list_any, f_getjumplist},
729 {"keys", 1, 1, FEARG_1, ret_list_string, f_keys}, 847 {"getline", 1, 2, FEARG_1, NULL,
730 {"last_buffer_nr", 0, 0, 0, ret_number, f_last_buffer_nr}, // obsolete 848 ret_f_getline, f_getline},
731 {"len", 1, 1, FEARG_1, ret_number, f_len}, 849 {"getloclist", 1, 2, 0, NULL,
732 {"libcall", 3, 3, FEARG_3, ret_string, f_libcall}, 850 ret_list_or_dict_1, f_getloclist},
733 {"libcallnr", 3, 3, FEARG_3, ret_number, f_libcallnr}, 851 {"getmarklist", 0, 1, FEARG_1, NULL,
734 {"line", 1, 2, FEARG_1, ret_number, f_line}, 852 ret_list_dict_any, f_getmarklist},
735 {"line2byte", 1, 1, FEARG_1, ret_number, f_line2byte}, 853 {"getmatches", 0, 1, 0, NULL,
736 {"lispindent", 1, 1, FEARG_1, ret_number, f_lispindent}, 854 ret_list_dict_any, f_getmatches},
737 {"list2str", 1, 2, FEARG_1, ret_string, f_list2str}, 855 {"getmousepos", 0, 0, 0, NULL,
738 {"listener_add", 1, 2, FEARG_2, ret_number, f_listener_add}, 856 ret_dict_number, f_getmousepos},
739 {"listener_flush", 0, 1, FEARG_1, ret_void, f_listener_flush}, 857 {"getpid", 0, 0, 0, NULL,
740 {"listener_remove", 1, 1, FEARG_1, ret_number, f_listener_remove}, 858 ret_number, f_getpid},
741 {"localtime", 0, 0, 0, ret_number, f_localtime}, 859 {"getpos", 1, 1, FEARG_1, NULL,
742 {"log", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_log)}, 860 ret_list_number, f_getpos},
743 {"log10", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_log10)}, 861 {"getqflist", 0, 1, 0, NULL,
744 {"luaeval", 1, 2, FEARG_1, ret_any, 862 ret_list_or_dict_0, f_getqflist},
863 {"getreg", 0, 3, FEARG_1, NULL,
864 ret_getreg, f_getreg},
865 {"getreginfo", 0, 1, FEARG_1, NULL,
866 ret_dict_any, f_getreginfo},
867 {"getregtype", 0, 1, FEARG_1, NULL,
868 ret_string, f_getregtype},
869 {"gettabinfo", 0, 1, FEARG_1, NULL,
870 ret_list_dict_any, f_gettabinfo},
871 {"gettabvar", 2, 3, FEARG_1, NULL,
872 ret_any, f_gettabvar},
873 {"gettabwinvar", 3, 4, FEARG_1, NULL,
874 ret_any, f_gettabwinvar},
875 {"gettagstack", 0, 1, FEARG_1, NULL,
876 ret_dict_any, f_gettagstack},
877 {"gettext", 1, 1, FEARG_1, NULL,
878 ret_string, f_gettext},
879 {"getwininfo", 0, 1, FEARG_1, NULL,
880 ret_list_dict_any, f_getwininfo},
881 {"getwinpos", 0, 1, FEARG_1, NULL,
882 ret_list_number, f_getwinpos},
883 {"getwinposx", 0, 0, 0, NULL,
884 ret_number, f_getwinposx},
885 {"getwinposy", 0, 0, 0, NULL,
886 ret_number, f_getwinposy},
887 {"getwinvar", 2, 3, FEARG_1, NULL,
888 ret_any, f_getwinvar},
889 {"glob", 1, 4, FEARG_1, NULL,
890 ret_any, f_glob},
891 {"glob2regpat", 1, 1, FEARG_1, NULL,
892 ret_string, f_glob2regpat},
893 {"globpath", 2, 5, FEARG_2, NULL,
894 ret_any, f_globpath},
895 {"has", 1, 2, 0, NULL,
896 ret_number, f_has},
897 {"has_key", 2, 2, FEARG_1, NULL,
898 ret_number, f_has_key},
899 {"haslocaldir", 0, 2, FEARG_1, NULL,
900 ret_number, f_haslocaldir},
901 {"hasmapto", 1, 3, FEARG_1, NULL,
902 ret_number, f_hasmapto},
903 {"highlightID", 1, 1, FEARG_1, NULL,
904 ret_number, f_hlID}, // obsolete
905 {"highlight_exists",1, 1, FEARG_1, NULL,
906 ret_number, f_hlexists}, // obsolete
907 {"histadd", 2, 2, FEARG_2, NULL,
908 ret_number, f_histadd},
909 {"histdel", 1, 2, FEARG_1, NULL,
910 ret_number, f_histdel},
911 {"histget", 1, 2, FEARG_1, NULL,
912 ret_string, f_histget},
913 {"histnr", 1, 1, FEARG_1, NULL,
914 ret_number, f_histnr},
915 {"hlID", 1, 1, FEARG_1, NULL,
916 ret_number, f_hlID},
917 {"hlexists", 1, 1, FEARG_1, NULL,
918 ret_number, f_hlexists},
919 {"hostname", 0, 0, 0, NULL,
920 ret_string, f_hostname},
921 {"iconv", 3, 3, FEARG_1, NULL,
922 ret_string, f_iconv},
923 {"indent", 1, 1, FEARG_1, NULL,
924 ret_number, f_indent},
925 {"index", 2, 4, FEARG_1, NULL,
926 ret_number, f_index},
927 {"input", 1, 3, FEARG_1, NULL,
928 ret_string, f_input},
929 {"inputdialog", 1, 3, FEARG_1, NULL,
930 ret_string, f_inputdialog},
931 {"inputlist", 1, 1, FEARG_1, NULL,
932 ret_number, f_inputlist},
933 {"inputrestore", 0, 0, 0, NULL,
934 ret_number, f_inputrestore},
935 {"inputsave", 0, 0, 0, NULL,
936 ret_number, f_inputsave},
937 {"inputsecret", 1, 2, FEARG_1, NULL,
938 ret_string, f_inputsecret},
939 {"insert", 2, 3, FEARG_1, NULL,
940 ret_first_arg, f_insert},
941 {"interrupt", 0, 0, 0, NULL,
942 ret_void, f_interrupt},
943 {"invert", 1, 1, FEARG_1, NULL,
944 ret_number, f_invert},
945 {"isdirectory", 1, 1, FEARG_1, NULL,
946 ret_number, f_isdirectory},
947 {"isinf", 1, 1, FEARG_1, NULL,
948 ret_number, MATH_FUNC(f_isinf)},
949 {"islocked", 1, 1, FEARG_1, NULL,
950 ret_number, f_islocked},
951 {"isnan", 1, 1, FEARG_1, NULL,
952 ret_number, MATH_FUNC(f_isnan)},
953 {"items", 1, 1, FEARG_1, NULL,
954 ret_list_any, f_items},
955 {"job_getchannel", 1, 1, FEARG_1, NULL,
956 ret_channel, JOB_FUNC(f_job_getchannel)},
957 {"job_info", 0, 1, FEARG_1, NULL,
958 ret_dict_any, JOB_FUNC(f_job_info)},
959 {"job_setoptions", 2, 2, FEARG_1, NULL,
960 ret_void, JOB_FUNC(f_job_setoptions)},
961 {"job_start", 1, 2, FEARG_1, NULL,
962 ret_job, JOB_FUNC(f_job_start)},
963 {"job_status", 1, 1, FEARG_1, NULL,
964 ret_string, JOB_FUNC(f_job_status)},
965 {"job_stop", 1, 2, FEARG_1, NULL,
966 ret_number, JOB_FUNC(f_job_stop)},
967 {"join", 1, 2, FEARG_1, NULL,
968 ret_string, f_join},
969 {"js_decode", 1, 1, FEARG_1, NULL,
970 ret_any, f_js_decode},
971 {"js_encode", 1, 1, FEARG_1, NULL,
972 ret_string, f_js_encode},
973 {"json_decode", 1, 1, FEARG_1, NULL,
974 ret_any, f_json_decode},
975 {"json_encode", 1, 1, FEARG_1, NULL,
976 ret_string, f_json_encode},
977 {"keys", 1, 1, FEARG_1, NULL,
978 ret_list_string, f_keys},
979 {"last_buffer_nr", 0, 0, 0, NULL,
980 ret_number, f_last_buffer_nr}, // obsolete
981 {"len", 1, 1, FEARG_1, NULL,
982 ret_number, f_len},
983 {"libcall", 3, 3, FEARG_3, NULL,
984 ret_string, f_libcall},
985 {"libcallnr", 3, 3, FEARG_3, NULL,
986 ret_number, f_libcallnr},
987 {"line", 1, 2, FEARG_1, NULL,
988 ret_number, f_line},
989 {"line2byte", 1, 1, FEARG_1, NULL,
990 ret_number, f_line2byte},
991 {"lispindent", 1, 1, FEARG_1, NULL,
992 ret_number, f_lispindent},
993 {"list2str", 1, 2, FEARG_1, NULL,
994 ret_string, f_list2str},
995 {"listener_add", 1, 2, FEARG_2, NULL,
996 ret_number, f_listener_add},
997 {"listener_flush", 0, 1, FEARG_1, NULL,
998 ret_void, f_listener_flush},
999 {"listener_remove", 1, 1, FEARG_1, NULL,
1000 ret_number, f_listener_remove},
1001 {"localtime", 0, 0, 0, NULL,
1002 ret_number, f_localtime},
1003 {"log", 1, 1, FEARG_1, NULL,
1004 ret_float, FLOAT_FUNC(f_log)},
1005 {"log10", 1, 1, FEARG_1, NULL,
1006 ret_float, FLOAT_FUNC(f_log10)},
1007 {"luaeval", 1, 2, FEARG_1, NULL,
1008 ret_any,
745 #ifdef FEAT_LUA 1009 #ifdef FEAT_LUA
746 f_luaeval 1010 f_luaeval
747 #else 1011 #else
748 NULL 1012 NULL
749 #endif 1013 #endif
750 }, 1014 },
751 {"map", 2, 2, FEARG_1, ret_any, f_map}, 1015 {"map", 2, 2, FEARG_1, NULL,
752 {"maparg", 1, 4, FEARG_1, ret_maparg, f_maparg}, 1016 ret_any, f_map},
753 {"mapcheck", 1, 3, FEARG_1, ret_string, f_mapcheck}, 1017 {"maparg", 1, 4, FEARG_1, NULL,
754 {"mapset", 3, 3, FEARG_1, ret_void, f_mapset}, 1018 ret_maparg, f_maparg},
755 {"match", 2, 4, FEARG_1, ret_any, f_match}, 1019 {"mapcheck", 1, 3, FEARG_1, NULL,
756 {"matchadd", 2, 5, FEARG_1, ret_number, f_matchadd}, 1020 ret_string, f_mapcheck},
757 {"matchaddpos", 2, 5, FEARG_1, ret_number, f_matchaddpos}, 1021 {"mapset", 3, 3, FEARG_1, NULL,
758 {"matcharg", 1, 1, FEARG_1, ret_list_string, f_matcharg}, 1022 ret_void, f_mapset},
759 {"matchdelete", 1, 2, FEARG_1, ret_number, f_matchdelete}, 1023 {"match", 2, 4, FEARG_1, NULL,
760 {"matchend", 2, 4, FEARG_1, ret_number, f_matchend}, 1024 ret_any, f_match},
761 {"matchfuzzy", 2, 3, FEARG_1, ret_list_string, f_matchfuzzy}, 1025 {"matchadd", 2, 5, FEARG_1, NULL,
762 {"matchfuzzypos", 2, 3, FEARG_1, ret_list_any, f_matchfuzzypos}, 1026 ret_number, f_matchadd},
763 {"matchlist", 2, 4, FEARG_1, ret_list_string, f_matchlist}, 1027 {"matchaddpos", 2, 5, FEARG_1, NULL,
764 {"matchstr", 2, 4, FEARG_1, ret_string, f_matchstr}, 1028 ret_number, f_matchaddpos},
765 {"matchstrpos", 2, 4, FEARG_1, ret_list_any, f_matchstrpos}, 1029 {"matcharg", 1, 1, FEARG_1, NULL,
766 {"max", 1, 1, FEARG_1, ret_any, f_max}, 1030 ret_list_string, f_matcharg},
767 {"menu_info", 1, 2, FEARG_1, ret_dict_any, 1031 {"matchdelete", 1, 2, FEARG_1, NULL,
1032 ret_number, f_matchdelete},
1033 {"matchend", 2, 4, FEARG_1, NULL,
1034 ret_number, f_matchend},
1035 {"matchfuzzy", 2, 3, FEARG_1, NULL,
1036 ret_list_string, f_matchfuzzy},
1037 {"matchfuzzypos", 2, 3, FEARG_1, NULL,
1038 ret_list_any, f_matchfuzzypos},
1039 {"matchlist", 2, 4, FEARG_1, NULL,
1040 ret_list_string, f_matchlist},
1041 {"matchstr", 2, 4, FEARG_1, NULL,
1042 ret_string, f_matchstr},
1043 {"matchstrpos", 2, 4, FEARG_1, NULL,
1044 ret_list_any, f_matchstrpos},
1045 {"max", 1, 1, FEARG_1, NULL,
1046 ret_any, f_max},
1047 {"menu_info", 1, 2, FEARG_1, NULL,
1048 ret_dict_any,
768 #ifdef FEAT_MENU 1049 #ifdef FEAT_MENU
769 f_menu_info 1050 f_menu_info
770 #else 1051 #else
771 NULL 1052 NULL
772 #endif 1053 #endif
773 }, 1054 },
774 {"min", 1, 1, FEARG_1, ret_any, f_min}, 1055 {"min", 1, 1, FEARG_1, NULL,
775 {"mkdir", 1, 3, FEARG_1, ret_number, f_mkdir}, 1056 ret_any, f_min},
776 {"mode", 0, 1, FEARG_1, ret_string, f_mode}, 1057 {"mkdir", 1, 3, FEARG_1, NULL,
777 {"mzeval", 1, 1, FEARG_1, ret_any, 1058 ret_number, f_mkdir},
1059 {"mode", 0, 1, FEARG_1, NULL,
1060 ret_string, f_mode},
1061 {"mzeval", 1, 1, FEARG_1, NULL,
1062 ret_any,
778 #ifdef FEAT_MZSCHEME 1063 #ifdef FEAT_MZSCHEME
779 f_mzeval 1064 f_mzeval
780 #else 1065 #else
781 NULL 1066 NULL
782 #endif 1067 #endif
783 }, 1068 },
784 {"nextnonblank", 1, 1, FEARG_1, ret_number, f_nextnonblank}, 1069 {"nextnonblank", 1, 1, FEARG_1, NULL,
785 {"nr2char", 1, 2, FEARG_1, ret_string, f_nr2char}, 1070 ret_number, f_nextnonblank},
786 {"or", 2, 2, FEARG_1, ret_number, f_or}, 1071 {"nr2char", 1, 2, FEARG_1, NULL,
787 {"pathshorten", 1, 2, FEARG_1, ret_string, f_pathshorten}, 1072 ret_string, f_nr2char},
788 {"perleval", 1, 1, FEARG_1, ret_any, 1073 {"or", 2, 2, FEARG_1, NULL,
1074 ret_number, f_or},
1075 {"pathshorten", 1, 2, FEARG_1, NULL,
1076 ret_string, f_pathshorten},
1077 {"perleval", 1, 1, FEARG_1, NULL,
1078 ret_any,
789 #ifdef FEAT_PERL 1079 #ifdef FEAT_PERL
790 f_perleval 1080 f_perleval
791 #else 1081 #else
792 NULL 1082 NULL
793 #endif 1083 #endif
794 }, 1084 },
795 {"popup_atcursor", 2, 2, FEARG_1, ret_number, PROP_FUNC(f_popup_atcursor)}, 1085 {"popup_atcursor", 2, 2, FEARG_1, NULL,
796 {"popup_beval", 2, 2, FEARG_1, ret_number, PROP_FUNC(f_popup_beval)}, 1086 ret_number, PROP_FUNC(f_popup_atcursor)},
797 {"popup_clear", 0, 1, 0, ret_void, PROP_FUNC(f_popup_clear)}, 1087 {"popup_beval", 2, 2, FEARG_1, NULL,
798 {"popup_close", 1, 2, FEARG_1, ret_void, PROP_FUNC(f_popup_close)}, 1088 ret_number, PROP_FUNC(f_popup_beval)},
799 {"popup_create", 2, 2, FEARG_1, ret_number, PROP_FUNC(f_popup_create)}, 1089 {"popup_clear", 0, 1, 0, NULL,
800 {"popup_dialog", 2, 2, FEARG_1, ret_number, PROP_FUNC(f_popup_dialog)}, 1090 ret_void, PROP_FUNC(f_popup_clear)},
801 {"popup_filter_menu", 2, 2, 0, ret_bool, PROP_FUNC(f_popup_filter_menu)}, 1091 {"popup_close", 1, 2, FEARG_1, NULL,
802 {"popup_filter_yesno", 2, 2, 0, ret_bool, PROP_FUNC(f_popup_filter_yesno)}, 1092 ret_void, PROP_FUNC(f_popup_close)},
803 {"popup_findinfo", 0, 0, 0, ret_number, PROP_FUNC(f_popup_findinfo)}, 1093 {"popup_create", 2, 2, FEARG_1, NULL,
804 {"popup_findpreview", 0, 0, 0, ret_number, PROP_FUNC(f_popup_findpreview)}, 1094 ret_number, PROP_FUNC(f_popup_create)},
805 {"popup_getoptions", 1, 1, FEARG_1, ret_dict_any, PROP_FUNC(f_popup_getoptions)}, 1095 {"popup_dialog", 2, 2, FEARG_1, NULL,
806 {"popup_getpos", 1, 1, FEARG_1, ret_dict_any, PROP_FUNC(f_popup_getpos)}, 1096 ret_number, PROP_FUNC(f_popup_dialog)},
807 {"popup_hide", 1, 1, FEARG_1, ret_void, PROP_FUNC(f_popup_hide)}, 1097 {"popup_filter_menu", 2, 2, 0, NULL,
808 {"popup_list", 0, 0, 0, ret_list_number, PROP_FUNC(f_popup_list)}, 1098 ret_bool, PROP_FUNC(f_popup_filter_menu)},
809 {"popup_locate", 2, 2, 0, ret_number, PROP_FUNC(f_popup_locate)}, 1099 {"popup_filter_yesno", 2, 2, 0, NULL,
810 {"popup_menu", 2, 2, FEARG_1, ret_number, PROP_FUNC(f_popup_menu)}, 1100 ret_bool, PROP_FUNC(f_popup_filter_yesno)},
811 {"popup_move", 2, 2, FEARG_1, ret_void, PROP_FUNC(f_popup_move)}, 1101 {"popup_findinfo", 0, 0, 0, NULL,
812 {"popup_notification", 2, 2, FEARG_1, ret_number, PROP_FUNC(f_popup_notification)}, 1102 ret_number, PROP_FUNC(f_popup_findinfo)},
813 {"popup_setoptions", 2, 2, FEARG_1, ret_void, PROP_FUNC(f_popup_setoptions)}, 1103 {"popup_findpreview", 0, 0, 0, NULL,
814 {"popup_settext", 2, 2, FEARG_1, ret_void, PROP_FUNC(f_popup_settext)}, 1104 ret_number, PROP_FUNC(f_popup_findpreview)},
815 {"popup_show", 1, 1, FEARG_1, ret_void, PROP_FUNC(f_popup_show)}, 1105 {"popup_getoptions", 1, 1, FEARG_1, NULL,
816 {"pow", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_pow)}, 1106 ret_dict_any, PROP_FUNC(f_popup_getoptions)},
817 {"prevnonblank", 1, 1, FEARG_1, ret_number, f_prevnonblank}, 1107 {"popup_getpos", 1, 1, FEARG_1, NULL,
818 {"printf", 1, 19, FEARG_2, ret_string, f_printf}, 1108 ret_dict_any, PROP_FUNC(f_popup_getpos)},
819 {"prompt_getprompt", 1, 1, FEARG_1, ret_string, JOB_FUNC(f_prompt_getprompt)}, 1109 {"popup_hide", 1, 1, FEARG_1, NULL,
820 {"prompt_setcallback", 2, 2, FEARG_1, ret_void, JOB_FUNC(f_prompt_setcallback)}, 1110 ret_void, PROP_FUNC(f_popup_hide)},
821 {"prompt_setinterrupt", 2, 2, FEARG_1,ret_void, JOB_FUNC(f_prompt_setinterrupt)}, 1111 {"popup_list", 0, 0, 0, NULL,
822 {"prompt_setprompt", 2, 2, FEARG_1, ret_void, JOB_FUNC(f_prompt_setprompt)}, 1112 ret_list_number, PROP_FUNC(f_popup_list)},
823 {"prop_add", 3, 3, FEARG_1, ret_void, PROP_FUNC(f_prop_add)}, 1113 {"popup_locate", 2, 2, 0, NULL,
824 {"prop_clear", 1, 3, FEARG_1, ret_void, PROP_FUNC(f_prop_clear)}, 1114 ret_number, PROP_FUNC(f_popup_locate)},
825 {"prop_find", 1, 2, FEARG_1, ret_dict_any, PROP_FUNC(f_prop_find)}, 1115 {"popup_menu", 2, 2, FEARG_1, NULL,
826 {"prop_list", 1, 2, FEARG_1, ret_list_dict_any, PROP_FUNC(f_prop_list)}, 1116 ret_number, PROP_FUNC(f_popup_menu)},
827 {"prop_remove", 1, 3, FEARG_1, ret_number, PROP_FUNC(f_prop_remove)}, 1117 {"popup_move", 2, 2, FEARG_1, NULL,
828 {"prop_type_add", 2, 2, FEARG_1, ret_void, PROP_FUNC(f_prop_type_add)}, 1118 ret_void, PROP_FUNC(f_popup_move)},
829 {"prop_type_change", 2, 2, FEARG_1, ret_void, PROP_FUNC(f_prop_type_change)}, 1119 {"popup_notification", 2, 2, FEARG_1, NULL,
830 {"prop_type_delete", 1, 2, FEARG_1, ret_void, PROP_FUNC(f_prop_type_delete)}, 1120 ret_number, PROP_FUNC(f_popup_notification)},
831 {"prop_type_get", 1, 2, FEARG_1, ret_dict_any, PROP_FUNC(f_prop_type_get)}, 1121 {"popup_setoptions", 2, 2, FEARG_1, NULL,
832 {"prop_type_list", 0, 1, FEARG_1, ret_list_string, PROP_FUNC(f_prop_type_list)}, 1122 ret_void, PROP_FUNC(f_popup_setoptions)},
833 {"pum_getpos", 0, 0, 0, ret_dict_number, f_pum_getpos}, 1123 {"popup_settext", 2, 2, FEARG_1, NULL,
834 {"pumvisible", 0, 0, 0, ret_number, f_pumvisible}, 1124 ret_void, PROP_FUNC(f_popup_settext)},
835 {"py3eval", 1, 1, FEARG_1, ret_any, 1125 {"popup_show", 1, 1, FEARG_1, NULL,
1126 ret_void, PROP_FUNC(f_popup_show)},
1127 {"pow", 2, 2, FEARG_1, NULL,
1128 ret_float, FLOAT_FUNC(f_pow)},
1129 {"prevnonblank", 1, 1, FEARG_1, NULL,
1130 ret_number, f_prevnonblank},
1131 {"printf", 1, 19, FEARG_2, NULL,
1132 ret_string, f_printf},
1133 {"prompt_getprompt", 1, 1, FEARG_1, NULL,
1134 ret_string, JOB_FUNC(f_prompt_getprompt)},
1135 {"prompt_setcallback", 2, 2, FEARG_1, NULL,
1136 ret_void, JOB_FUNC(f_prompt_setcallback)},
1137 {"prompt_setinterrupt", 2, 2, FEARG_1, NULL,
1138 ret_void, JOB_FUNC(f_prompt_setinterrupt)},
1139 {"prompt_setprompt", 2, 2, FEARG_1, NULL,
1140 ret_void, JOB_FUNC(f_prompt_setprompt)},
1141 {"prop_add", 3, 3, FEARG_1, NULL,
1142 ret_void, PROP_FUNC(f_prop_add)},
1143 {"prop_clear", 1, 3, FEARG_1, NULL,
1144 ret_void, PROP_FUNC(f_prop_clear)},
1145 {"prop_find", 1, 2, FEARG_1, NULL,
1146 ret_dict_any, PROP_FUNC(f_prop_find)},
1147 {"prop_list", 1, 2, FEARG_1, NULL,
1148 ret_list_dict_any, PROP_FUNC(f_prop_list)},
1149 {"prop_remove", 1, 3, FEARG_1, NULL,
1150 ret_number, PROP_FUNC(f_prop_remove)},
1151 {"prop_type_add", 2, 2, FEARG_1, NULL,
1152 ret_void, PROP_FUNC(f_prop_type_add)},
1153 {"prop_type_change", 2, 2, FEARG_1, NULL,
1154 ret_void, PROP_FUNC(f_prop_type_change)},
1155 {"prop_type_delete", 1, 2, FEARG_1, NULL,
1156 ret_void, PROP_FUNC(f_prop_type_delete)},
1157 {"prop_type_get", 1, 2, FEARG_1, NULL,
1158 ret_dict_any, PROP_FUNC(f_prop_type_get)},
1159 {"prop_type_list", 0, 1, FEARG_1, NULL,
1160 ret_list_string, PROP_FUNC(f_prop_type_list)},
1161 {"pum_getpos", 0, 0, 0, NULL,
1162 ret_dict_number, f_pum_getpos},
1163 {"pumvisible", 0, 0, 0, NULL,
1164 ret_number, f_pumvisible},
1165 {"py3eval", 1, 1, FEARG_1, NULL,
1166 ret_any,
836 #ifdef FEAT_PYTHON3 1167 #ifdef FEAT_PYTHON3
837 f_py3eval 1168 f_py3eval
838 #else 1169 #else
839 NULL 1170 NULL
840 #endif 1171 #endif
841 }, 1172 },
842 {"pyeval", 1, 1, FEARG_1, ret_any, 1173 {"pyeval", 1, 1, FEARG_1, NULL,
1174 ret_any,
843 #ifdef FEAT_PYTHON 1175 #ifdef FEAT_PYTHON
844 f_pyeval 1176 f_pyeval
845 #else 1177 #else
846 NULL 1178 NULL
847 #endif 1179 #endif
848 }, 1180 },
849 {"pyxeval", 1, 1, FEARG_1, ret_any, 1181 {"pyxeval", 1, 1, FEARG_1, NULL,
1182 ret_any,
850 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) 1183 #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
851 f_pyxeval 1184 f_pyxeval
852 #else 1185 #else
853 NULL 1186 NULL
854 #endif 1187 #endif
855 }, 1188 },
856 {"rand", 0, 1, FEARG_1, ret_number, f_rand}, 1189 {"rand", 0, 1, FEARG_1, NULL,
857 {"range", 1, 3, FEARG_1, ret_list_number, f_range}, 1190 ret_number, f_rand},
858 {"readdir", 1, 3, FEARG_1, ret_list_string, f_readdir}, 1191 {"range", 1, 3, FEARG_1, NULL,
859 {"readdirex", 1, 3, FEARG_1, ret_list_dict_any, f_readdirex}, 1192 ret_list_number, f_range},
860 {"readfile", 1, 3, FEARG_1, ret_any, f_readfile}, 1193 {"readdir", 1, 3, FEARG_1, NULL,
861 {"reduce", 2, 3, FEARG_1, ret_any, f_reduce}, 1194 ret_list_string, f_readdir},
862 {"reg_executing", 0, 0, 0, ret_string, f_reg_executing}, 1195 {"readdirex", 1, 3, FEARG_1, NULL,
863 {"reg_recording", 0, 0, 0, ret_string, f_reg_recording}, 1196 ret_list_dict_any, f_readdirex},
864 {"reltime", 0, 2, FEARG_1, ret_list_any, f_reltime}, 1197 {"readfile", 1, 3, FEARG_1, NULL,
865 {"reltimefloat", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_reltimefloat)}, 1198 ret_any, f_readfile},
866 {"reltimestr", 1, 1, FEARG_1, ret_string, f_reltimestr}, 1199 {"reduce", 2, 3, FEARG_1, NULL,
867 {"remote_expr", 2, 4, FEARG_1, ret_string, f_remote_expr}, 1200 ret_any, f_reduce},
868 {"remote_foreground", 1, 1, FEARG_1, ret_string, f_remote_foreground}, 1201 {"reg_executing", 0, 0, 0, NULL,
869 {"remote_peek", 1, 2, FEARG_1, ret_number, f_remote_peek}, 1202 ret_string, f_reg_executing},
870 {"remote_read", 1, 2, FEARG_1, ret_string, f_remote_read}, 1203 {"reg_recording", 0, 0, 0, NULL,
871 {"remote_send", 2, 3, FEARG_1, ret_string, f_remote_send}, 1204 ret_string, f_reg_recording},
872 {"remote_startserver", 1, 1, FEARG_1, ret_void, f_remote_startserver}, 1205 {"reltime", 0, 2, FEARG_1, NULL,
873 {"remove", 2, 3, FEARG_1, ret_remove, f_remove}, 1206 ret_list_any, f_reltime},
874 {"rename", 2, 2, FEARG_1, ret_number, f_rename}, 1207 {"reltimefloat", 1, 1, FEARG_1, NULL,
875 {"repeat", 2, 2, FEARG_1, ret_first_arg, f_repeat}, 1208 ret_float, FLOAT_FUNC(f_reltimefloat)},
876 {"resolve", 1, 1, FEARG_1, ret_string, f_resolve}, 1209 {"reltimestr", 1, 1, FEARG_1, NULL,
877 {"reverse", 1, 1, FEARG_1, ret_first_arg, f_reverse}, 1210 ret_string, f_reltimestr},
878 {"round", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_round)}, 1211 {"remote_expr", 2, 4, FEARG_1, NULL,
879 {"rubyeval", 1, 1, FEARG_1, ret_any, 1212 ret_string, f_remote_expr},
1213 {"remote_foreground", 1, 1, FEARG_1, NULL,
1214 ret_string, f_remote_foreground},
1215 {"remote_peek", 1, 2, FEARG_1, NULL,
1216 ret_number, f_remote_peek},
1217 {"remote_read", 1, 2, FEARG_1, NULL,
1218 ret_string, f_remote_read},
1219 {"remote_send", 2, 3, FEARG_1, NULL,
1220 ret_string, f_remote_send},
1221 {"remote_startserver", 1, 1, FEARG_1, NULL,
1222 ret_void, f_remote_startserver},
1223 {"remove", 2, 3, FEARG_1, NULL,
1224 ret_remove, f_remove},
1225 {"rename", 2, 2, FEARG_1, NULL,
1226 ret_number, f_rename},
1227 {"repeat", 2, 2, FEARG_1, NULL,
1228 ret_first_arg, f_repeat},
1229 {"resolve", 1, 1, FEARG_1, NULL,
1230 ret_string, f_resolve},
1231 {"reverse", 1, 1, FEARG_1, NULL,
1232 ret_first_arg, f_reverse},
1233 {"round", 1, 1, FEARG_1, NULL,
1234 ret_float, FLOAT_FUNC(f_round)},
1235 {"rubyeval", 1, 1, FEARG_1, NULL,
1236 ret_any,
880 #ifdef FEAT_RUBY 1237 #ifdef FEAT_RUBY
881 f_rubyeval 1238 f_rubyeval
882 #else 1239 #else
883 NULL 1240 NULL
884 #endif 1241 #endif
885 }, 1242 },
886 {"screenattr", 2, 2, FEARG_1, ret_number, f_screenattr}, 1243 {"screenattr", 2, 2, FEARG_1, NULL,
887 {"screenchar", 2, 2, FEARG_1, ret_number, f_screenchar}, 1244 ret_number, f_screenattr},
888 {"screenchars", 2, 2, FEARG_1, ret_list_number, f_screenchars}, 1245 {"screenchar", 2, 2, FEARG_1, NULL,
889 {"screencol", 0, 0, 0, ret_number, f_screencol}, 1246 ret_number, f_screenchar},
890 {"screenpos", 3, 3, FEARG_1, ret_dict_number, f_screenpos}, 1247 {"screenchars", 2, 2, FEARG_1, NULL,
891 {"screenrow", 0, 0, 0, ret_number, f_screenrow}, 1248 ret_list_number, f_screenchars},
892 {"screenstring", 2, 2, FEARG_1, ret_string, f_screenstring}, 1249 {"screencol", 0, 0, 0, NULL,
893 {"search", 1, 5, FEARG_1, ret_number, f_search}, 1250 ret_number, f_screencol},
894 {"searchcount", 0, 1, FEARG_1, ret_dict_any, f_searchcount}, 1251 {"screenpos", 3, 3, FEARG_1, NULL,
895 {"searchdecl", 1, 3, FEARG_1, ret_number, f_searchdecl}, 1252 ret_dict_number, f_screenpos},
896 {"searchpair", 3, 7, 0, ret_number, f_searchpair}, 1253 {"screenrow", 0, 0, 0, NULL,
897 {"searchpairpos", 3, 7, 0, ret_list_number, f_searchpairpos}, 1254 ret_number, f_screenrow},
898 {"searchpos", 1, 5, FEARG_1, ret_list_number, f_searchpos}, 1255 {"screenstring", 2, 2, FEARG_1, NULL,
899 {"server2client", 2, 2, FEARG_1, ret_number, f_server2client}, 1256 ret_string, f_screenstring},
900 {"serverlist", 0, 0, 0, ret_string, f_serverlist}, 1257 {"search", 1, 5, FEARG_1, NULL,
901 {"setbufline", 3, 3, FEARG_3, ret_number, f_setbufline}, 1258 ret_number, f_search},
902 {"setbufvar", 3, 3, FEARG_3, ret_void, f_setbufvar}, 1259 {"searchcount", 0, 1, FEARG_1, NULL,
903 {"setcellwidths", 1, 1, FEARG_1, ret_void, f_setcellwidths}, 1260 ret_dict_any, f_searchcount},
904 {"setcharsearch", 1, 1, FEARG_1, ret_void, f_setcharsearch}, 1261 {"searchdecl", 1, 3, FEARG_1, NULL,
905 {"setcmdpos", 1, 1, FEARG_1, ret_number, f_setcmdpos}, 1262 ret_number, f_searchdecl},
906 {"setenv", 2, 2, FEARG_2, ret_void, f_setenv}, 1263 {"searchpair", 3, 7, 0, NULL,
907 {"setfperm", 2, 2, FEARG_1, ret_number, f_setfperm}, 1264 ret_number, f_searchpair},
908 {"setline", 2, 2, FEARG_2, ret_number, f_setline}, 1265 {"searchpairpos", 3, 7, 0, NULL,
909 {"setloclist", 2, 4, FEARG_2, ret_number, f_setloclist}, 1266 ret_list_number, f_searchpairpos},
910 {"setmatches", 1, 2, FEARG_1, ret_number, f_setmatches}, 1267 {"searchpos", 1, 5, FEARG_1, NULL,
911 {"setpos", 2, 2, FEARG_2, ret_number, f_setpos}, 1268 ret_list_number, f_searchpos},
912 {"setqflist", 1, 3, FEARG_1, ret_number, f_setqflist}, 1269 {"server2client", 2, 2, FEARG_1, NULL,
913 {"setreg", 2, 3, FEARG_2, ret_number, f_setreg}, 1270 ret_number, f_server2client},
914 {"settabvar", 3, 3, FEARG_3, ret_void, f_settabvar}, 1271 {"serverlist", 0, 0, 0, NULL,
915 {"settabwinvar", 4, 4, FEARG_4, ret_void, f_settabwinvar}, 1272 ret_string, f_serverlist},
916 {"settagstack", 2, 3, FEARG_2, ret_number, f_settagstack}, 1273 {"setbufline", 3, 3, FEARG_3, NULL,
917 {"setwinvar", 3, 3, FEARG_3, ret_void, f_setwinvar}, 1274 ret_number, f_setbufline},
918 {"sha256", 1, 1, FEARG_1, ret_string, 1275 {"setbufvar", 3, 3, FEARG_3, NULL,
1276 ret_void, f_setbufvar},
1277 {"setcellwidths", 1, 1, FEARG_1, NULL,
1278 ret_void, f_setcellwidths},
1279 {"setcharsearch", 1, 1, FEARG_1, NULL,
1280 ret_void, f_setcharsearch},
1281 {"setcmdpos", 1, 1, FEARG_1, NULL,
1282 ret_number, f_setcmdpos},
1283 {"setenv", 2, 2, FEARG_2, NULL,
1284 ret_void, f_setenv},
1285 {"setfperm", 2, 2, FEARG_1, NULL,
1286 ret_number, f_setfperm},
1287 {"setline", 2, 2, FEARG_2, NULL,
1288 ret_number, f_setline},
1289 {"setloclist", 2, 4, FEARG_2, NULL,
1290 ret_number, f_setloclist},
1291 {"setmatches", 1, 2, FEARG_1, NULL,
1292 ret_number, f_setmatches},
1293 {"setpos", 2, 2, FEARG_2, NULL,
1294 ret_number, f_setpos},
1295 {"setqflist", 1, 3, FEARG_1, NULL,
1296 ret_number, f_setqflist},
1297 {"setreg", 2, 3, FEARG_2, NULL,
1298 ret_number, f_setreg},
1299 {"settabvar", 3, 3, FEARG_3, NULL,
1300 ret_void, f_settabvar},
1301 {"settabwinvar", 4, 4, FEARG_4, NULL,
1302 ret_void, f_settabwinvar},
1303 {"settagstack", 2, 3, FEARG_2, NULL,
1304 ret_number, f_settagstack},
1305 {"setwinvar", 3, 3, FEARG_3, NULL,
1306 ret_void, f_setwinvar},
1307 {"sha256", 1, 1, FEARG_1, NULL,
1308 ret_string,
919 #ifdef FEAT_CRYPT 1309 #ifdef FEAT_CRYPT
920 f_sha256 1310 f_sha256
921 #else 1311 #else
922 NULL 1312 NULL
923 #endif 1313 #endif
924 }, 1314 },
925 {"shellescape", 1, 2, FEARG_1, ret_string, f_shellescape}, 1315 {"shellescape", 1, 2, FEARG_1, NULL,
926 {"shiftwidth", 0, 1, FEARG_1, ret_number, f_shiftwidth}, 1316 ret_string, f_shellescape},
927 {"sign_define", 1, 2, FEARG_1, ret_any, SIGN_FUNC(f_sign_define)}, 1317 {"shiftwidth", 0, 1, FEARG_1, NULL,
928 {"sign_getdefined", 0, 1, FEARG_1, ret_list_dict_any, SIGN_FUNC(f_sign_getdefined)}, 1318 ret_number, f_shiftwidth},
929 {"sign_getplaced", 0, 2, FEARG_1, ret_list_dict_any, SIGN_FUNC(f_sign_getplaced)}, 1319 {"sign_define", 1, 2, FEARG_1, NULL,
930 {"sign_jump", 3, 3, FEARG_1, ret_number, SIGN_FUNC(f_sign_jump)}, 1320 ret_any, SIGN_FUNC(f_sign_define)},
931 {"sign_place", 4, 5, FEARG_1, ret_number, SIGN_FUNC(f_sign_place)}, 1321 {"sign_getdefined", 0, 1, FEARG_1, NULL,
932 {"sign_placelist", 1, 1, FEARG_1, ret_list_number, SIGN_FUNC(f_sign_placelist)}, 1322 ret_list_dict_any, SIGN_FUNC(f_sign_getdefined)},
933 {"sign_undefine", 0, 1, FEARG_1, ret_number, SIGN_FUNC(f_sign_undefine)}, 1323 {"sign_getplaced", 0, 2, FEARG_1, NULL,
934 {"sign_unplace", 1, 2, FEARG_1, ret_number, SIGN_FUNC(f_sign_unplace)}, 1324 ret_list_dict_any, SIGN_FUNC(f_sign_getplaced)},
935 {"sign_unplacelist", 1, 2, FEARG_1, ret_list_number, SIGN_FUNC(f_sign_unplacelist)}, 1325 {"sign_jump", 3, 3, FEARG_1, NULL,
936 {"simplify", 1, 1, FEARG_1, ret_string, f_simplify}, 1326 ret_number, SIGN_FUNC(f_sign_jump)},
937 {"sin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sin)}, 1327 {"sign_place", 4, 5, FEARG_1, NULL,
938 {"sinh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sinh)}, 1328 ret_number, SIGN_FUNC(f_sign_place)},
939 {"sort", 1, 3, FEARG_1, ret_first_arg, f_sort}, 1329 {"sign_placelist", 1, 1, FEARG_1, NULL,
940 {"sound_clear", 0, 0, 0, ret_void, SOUND_FUNC(f_sound_clear)}, 1330 ret_list_number, SIGN_FUNC(f_sign_placelist)},
941 {"sound_playevent", 1, 2, FEARG_1, ret_number, SOUND_FUNC(f_sound_playevent)}, 1331 {"sign_undefine", 0, 1, FEARG_1, NULL,
942 {"sound_playfile", 1, 2, FEARG_1, ret_number, SOUND_FUNC(f_sound_playfile)}, 1332 ret_number, SIGN_FUNC(f_sign_undefine)},
943 {"sound_stop", 1, 1, FEARG_1, ret_void, SOUND_FUNC(f_sound_stop)}, 1333 {"sign_unplace", 1, 2, FEARG_1, NULL,
944 {"soundfold", 1, 1, FEARG_1, ret_string, f_soundfold}, 1334 ret_number, SIGN_FUNC(f_sign_unplace)},
945 {"spellbadword", 0, 1, FEARG_1, ret_list_string, f_spellbadword}, 1335 {"sign_unplacelist", 1, 2, FEARG_1, NULL,
946 {"spellsuggest", 1, 3, FEARG_1, ret_list_string, f_spellsuggest}, 1336 ret_list_number, SIGN_FUNC(f_sign_unplacelist)},
947 {"split", 1, 3, FEARG_1, ret_list_string, f_split}, 1337 {"simplify", 1, 1, FEARG_1, NULL,
948 {"sqrt", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sqrt)}, 1338 ret_string, f_simplify},
949 {"srand", 0, 1, FEARG_1, ret_list_number, f_srand}, 1339 {"sin", 1, 1, FEARG_1, NULL,
950 {"state", 0, 1, FEARG_1, ret_string, f_state}, 1340 ret_float, FLOAT_FUNC(f_sin)},
951 {"str2float", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_str2float)}, 1341 {"sinh", 1, 1, FEARG_1, NULL,
952 {"str2list", 1, 2, FEARG_1, ret_list_number, f_str2list}, 1342 ret_float, FLOAT_FUNC(f_sinh)},
953 {"str2nr", 1, 3, FEARG_1, ret_number, f_str2nr}, 1343 {"sort", 1, 3, FEARG_1, NULL,
954 {"strcharpart", 2, 3, FEARG_1, ret_string, f_strcharpart}, 1344 ret_first_arg, f_sort},
955 {"strchars", 1, 2, FEARG_1, ret_number, f_strchars}, 1345 {"sound_clear", 0, 0, 0, NULL,
956 {"strdisplaywidth", 1, 2, FEARG_1, ret_number, f_strdisplaywidth}, 1346 ret_void, SOUND_FUNC(f_sound_clear)},
957 {"strftime", 1, 2, FEARG_1, ret_string, 1347 {"sound_playevent", 1, 2, FEARG_1, NULL,
1348 ret_number, SOUND_FUNC(f_sound_playevent)},
1349 {"sound_playfile", 1, 2, FEARG_1, NULL,
1350 ret_number, SOUND_FUNC(f_sound_playfile)},
1351 {"sound_stop", 1, 1, FEARG_1, NULL,
1352 ret_void, SOUND_FUNC(f_sound_stop)},
1353 {"soundfold", 1, 1, FEARG_1, NULL,
1354 ret_string, f_soundfold},
1355 {"spellbadword", 0, 1, FEARG_1, NULL,
1356 ret_list_string, f_spellbadword},
1357 {"spellsuggest", 1, 3, FEARG_1, NULL,
1358 ret_list_string, f_spellsuggest},
1359 {"split", 1, 3, FEARG_1, NULL,
1360 ret_list_string, f_split},
1361 {"sqrt", 1, 1, FEARG_1, NULL,
1362 ret_float, FLOAT_FUNC(f_sqrt)},
1363 {"srand", 0, 1, FEARG_1, NULL,
1364 ret_list_number, f_srand},
1365 {"state", 0, 1, FEARG_1, NULL,
1366 ret_string, f_state},
1367 {"str2float", 1, 1, FEARG_1, NULL,
1368 ret_float, FLOAT_FUNC(f_str2float)},
1369 {"str2list", 1, 2, FEARG_1, NULL,
1370 ret_list_number, f_str2list},
1371 {"str2nr", 1, 3, FEARG_1, NULL,
1372 ret_number, f_str2nr},
1373 {"strcharpart", 2, 3, FEARG_1, NULL,
1374 ret_string, f_strcharpart},
1375 {"strchars", 1, 2, FEARG_1, NULL,
1376 ret_number, f_strchars},
1377 {"strdisplaywidth", 1, 2, FEARG_1, NULL,
1378 ret_number, f_strdisplaywidth},
1379 {"strftime", 1, 2, FEARG_1, NULL,
1380 ret_string,
958 #ifdef HAVE_STRFTIME 1381 #ifdef HAVE_STRFTIME
959 f_strftime 1382 f_strftime
960 #else 1383 #else
961 NULL 1384 NULL
962 #endif 1385 #endif
963 }, 1386 },
964 {"strgetchar", 2, 2, FEARG_1, ret_number, f_strgetchar}, 1387 {"strgetchar", 2, 2, FEARG_1, NULL,
965 {"stridx", 2, 3, FEARG_1, ret_number, f_stridx}, 1388 ret_number, f_strgetchar},
966 {"string", 1, 1, FEARG_1, ret_string, f_string}, 1389 {"stridx", 2, 3, FEARG_1, NULL,
967 {"strlen", 1, 1, FEARG_1, ret_number, f_strlen}, 1390 ret_number, f_stridx},
968 {"strpart", 2, 4, FEARG_1, ret_string, f_strpart}, 1391 {"string", 1, 1, FEARG_1, NULL,
969 {"strptime", 2, 2, FEARG_1, ret_number, 1392 ret_string, f_string},
1393 {"strlen", 1, 1, FEARG_1, NULL,
1394 ret_number, f_strlen},
1395 {"strpart", 2, 4, FEARG_1, NULL,
1396 ret_string, f_strpart},
1397 {"strptime", 2, 2, FEARG_1, NULL,
1398 ret_number,
970 #ifdef HAVE_STRPTIME 1399 #ifdef HAVE_STRPTIME
971 f_strptime 1400 f_strptime
972 #else 1401 #else
973 NULL 1402 NULL
974 #endif 1403 #endif
975 }, 1404 },
976 {"strridx", 2, 3, FEARG_1, ret_number, f_strridx}, 1405 {"strridx", 2, 3, FEARG_1, NULL,
977 {"strtrans", 1, 1, FEARG_1, ret_string, f_strtrans}, 1406 ret_number, f_strridx},
978 {"strwidth", 1, 1, FEARG_1, ret_number, f_strwidth}, 1407 {"strtrans", 1, 1, FEARG_1, NULL,
979 {"submatch", 1, 2, FEARG_1, ret_string, f_submatch}, 1408 ret_string, f_strtrans},
980 {"substitute", 4, 4, FEARG_1, ret_string, f_substitute}, 1409 {"strwidth", 1, 1, FEARG_1, NULL,
981 {"swapinfo", 1, 1, FEARG_1, ret_dict_any, f_swapinfo}, 1410 ret_number, f_strwidth},
982 {"swapname", 1, 1, FEARG_1, ret_string, f_swapname}, 1411 {"submatch", 1, 2, FEARG_1, NULL,
983 {"synID", 3, 3, 0, ret_number, f_synID}, 1412 ret_string, f_submatch},
984 {"synIDattr", 2, 3, FEARG_1, ret_string, f_synIDattr}, 1413 {"substitute", 4, 4, FEARG_1, NULL,
985 {"synIDtrans", 1, 1, FEARG_1, ret_number, f_synIDtrans}, 1414 ret_string, f_substitute},
986 {"synconcealed", 2, 2, 0, ret_list_any, f_synconcealed}, 1415 {"swapinfo", 1, 1, FEARG_1, NULL,
987 {"synstack", 2, 2, 0, ret_list_number, f_synstack}, 1416 ret_dict_any, f_swapinfo},
988 {"system", 1, 2, FEARG_1, ret_string, f_system}, 1417 {"swapname", 1, 1, FEARG_1, NULL,
989 {"systemlist", 1, 2, FEARG_1, ret_list_string, f_systemlist}, 1418 ret_string, f_swapname},
990 {"tabpagebuflist", 0, 1, FEARG_1, ret_list_number, f_tabpagebuflist}, 1419 {"synID", 3, 3, 0, NULL,
991 {"tabpagenr", 0, 1, 0, ret_number, f_tabpagenr}, 1420 ret_number, f_synID},
992 {"tabpagewinnr", 1, 2, FEARG_1, ret_number, f_tabpagewinnr}, 1421 {"synIDattr", 2, 3, FEARG_1, NULL,
993 {"tagfiles", 0, 0, 0, ret_list_string, f_tagfiles}, 1422 ret_string, f_synIDattr},
994 {"taglist", 1, 2, FEARG_1, ret_list_dict_any, f_taglist}, 1423 {"synIDtrans", 1, 1, FEARG_1, NULL,
995 {"tan", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_tan)}, 1424 ret_number, f_synIDtrans},
996 {"tanh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_tanh)}, 1425 {"synconcealed", 2, 2, 0, NULL,
997 {"tempname", 0, 0, 0, ret_string, f_tempname}, 1426 ret_list_any, f_synconcealed},
998 {"term_dumpdiff", 2, 3, FEARG_1, ret_number, TERM_FUNC(f_term_dumpdiff)}, 1427 {"synstack", 2, 2, 0, NULL,
999 {"term_dumpload", 1, 2, FEARG_1, ret_number, TERM_FUNC(f_term_dumpload)}, 1428 ret_list_number, f_synstack},
1000 {"term_dumpwrite", 2, 3, FEARG_2, ret_void, TERM_FUNC(f_term_dumpwrite)}, 1429 {"system", 1, 2, FEARG_1, NULL,
1001 {"term_getaltscreen", 1, 1, FEARG_1, ret_number, TERM_FUNC(f_term_getaltscreen)}, 1430 ret_string, f_system},
1002 {"term_getansicolors", 1, 1, FEARG_1, ret_list_string, 1431 {"systemlist", 1, 2, FEARG_1, NULL,
1432 ret_list_string, f_systemlist},
1433 {"tabpagebuflist", 0, 1, FEARG_1, NULL,
1434 ret_list_number, f_tabpagebuflist},
1435 {"tabpagenr", 0, 1, 0, NULL,
1436 ret_number, f_tabpagenr},
1437 {"tabpagewinnr", 1, 2, FEARG_1, NULL,
1438 ret_number, f_tabpagewinnr},
1439 {"tagfiles", 0, 0, 0, NULL,
1440 ret_list_string, f_tagfiles},
1441 {"taglist", 1, 2, FEARG_1, NULL,
1442 ret_list_dict_any, f_taglist},
1443 {"tan", 1, 1, FEARG_1, NULL,
1444 ret_float, FLOAT_FUNC(f_tan)},
1445 {"tanh", 1, 1, FEARG_1, NULL,
1446 ret_float, FLOAT_FUNC(f_tanh)},
1447 {"tempname", 0, 0, 0, NULL,
1448 ret_string, f_tempname},
1449 {"term_dumpdiff", 2, 3, FEARG_1, NULL,
1450 ret_number, TERM_FUNC(f_term_dumpdiff)},
1451 {"term_dumpload", 1, 2, FEARG_1, NULL,
1452 ret_number, TERM_FUNC(f_term_dumpload)},
1453 {"term_dumpwrite", 2, 3, FEARG_2, NULL,
1454 ret_void, TERM_FUNC(f_term_dumpwrite)},
1455 {"term_getaltscreen", 1, 1, FEARG_1, NULL,
1456 ret_number, TERM_FUNC(f_term_getaltscreen)},
1457 {"term_getansicolors", 1, 1, FEARG_1, NULL,
1458 ret_list_string,
1003 #if defined(FEAT_TERMINAL) && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)) 1459 #if defined(FEAT_TERMINAL) && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS))
1004 f_term_getansicolors 1460 f_term_getansicolors
1005 #else 1461 #else
1006 NULL 1462 NULL
1007 #endif 1463 #endif
1008 }, 1464 },
1009 {"term_getattr", 2, 2, FEARG_1, ret_number, TERM_FUNC(f_term_getattr)}, 1465 {"term_getattr", 2, 2, FEARG_1, NULL,
1010 {"term_getcursor", 1, 1, FEARG_1, ret_list_any, TERM_FUNC(f_term_getcursor)}, 1466 ret_number, TERM_FUNC(f_term_getattr)},
1011 {"term_getjob", 1, 1, FEARG_1, ret_job, TERM_FUNC(f_term_getjob)}, 1467 {"term_getcursor", 1, 1, FEARG_1, NULL,
1012 {"term_getline", 2, 2, FEARG_1, ret_string, TERM_FUNC(f_term_getline)}, 1468 ret_list_any, TERM_FUNC(f_term_getcursor)},
1013 {"term_getscrolled", 1, 1, FEARG_1, ret_number, TERM_FUNC(f_term_getscrolled)}, 1469 {"term_getjob", 1, 1, FEARG_1, NULL,
1014 {"term_getsize", 1, 1, FEARG_1, ret_list_number, TERM_FUNC(f_term_getsize)}, 1470 ret_job, TERM_FUNC(f_term_getjob)},
1015 {"term_getstatus", 1, 1, FEARG_1, ret_string, TERM_FUNC(f_term_getstatus)}, 1471 {"term_getline", 2, 2, FEARG_1, NULL,
1016 {"term_gettitle", 1, 1, FEARG_1, ret_string, TERM_FUNC(f_term_gettitle)}, 1472 ret_string, TERM_FUNC(f_term_getline)},
1017 {"term_gettty", 1, 2, FEARG_1, ret_string, TERM_FUNC(f_term_gettty)}, 1473 {"term_getscrolled", 1, 1, FEARG_1, NULL,
1018 {"term_list", 0, 0, 0, ret_list_number, TERM_FUNC(f_term_list)}, 1474 ret_number, TERM_FUNC(f_term_getscrolled)},
1019 {"term_scrape", 2, 2, FEARG_1, ret_list_dict_any, TERM_FUNC(f_term_scrape)}, 1475 {"term_getsize", 1, 1, FEARG_1, NULL,
1020 {"term_sendkeys", 2, 2, FEARG_1, ret_void, TERM_FUNC(f_term_sendkeys)}, 1476 ret_list_number, TERM_FUNC(f_term_getsize)},
1021 {"term_setansicolors", 2, 2, FEARG_1, ret_void, 1477 {"term_getstatus", 1, 1, FEARG_1, NULL,
1478 ret_string, TERM_FUNC(f_term_getstatus)},
1479 {"term_gettitle", 1, 1, FEARG_1, NULL,
1480 ret_string, TERM_FUNC(f_term_gettitle)},
1481 {"term_gettty", 1, 2, FEARG_1, NULL,
1482 ret_string, TERM_FUNC(f_term_gettty)},
1483 {"term_list", 0, 0, 0, NULL,
1484 ret_list_number, TERM_FUNC(f_term_list)},
1485 {"term_scrape", 2, 2, FEARG_1, NULL,
1486 ret_list_dict_any, TERM_FUNC(f_term_scrape)},
1487 {"term_sendkeys", 2, 2, FEARG_1, NULL,
1488 ret_void, TERM_FUNC(f_term_sendkeys)},
1489 {"term_setansicolors", 2, 2, FEARG_1, NULL,
1490 ret_void,
1022 #if defined(FEAT_TERMINAL) && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)) 1491 #if defined(FEAT_TERMINAL) && (defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS))
1023 f_term_setansicolors 1492 f_term_setansicolors
1024 #else 1493 #else
1025 NULL 1494 NULL
1026 #endif 1495 #endif
1027 }, 1496 },
1028 {"term_setapi", 2, 2, FEARG_1, ret_void, TERM_FUNC(f_term_setapi)}, 1497 {"term_setapi", 2, 2, FEARG_1, NULL,
1029 {"term_setkill", 2, 2, FEARG_1, ret_void, TERM_FUNC(f_term_setkill)}, 1498 ret_void, TERM_FUNC(f_term_setapi)},
1030 {"term_setrestore", 2, 2, FEARG_1, ret_void, TERM_FUNC(f_term_setrestore)}, 1499 {"term_setkill", 2, 2, FEARG_1, NULL,
1031 {"term_setsize", 3, 3, FEARG_1, ret_void, TERM_FUNC(f_term_setsize)}, 1500 ret_void, TERM_FUNC(f_term_setkill)},
1032 {"term_start", 1, 2, FEARG_1, ret_number, TERM_FUNC(f_term_start)}, 1501 {"term_setrestore", 2, 2, FEARG_1, NULL,
1033 {"term_wait", 1, 2, FEARG_1, ret_void, TERM_FUNC(f_term_wait)}, 1502 ret_void, TERM_FUNC(f_term_setrestore)},
1034 {"terminalprops", 0, 0, 0, ret_dict_string, f_terminalprops}, 1503 {"term_setsize", 3, 3, FEARG_1, NULL,
1035 {"test_alloc_fail", 3, 3, FEARG_1, ret_void, f_test_alloc_fail}, 1504 ret_void, TERM_FUNC(f_term_setsize)},
1036 {"test_autochdir", 0, 0, 0, ret_void, f_test_autochdir}, 1505 {"term_start", 1, 2, FEARG_1, NULL,
1037 {"test_feedinput", 1, 1, FEARG_1, ret_void, f_test_feedinput}, 1506 ret_number, TERM_FUNC(f_term_start)},
1038 {"test_garbagecollect_now", 0, 0, 0, ret_void, f_test_garbagecollect_now}, 1507 {"term_wait", 1, 2, FEARG_1, NULL,
1039 {"test_garbagecollect_soon", 0, 0, 0, ret_void, f_test_garbagecollect_soon}, 1508 ret_void, TERM_FUNC(f_term_wait)},
1040 {"test_getvalue", 1, 1, FEARG_1, ret_number, f_test_getvalue}, 1509 {"terminalprops", 0, 0, 0, NULL,
1041 {"test_ignore_error", 1, 1, FEARG_1, ret_void, f_test_ignore_error}, 1510 ret_dict_string, f_terminalprops},
1042 {"test_null_blob", 0, 0, 0, ret_blob, f_test_null_blob}, 1511 {"test_alloc_fail", 3, 3, FEARG_1, NULL,
1043 {"test_null_channel", 0, 0, 0, ret_channel, JOB_FUNC(f_test_null_channel)}, 1512 ret_void, f_test_alloc_fail},
1044 {"test_null_dict", 0, 0, 0, ret_dict_any, f_test_null_dict}, 1513 {"test_autochdir", 0, 0, 0, NULL,
1045 {"test_null_function", 0, 0, 0, ret_func_any, f_test_null_function}, 1514 ret_void, f_test_autochdir},
1046 {"test_null_job", 0, 0, 0, ret_job, JOB_FUNC(f_test_null_job)}, 1515 {"test_feedinput", 1, 1, FEARG_1, NULL,
1047 {"test_null_list", 0, 0, 0, ret_list_any, f_test_null_list}, 1516 ret_void, f_test_feedinput},
1048 {"test_null_partial", 0, 0, 0, ret_func_any, f_test_null_partial}, 1517 {"test_garbagecollect_now", 0, 0, 0, NULL,
1049 {"test_null_string", 0, 0, 0, ret_string, f_test_null_string}, 1518 ret_void, f_test_garbagecollect_now},
1050 {"test_option_not_set", 1, 1, FEARG_1,ret_void, f_test_option_not_set}, 1519 {"test_garbagecollect_soon", 0, 0, 0, NULL,
1051 {"test_override", 2, 2, FEARG_2, ret_void, f_test_override}, 1520 ret_void, f_test_garbagecollect_soon},
1052 {"test_refcount", 1, 1, FEARG_1, ret_number, f_test_refcount}, 1521 {"test_getvalue", 1, 1, FEARG_1, NULL,
1053 {"test_scrollbar", 3, 3, FEARG_2, ret_void, 1522 ret_number, f_test_getvalue},
1523 {"test_ignore_error", 1, 1, FEARG_1, NULL,
1524 ret_void, f_test_ignore_error},
1525 {"test_null_blob", 0, 0, 0, NULL,
1526 ret_blob, f_test_null_blob},
1527 {"test_null_channel", 0, 0, 0, NULL,
1528 ret_channel, JOB_FUNC(f_test_null_channel)},
1529 {"test_null_dict", 0, 0, 0, NULL,
1530 ret_dict_any, f_test_null_dict},
1531 {"test_null_function", 0, 0, 0, NULL,
1532 ret_func_any, f_test_null_function},
1533 {"test_null_job", 0, 0, 0, NULL,
1534 ret_job, JOB_FUNC(f_test_null_job)},
1535 {"test_null_list", 0, 0, 0, NULL,
1536 ret_list_any, f_test_null_list},
1537 {"test_null_partial", 0, 0, 0, NULL,
1538 ret_func_any, f_test_null_partial},
1539 {"test_null_string", 0, 0, 0, NULL,
1540 ret_string, f_test_null_string},
1541 {"test_option_not_set", 1, 1, FEARG_1, NULL,
1542 ret_void, f_test_option_not_set},
1543 {"test_override", 2, 2, FEARG_2, NULL,
1544 ret_void, f_test_override},
1545 {"test_refcount", 1, 1, FEARG_1, NULL,
1546 ret_number, f_test_refcount},
1547 {"test_scrollbar", 3, 3, FEARG_2, NULL,
1548 ret_void,
1054 #ifdef FEAT_GUI 1549 #ifdef FEAT_GUI
1055 f_test_scrollbar 1550 f_test_scrollbar
1056 #else 1551 #else
1057 NULL 1552 NULL
1058 #endif 1553 #endif
1059 }, 1554 },
1060 {"test_setmouse", 2, 2, 0, ret_void, f_test_setmouse}, 1555 {"test_setmouse", 2, 2, 0, NULL,
1061 {"test_settime", 1, 1, FEARG_1, ret_void, f_test_settime}, 1556 ret_void, f_test_setmouse},
1062 {"test_srand_seed", 0, 1, FEARG_1, ret_void, f_test_srand_seed}, 1557 {"test_settime", 1, 1, FEARG_1, NULL,
1063 {"test_unknown", 0, 0, 0, ret_any, f_test_unknown}, 1558 ret_void, f_test_settime},
1064 {"test_void", 0, 0, 0, ret_void, f_test_void}, 1559 {"test_srand_seed", 0, 1, FEARG_1, NULL,
1065 {"timer_info", 0, 1, FEARG_1, ret_list_dict_any, TIMER_FUNC(f_timer_info)}, 1560 ret_void, f_test_srand_seed},
1066 {"timer_pause", 2, 2, FEARG_1, ret_void, TIMER_FUNC(f_timer_pause)}, 1561 {"test_unknown", 0, 0, 0, NULL,
1067 {"timer_start", 2, 3, FEARG_1, ret_number, TIMER_FUNC(f_timer_start)}, 1562 ret_any, f_test_unknown},
1068 {"timer_stop", 1, 1, FEARG_1, ret_void, TIMER_FUNC(f_timer_stop)}, 1563 {"test_void", 0, 0, 0, NULL,
1069 {"timer_stopall", 0, 0, 0, ret_void, TIMER_FUNC(f_timer_stopall)}, 1564 ret_void, f_test_void},
1070 {"tolower", 1, 1, FEARG_1, ret_string, f_tolower}, 1565 {"timer_info", 0, 1, FEARG_1, NULL,
1071 {"toupper", 1, 1, FEARG_1, ret_string, f_toupper}, 1566 ret_list_dict_any, TIMER_FUNC(f_timer_info)},
1072 {"tr", 3, 3, FEARG_1, ret_string, f_tr}, 1567 {"timer_pause", 2, 2, FEARG_1, NULL,
1073 {"trim", 1, 3, FEARG_1, ret_string, f_trim}, 1568 ret_void, TIMER_FUNC(f_timer_pause)},
1074 {"trunc", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_trunc)}, 1569 {"timer_start", 2, 3, FEARG_1, NULL,
1075 {"type", 1, 1, FEARG_1, ret_number, f_type}, 1570 ret_number, TIMER_FUNC(f_timer_start)},
1076 {"undofile", 1, 1, FEARG_1, ret_string, f_undofile}, 1571 {"timer_stop", 1, 1, FEARG_1, NULL,
1077 {"undotree", 0, 0, 0, ret_dict_any, f_undotree}, 1572 ret_void, TIMER_FUNC(f_timer_stop)},
1078 {"uniq", 1, 3, FEARG_1, ret_list_any, f_uniq}, 1573 {"timer_stopall", 0, 0, 0, NULL,
1079 {"values", 1, 1, FEARG_1, ret_list_any, f_values}, 1574 ret_void, TIMER_FUNC(f_timer_stopall)},
1080 {"virtcol", 1, 1, FEARG_1, ret_number, f_virtcol}, 1575 {"tolower", 1, 1, FEARG_1, NULL,
1081 {"visualmode", 0, 1, 0, ret_string, f_visualmode}, 1576 ret_string, f_tolower},
1082 {"wildmenumode", 0, 0, 0, ret_number, f_wildmenumode}, 1577 {"toupper", 1, 1, FEARG_1, NULL,
1083 {"win_execute", 2, 3, FEARG_2, ret_string, f_win_execute}, 1578 ret_string, f_toupper},
1084 {"win_findbuf", 1, 1, FEARG_1, ret_list_number, f_win_findbuf}, 1579 {"tr", 3, 3, FEARG_1, NULL,
1085 {"win_getid", 0, 2, FEARG_1, ret_number, f_win_getid}, 1580 ret_string, f_tr},
1086 {"win_gettype", 0, 1, FEARG_1, ret_string, f_win_gettype}, 1581 {"trim", 1, 3, FEARG_1, NULL,
1087 {"win_gotoid", 1, 1, FEARG_1, ret_number, f_win_gotoid}, 1582 ret_string, f_trim},
1088 {"win_id2tabwin", 1, 1, FEARG_1, ret_list_number, f_win_id2tabwin}, 1583 {"trunc", 1, 1, FEARG_1, NULL,
1089 {"win_id2win", 1, 1, FEARG_1, ret_number, f_win_id2win}, 1584 ret_float, FLOAT_FUNC(f_trunc)},
1090 {"win_screenpos", 1, 1, FEARG_1, ret_list_number, f_win_screenpos}, 1585 {"type", 1, 1, FEARG_1, NULL,
1091 {"win_splitmove", 2, 3, FEARG_1, ret_number, f_win_splitmove}, 1586 ret_number, f_type},
1092 {"winbufnr", 1, 1, FEARG_1, ret_number, f_winbufnr}, 1587 {"undofile", 1, 1, FEARG_1, NULL,
1093 {"wincol", 0, 0, 0, ret_number, f_wincol}, 1588 ret_string, f_undofile},
1094 {"windowsversion", 0, 0, 0, ret_string, f_windowsversion}, 1589 {"undotree", 0, 0, 0, NULL,
1095 {"winheight", 1, 1, FEARG_1, ret_number, f_winheight}, 1590 ret_dict_any, f_undotree},
1096 {"winlayout", 0, 1, FEARG_1, ret_list_any, f_winlayout}, 1591 {"uniq", 1, 3, FEARG_1, NULL,
1097 {"winline", 0, 0, 0, ret_number, f_winline}, 1592 ret_list_any, f_uniq},
1098 {"winnr", 0, 1, FEARG_1, ret_number, f_winnr}, 1593 {"values", 1, 1, FEARG_1, NULL,
1099 {"winrestcmd", 0, 0, 0, ret_string, f_winrestcmd}, 1594 ret_list_any, f_values},
1100 {"winrestview", 1, 1, FEARG_1, ret_void, f_winrestview}, 1595 {"virtcol", 1, 1, FEARG_1, NULL,
1101 {"winsaveview", 0, 0, 0, ret_dict_any, f_winsaveview}, 1596 ret_number, f_virtcol},
1102 {"winwidth", 1, 1, FEARG_1, ret_number, f_winwidth}, 1597 {"visualmode", 0, 1, 0, NULL,
1103 {"wordcount", 0, 0, 0, ret_dict_number, f_wordcount}, 1598 ret_string, f_visualmode},
1104 {"writefile", 2, 3, FEARG_1, ret_number, f_writefile}, 1599 {"wildmenumode", 0, 0, 0, NULL,
1105 {"xor", 2, 2, FEARG_1, ret_number, f_xor}, 1600 ret_number, f_wildmenumode},
1601 {"win_execute", 2, 3, FEARG_2, NULL,
1602 ret_string, f_win_execute},
1603 {"win_findbuf", 1, 1, FEARG_1, NULL,
1604 ret_list_number, f_win_findbuf},
1605 {"win_getid", 0, 2, FEARG_1, NULL,
1606 ret_number, f_win_getid},
1607 {"win_gettype", 0, 1, FEARG_1, NULL,
1608 ret_string, f_win_gettype},
1609 {"win_gotoid", 1, 1, FEARG_1, NULL,
1610 ret_number, f_win_gotoid},
1611 {"win_id2tabwin", 1, 1, FEARG_1, NULL,
1612 ret_list_number, f_win_id2tabwin},
1613 {"win_id2win", 1, 1, FEARG_1, NULL,
1614 ret_number, f_win_id2win},
1615 {"win_screenpos", 1, 1, FEARG_1, NULL,
1616 ret_list_number, f_win_screenpos},
1617 {"win_splitmove", 2, 3, FEARG_1, NULL,
1618 ret_number, f_win_splitmove},
1619 {"winbufnr", 1, 1, FEARG_1, NULL,
1620 ret_number, f_winbufnr},
1621 {"wincol", 0, 0, 0, NULL,
1622 ret_number, f_wincol},
1623 {"windowsversion", 0, 0, 0, NULL,
1624 ret_string, f_windowsversion},
1625 {"winheight", 1, 1, FEARG_1, NULL,
1626 ret_number, f_winheight},
1627 {"winlayout", 0, 1, FEARG_1, NULL,
1628 ret_list_any, f_winlayout},
1629 {"winline", 0, 0, 0, NULL,
1630 ret_number, f_winline},
1631 {"winnr", 0, 1, FEARG_1, NULL,
1632 ret_number, f_winnr},
1633 {"winrestcmd", 0, 0, 0, NULL,
1634 ret_string, f_winrestcmd},
1635 {"winrestview", 1, 1, FEARG_1, NULL,
1636 ret_void, f_winrestview},
1637 {"winsaveview", 0, 0, 0, NULL,
1638 ret_dict_any, f_winsaveview},
1639 {"winwidth", 1, 1, FEARG_1, NULL,
1640 ret_number, f_winwidth},
1641 {"wordcount", 0, 0, 0, NULL,
1642 ret_dict_number, f_wordcount},
1643 {"writefile", 2, 3, FEARG_1, NULL,
1644 ret_number, f_writefile},
1645 {"xor", 2, 2, FEARG_1, NULL,
1646 ret_number, f_xor},
1106 }; 1647 };
1107 1648
1108 /* 1649 /*
1109 * Function given to ExpandGeneric() to obtain the list of internal 1650 * Function given to ExpandGeneric() to obtain the list of internal
1110 * or user defined function names. 1651 * or user defined function names.
1212 1753
1213 char * 1754 char *
1214 internal_func_name(int idx) 1755 internal_func_name(int idx)
1215 { 1756 {
1216 return global_functions[idx].f_name; 1757 return global_functions[idx].f_name;
1758 }
1759
1760 /*
1761 * Check the argument types for builting function "idx".
1762 * Uses the list of types on the type stack: "types".
1763 * Return FAIL and gives an error message when a type is wrong.
1764 */
1765 int
1766 internal_func_check_arg_types(type_T *types, int idx, int argcount)
1767 {
1768 argcheck_T *argchecks = global_functions[idx].f_argcheck;
1769 int i;
1770
1771 if (argchecks != NULL)
1772 {
1773 argcontext_T context;
1774
1775 context.arg_count = argcount;
1776 for (i = 0; i < argcount; ++i)
1777 if (argchecks[i] != NULL)
1778 {
1779 context.arg_idx = i;
1780 if (argchecks[i](types + i, &context) == FAIL)
1781 return FAIL;
1782 }
1783 }
1784 return OK;
1217 } 1785 }
1218 1786
1219 type_T * 1787 type_T *
1220 internal_func_ret_type(int idx, int argcount, type_T **argtypes) 1788 internal_func_ret_type(int idx, int argcount, type_T **argtypes)
1221 { 1789 {