Changeset: d79578991ee1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d79578991ee1
Modified Files:
        clients/mapiclient/eventparser.c
        clients/mapiclient/tachograph.c
Branch: default
Log Message:

JSON preparations


diffs (44 lines):

diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -429,6 +429,10 @@ eventparser(char *row, EventRecord *ev)
                if( v)
                        parseArguments(v+3,1);
        }
+       if (ev->stmt && (v=strstr(ev->stmt, ",\t]"))){
+               *v=',';
+               *(v+1) = 0;
+       } else
        if (ev->stmt && (v=strstr(ev->stmt, "\"\t]")))
                *v = 0;
        else
diff --git a/clients/mapiclient/tachograph.c b/clients/mapiclient/tachograph.c
--- a/clients/mapiclient/tachograph.c
+++ b/clients/mapiclient/tachograph.c
@@ -777,8 +777,24 @@ update(EventRecord *ev)
                fprintf(tachostmt,LLFMT"\t",ev->tmpspace);
                fprintf(tachostmt,LLFMT"\t",ev->inblock);
                fprintf(tachostmt,LLFMT"\t",ev->oublock);
-               fprintf(tachostmt,"%s\t",ev->stmt);
-               fprintf(tachostmt, "%s\n",line);
+               fprintf(tachojson," \"stmt\":\"");
+               for(s = ev->stmt; *s; s++)
+               switch(*s){
+               case '\\': 
+                       if( *(s+1) == '\\' ) s++;
+               default: fputc((int) *s, tachojson);
+               }
+               fprintf(tachojson,"\",\n");
+
+               fprintf(tachojson," \"beautystmt\":\"");
+               for(s = line; *s; s++)
+               switch(*s){
+               case '\\': 
+                       if( *(s+1) == '\\' ) s++;
+               default: fputc((int) *s, tachojson);
+               }
+               fprintf(tachojson,"\",\n");
+
 
                free(ev->stmt);
                progress = (int)(pccount++ / (malsize/100.0));
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to