wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
debug.h
Go to the documentation of this file.
1#ifndef WIRED_DEBUG_H
2#define WIRED_DEBUG_H
3
5
13
17typedef struct {
22
32void wired_fmt_u64(char* out, usz* at, const wired_fmt_u64_in* in);
33
39void wired_log_str(const char* s);
40
46void wired_log_ts(const char* s);
47
51#ifdef WIRED_DEBUG
52#define WIRED_LOG(s) wired_log_ts(s)
53#else
54#define WIRED_LOG(s) ((void)0)
55#endif
56
57#endif
void wired_log_ts(const char *s)
Write a CLOCK_REALTIME "sec.nsec " timestamp then s to stderr.
void wired_log_str(const char *s)
Write a NUL-terminated string to stderr (fd 2).
void wired_fmt_u64(char *out, usz *at, const wired_fmt_u64_in *in)
Write in->v as decimal into out at *at, left-padded with '0' to in->width.
The value to format and its minimum zero-padded width.
Definition debug.h:17
u64 v
value to format as decimal
Definition debug.h:18
usz width
minimum digit count, at most 20 (a u64's maximum); shorter values are zero-padded
Definition debug.h:19
Linux direct syscalls.
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned long u64
unsigned 64-bit integer
Definition types.h:13