58 #define STR(x) vstring_str(x)
59 #define LEN(x) VSTRING_LEN(x)
63 static char *json_quote(
VSTRING *result,
const char *text)
75 for (cp = (
unsigned char *) text; (ch = *cp) != 0; cp++) {
121 return (
STR(result));
126 static void format_json(
VSTREAM *showq_stream)
128 static VSTRING *queue_name = 0;
141 if (queue_name == 0) {
162 json_quote(quote_buf,
STR(queue_name)));
164 json_quote(quote_buf,
STR(queue_id)));
168 json_quote(quote_buf,
STR(addr)));
176 for (rcpt_count = 0; (showq_status =
attr_scan_more(showq_stream)) > 0; rcpt_count++) {
186 json_quote(quote_buf,
STR(addr)));
189 json_quote(quote_buf,
STR(why)));
193 if (showq_status < 0)
212 format_json(showq_stream);
214 if (showq_status < 0)
void showq_json(VSTREAM *showq_stream)
#define VSTRING_TERMINATE(vp)
#define VSTRING_ADDCH(vp, ch)
#define RECV_ATTR_LONG(name, val)
VSTREAM * vstream_printf(const char *fmt,...)
#define VSTRING_RESET(vp)
VSTRING * vstring_alloc(ssize_t len)
VSTRING * vstring_sprintf(VSTRING *vp, const char *format,...)
int vstream_fflush(VSTREAM *stream)
NORETURN msg_fatal_status(int status, const char *fmt,...)
#define MAIL_ATTR_QUEUEID
char * printable(char *string, int replacement)
#define vstream_ferror(vp)
#define RECV_ATTR_STR(name, val)