Lines Matching refs:p
25 const char *p; in first_word() local
46 p = s + wl; in first_word()
47 if (*p == 0) in first_word()
48 return (char*) p; in first_word()
50 if (!strchr(WHITESPACE, *p)) in first_word()
53 p += strspn(p, WHITESPACE); in first_word()
54 return (char*) p; in first_word()
91 char *r, *p; in strjoin_real() local
106 p = r = new(char, l); in strjoin_real()
112 p = stpcpy(p, t); in strjoin_real()
115 *p = 0; in strjoin_real()
163 for (char *p = s; *p; p++) in delete_trailing_chars() local
164 if (!strchr(bad, *p)) in delete_trailing_chars()
165 c = p + 1; in delete_trailing_chars()
198 for (char *p = t; *p; p++) in ascii_strlower() local
199 *p = ascii_tolower(*p); in ascii_strlower()
207 for (char *p = t; *p; p++) in ascii_strupper() local
208 *p = ascii_toupper(*p); in ascii_strupper()
250 for (const char *p = a; *p; p++) in chars_intersect() local
251 if (strchr(b, *p)) in chars_intersect()
257 bool string_has_cc(const char *p, const char *ok) { in string_has_cc() argument
258 assert(p); in string_has_cc()
266 for (const char *t = p; *t; t++) { in string_has_cc()
726 char *nr, *p; in strextend_with_separator_internal() local
767 p = nr + f; in strextend_with_separator_internal()
778 p = stpcpy(p, separator); in strextend_with_separator_internal()
780 p = stpcpy(p, t); in strextend_with_separator_internal()
786 assert(p == nr + l); in strextend_with_separator_internal()
788 *p = 0; in strextend_with_separator_internal()
790 return p; in strextend_with_separator_internal()
880 char *r, *p; in strrep() local
886 p = r = malloc(l * n + 1); in strrep()
891 p = stpcpy(p, s); in strrep()
893 *p = 0; in strrep()
928 int free_and_strdup(char **p, const char *s) { in free_and_strdup() argument
931 assert(p); in free_and_strdup()
936 if (streq_ptr(*p, s)) in free_and_strdup()
946 free(*p); in free_and_strdup()
947 *p = t; in free_and_strdup()
952 int free_and_strndup(char **p, const char *s, size_t l) { in free_and_strndup() argument
955 assert(p); in free_and_strndup()
961 if (!*p && !s) in free_and_strndup()
964 if (*p && s && strneq(*p, s, l) && (l > strlen(*p) || (*p)[l] == '\0')) in free_and_strndup()
974 free_and_replace(*p, t); in free_and_strndup()
978 bool string_is_safe(const char *p) { in string_is_safe() argument
979 if (!p) in string_is_safe()
984 for (const char *t = p; *t; t++) { in string_is_safe()
1006 const char *p = s, *e = s; in string_truncate_lines() local
1020 k = strcspn(p, "\n"); in string_truncate_lines()
1022 if (p[k] == 0) { in string_truncate_lines()
1029 e = p + k; /* last line to include */ in string_truncate_lines()
1033 assert(p[k] == '\n'); in string_truncate_lines()
1039 e = p + k; in string_truncate_lines()
1041 p += k + 1; in string_truncate_lines()
1063 const char *p = s; in string_extract_line() local
1075 q = strchr(p, '\n'); in string_extract_line()
1082 m = strndup(p, q - p); in string_extract_line()
1089 if (p == s) in string_extract_line()
1094 m = strdup(p); in string_extract_line()
1118 p = q + 1; in string_extract_line()
1130 for (const char *p = string;;) { in string_contains_word_strv() local
1134 r = extract_first_word(&p, &w, separators, flags); in string_contains_word_strv()
1172 for (char *p = strchr(str, old_char); p; p = strchr(p + 1, old_char)) in string_replace_char() local
1173 *p = new_char; in string_replace_char()
1187 for (const char *p = str + strlen(str); p > str && strchr(accept, p[-1]); p--) in strspn_from_end() local