Lines Matching refs:b
114 log_buffer_timestamp (buffer * const restrict b) in __attribute_nonnull__()
120 buffer_append_int(b, TIME64_CAST(ts.tv_sec)); in __attribute_nonnull__()
121 buffer_append_string_len(b, CONST_STR_LEN(".000000000: ")); in __attribute_nonnull__()
125 buffer_append_str2(b, tstr, tlen, CONST_STR_LEN(".000000000: ")); in __attribute_nonnull__()
130 memcpy(b->ptr+buffer_clen(b)-nlen-2, n, nlen); in __attribute_nonnull__()
140 buffer_copy_string_len(b, tstr, tlen); in __attribute_nonnull__()
147 log_buffer_prefix (buffer * const restrict b, in __attribute_nonnull__()
159 buffer_append_iovec(b, iov, sizeof(iov)/sizeof(*iov)); in __attribute_nonnull__()
164 log_buffer_append_encoded (buffer * const b, in log_buffer_append_encoded() argument
170 buffer_append_string_len(b, s, n); /* common case; nothing to encode */ in log_buffer_append_encoded()
172 buffer_append_string_c_escaped(b, s, n); in log_buffer_append_encoded()
179 log_buffer_vsprintf (buffer * const restrict b, in __attribute_nonnull__()
185 size_t blen = buffer_clen(b); in __attribute_nonnull__()
186 size_t bsp = buffer_string_space(b)+1; in __attribute_nonnull__()
187 char *s = b->ptr + blen; in __attribute_nonnull__()
198 buffer_truncate(b, blen+n); /*buffer_commit(b, n);*/ in __attribute_nonnull__()
200 s = buffer_extend(b, n); in __attribute_nonnull__()
213 buffer_truncate(b, blen+i); in __attribute_nonnull__()
214 buffer_append_string_c_escaped(b, src, n); in __attribute_nonnull__()
225 buffer * const restrict b = &log_errh->b; /*(use shared temp buffer)*/ in __attribute_nonnull__() local
226 buffer_clear(b); in __attribute_nonnull__()
229 log_buffer_timestamp(b); in __attribute_nonnull__()
231 log_buffer_prefix(b, filename, line); in __attribute_nonnull__()
232 return b; in __attribute_nonnull__()
238 log_error_write (const log_error_st * const errh, buffer * const restrict b) in __attribute_nonnull__()
241 buffer_append_char(b, '\n'); in __attribute_nonnull__()
242 write_all(errh->fd, BUF_PTR_LEN(b)); in __attribute_nonnull__()
245 syslog(LOG_ERR, "%s", b->ptr); in __attribute_nonnull__()
252 log_error_append_strerror (buffer * const b, const int errnum) in log_error_append_strerror() argument
257 buffer_append_str2(b, CONST_STR_LEN(": "), buf, strlen(buf)); in log_error_append_strerror()
272 buffer * const restrict b = log_buffer_prepare(errh, filename, line); in log_error_va_list_impl() local
273 if (NULL == b) return; /*(errno not modified if errh->fd == -1)*/ in log_error_va_list_impl()
275 log_buffer_vsprintf(b, fmt, ap); in log_error_va_list_impl()
277 log_error_append_strerror(b, errnum); in log_error_va_list_impl()
279 log_error_write(errh, b); in log_error_va_list_impl()
281 buffer_clear(b); in log_error_va_list_impl()
323 buffer * const restrict b = log_buffer_prepare(errh, filename, line); in log_error_multiline() local
324 if (NULL == b) return; /*(errno not modified if errh->fd == -1)*/ in log_error_multiline()
328 log_buffer_vsprintf(b, fmt, ap); in log_error_multiline()
331 const uint32_t prefix_len = buffer_clen(b); in log_error_multiline()
340 buffer_truncate(b, prefix_len); in log_error_multiline()
341 log_buffer_append_encoded(b, current_line, n); in log_error_multiline()
342 log_error_write(errh, b); in log_error_multiline()
345 buffer_clear(b); in log_error_multiline()
360 buffer_free_ptr(&log_stderrh.b); in log_set_global_errh()