#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 STAGEDIR.vanilla2013-10-292-8/+8
* Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-0/+1
* - Convert to new perl frameworkmat2013-08-031-1/+2
* For perl@ owned ports:eadler2013-03-291-5/+1
* - Remove SITE_PERL from *_DEPENDSak2012-06-151-2/+2
* - Convert all remaining instances of BUILD_DEPENDS=${RUN_DEPENDS} orswills2012-06-111-1/+1
* Pass maintainership of almost of my "p5-*" ports to "perl@".skv2012-05-071-1/+1
* -remove MD5ohauer2011-07-031-1/+0
* Fix plist with perl 5.8.9.tobez2009-01-141-1/+3
* Hunt for typos in devel/p5-*.olgeni2008-05-241-3/+3