diff options
| author | Sam Varshavchik | 2013-08-19 16:39:41 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2013-08-25 14:43:51 -0400 |
| commit | 9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch) | |
| tree | 7a81a04cb51efb078ee350859a64be2ebc6b8813 /rfc2045/rfc2045xdump.c | |
| parent | a9520698b770168d1f33d6301463bb70a19655ec (diff) | |
| download | courier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2 | |
Initial checkin
Imported from subversion report, converted to git. Updated all paths in
scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'rfc2045/rfc2045xdump.c')
| -rw-r--r-- | rfc2045/rfc2045xdump.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/rfc2045/rfc2045xdump.c b/rfc2045/rfc2045xdump.c new file mode 100644 index 0000000..f1f96eb --- /dev/null +++ b/rfc2045/rfc2045xdump.c @@ -0,0 +1,47 @@ +/* +** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for +** distribution information. +*/ + +/* +*/ +#include "rfc2045.h" +#include <stdio.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); +} |
