From: Good Guy Date: Thu, 14 Jul 2016 20:39:55 +0000 (-0600) Subject: add xlat.C nodups options X-Git-Url: http://git.cinelerra-gg.org/git/?a=commitdiff_plain;ds=sidebyside;h=1dc360f0841d511891a2eca12fbfa8bf820008f5;hp=0ce171270662e17398676054050f570228d8f45f;p=goodguy%2Fhistory.git add xlat.C nodups options --- diff --git a/cinelerra-5.1/po/xlat.C b/cinelerra-5.1/po/xlat.C index 7a38f293..5227bcf5 100644 --- a/cinelerra-5.1/po/xlat.C +++ b/cinelerra-5.1/po/xlat.C @@ -509,7 +509,7 @@ void scan_po(FILE *ifp, FILE *ofp) if( ifp != stdin ) fclose(ifp); } -void list_po(FILE *ifp, FILE *ofp) +void list_po(FILE *ifp, FILE *ofp, int xeqx = 0, int nnul = 0) { int no = 0; int dup = 0, nul = 0; @@ -546,8 +546,8 @@ void list_po(FILE *ifp, FILE *ofp) xlat2(&tbfr[0], str); txt.append((const char*)str); ++no; } - if( !txt.size() ) { ++nul; continue; } - if( !key.compare(txt) ) { ++dup; continue; } + if( nnul && !txt.size() ) { ++nul; continue; } + if( xeqx && !key.compare(txt) ) { ++dup; continue; } xlat4(key.c_str(), str); fprintf(ofp, "%s,", (char *)str); xlat4(txt.c_str(), str); @@ -558,9 +558,10 @@ void list_po(FILE *ifp, FILE *ofp) static void usage(const char *av0) { - printf("test csv %s csv < data.csv\n",av0); - printf("test po %s po < data.po\n",av0); - printf("get strings %s key < xgettext.po\n",av0); + printf("test csv %s csv < data.csv\n",av0); + printf("list po %s po < data.po\n",av0); + printf("list po %s nodups < data.po\n",av0); + printf("get strings %s key < xgettext.po\n",av0); printf("gen xlation %s xlat xgettext.po xlat.csv\n",av0); printf("gen xlation %s xlat - text,xlat ... < xgettext.po\n",av0); exit(1); @@ -583,6 +584,11 @@ int main(int ac, char **av) return 0; } + if( !strcmp(av[1],"nodups") ) { // test po + list_po(stdin, stdout, 1, 1); + return 0; + } + if( !strcmp(av[1],"po") ) { // test po list_po(stdin, stdout); return 0;