165 #define STR(x) vstring_str(x)
209 #define DSB_TRUNCATE(s) \
210 do { VSTRING_RESET(s); VSTRING_TERMINATE(s); } while (0)
212 #define NULL_OR_EMPTY(s) ((s) == 0 || *(s) == 0)
214 #define DSB_ACTION(dsb, stat, act) \
215 vstring_strcpy((dsb)->action, !NULL_OR_EMPTY(act) ? (act) : "")
217 #define DSB_MTA(dsb, type, name) do { \
218 if (NULL_OR_EMPTY(type) || NULL_OR_EMPTY(name)) { \
219 DSB_TRUNCATE((dsb)->mtype); \
220 DSB_TRUNCATE((dsb)->mname); \
222 vstring_strcpy((dsb)->mtype, (type)); \
223 vstring_strcpy((dsb)->mname, (name)); \
227 #define DSB_DIAG(dsb, type, text) do { \
228 if (NULL_OR_EMPTY(type) || NULL_OR_EMPTY(text)) { \
229 DSB_TRUNCATE((dsb)->dtype); \
230 DSB_TRUNCATE((dsb)->dtext); \
232 vstring_strcpy((dsb)->dtype, (type)); \
233 vstring_strcpy((dsb)->dtext, (text)); \
240 const char *mtype,
const char *mname,
241 const char *dtype,
const char *dtext,
242 const char *format,...)
250 va_start(ap, format);
279 va_start(ap, format);
288 const char *dtext,
const char *format,...)
298 va_start(ap, format);
308 const char *mtype,
const char *mname,
309 const char *dtype,
const char *dtext)
DSN_BUF * dsb_create(void)
DSN_BUF * dsb_update(DSN_BUF *dsb, const char *status, const char *action, const char *mtype, const char *mname, const char *dtype, const char *dtext, const char *format,...)
void dsb_reset(DSN_BUF *dsb)
void dsb_free(DSN_BUF *dsb)
DSN_BUF * vdsb_simple(DSN_BUF *dsb, const char *status, const char *format, va_list ap)
VSTRING * vstring_strcpy(VSTRING *vp, const char *src)
VSTRING * vstring_vsprintf(VSTRING *vp, const char *format, va_list ap)
VSTRING * vstring_alloc(ssize_t len)
#define DSB_DIAG(dsb, type, text)
DSN_BUF * dsb_simple(DSN_BUF *dsb, const char *status, const char *format,...)
#define DSB_MTA(dsb, type, name)
DSN_BUF * dsb_status(DSN_BUF *dsb, const char *status)
DSN_BUF * dsb_unix(DSN_BUF *dsb, const char *status, const char *dtext, const char *format,...)
VSTRING * vstring_free(VSTRING *vp)
DSN_BUF * dsb_formal(DSN_BUF *dsb, const char *status, const char *action, const char *mtype, const char *mname, const char *dtype, const char *dtext)
#define DSB_ACTION(dsb, stat, act)
void * mymalloc(ssize_t len)