20#ifndef DETERMINISTICESPASYNCWEBSERVER_DET_STRBUF_H
21#define DETERMINISTICESPASYNCWEBSERVER_DET_STRBUF_H
40 size_t sl = strnlen(s, b->
cap);
46 memcpy(b->
p + b->
len, s, sl);
57 const char *rep =
nullptr;
size_t det_sb_finish(DetSb *b)
NUL-terminate and return the built length, or 0 if the build overflowed.
void det_sb_put(DetSb *b, const char *s)
Append NUL-terminated s; leaves the buffer untouched and clears ok if it would not fit.
void det_sb_xml(DetSb *b, const char *s)
Append s XML-escaped (& < > "); a NULL s appends nothing.
Bump-append target; ok latches false once an append would overflow cap.