X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhlistsbr.c;h=a4e831a068014dd4baefaed342181bc719e7d2cf;hb=ab3e934551e83f49a04975b05c11c1b3d5768642;hp=dd6d855ff04f85c39eabcd0643a526f9c2644756;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index dd6d855..a4e831a 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -3,8 +3,6 @@ * mhlistsbr.c -- routines to list information about the * -- contents of MIME messages * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -19,8 +17,7 @@ #include #include #include - -extern int errno; +#include /* mhmisc.c */ int part_ok (CT, int); @@ -209,18 +206,26 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug) printf ("\n"); - /* - * If verbose, print any RFC-822 comments in the - * Content-Type line. - */ - if (verbose && ci->ci_comment) { - char *dp; + if (verbose) { + char **ap, **ep; + CI ci = &ct->c_ctinfo; - dp = trimcpy (cp = add (ci->ci_comment, NULL)); - free (cp); - snprintf (buffer, sizeof(buffer), "(%s)", dp); - free (dp); - printf (LSTFMT2d2, buffer); + for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) + printf ("\t %s=\"%s\"\n", *ap, *ep); + + /* + * If verbose, print any RFC-822 comments in the + * Content-Type line. + */ + if (ci->ci_comment) { + char *dp; + + dp = trimcpy (cp = add (ci->ci_comment, NULL)); + free (cp); + snprintf (buffer, sizeof(buffer), "(%s)", dp); + free (dp); + printf (LSTFMT2d2, buffer); + } } if (debug) @@ -264,7 +269,8 @@ list_debug (CT ct) /* print internal flags for type/subtype */ fprintf (stderr, " type 0x%x subtype 0x%x params 0x%x\n", - ct->c_type, ct->c_subtype, (unsigned int) ct->c_ctparams); + ct->c_type, ct->c_subtype, + (unsigned int)(unsigned long) ct->c_ctparams); fprintf (stderr, " showproc \"%s\"\n", empty (ct->c_showproc)); fprintf (stderr, " termproc \"%s\"\n", empty (ct->c_termproc)); @@ -276,7 +282,7 @@ list_debug (CT ct) /* print internal flags for transfer encoding */ fprintf (stderr, " transfer encoding 0x%x params 0x%x\n", - ct->c_encoding, (unsigned int) ct->c_cefile); + ct->c_encoding, (unsigned int)(unsigned long) ct->c_cefile); /* print Content-ID */ if (ct->c_id) @@ -287,7 +293,7 @@ list_debug (CT ct) fprintf (stderr, " %s:%s", DESCR_FIELD, ct->c_descr); fprintf (stderr, " read fp 0x%x file \"%s\" begin %ld end %ld\n", - (unsigned int) ct->c_fp, empty (ct->c_file), + (unsigned int)(unsigned long) ct->c_fp, empty (ct->c_file), ct->c_begin, ct->c_end); /* print more information about transfer encoding */ @@ -396,19 +402,15 @@ list_external (CT ct, int toplevel, int realsize, int verbose, int debug) /* * list content information for type "application" + * This no longer needs to be a separate function. It used to + * produce some output with verbose enabled, but that has been + * moved to list_content (). */ static int list_application (CT ct, int toplevel, int realsize, int verbose, int debug) { list_content (ct, toplevel, realsize, verbose, debug); - if (verbose) { - char **ap, **ep; - CI ci = &ct->c_ctinfo; - - for (ap = ci->ci_attrs, ep = ci->ci_values; *ap; ap++, ep++) - printf ("\t %s=\"%s\"\n", *ap, *ep); - } return OK; } @@ -426,7 +428,8 @@ list_encoding (CT ct) if ((ce = ct->c_cefile)) fprintf (stderr, " decoded fp 0x%x file \"%s\"\n", - (unsigned int) ce->ce_fp, ce->ce_file ? ce->ce_file : ""); + (unsigned int)(unsigned long) ce->ce_fp, + ce->ce_file ? ce->ce_file : ""); return OK; }