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/digraph.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/typval.h"
#include "nvim/eval/userfunc.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/highlight_group.h"
#include "nvim/if_cscope.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/input.h"
#include "nvim/lua/executor.h"
#include "nvim/macros.h"
#include "nvim/mark.h"
#include "nvim/match.h"
#include "nvim/memline.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/testing.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/version.h"
#include "nvim/vim.h"
#include "nvim/window.h"

Data Structures

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


#define ROTL(x, k)   (((x) << (k)) | ((x) >> (32 - (k))))
#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


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


char * get_function_name (expand_T *xp, int idx)
char * get_expr_name (expand_T *xp, int idx)
const EvalFuncDeffind_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)
 Get buffer by number or pattern. More...
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)
win_Tget_optional_window (typval_T *argvars, int idx)
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 ((char_u *) 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 *) title, what)==OK)


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 = (char *)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
static void const char * title = NULL
char 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)
typval_T *const what_arg = &args[2]
skip_args __pad0__
list_T *const l = list_arg->vval.v_list

Macro Definition Documentation


#define ITEM_COMPARE_FAIL   999


#define ROTL (   x,
)    (((x) << (k)) | ((x) >> (32 - (k))))


#define SP_COLUMN   0x80

start at cursor column


#define SP_END   0x40

leave cursor at end of match


#define SP_NOMOVE   0x01

don't move cursor


#define SP_REPEAT   0x02

repeat to find outer pair


#define SP_RETCOUNT   0x04

return matchcount


#define SP_SETPCMARK   0x08

set previous context mark


#define SP_START   0x10

accept match at start position


#define SP_SUBPAT   0x20

return nr of matching sub-pattern

Enumeration Type Documentation

◆ SomeMatchType

Describe data to return from find_some_match()


Data for match().


Data for matchend().


Data for matchlist().


Data for matchstr().


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.

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

◆ find_internal_func()

const EvalFuncDef* find_internal_func ( const char *const  name)

Find internal function in hash functions

[in]nameName of the function.
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* 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* get_function_name ( expand_T xp,
int  idx 

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

◆ get_optional_window()

win_T* get_optional_window ( typval_T argvars,
int  idx 

◆ if() [1/12]

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

◆ if() [2/12]

if ( (char_u *)  p_cpo = = empty_option)

◆ if() [3/12]

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

◆ if() [4/12]

◆ if() [5/12]

if ( action_arg->  v_type = VAR_UNKNOWN)

◆ if() [6/12]

if ( flags &  SP_START)

◆ if() [7/12]

if ( list_arg->v_type = VAR_LIST)

◆ if() [8/12]

if ( match_pos !  = NULL)

◆ if() [9/12]

else if ( recursive !  = 0)

◆ if() [10/12]

if ( set_errorlist(wp, l, action,(char *) 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  ,

◆ tv_get_buf()

buf_T* tv_get_buf ( typval_T tv,
int  curtab_only 

Get buffer by number or pattern.

◆ 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

char action = ' '

◆ action_arg

typval_T* action_arg = &args[1]

◆ 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 = (char *)empty_option

◆ pat

Initial value:
char *save_cpo

◆ 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


◆ 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]
long char_u * pat2
Definition: funcs.c:8307
Structure containing last search pattern and its attributes.
Definition: search.h:73
const size_t pat3_len
Definition: funcs.c:8331
if mpat
Definition: funcs.c:8334
long char_u * pat3
Definition: funcs.c:8307
snprintf((char *) pat2, pat2_len, "\\m\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat)
Definition: funcs.c:8321
#define STRCPY(d, s)
Definition: vim.h:222