X("nocheck", 0, NCHECKSW) \
X("verbose", 0, VERBSW) \
X("noverbose", 0, NVERBSW) \
+ X("concat", 0, CONCATSW) \
+ X("noconcat", 0, NCONCATSW) \
X("file file", 0, FILESW) \
X("form formfile", 0, FORMSW) \
X("part number", 0, PARTSW) \
int type_ok (CT, int);
void flush_errors (void);
-/* mhshowsbr.c */
-void show_all_messages (CT *);
-
/* mhfree.c */
extern CT *cts;
void freects_done (int) NORETURN;
int
main (int argc, char **argv)
{
- int msgnum, *icachesw;
+ int msgnum, *icachesw, concatsw = 1, textonly = 1, inlineonly = 1;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
char **arguments;
checksw = 0;
continue;
+ case CONCATSW:
+ concatsw = 1;
+ continue;
+ case NCONCATSW:
+ concatsw = 0;
+ continue;
+
case PARTSW:
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
parts[npart] = NULL;
types[ntype] = NULL;
+ /*
+ * If we had any specific parts or types specified, turn off text only
+ * content.
+ */
+
+ if (npart > 0 || ntype > 0) {
+ textonly = 0;
+ inlineonly = 0;
+ }
+
/*
* Check if we've specified an additional profile
*/
/*
* Show the message content
*/
- show_all_messages (cts);
+ show_all_messages (cts, concatsw, textonly, inlineonly);
/* Now free all the structures for the content */
for (ctp = cts; *ctp; ctp++)
/*
* prototypes
*/
-void show_all_messages (CT *);
int show_content_aux (CT, int, char *, char *);
/*
* static prototypes
*/
-static void show_single_message (CT, char *);
-static void DisplayMsgHeader (CT, char *);
-static int show_switch (CT, int);
+static void show_single_message (CT, char *, int, int, int);
+static void DisplayMsgHeader (CT, char *, int);
+static int show_switch (CT, int, int, int, int);
static int show_content (CT, int);
static int show_content_aux2 (CT, int, char *, char *, int, int, int);
static int show_text (CT, int);
-static int show_multi (CT, int);
-static int show_multi_internal (CT, int);
+static int show_multi (CT, int, int, int, int);
+static int show_multi_internal (CT, int, int, int, int);
static int show_multi_aux (CT, int, char *);
static int show_message_rfc822 (CT, int);
static int show_partial (CT, int);
-static int show_external (CT, int);
+static int show_external (CT, int, int, int, int);
static int parse_display_string (CT, char *, int *, int *, char *, char *,
size_t, int multipart);
static int convert_content_charset (CT, char **);
*/
void
-show_all_messages (CT *cts)
+show_all_messages (CT *cts, int concat, int textonly, int inlineonly)
{
CT ct, *ctp;
/* if top-level type is ok, then display message */
if (type_ok (ct, 1))
- show_single_message (ct, formsw);
+ show_single_message (ct, formsw, concat, textonly, inlineonly);
}
}
*/
static void
-show_single_message (CT ct, char *form)
+show_single_message (CT ct, char *form, int concat, int textonly,
+ int inlineonly)
{
sigset_t set, oset;
* the message headers.
*/
if (form)
- DisplayMsgHeader(ct, form);
+ DisplayMsgHeader(ct, form, concat);
/* Show the body of the message */
- show_switch (ct, 0);
+ show_switch (ct, 0, concat, textonly, inlineonly);
if (ct->c_fp) {
fclose (ct->c_fp);
*/
static void
-DisplayMsgHeader (CT ct, char *form)
+DisplayMsgHeader (CT ct, char *form, int concat)
{
pid_t child_id;
int i, vecp;
* If we've specified -(no)moreproc,
* then just pass that along.
*/
- if (nomore) {
+ if (nomore || concat) {
vec[vecp++] = getcpy("-nomoreproc");
} else if (progsw) {
vec[vecp++] = getcpy("-moreproc");
*/
static int
-show_switch (CT ct, int alternate)
+show_switch (CT ct, int alternate, int concat, int textonly, int inlineonly)
{
switch (ct->c_type) {
case CT_MULTIPART:
- return show_multi (ct, alternate);
+ return show_multi (ct, alternate, concat, textonly, inlineonly);
case CT_MESSAGE:
switch (ct->c_subtype) {
return show_partial (ct, alternate);
case MESSAGE_EXTERNAL:
- return show_external (ct, alternate);
+ return show_external (ct, alternate, concat, textonly,
+ inlineonly);
case MESSAGE_RFC822:
default:
*/
static int
-show_multi (CT ct, int alternate)
+show_multi (CT ct, int alternate, int concat, int textonly, int inlineonly)
{
char *cp, buffer[BUFSIZ];
CI ci = &ct->c_ctinfo;
* unknown types are displayable, since they're treated as mixed
* per RFC 2046.
*/
- return show_multi_internal (ct, alternate);
+ return show_multi_internal (ct, alternate, concat, textonly, inlineonly);
}
*/
static int
-show_multi_internal (CT ct, int alternate)
+show_multi_internal (CT ct, int alternate, int concat, int textonly,
+ int inlineonly)
{
int alternating, nowalternate, result;
struct multipart *m = (struct multipart *) ct->c_ctparams;
if (part_ok (p, 1) && type_ok (p, 1)) {
int inneresult;
- inneresult = show_switch (p, nowalternate);
+ inneresult = show_switch (p, nowalternate, concat, textonly,
+ inlineonly);
switch (inneresult) {
case NOTOK:
if (alternate && !alternating) {
*/
static int
-show_external (CT ct, int alternate)
+show_external (CT ct, int alternate, int concat, int textonly, int inlineonly)
{
struct exbody *e = (struct exbody *) ct->c_ctparams;
CT p = e->eb_content;
if (!type_ok (p, 0))
return OK;
- return show_switch (p, alternate);
+ return show_switch (p, alternate, concat, textonly, inlineonly);
}