Lines Matching refs:s

45 static char *is_prio(char *s, size_t len) {  in is_prio()  argument
46 if (!len || !isdigit(*s++)) { in is_prio()
53 while (((c = *s++)) && (++priolen <= max_prio_len)) { in is_prio()
55 return ((c == '>') && (*s == '[')) ? s : NULL; in is_prio()
62 static char *is_timestamp(char *s, size_t len) { in is_timestamp() argument
63 while (len && (*s == ' ')) { in is_timestamp()
64 ++s; in is_timestamp()
67 if (!len || !isdigit(*s++)) { in is_timestamp()
73 while (len && ((c = *s++))) { in is_timestamp()
78 return ((c == ']') && !first_period && (*s == ' ')) ? s : NULL; in is_timestamp()
97 char *log_strntok_r(char *s, size_t *len, char **last, size_t *sublen) { in log_strntok_r() argument
102 if (!s) { in log_strntok_r()
103 if (!(s = *last)) { in log_strntok_r()
108 if ((*s & SIGNATURE_MASK) == LESS_THAN_SIG) { in log_strntok_r()
109 *s = (*s & ~SIGNATURE_MASK) + '0'; in log_strntok_r()
110 *--s = '<'; in log_strntok_r()
115 if ((*s & SIGNATURE_MASK) == OPEN_BRACKET_SIG) { in log_strntok_r()
116 if (*s == OPEN_BRACKET_SPACE) { in log_strntok_r()
117 *s = ' '; in log_strntok_r()
119 *s = (*s & ~SIGNATURE_MASK) + '0'; in log_strntok_r()
121 *--s = '['; in log_strntok_r()
126 while (*len && ((*s == '\r') || (*s == '\n'))) { in log_strntok_r()
127 ++s; in log_strntok_r()
135 char *peek, *tok = s; in log_strntok_r()
142 char c = *s++; in log_strntok_r()
148 s[-1] = '\0'; in log_strntok_r()
149 *last = s; in log_strntok_r()
153 peek = is_prio(s, *len); in log_strntok_r()
157 if (s != (tok + 1)) { // not first? in log_strntok_r()
158 s[-1] = '\0'; in log_strntok_r()
159 *s &= ~SIGNATURE_MASK; in log_strntok_r()
160 *s |= LESS_THAN_SIG; // signature for '<' in log_strntok_r()
161 *last = s; in log_strntok_r()
164 adjust = peek - s; in log_strntok_r()
170 s = peek; in log_strntok_r()
171 if ((*s == '[') && ((peek = is_timestamp(s + 1, *len - 1)))) { in log_strntok_r()
172 adjust = peek - s; in log_strntok_r()
178 s = peek; in log_strntok_r()
183 peek = is_timestamp(s, *len); in log_strntok_r()
187 if (s != (tok + 1)) { // not first? in log_strntok_r()
188 s[-1] = '\0'; in log_strntok_r()
189 if (*s == ' ') { in log_strntok_r()
190 *s = OPEN_BRACKET_SPACE; in log_strntok_r()
192 *s &= ~SIGNATURE_MASK; in log_strntok_r()
193 *s |= OPEN_BRACKET_SIG; // signature for '[' in log_strntok_r()
195 *last = s; in log_strntok_r()
198 adjust = peek - s; in log_strntok_r()
204 s = peek; in log_strntok_r()
308 static const char *strnstr(const char *s, size_t len, const char *needle) { in strnstr() argument
322 } while (*s++ != c); in strnstr()
323 } while (fast<memcmp>(s, needle, needleLen)); in strnstr()
324 s--; in strnstr()
326 return s; in strnstr()
515 static const char *strnrchr(const char *s, size_t len, char c) { in strnrchr() argument
517 for (;len; ++s, len--) { in strnrchr()
518 if (*s == c) { in strnrchr()
519 save = s; in strnrchr()
734 size_t s = etag - mp; in log() local
735 if (((s + s) < taglen) && !fast<memcmp>(mp, mp - 1 - s, s)) { in log()