#include #include #include "vcc.h" FILE *cfp; void myMimeErrorHandler(char *s) { printf("%s\n", s); } void main(int argc, char **argv) { int testmem = 0; char * foo[2] = {"foo","alden.vcf"}; argc = 2; argv = foo; #ifdef _CONSOLE cfp = stdout; registerMimeErrorHandler(myMimeErrorHandler); #else cfp = fopen("vctest.out", "w"); if (!cfp) return; #endif ++argv; while (--argc) { FILE *fp; if (strcmp(*argv,"-testmem") == 0) { testmem = 1; argv++; continue; } fprintf(cfp,"processing %s\n",*argv); fp = fopen(*argv,"r"); if (!fp) { fprintf(cfp,"error opening file\n"); } else { VObject *v, *t; FILE *ofp; char buf[256]; char *p; strcpy(buf,*argv); p = strchr(buf,'.'); if (p) *p = 0; strcat(buf,".out"); fprintf(cfp,"reading text input from '%s'...\n", *argv); /*v = Parse_MIME_FromFile(fp); */ v = Parse_MIME_FromFileName(*argv); writeVObjectToFile(buf,v); cleanVObject(v); /* fprintf(cfp,"pretty print internal format of '%s'...\n", *argv); ofp = fopen(buf,"w"); while (v) { printVObject(cfp,v); if (testmem) { char *s, *p; fprintf(cfp,"test writing to mem...\n"); p = s = writeMemVObject(0,0,v); if (s) { while (*s) { fputc(*s,ofp); s++; } free(p); } } else { writeVObject(ofp,v); } t = v; v = nextVObjectInList(v); cleanVObject(t); } fclose(ofp); fclose(fp); */ } cleanStrTbl(); argv++; } if (cfp != stdout) fclose(cfp); } .3 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* - Support staginggblach2013-09-281-1/+0
* Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-201-0/+1
* Convert audio from USE_GMAKE to USES=gmakebapt2013-08-311-2/+1
* - Update to 2.8gblach2013-06-114-6/+145
* - Change my email address to gblach@FreeBSD.orggblach2012-11-04d class='commitgraph'>* Remove misleading signature (same as Whom: anyway)vs2005-04-191-2/+0
* - Don't patch Makefile if imake is going to regenerate it anywayvs2005-04-193-161/+1
* There are no more html man pages.lesi2004-12-252-2/+0
* - Fix build on 5-xkrion2004-02-272-4/+34
* BROKEN on 5.x: does not compilekris2004-02-081-1/+7
* Add SIZE.trevor2004-01-281-0/+1
* - Use canonical form (ports@FreeBSD.org) in MAINTAINER linesergei2003-12-211-1/+1
* De-pkg-comment.knu2003-02-212-1/+1
* Remove old WWW site.edwin2002-12-271-2/+0
* o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-112-2/+1
* Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-072-1/+2
* Override XFREE86_HTML_MANdwcjr2002-05-272-2/+2
* BROKEN: fails to package (XFree86-4 html manpage fallout)kris2002-05-171-0/+2