URI: 
       quote newline and tabs; set separator and attribute assign chars - xml2tsv - a simple xml-to-tsv converter, based on xmlparser
   DIR Log
   DIR Files
   DIR Refs
   DIR Tags
   DIR README
   DIR LICENSE
       ---
   DIR commit d1d29f3306ef651796d171c8d406b14fc74778ca
   DIR parent 171b4c872cde8fea8cd6ddc0bc5df3e3bb5c3dcb
  HTML Author: KatolaZ <katolaz@freaknet.org>
       Date:   Sat,  4 Jan 2020 01:31:40 +0000
       
       quote newline and tabs; set separator and attribute assign chars
       
       Diffstat:
         M xml2tsv.c                           |      23 ++++++++++++++++-------
       
       1 file changed, 16 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/xml2tsv.c b/xml2tsv.c
       @@ -19,7 +19,8 @@
        
        #define STR_MAX 128
        #define DEPTH_MAX 50
       -
       +#define SEP '\t'
       +#define SATTR '='
        
        /* tag stack */
        
       @@ -65,11 +66,19 @@ void print_no_cr(FILE *f, const char *s){
                const char *tmp = s;
                size_t len;
                while (*tmp != '\0'){
       -                len = strcspn(tmp, "\n");
       +                len = strcspn(tmp, "\n\t");
                        fwrite(tmp, 1, len, f);
                        tmp += len;
       -                if (tmp[len] == '\n')
       -                        tmp++;
       +                if (*tmp == '\n'){
       +                        if (len > 0){
       +                                fprintf(f, "\\n");
       +                        }
       +                        tmp ++;
       +                }
       +                else if (*tmp == '\t'){
       +                        fprintf(f, "\\t");
       +                        tmp ++;
       +                }
                }
        }
        
       @@ -115,13 +124,13 @@ xmlattrend(XMLParser *x, const char *t, size_t tl, const char *a, size_t al)
        void
        xmlattrstart(XMLParser *x, const char *t, size_t tl, const char *a, size_t al)
        {
       -        printf("\t%s=", a);
       +        printf("%c%s%c", SEP, a, SATTR);
        }
        
        void
        xmlcdatastart(XMLParser *x)
        {
       -        printf("\t");
       +        printf("%c", SEP);
        }
        
        void
       @@ -176,7 +185,7 @@ xmldataentity(XMLParser *x, const char *d, size_t dl)
        void
        xmldatastart(XMLParser *x)
        {
       -        printf("\t");
       +        printf("%c", SEP);
        }
        
        void