hash_clear(&compat_hashtab);
free_scriptnames();
+# if defined(FEAT_CMDL_COMPL)
free_locales();
+# endif
/* global variables */
vars_clear(&globvarht);
}
-#if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) \
- || defined(FEAT_COMPL_FUNC) || defined(PROTO)
/*
* Call some vimL function and return the result in "*rettv".
* Uses argv[argc] for the function arguments. Only Number and String
return ret;
}
-# if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) || defined(PROTO)
/*
- * Call vimL function "func" and return the result as a string.
- * Returns NULL when calling the function fails.
+ * Call vimL function "func" and return the result as a number.
+ * Returns -1 when calling the function fails.
* Uses argv[argc] for the function arguments.
*/
- void *
-call_func_retstr(func, argc, argv, safe)
+ long
+call_func_retnr(func, argc, argv, safe)
char_u *func;
int argc;
char_u **argv;
int safe; /* use the sandbox */
{
typval_T rettv;
- char_u *retval;
+ long retval;
/* All arguments are passed as strings, no conversion to number. */
if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL)
- return NULL;
+ return -1;
- retval = vim_strsave(get_tv_string(&rettv));
+ retval = get_tv_number_chk(&rettv, NULL);
clear_tv(&rettv);
return retval;
}
-# endif
-# if defined(FEAT_COMPL_FUNC) || defined(PROTO)
+#if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) \
+ || defined(FEAT_COMPL_FUNC) || defined(PROTO)
+
+# if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) || defined(PROTO)
/*
- * Call vimL function "func" and return the result as a number.
- * Returns -1 when calling the function fails.
+ * Call vimL function "func" and return the result as a string.
+ * Returns NULL when calling the function fails.
* Uses argv[argc] for the function arguments.
*/
- long
-call_func_retnr(func, argc, argv, safe)
+ void *
+call_func_retstr(func, argc, argv, safe)
char_u *func;
int argc;
char_u **argv;
int safe; /* use the sandbox */
{
typval_T rettv;
- long retval;
+ char_u *retval;
/* All arguments are passed as strings, no conversion to number. */
if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL)
- return -1;
+ return NULL;
- retval = get_tv_number_chk(&rettv, NULL);
+ retval = vim_strsave(get_tv_string(&rettv));
clear_tv(&rettv);
return retval;
}
}
#endif
-
/*
* Save the current function call pointer, and set it to NULL.
* Used when executing autocommands and for ":source".
*/
static void
f_cindent(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
#ifdef FEAT_CINDENT
static void
findfilendir(argvars, rettv, find_what)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
- int find_what;
+ int find_what UNUSED;
{
#ifdef FEAT_SEARCHPATH
char_u *fname;
*/
static void
foldclosed_both(argvars, rettv, end)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
- int end;
+ int end UNUSED;
{
#ifdef FEAT_FOLDING
linenr_T lnum;
*/
static void
f_foldlevel(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_FOLDING
linenr_T lnum;
static void
f_getmatches(argvars, rettv)
typval_T *argvars UNUSED;
- typval_T *rettv;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
dict_T *dict;
*/
static void
f_lispindent(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
#ifdef FEAT_LISP
*/
static void
f_matchadd(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
char_u buf[NUMBUFLEN];
*/
static void
f_matcharg(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
if (rettv_list_alloc(rettv) == OK)
*/
static void
f_matchdelete(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
rettv->vval.v_number = match_delete(curwin,
*/
static void
f_reltime(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_RELTIME
proftime_T res;
*/
static void
f_reltimestr(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
#ifdef FEAT_RELTIME
int flags; /* SP_SETPCMARK and other SP_ values */
pos_T *match_pos;
linenr_T lnum_stop; /* stop at this line if not zero */
- long time_limit; /* stop after this many msec */
+ long time_limit UNUSED; /* stop after this many msec */
{
char_u *save_cpo;
char_u *pat, *pat2 = NULL, *pat3 = NULL;
*/
static void
f_setmatches(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+ typval_T *argvars UNUSED;
+ typval_T *rettv UNUSED;
{
#ifdef FEAT_SEARCH_EXTRA
list_T *l;
*/
static void
f_undofile(argvars, rettv)
- typval_T *argvars;
+ typval_T *argvars UNUSED;
typval_T *rettv;
{
rettv->v_type = VAR_STRING;