Data Structures | Macros | Enumerations | Functions | Variables
funcs.c File Reference
#include <float.h>
#include <math.h>
#include "nvim/api/private/converter.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/ascii.h"
#include "nvim/assert.h"
#include "nvim/buffer.h"
#include "nvim/change.h"
#include "nvim/channel.h"
#include "nvim/charset.h"
#include "nvim/context.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/eval/decode.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/executor.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/globals.h"
#include "nvim/if_cscope.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/lua/executor.h"
#include "nvim/macros.h"
#include "nvim/mark.h"
#include "nvim/memline.h"
#include "nvim/misc1.h"
#include "nvim/mouse.h"
#include "nvim/move.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/msgpack_rpc/server.h"
#include "nvim/ops.h"
#include "nvim/option.h"
#include "nvim/os/dl.h"
#include "nvim/os/input.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/plines.h"
#include "nvim/popupmnu.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/sha256.h"
#include "nvim/sign.h"
#include "nvim/spell.h"
#include "nvim/state.h"
#include "nvim/syntax.h"
#include "nvim/tag.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/version.h"
#include "nvim/vim.h"

Data Structures

struct  GetListLineCookie
 
struct  sortinfo_T
 struct storing information about current sort More...
 

Macros

#define SP_NOMOVE   0x01
 don't move cursor More...
 
#define SP_REPEAT   0x02
 repeat to find outer pair More...
 
#define SP_RETCOUNT   0x04
 return matchcount More...
 
#define SP_SETPCMARK   0x08
 set previous context mark More...
 
#define SP_START   0x10
 accept match at start position More...
 
#define SP_SUBPAT   0x20
 return nr of matching sub-pattern More...
 
#define SP_END   0x40
 leave cursor at end of match More...
 
#define SP_COLUMN   0x80
 start at cursor column More...
 
#define ITEM_COMPARE_FAIL   999
 

Enumerations

enum  SomeMatchType {
  kSomeMatch, kSomeMatchEnd, kSomeMatchList, kSomeMatchStr,
  kSomeMatchStrPos
}
 Describe data to return from find_some_match() More...
 

Functions

char_uget_function_name (expand_T *xp, int idx)
 
char_uget_expr_name (expand_T *xp, int idx)
 
const VimLFuncDeffind_internal_func (const char *const name) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE FUNC_ATTR_NONNULL_ALL
 
int call_internal_func (const char_u *const fname, const int argcount, typval_T *const argvars, typval_T *const rettv) FUNC_ATTR_NONNULL_ALL
 
int call_internal_method (const char_u *const fname, const int argcount, typval_T *const argvars, typval_T *const rettv, typval_T *const basetv) FUNC_ATTR_NONNULL_ALL
 Invoke a method for base->method(). More...
 
buf_Ttv_get_buf (typval_T *tv, int curtab_only)
 
buf_Ttv_get_buf_from_arg (typval_T *const tv) FUNC_ATTR_NONNULL_ALL
 Like tv_get_buf() but give an error message if the type is wrong. More...
 
buf_Tget_buf_arg (typval_T *arg)
 
void f_getmousepos (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 
void f_prompt_getprompt (typval_T *argvars, typval_T *rettv, FunPtr fptr) FUNC_ATTR_NONNULL_ALL
 "prompt_getprompt({buffer})" function More...
 
long do_searchpair (const char *spat, const char *mpat, const char *epat, int dir, const typval_T *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit) FUNC_ATTR_NONNULL_ARG(1
 
 snprintf ((char *) pat2, pat2_len, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat)
 
 if (flags &SP_START)
 
 if (skip !=NULL)
 
 for (;;)
 
 if (match_pos !=NULL)
 
 if ((flags &SP_NOMOVE)||retval==0)
 
 xfree (pat2)
 
 xfree (pat3)
 
 if (p_cpo==empty_option)
 
 if (list_arg->v_type !=VAR_LIST)
 
else if (recursive !=0)
 
 if (action_arg->v_type==VAR_UNKNOWN)
 
else if (action_arg->v_type !=VAR_STRING)
 
 if ((*act=='a'|| *act=='r'|| *act==' '|| *act=='f') &&act[1]==NUL)
 
 if (what_arg->v_type==VAR_UNKNOWN)
 
 if (set_errorlist(wp, l, action,(char_u *) title, what)==OK)
 
void f_string (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 

Variables

long char_upat
 
long char_upat2 = NULL
 
long char_upat3 = NULL
 
long retval = 0
 
pos_T pos = curwin->w_cursor
 
pos_T firstpos
 
pos_T foundpos
 
pos_T save_cursor = curwin->w_cursor
 
pos_T save_pos
 
int n = 0
 
int nest = 1
 
bool use_skip = false
 
int options = SEARCH_KEEP
 
proftime_T tm = profile_setlimit(time_limit)
 
 save_cpo = p_cpo
 
 p_cpo = empty_option
 
const size_t pat2_len = strlen(spat) + strlen(epat) + 17
 
const size_t pat3_len = strlen(spat) + strlen(mpat) + strlen(epat) + 25
 
if mpat
 
 else
 
static void const char * title = NULL
 
int action = ' '
 
rettv vval v_number = -1
 
dict_Twhat = NULL
 
typval_Tlist_arg = &args[0]
 
typval_Taction_arg = &args[1]
 
const char *const act = tv_get_string_chk(action_arg)
 
 return
 
typval_T *const what_arg = &args[2]
 
skip_args __pad0__
 
list_T *const l = list_arg->vval.v_list
 

Macro Definition Documentation

◆ ITEM_COMPARE_FAIL

#define ITEM_COMPARE_FAIL   999

◆ SP_COLUMN

#define SP_COLUMN   0x80

start at cursor column

◆ SP_END

#define SP_END   0x40

leave cursor at end of match

◆ SP_NOMOVE

#define SP_NOMOVE   0x01

don't move cursor

◆ SP_REPEAT

#define SP_REPEAT   0x02

repeat to find outer pair

◆ SP_RETCOUNT

#define SP_RETCOUNT   0x04

return matchcount

◆ SP_SETPCMARK

#define SP_SETPCMARK   0x08

set previous context mark

◆ SP_START

#define SP_START   0x10

accept match at start position

◆ SP_SUBPAT

#define SP_SUBPAT   0x20

return nr of matching sub-pattern

Enumeration Type Documentation

◆ SomeMatchType

Describe data to return from find_some_match()

Enumerator
kSomeMatch 

Data for match().

kSomeMatchEnd 

Data for matchend().

kSomeMatchList 

Data for matchlist().

kSomeMatchStr 

Data for matchstr().

kSomeMatchStrPos 

Data for matchstrpos().

Function Documentation

◆ call_internal_func()

int call_internal_func ( const char_u *const  fname,
const int  argcount,
typval_T *const  argvars,
typval_T *const  rettv 
)

◆ call_internal_method()

int call_internal_method ( const char_u *const  fname,
const int  argcount,
typval_T *const  argvars,
typval_T *const  rettv,
typval_T *const  basetv 
)

Invoke a method for base->method().

◆ do_searchpair()

long do_searchpair ( const char *  spat,
const char *  mpat,
const char *  epat,
int  dir,
const typval_T skip,
int  flags,
pos_T match_pos,
linenr_T  lnum_stop,
long  time_limit 
)

Search for a start/middle/end thing. Used by searchpair(), see its documentation for the details.

Parameters
spatstart pattern
mpatmiddle pattern
epatend pattern
dirBACKWARD or FORWARD
skipskip expression
flagsSP_SETPCMARK and other SP_ values
lnum_stopstop at this line if not zero
time_limitstop after this many msec
Returns
0 or -1 for no match,

◆ f_getmousepos()

void f_getmousepos ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

◆ f_prompt_getprompt()

void f_prompt_getprompt ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"prompt_getprompt({buffer})" function

◆ f_string()

void f_string ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

◆ find_internal_func()

const VimLFuncDef* find_internal_func ( const char *const  name)

Find internal function in hash functions

Parameters
[in]nameName of the function.

Returns pointer to the function definition or NULL if not found.

◆ for()

for ( ;;  )

◆ get_buf_arg()

buf_T* get_buf_arg ( typval_T arg)

Get the buffer from "arg" and give an error and return NULL if it is not valid.

◆ get_expr_name()

char_u* get_expr_name ( expand_T xp,
int  idx 
)

Function given to ExpandGeneric() to obtain the list of internal or user defined variable or function names.

◆ get_function_name()

char_u* get_function_name ( expand_T xp,
int  idx 
)

Function given to ExpandGeneric() to obtain the list of internal or user defined function names.

◆ if() [1/12]

if ( *==''|| *==''|| *==' '|| *==' 'f &&  act[1] = NUL)

◆ if() [2/12]

if ( (flags &SP_NOMOVE)||  retval = = 0)

◆ if() [3/12]

◆ if() [4/12]

if ( action_arg->  v_type = VAR_UNKNOWN)

◆ if() [5/12]

if ( flags &  SP_START)

◆ if() [6/12]

if ( list_arg->v_type = VAR_LIST)

◆ if() [7/12]

if ( match_pos !  = NULL)

◆ if() [8/12]

if ( p_cpo  = = empty_option)

◆ if() [9/12]

else if ( recursive !  = 0)

◆ if() [10/12]

if ( set_errorlist(wp, l, action,(char_u *) title, what = OK)

◆ if() [11/12]

if ( skip !  = NULL)

◆ if() [12/12]

else if ( what_arg->  v_type = VAR_UNKNOWN)

◆ snprintf()

snprintf ( (char *)  pat2,
pat2_len  ,
"\\m\\(%s\\m\\)\\|\\(%s\\m\\)"  ,
spat  ,
epat   
)

◆ tv_get_buf()

buf_T* tv_get_buf ( typval_T tv,
int  curtab_only 
)

◆ tv_get_buf_from_arg()

buf_T* tv_get_buf_from_arg ( typval_T *const  tv)

Like tv_get_buf() but give an error message if the type is wrong.

◆ xfree() [1/2]

xfree ( pat2  )

◆ xfree() [2/2]

xfree ( pat3  )

Variable Documentation

◆ __pad0__

skip_args __pad0__

◆ act

const char* const act = tv_get_string_chk(action_arg)

◆ action

int action = ' '

◆ action_arg

typval_T* action_arg = &args[1]

◆ else

else
Initial value:
{
"\\m\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat, mpat)

◆ firstpos

clearpos & firstpos

◆ foundpos

clearpos & foundpos

◆ l

list_T* const l = list_arg->vval.v_list

◆ list_arg

typval_T* list_arg = &args[0]

◆ mpat

if mpat
Initial value:

◆ n

nextlist n = 0

◆ nest

int nest = 1

◆ options

int options = SEARCH_KEEP

◆ p_cpo

p_cpo = empty_option

◆ pat

pat
Initial value:

◆ pat2

pat2 = NULL

◆ pat2_len

const size_t pat2_len = strlen(spat) + strlen(epat) + 17

◆ pat3

pat3 = NULL

◆ pat3_len

const size_t pat3_len = strlen(spat) + strlen(mpat) + strlen(epat) + 25

◆ pos

pos = curwin->w_cursor

◆ return

return

◆ retval

return retval = 0

◆ save_cpo

save_cpo = p_cpo

◆ save_cursor

save_cursor = curwin->w_cursor

◆ save_pos

pos_T save_pos

◆ title

void const char* title = NULL

◆ tm

tm = profile_setlimit(time_limit)

◆ use_skip

bool use_skip = false

◆ v_number

rettv vval v_number = -1

◆ what

dict_T* what = NULL

◆ what_arg

typval_T* const what_arg = &args[2]
pat2
long char_u * pat2
Definition: funcs.c:8555
spat
Structure containing last search pattern and its attributes.
Definition: search.h:70
pat3_len
const size_t pat3_len
Definition: funcs.c:8579
mpat
if mpat
Definition: funcs.c:8582
pat3
long char_u * pat3
Definition: funcs.c:8555
char_u
unsigned char char_u
Definition: types.h:12
snprintf
snprintf((char *) pat2, pat2_len, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat)
save_cpo
save_cpo
Definition: funcs.c:8569
STRCPY
#define STRCPY(d, s)
Definition: vim.h:218