Lines Matching refs:p
23 char_u *p; in vim_strsave() local
27 p = alloc(len); in vim_strsave()
28 if (p != NULL) in vim_strsave()
29 mch_memmove(p, string, len); in vim_strsave()
30 return p; in vim_strsave()
42 char_u *p; in vim_strnsave() local
44 p = alloc(len + 1); in vim_strnsave()
45 if (p != NULL) in vim_strnsave()
47 STRNCPY(p, string, len); in vim_strnsave()
48 p[len] = NUL; in vim_strnsave()
50 return p; in vim_strnsave()
75 char_u *p; in vim_strsave_escaped_ext() local
84 for (p = string; *p; p++) in vim_strsave_escaped_ext()
86 if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1) in vim_strsave_escaped_ext()
89 p += l - 1; in vim_strsave_escaped_ext()
92 if (vim_strchr(esc_chars, *p) != NULL || (bsl && rem_backslash(p))) in vim_strsave_escaped_ext()
100 for (p = string; *p; p++) in vim_strsave_escaped_ext()
102 if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1) in vim_strsave_escaped_ext()
104 mch_memmove(p2, p, (size_t)l); in vim_strsave_escaped_ext()
106 p += l - 1; // skip multibyte char in vim_strsave_escaped_ext()
109 if (vim_strchr(esc_chars, *p) != NULL || (bsl && rem_backslash(p))) in vim_strsave_escaped_ext()
111 *p2++ = *p; in vim_strsave_escaped_ext()
152 char_u *p; in vim_strsave_shellescape() local
185 for (p = string; *p != NUL; MB_PTR_ADV(p)) in vim_strsave_shellescape()
190 if (*p == '"') in vim_strsave_shellescape()
195 if (*p == '\'') in vim_strsave_shellescape()
202 if ((*p == '\n' && (csh_like || do_newline)) in vim_strsave_shellescape()
203 || (*p == '!' && (csh_like || do_special))) in vim_strsave_shellescape()
209 if (do_special && find_cmdline_var(p, &l) >= 0) in vim_strsave_shellescape()
212 p += l - 1; in vim_strsave_shellescape()
214 if (*p == '\\' && fish_like) in vim_strsave_shellescape()
232 for (p = string; *p != NUL; ) in vim_strsave_shellescape()
237 if (*p == '"') in vim_strsave_shellescape()
241 ++p; in vim_strsave_shellescape()
247 if (*p == '\'') in vim_strsave_shellescape()
261 ++p; in vim_strsave_shellescape()
264 if ((*p == '\n' && (csh_like || do_newline)) in vim_strsave_shellescape()
265 || (*p == '!' && (csh_like || do_special))) in vim_strsave_shellescape()
270 *d++ = *p++; in vim_strsave_shellescape()
273 if (do_special && find_cmdline_var(p, &l) >= 0) in vim_strsave_shellescape()
277 *d++ = *p++; in vim_strsave_shellescape()
280 if (*p == '\\' && fish_like) in vim_strsave_shellescape()
283 *d++ = *p++; in vim_strsave_shellescape()
287 MB_COPY_CHAR(p, d); in vim_strsave_shellescape()
336 char_u *p) in vim_strup() argument
341 if (p != NULL) in vim_strup()
343 p2 = p; in vim_strup()
362 char_u *p; in strup_save() local
365 res = p = vim_strsave(orig); in strup_save()
368 while (*p != NUL) in strup_save()
378 c = utf_ptr2char(p); in strup_save()
379 l = utf_ptr2len(p); in strup_save()
383 c = *p; in strup_save()
399 mch_memmove(s, res, p - res); in strup_save()
400 STRCPY(s + (p - res) + newl, p + l); in strup_save()
401 p = s + (p - res); in strup_save()
406 utf_char2bytes(uc, p); in strup_save()
407 p += newl; in strup_save()
409 else if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1) in strup_save()
410 p += l; // skip multi-byte character in strup_save()
413 *p = TOUPPER_LOC(*p); // note that toupper() can be a macro in strup_save()
414 p++; in strup_save()
429 char_u *p; in strlow_save() local
432 res = p = vim_strsave(orig); in strlow_save()
435 while (*p != NUL) in strlow_save()
445 c = utf_ptr2char(p); in strlow_save()
446 l = utf_ptr2len(p); in strlow_save()
450 c = *p; in strlow_save()
466 mch_memmove(s, res, p - res); in strlow_save()
467 STRCPY(s + (p - res) + newl, p + l); in strlow_save()
468 p = s + (p - res); in strlow_save()
473 utf_char2bytes(lc, p); in strlow_save()
474 p += newl; in strlow_save()
476 else if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1) in strlow_save()
477 p += l; // skip multi-byte character in strlow_save()
480 *p = TOLOWER_LOC(*p); // note that tolower() can be a macro in strlow_save()
481 p++; in strlow_save()
592 char_u *p; in vim_strchr() local
595 p = string; in vim_strchr()
598 while (*p != NUL) in vim_strchr()
600 int l = utfc_ptr2len(p); in vim_strchr()
603 if (utf_ptr2char(p) == c && l > 1) in vim_strchr()
604 return p; in vim_strchr()
605 p += l; in vim_strchr()
614 while ((b = *p) != NUL) in vim_strchr()
616 if (b == c && p[1] == n2) in vim_strchr()
617 return p; in vim_strchr()
618 p += (*mb_ptr2len)(p); in vim_strchr()
624 while ((b = *p) != NUL) in vim_strchr()
627 return p; in vim_strchr()
628 p += (*mb_ptr2len)(p); in vim_strchr()
632 while ((b = *p) != NUL) in vim_strchr()
635 return p; in vim_strchr()
636 ++p; in vim_strchr()
649 char_u *p = string; in vim_strbyte() local
651 while (*p != NUL) in vim_strbyte()
653 if (*p == c) in vim_strbyte()
654 return p; in vim_strbyte()
655 ++p; in vim_strbyte()
672 char_u *p = string; in vim_strrchr() local
674 while (*p) in vim_strrchr()
676 if (*p == c) in vim_strrchr()
677 retval = p; in vim_strrchr()
678 MB_PTR_ADV(p); in vim_strrchr()
733 char_u *p; in has_non_ascii() local
736 for (p = s; *p != NUL; ++p) in has_non_ascii()
737 if (*p >= 128) in has_non_ascii()
777 char_u *p, *r, *s; in string_quote() local
783 for (p = str; *p != NUL; MB_PTR_ADV(p)) in string_quote()
784 if (*p == '\'') in string_quote()
798 for (p = str; *p != NUL; ) in string_quote()
800 if (*p == '\'') in string_quote()
802 MB_COPY_CHAR(p, r); in string_quote()
871 char_u *p; in f_charidx() local
910 for (p = str, len = 0; p <= str + idx; len++) in f_charidx()
912 if (*p == NUL) in f_charidx()
914 p += ptr2len(p); in f_charidx()
926 char_u *p; in f_str2list() local
940 p = tv_get_string(&argvars[0]); in f_str2list()
958 for ( ; *p != NUL; p += (*ptr2len)(p)) in f_str2list()
959 list_append_number(rettv->vval.v_list, (*ptr2char)(p)); in f_str2list()
962 for ( ; *p != NUL; ++p) in f_str2list()
963 list_append_number(rettv->vval.v_list, *p); in f_str2list()
973 char_u *p; in f_str2nr() local
997 p = skipwhite(tv_get_string_strict(&argvars[0])); in f_str2nr()
998 isneg = (*p == '-'); in f_str2nr()
999 if (*p == '+' || *p == '-') in f_str2nr()
1000 p = skipwhite(p + 1); in f_str2nr()
1007 vim_str2nr(p, NULL, NULL, what, &n, NULL, 0, FALSE); in f_str2nr()
1221 char_u *p; in f_strcharpart() local
1238 p = tv_get_string(&argvars[0]); in f_strcharpart()
1239 slen = (int)STRLEN(p); in f_strcharpart()
1259 nbyte += mb_ptr2len(p + nbyte); in f_strcharpart()
1261 nbyte += MB_CPTR2LEN(p + nbyte); in f_strcharpart()
1278 len += mb_ptr2len(p + off); in f_strcharpart()
1280 len += MB_CPTR2LEN(p + off); in f_strcharpart()
1304 rettv->vval.v_string = vim_strnsave(p + nbyte, len); in f_strcharpart()
1313 char_u *p; in f_strpart() local
1327 p = tv_get_string(&argvars[0]); in f_strpart()
1328 slen = (int)STRLEN(p); in f_strpart()
1358 off += mb_ptr2len(p + off); in f_strpart()
1363 rettv->vval.v_string = vim_strnsave(p + n, len); in f_strpart()
1473 char_u *p; in f_tr() local
1521 for (p = fromstr; *p != NUL; p += fromlen) in f_tr()
1523 fromlen = (*mb_ptr2len)(p); in f_tr()
1524 if (fromlen == inlen && STRNCMP(in_str, p, inlen) == 0) in f_tr()
1526 for (p = tostr; *p != NUL; p += tolen) in f_tr()
1528 tolen = (*mb_ptr2len)(p); in f_tr()
1532 cpstr = p; in f_tr()
1536 if (*p == NUL) // tostr is shorter than fromstr in f_tr()
1549 for (p = tostr; *p != NUL; p += tolen) in f_tr()
1551 tolen = (*mb_ptr2len)(p); in f_tr()
1567 p = vim_strchr(fromstr, *in_str); in f_tr()
1568 if (p != NULL) in f_tr()
1569 ga_append(&ga, tostr[p - fromstr]); in f_tr()
1595 char_u *p; in f_trim() local
1652 for (p = mask; *p != NUL; MB_PTR_ADV(p)) in f_trim()
1653 if (c1 == PTR2CHAR(p)) in f_trim()
1655 if (*p == NUL) in f_trim()
1678 for (p = mask; *p != NUL; MB_PTR_ADV(p)) in f_trim()
1679 if (c1 == PTR2CHAR(p)) in f_trim()
1681 if (*p == NUL) in f_trim()
1891 const char *p = fmt; in vim_vsnprintf_typval() local
1894 if (p == NULL) in vim_vsnprintf_typval()
1895 p = ""; in vim_vsnprintf_typval()
1896 while (*p != NUL) in vim_vsnprintf_typval()
1898 if (*p != '%') in vim_vsnprintf_typval()
1900 char *q = strchr(p + 1, '%'); in vim_vsnprintf_typval()
1901 size_t n = (q == NULL) ? STRLEN(p) : (size_t)(q - p); in vim_vsnprintf_typval()
1908 mch_memmove(str + str_l, p, n > avail ? avail : n); in vim_vsnprintf_typval()
1910 p += n; in vim_vsnprintf_typval()
1961 p++; // skip '%' in vim_vsnprintf_typval()
1964 while (*p == '0' || *p == '-' || *p == '+' || *p == ' ' in vim_vsnprintf_typval()
1965 || *p == '#' || *p == '\'') in vim_vsnprintf_typval()
1967 switch (*p) in vim_vsnprintf_typval()
1979 p++; in vim_vsnprintf_typval()
1985 if (*p == '*') in vim_vsnprintf_typval()
1989 p++; in vim_vsnprintf_typval()
2003 else if (VIM_ISDIGIT((int)(*p))) in vim_vsnprintf_typval()
2007 unsigned int uj = *p++ - '0'; in vim_vsnprintf_typval()
2009 while (VIM_ISDIGIT((int)(*p))) in vim_vsnprintf_typval()
2010 uj = 10 * uj + (unsigned int)(*p++ - '0'); in vim_vsnprintf_typval()
2015 if (*p == '.') in vim_vsnprintf_typval()
2017 p++; in vim_vsnprintf_typval()
2019 if (*p == '*') in vim_vsnprintf_typval()
2028 p++; in vim_vsnprintf_typval()
2037 else if (VIM_ISDIGIT((int)(*p))) in vim_vsnprintf_typval()
2041 unsigned int uj = *p++ - '0'; in vim_vsnprintf_typval()
2043 while (VIM_ISDIGIT((int)(*p))) in vim_vsnprintf_typval()
2044 uj = 10 * uj + (unsigned int)(*p++ - '0'); in vim_vsnprintf_typval()
2050 if (*p == 'h' || *p == 'l') in vim_vsnprintf_typval()
2052 length_modifier = *p; in vim_vsnprintf_typval()
2053 p++; in vim_vsnprintf_typval()
2054 if (length_modifier == 'l' && *p == 'l') in vim_vsnprintf_typval()
2058 p++; in vim_vsnprintf_typval()
2061 fmt_spec = *p; in vim_vsnprintf_typval()
2095 str_arg = p; in vim_vsnprintf_typval()
2666 str_arg = p; in vim_vsnprintf_typval()
2668 if (*p != NUL) in vim_vsnprintf_typval()
2674 if (*p != NUL) in vim_vsnprintf_typval()
2675 p++; // step over the just processed conversion specifier in vim_vsnprintf_typval()