diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-07-10 21:29:18 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-10 21:29:18 +0200 |
commit | a2438132a675be4dde3acbdf03ba1fdb2f09427c (patch) | |
tree | 973f677bea21a7f41bbb9d49ad0038550e6e665b /src/proto | |
parent | 31e21766d6fb0a386e15ccc8c2192f6a3a210f53 (diff) | |
download | vim-git-a2438132a675be4dde3acbdf03ba1fdb2f09427c.tar.gz |
patch 8.2.3139: functions for string manipulation are spread outv8.2.3139
Problem: Functions for string manipulation are spread out.
Solution: Move string related functions to a new source file. (Yegappan
Lakshmanan, closes #8470)
Diffstat (limited to 'src/proto')
-rw-r--r-- | src/proto/eval.pro | 3 | ||||
-rw-r--r-- | src/proto/evalfunc.pro | 1 | ||||
-rw-r--r-- | src/proto/mbyte.pro | 1 | ||||
-rw-r--r-- | src/proto/misc1.pro | 1 | ||||
-rw-r--r-- | src/proto/misc2.pro | 21 | ||||
-rw-r--r-- | src/proto/strings.pro | 45 |
6 files changed, 46 insertions, 26 deletions
diff --git a/src/proto/eval.pro b/src/proto/eval.pro index d31ed1c72..2204f26af 100644 --- a/src/proto/eval.pro +++ b/src/proto/eval.pro @@ -32,8 +32,6 @@ int next_for_item(void *fi_void, char_u *arg); void free_for_info(void *fi_void); void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx); int pattern_match(char_u *pat, char_u *text, int ic); -char_u *eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext); -char_u *eval_next_line(evalarg_T *evalarg); char_u *skipwhite_and_linebreak(char_u *arg, evalarg_T *evalarg); void clear_evalarg(evalarg_T *evalarg, exarg_T *eap); int eval0(char_u *arg, typval_T *rettv, exarg_T *eap, evalarg_T *evalarg); @@ -55,7 +53,6 @@ int set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack); int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); char_u *echo_string_core(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); -char_u *string_quote(char_u *str, int function); int buf_byteidx_to_charidx(buf_T *buf, int lnum, int byteidx); int buf_charidx_to_byteidx(buf_T *buf, int lnum, int charidx); pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum, int charcol); diff --git a/src/proto/evalfunc.pro b/src/proto/evalfunc.pro index 3faff292a..67bb5e4d3 100644 --- a/src/proto/evalfunc.pro +++ b/src/proto/evalfunc.pro @@ -23,5 +23,4 @@ int dynamic_feature(char_u *feature); void mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv); void range_list_materialize(list_T *list); long do_searchpair(char_u *spat, char_u *mpat, char_u *epat, int dir, typval_T *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit); -void f_string(typval_T *argvars, typval_T *rettv); /* vim: set ft=c : */ diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro index 7a6009ed6..1cd02a903 100644 --- a/src/proto/mbyte.pro +++ b/src/proto/mbyte.pro @@ -86,4 +86,5 @@ char_u *string_convert(vimconv_T *vcp, char_u *ptr, int *lenp); char_u *string_convert_ext(vimconv_T *vcp, char_u *ptr, int *lenp, int *unconvlenp); void f_setcellwidths(typval_T *argvars, typval_T *rettv); void f_charclass(typval_T *argvars, typval_T *rettv); +void f_iconv(typval_T *argvars UNUSED, typval_T *rettv); /* vim: set ft=c : */ diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index d5fa1fad8..7c3e78c2d 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -36,7 +36,6 @@ void vim_setenv(char_u *name, char_u *val); char_u *get_env_name(expand_T *xp, int idx); char_u *get_users(expand_T *xp, int idx); int match_user(char_u *name); -char_u *concat_str(char_u *str1, char_u *str2); void preserve_exit(void); void line_breakcheck(void); void fast_breakcheck(void); diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro index fc574038a..5f7d70927 100644 --- a/src/proto/misc2.pro +++ b/src/proto/misc2.pro @@ -31,28 +31,9 @@ void *lalloc_id(size_t size, int message, alloc_id_T id); void *mem_realloc(void *ptr, size_t size); void do_outofmem_msg(size_t size); void free_all_mem(void); -char_u *vim_strsave(char_u *string); -char_u *vim_strnsave(char_u *string, size_t len); char_u *vim_memsave(char_u *p, size_t len); -char_u *vim_strsave_escaped(char_u *string, char_u *esc_chars); -char_u *vim_strsave_escaped_ext(char_u *string, char_u *esc_chars, int cc, int bsl); -int csh_like_shell(void); -char_u *vim_strsave_shellescape(char_u *string, int do_special, int do_newline); -char_u *vim_strsave_up(char_u *string); -char_u *vim_strnsave_up(char_u *string, size_t len); -void vim_strup(char_u *p); -char_u *strup_save(char_u *orig); -char_u *strlow_save(char_u *orig); -void del_trailing_spaces(char_u *ptr); -void vim_strncpy(char_u *to, char_u *from, size_t len); -void vim_strcat(char_u *to, char_u *from, size_t tosize); int copy_option_part(char_u **option, char_u *buf, int maxlen, char *sep_chars); void vim_free(void *x); -int vim_stricmp(char *s1, char *s2); -int vim_strnicmp(char *s1, char *s2, size_t len); -char_u *vim_strchr(char_u *string, int c); -char_u *vim_strbyte(char_u *string, int c); -char_u *vim_strrchr(char_u *string, int c); int vim_isspace(int x); void ga_clear(garray_T *gap); void ga_clear_strings(garray_T *gap); @@ -93,14 +74,12 @@ int get_shape_idx(int mouse); void update_mouseshape(int shape_idx); int vim_chdir(char_u *new_dir); int get_user_name(char_u *buf, int len); -void sort_strings(char_u **files, int count); int filewritable(char_u *fname); int get2c(FILE *fd); int get3c(FILE *fd); int get4c(FILE *fd); char_u *read_string(FILE *fd, int cnt); int put_bytes(FILE *fd, long_u nr, int len); -int has_non_ascii(char_u *s); int mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc); int build_argv_from_string(char_u *cmd, char ***argv, int *argc); int build_argv_from_list(list_T *l, char ***argv, int *argc); diff --git a/src/proto/strings.pro b/src/proto/strings.pro new file mode 100644 index 000000000..4dba9b1bd --- /dev/null +++ b/src/proto/strings.pro @@ -0,0 +1,45 @@ +/* strings.c */ +char_u *vim_strsave(char_u *string); +char_u *vim_strnsave(char_u *string, size_t len); +char_u *vim_strsave_escaped(char_u *string, char_u *esc_chars); +char_u *vim_strsave_escaped_ext(char_u *string, char_u *esc_chars, int cc, int bsl); +int csh_like_shell(void); +char_u *vim_strsave_shellescape(char_u *string, int do_special, int do_newline); +char_u *vim_strsave_up(char_u *string); +char_u *vim_strnsave_up(char_u *string, size_t len); +void vim_strup(char_u *p); +char_u *strlow_save(char_u *orig); +void del_trailing_spaces(char_u *ptr); +void vim_strncpy(char_u *to, char_u *from, size_t len); +void vim_strcat(char_u *to, char_u *from, size_t tosize); +int vim_stricmp(char *s1, char *s2); +int vim_strnicmp(char *s1, char *s2, size_t len); +char_u *vim_strchr(char_u *string, int c); +char_u *vim_strbyte(char_u *string, int c); +char_u *vim_strrchr(char_u *string, int c); +void sort_strings(char_u **files, int count); +int has_non_ascii(char_u *s); +char_u *concat_str(char_u *str1, char_u *str2); +char_u *string_quote(char_u *str, int function); +void f_byteidx(typval_T *argvars, typval_T *rettv); +void f_byteidxcomp(typval_T *argvars, typval_T *rettv); +void f_charidx(typval_T *argvars, typval_T *rettv); +void f_str2list(typval_T *argvars, typval_T *rettv); +void f_str2nr(typval_T *argvars, typval_T *rettv); +void f_strgetchar(typval_T *argvars, typval_T *rettv); +void f_stridx(typval_T *argvars, typval_T *rettv); +void f_string(typval_T *argvars, typval_T *rettv); +void f_strlen(typval_T *argvars, typval_T *rettv); +void f_strcharlen(typval_T *argvars, typval_T *rettv); +void f_strchars(typval_T *argvars, typval_T *rettv); +void f_strdisplaywidth(typval_T *argvars, typval_T *rettv); +void f_strwidth(typval_T *argvars, typval_T *rettv); +void f_strcharpart(typval_T *argvars, typval_T *rettv); +void f_strpart(typval_T *argvars, typval_T *rettv); +void f_strridx(typval_T *argvars, typval_T *rettv); +void f_strtrans(typval_T *argvars, typval_T *rettv); +void f_tolower(typval_T *argvars, typval_T *rettv); +void f_toupper(typval_T *argvars, typval_T *rettv); +void f_tr(typval_T *argvars, typval_T *rettv); +void f_trim(typval_T *argvars, typval_T *rettv); +/* vim: set ft=c : */ |