aboutsummaryrefslogtreecommitdiffstats
path: root/libversit/vctest.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-02 10:18:42 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-02 10:18:42 +0800
commit4750b90ad18f4f59fa19b839550d6397f5dffbfd (patch)
treea2d62941f88d3aedb6509b4883e08c82e13ed1cc /libversit/vctest.c
parent9bc7db5333a2319828768142c527d3fb64afd999 (diff)
downloadgsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar
gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.gz
gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.bz2
gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.lz
gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.xz
gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.tar.zst
gsoc2013-evolution-4750b90ad18f4f59fa19b839550d6397f5dffbfd.zip
GnomeCalendar toplevel GnomeApp; versit code -mig
svn path=/trunk/; revision=89
Diffstat (limited to 'libversit/vctest.c')
-rw-r--r--libversit/vctest.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/libversit/vctest.c b/libversit/vctest.c
new file mode 100644
index 0000000000..b14e6c1b4e
--- /dev/null
+++ b/libversit/vctest.c
@@ -0,0 +1,95 @@
+
+#include <stdio.h>
+#include <string.h>
+#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);
+
+}
+