This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/clib/maildrop/rfc2045/rfc2045xdump.c

49 lines
1.2 KiB
C
Raw Normal View History

2010-06-17 00:40:25 +01:00
/*
** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
** distribution information.
*/
/*
** $Id$
*/
#include <stdio.h>
#include "rfc2045.h"
#define DUMP(s,n) if ( (s) ) { printf("%*s%s: %s\n", level*4, "", n, (s)); }
/* Extended RFC2045 dump */
static void dodump(struct rfc2045 *p, int level)
{
if (!p->isdummy)
{
printf("%*sMessage start %ld, end %ld, startbody %ld, endbody %ld.\n", level*4,
"", (long)p->startpos, (long)p->endpos,
(long)p->startbody, (long)p->endbody);
DUMP(p->mime_version, "Mime-Version")
DUMP(p->content_type, "Content-Type")
DUMP(rfc2045_getattr(p->content_type_attr, "charset"),
"Charset")
DUMP(p->content_transfer_encoding, "Transfer Encoding")
DUMP(rfc2045_getattr(p->content_type_attr, "boundary"),
"Boundary")
DUMP(p->content_disposition, "Content Disposition")
DUMP(rfc2045_getattr(p->content_disposition_attr, "name"),
"Disposition Name")
DUMP(rfc2045_getattr(p->content_disposition_attr, "filename"),
"Disposition Filename")
}
for (p=p->firstpart; p; p=p->next)
{
printf("%*s{\n", level*4, "");
dodump(p, level+1);
printf("%*s}\n", level*4, "");
}
}
void rfc2045_xdump(struct rfc2045 *p)
{
dodump(p, 0);
}