static void
reply_part (GMimeObject *part,
- unused (int *part_count),
- unused (int first));
+ unused (int *part_count));
static const notmuch_show_format_t format_reply = {
NULL,
NULL, NULL,
NULL, NULL, NULL,
- NULL, reply_part, NULL, NULL,
+ NULL, reply_part, NULL, NULL, NULL,
NULL, NULL,
NULL
};
static void
reply_part (GMimeObject *part,
- unused (int *part_count),
- unused (int first))
+ unused (int *part_count))
{
GMimeContentDisposition *disposition;
GMimeContentType *content_type;
static void
format_part_text (GMimeObject *part,
- int *part_count,
- int first);
+ int *part_count);
static void
format_part_end_text (GMimeObject *part);
"",
"\fmessage{ ", format_message_text,
"\fheader{\n", format_headers_text, "\fheader}\n",
- "\fbody{\n", format_part_text, format_part_end_text, "\fbody}\n",
+ "\fbody{\n", format_part_text, format_part_end_text, "", "\fbody}\n",
"\fmessage}\n", "",
""
};
static void
format_part_json (GMimeObject *part,
- int *part_count,
- int first);
+ int *part_count);
static void
format_part_end_json (GMimeObject *part);
"[",
"{", format_message_json,
", \"headers\": {", format_headers_json, "}",
- ", \"body\": [", format_part_json, format_part_end_json, "]",
+ ", \"body\": [", format_part_json, format_part_end_json, ", ", "]",
"}", ", ",
"]"
};
"",
"", format_message_mbox,
"", NULL, "",
- "", NULL, NULL, "",
+ "", NULL, NULL, "", "",
"", "",
""
};
}
static void
-format_part_text (GMimeObject *part, int *part_count, unused (int first))
+format_part_text (GMimeObject *part, int *part_count)
{
GMimeContentDisposition *disposition;
GMimeContentType *content_type;
}
static void
-format_part_json (GMimeObject *part, int *part_count, int first)
+format_part_json (GMimeObject *part, int *part_count)
{
GMimeContentType *content_type;
GMimeContentDisposition *disposition;
content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
- if (! first)
- fputs (", ", stdout);
-
printf ("{\"id\": %d, \"content-type\": %s",
*part_count,
json_quote_str (ctx, g_mime_content_type_to_string (content_type)));
const notmuch_show_format_t *format,
int first)
{
+ if (!first)
+ fputs (format->part_sep, stdout);
+
if (GMIME_IS_MULTIPART (part)) {
GMimeMultipart *multipart = GMIME_MULTIPART (part);
int i;
*part_count = *part_count + 1;
- format->part (part, part_count, first);
+ format->part (part, part_count);
for (i = 0; i < g_mime_multipart_get_count (multipart); i++) {
show_message_part (g_mime_multipart_get_part (multipart, i),
*part_count = *part_count + 1;
- format->part (part, part_count, first);
+ format->part (part, part_count);
if (format->part_end)
format->part_end (part);
}