From cb0fd5ee2d881e075e7cb14f3e85b7f336f66d00 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 26 Jun 2017 18:59:21 +0100 Subject: [PATCH 01/10] Make greeklib buildable with LLVM This was quite straightforward, it involved: - Ensuring all int functions return a value - Including all libc headers necessary - Explicitly including all .h files used --- src/greeklib/Fclose.c | 5 +++-- src/greeklib/addaccent.c | 6 ++++-- src/greeklib/aspirate.c | 2 +- src/greeklib/checkaccent.c | 1 + src/greeklib/cinsert.c | 1 + src/greeklib/do_dissim.c | 3 ++- src/greeklib/endsinstr.c | 6 +++++- src/greeklib/getquantity.c | 2 ++ src/greeklib/getsyll.c | 3 +++ src/greeklib/gkstrlen.c | 1 + src/greeklib/isdiphth.c | 3 ++- src/greeklib/issubstring.c | 1 + src/greeklib/keyio.c | 1 + src/greeklib/nsylls.c | 2 ++ src/greeklib/quantprim.c | 3 ++- src/greeklib/sprntGkflags.c | 2 ++ src/greeklib/standword.c | 3 +++ src/greeklib/stripacc.c | 3 +++ src/greeklib/stripacute.c | 3 ++- src/greeklib/stripbreath.c | 2 ++ src/greeklib/stripdiaer.c | 2 ++ src/greeklib/stripmeta.c | 4 ++++ src/greeklib/stripquant.c | 2 ++ src/greeklib/stripstemsep.c | 2 ++ src/greeklib/stripzeroend.c | 1 + src/greeklib/xstrings.c | 3 ++- src/greeklib/zap2ndbreath.proto.h | 1 + 27 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/greeklib/Fclose.c b/src/greeklib/Fclose.c index e2daeb4..c172fb4 100755 --- a/src/greeklib/Fclose.c +++ b/src/greeklib/Fclose.c @@ -1,4 +1,5 @@ #include +#include #include "Fclose.proto.h" @@ -6,7 +7,7 @@ xFclose(FILE *f) { if( ! f ) { fprintf(stderr,"hey! trying to close a NULL pointer!\n"); - return; + return(-1); } fclose(f); } @@ -27,4 +28,4 @@ xFree(char *p, char *errmess) */ free(p); return(0); -} \ No newline at end of file +} diff --git a/src/greeklib/addaccent.c b/src/greeklib/addaccent.c index b343bff..30dac78 100755 --- a/src/greeklib/addaccent.c +++ b/src/greeklib/addaccent.c @@ -11,6 +11,8 @@ */ #include +#include "isdiphth.proto.h" +#include "strsqz.proto.h" addaccent(char *word, int accent, char *p) @@ -20,11 +22,11 @@ addaccent(char *word, int accent, char *p) if(*word == '*' && Is_breath(*(word+1)) ) { if( p == (word+2)) { cinsert(accent,word+2); - return; + return(0); } if( p == (word+3) && is_diphth(p,word) == YES) { cinsert(accent,word+2); - return; + return(0); } } diff --git a/src/greeklib/aspirate.c b/src/greeklib/aspirate.c index 8f9263f..9a87a6a 100755 --- a/src/greeklib/aspirate.c +++ b/src/greeklib/aspirate.c @@ -10,7 +10,7 @@ aspirate(char *p) { if (!Is_unasp(*p)) - return; + return(-1); switch (*p) { case 't': case 'd': diff --git a/src/greeklib/checkaccent.c b/src/greeklib/checkaccent.c index b5abd4d..301b8bb 100755 --- a/src/greeklib/checkaccent.c +++ b/src/greeklib/checkaccent.c @@ -3,6 +3,7 @@ */ #include +#include "getaccent.proto.h" #include "checkaccent.proto.h" diff --git a/src/greeklib/cinsert.c b/src/greeklib/cinsert.c index d288282..bb0677b 100755 --- a/src/greeklib/cinsert.c +++ b/src/greeklib/cinsert.c @@ -4,6 +4,7 @@ /* David Neel Smith */ #include +#include "xstrings.proto.h" cinsert (int c, char *p) diff --git a/src/greeklib/do_dissim.c b/src/greeklib/do_dissim.c index f02fb81..b711a00 100755 --- a/src/greeklib/do_dissim.c +++ b/src/greeklib/do_dissim.c @@ -6,6 +6,7 @@ */ #include +#include "xstrings.proto.h" #include "do_dissim.proto.h" @@ -78,4 +79,4 @@ next_cons(char *s) while(Is_cons(*s)||Is_accent(*s)) s++; while(Is_vowel(*s)||Is_accent(*s)) s++; return(s); -} \ No newline at end of file +} diff --git a/src/greeklib/endsinstr.c b/src/greeklib/endsinstr.c index d6bd1a2..1d3c344 100755 --- a/src/greeklib/endsinstr.c +++ b/src/greeklib/endsinstr.c @@ -1,4 +1,8 @@ #include +#include +#include "stripacc.proto.h" +#include "stripdiaer.proto.h" +#include "xstrings.proto.h" #define LOCBUF 256 #include "endsinstr.proto.h" @@ -45,4 +49,4 @@ ends_in(char *s1, char *s2) return( Xstrncmp(b2,b1,Xstrlen(b2)) ? 0 : 1 ); - } \ No newline at end of file + } diff --git a/src/greeklib/getquantity.c b/src/greeklib/getquantity.c index 832629b..0e910a8 100755 --- a/src/greeklib/getquantity.c +++ b/src/greeklib/getquantity.c @@ -4,6 +4,8 @@ /* David Neel Smith */ #include +#include "getaccent.proto.h" +#include "quantprim.proto.h" #include "getquantity.proto.h" diff --git a/src/greeklib/getsyll.c b/src/greeklib/getsyll.c index 1bc9627..34b8917 100755 --- a/src/greeklib/getsyll.c +++ b/src/greeklib/getsyll.c @@ -4,6 +4,9 @@ /* David Neel Smith */ #include +#include "isdiphth.proto.h" +#include "nsylls.proto.h" +#include "xstrings.proto.h" #include "getsyll.proto.h" diff --git a/src/greeklib/gkstrlen.c b/src/greeklib/gkstrlen.c index 635fd9d..3b27cd4 100755 --- a/src/greeklib/gkstrlen.c +++ b/src/greeklib/gkstrlen.c @@ -4,6 +4,7 @@ /* David Neel Smith */ #include +#include "xstrings.proto.h" #include "gkstrlen.proto.h" diff --git a/src/greeklib/isdiphth.c b/src/greeklib/isdiphth.c index 996730b..33fa664 100755 --- a/src/greeklib/isdiphth.c +++ b/src/greeklib/isdiphth.c @@ -4,6 +4,7 @@ /* David Neel Smith */ #include +#include "xstrings.proto.h" #include "isdiphth.proto.h" @@ -43,4 +44,4 @@ bool is_diphth(char *p, char *word) starts_w_diphth(char *stem) { return(is_diphth(stem+1,stem)); -} \ No newline at end of file +} diff --git a/src/greeklib/issubstring.c b/src/greeklib/issubstring.c index a5b85cf..634b623 100755 --- a/src/greeklib/issubstring.c +++ b/src/greeklib/issubstring.c @@ -10,6 +10,7 @@ * find s1 in s2 */ #include +#include "xstrings.proto.h" #include "issubstring.proto.h" char * diff --git a/src/greeklib/keyio.c b/src/greeklib/keyio.c index 9dc3576..4589627 100755 --- a/src/greeklib/keyio.c +++ b/src/greeklib/keyio.c @@ -1,5 +1,6 @@ #include #include +#include "vaxwords.proto.h" #include "keyio.proto.h" diff --git a/src/greeklib/nsylls.c b/src/greeklib/nsylls.c index d13cee4..78474a3 100755 --- a/src/greeklib/nsylls.c +++ b/src/greeklib/nsylls.c @@ -4,6 +4,8 @@ /* David Neel Smith */ #include +#include "isdiphth.proto.h" +#include "xstrings.proto.h" #include "nsylls.proto.h" diff --git a/src/greeklib/quantprim.c b/src/greeklib/quantprim.c index 7e845f1..72dfb44 100755 --- a/src/greeklib/quantprim.c +++ b/src/greeklib/quantprim.c @@ -4,6 +4,7 @@ /* David Neel Smith */ #include +#include "isdiphth.proto.h" #include "quantprim.proto.h" @@ -57,4 +58,4 @@ long_by_isub(char *s) { if(*(s+1) == '|' || (Is_breath(*(s+1)) && *(s+2) == '|') ) return(1); return(0); -} \ No newline at end of file +} diff --git a/src/greeklib/sprntGkflags.c b/src/greeklib/sprntGkflags.c index 90790eb..8d49a25 100755 --- a/src/greeklib/sprntGkflags.c +++ b/src/greeklib/sprntGkflags.c @@ -1,4 +1,6 @@ #include +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/morphkeys.proto.h" #include "sprntGkflags.proto.h" diff --git a/src/greeklib/standword.c b/src/greeklib/standword.c index 8a45d49..21a2c48 100755 --- a/src/greeklib/standword.c +++ b/src/greeklib/standword.c @@ -1,4 +1,7 @@ #include +#include "stripacc.proto.h" +#include "stripdiaer.proto.h" +#include "zap2ndbreath.proto.h" /* * greg crane diff --git a/src/greeklib/stripacc.c b/src/greeklib/stripacc.c index 67b6f74..873768f 100755 --- a/src/greeklib/stripacc.c +++ b/src/greeklib/stripacc.c @@ -4,6 +4,9 @@ /* David Neel Smith */ #include +#include "nsylls.proto.h" +#include "strsqz.proto.h" +#include "xstrings.proto.h" #include "stripacc.proto.h" diff --git a/src/greeklib/stripacute.c b/src/greeklib/stripacute.c index 80cd9c8..34b389f 100755 --- a/src/greeklib/stripacute.c +++ b/src/greeklib/stripacute.c @@ -1,4 +1,5 @@ #include +#include "strsqz.proto.h" #include "stripacute.proto.h" @@ -15,4 +16,4 @@ strsqz(s,1); s++; } -} \ No newline at end of file +} diff --git a/src/greeklib/stripbreath.c b/src/greeklib/stripbreath.c index 5a7eaae..ca682cd 100755 --- a/src/greeklib/stripbreath.c +++ b/src/greeklib/stripbreath.c @@ -4,6 +4,8 @@ /* David Neel Smith */ #include +#include "strsqz.proto.h" +#include "xstrings.proto.h" #include "stripbreath.proto.h" diff --git a/src/greeklib/stripdiaer.c b/src/greeklib/stripdiaer.c index b88ab31..793520f 100755 --- a/src/greeklib/stripdiaer.c +++ b/src/greeklib/stripdiaer.c @@ -5,6 +5,8 @@ */ #include +#include "strsqz.proto.h" +#include "xstrings.proto.h" #include "stripdiaer.proto.h" diff --git a/src/greeklib/stripmeta.c b/src/greeklib/stripmeta.c index 32e8bcf..db38f62 100755 --- a/src/greeklib/stripmeta.c +++ b/src/greeklib/stripmeta.c @@ -1,3 +1,7 @@ +#include "stripquant.proto.h" +#include "stripzeroend.proto.h" +#include "stripstemsep.proto.h" +#include "zap2ndbreath.proto.h" #include "stripmeta.proto.h" /* diff --git a/src/greeklib/stripquant.c b/src/greeklib/stripquant.c index f772826..d89b29e 100755 --- a/src/greeklib/stripquant.c +++ b/src/greeklib/stripquant.c @@ -7,6 +7,8 @@ * grc 2/20/88 */ #include +#include "strsqz.proto.h" +#include "xstrings.proto.h" #include "stripquant.proto.h" diff --git a/src/greeklib/stripstemsep.c b/src/greeklib/stripstemsep.c index 80cae4e..8bdad48 100755 --- a/src/greeklib/stripstemsep.c +++ b/src/greeklib/stripstemsep.c @@ -3,6 +3,8 @@ */ #include +#include "strsqz.proto.h" +#include "xstrings.proto.h" #include "stripstemsep.proto.h" diff --git a/src/greeklib/stripzeroend.c b/src/greeklib/stripzeroend.c index fab33fb..4f5f3d4 100755 --- a/src/greeklib/stripzeroend.c +++ b/src/greeklib/stripzeroend.c @@ -1,4 +1,5 @@ #include +#include "xstrings.proto.h" #define Is_zeroend(X) (X=='*') #include "stripzeroend.proto.h" diff --git a/src/greeklib/xstrings.c b/src/greeklib/xstrings.c index 7f9fde4..00d92b0 100755 --- a/src/greeklib/xstrings.c +++ b/src/greeklib/xstrings.c @@ -1,6 +1,7 @@ #include #include #include +#include "Fclose.proto.h" #include "xstrings.proto.h" int @@ -27,7 +28,7 @@ Ystrncpy(char *s1, const char *s2, size_t len) if( ! p ) { fprintf(stderr,"could not allocate %d byte buf in Xstrncpy!\n", len+1); *s1 = 0; - return; + return(0); } strncpy(p,s2,(size_t)len); *(p+len-1) = 0; diff --git a/src/greeklib/zap2ndbreath.proto.h b/src/greeklib/zap2ndbreath.proto.h index 44f265f..6bee6e5 100755 --- a/src/greeklib/zap2ndbreath.proto.h +++ b/src/greeklib/zap2ndbreath.proto.h @@ -2,3 +2,4 @@ /* zap2ndbreath.c */ int zap_extra_breath(char *); int has_extra_breath(char *); +int zap_rr_breath(char *); From 3c32bcf6831ac6a7d7ca46dc49f4909a0b5716c2 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 28 Jun 2017 11:21:30 +0100 Subject: [PATCH 02/10] Start work on adding needed syntax tweaks to morphlib --- src/morphlib/adddomain.c | 2 +- src/morphlib/addninfix.c | 3 ++- src/morphlib/antepenform.c | 1 + src/morphlib/augment.c | 13 +++++++++++-- src/morphlib/setlang.proto.h | 2 ++ 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 src/morphlib/setlang.proto.h diff --git a/src/morphlib/adddomain.c b/src/morphlib/adddomain.c index 6ec833c..8712917 100755 --- a/src/morphlib/adddomain.c +++ b/src/morphlib/adddomain.c @@ -17,4 +17,4 @@ add_domain(gk_string *gstr, int n) } *p = n; return(1); -} \ No newline at end of file +} diff --git a/src/morphlib/addninfix.c b/src/morphlib/addninfix.c index 28462f7..be531e3 100755 --- a/src/morphlib/addninfix.c +++ b/src/morphlib/addninfix.c @@ -1,4 +1,5 @@ #include +#include "../greeklib/nsylls.proto.h" #include "addninfix.proto.h" @@ -29,4 +30,4 @@ addninfix(char *word) cinsert(c,syllp); return(1); } - \ No newline at end of file + diff --git a/src/morphlib/antepenform.c b/src/morphlib/antepenform.c index 5cad742..ab6b4dd 100755 --- a/src/morphlib/antepenform.c +++ b/src/morphlib/antepenform.c @@ -1,4 +1,5 @@ #include +#include "morphflags.proto.h" #include "antepenform.proto.h" diff --git a/src/morphlib/augment.c b/src/morphlib/augment.c index 9301cde..83d86c5 100755 --- a/src/morphlib/augment.c +++ b/src/morphlib/augment.c @@ -1,4 +1,13 @@ #include +#include "../greeklib/standword.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "gkstring.proto.h" +#include "morphflags.proto.h" +#include "morphstrcmp.proto.h" +#include "setlang.proto.h" #define MAXAUG 8 #define TEMP_AUGMENT SYLL_AUGMENT * 2 @@ -557,7 +566,7 @@ simpleaugment(char *s, bool syllabic) gkform = CreatGkword(6); if( ! gkform ) { fprintf(stderr,"no memory for gkform in simpleaugment of [%s]\n",s); - return; + return(-1); } set_workword(gkform,s); @@ -603,7 +612,7 @@ simpleredupit(char *s, int syllabic, int redupc) gkform = CreatGkword(6); if( ! gkform ) { fprintf(stderr,"no memory for gkform in simpleaugment of [%s]\n",s); - return; + return(-1); } set_workword(gkform,s); diff --git a/src/morphlib/setlang.proto.h b/src/morphlib/setlang.proto.h new file mode 100644 index 0000000..36d32b9 --- /dev/null +++ b/src/morphlib/setlang.proto.h @@ -0,0 +1,2 @@ +int set_lang(int); +int cur_lang(); From 477e07d3e53256fa39cebf671e8a2ad0b185fe17 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 28 Jun 2017 23:36:46 +0100 Subject: [PATCH 03/10] Next batch of morphlib fixes for LLVM build --- src/morphlib/adddomain.c | 1 + src/morphlib/beta2rtf.c | 10 +++--- src/morphlib/beta2smarta.c | 1 + src/morphlib/conjstem.c | 6 ++-- src/morphlib/endio.c | 1 + src/morphlib/endio.proto.h | 1 + src/morphlib/fixacc.c | 63 ++++++++++++++++++++++--------------- src/morphlib/fixacc.proto.h | 1 + 8 files changed, 53 insertions(+), 31 deletions(-) diff --git a/src/morphlib/adddomain.c b/src/morphlib/adddomain.c index 8712917..2dfc9cd 100755 --- a/src/morphlib/adddomain.c +++ b/src/morphlib/adddomain.c @@ -1,4 +1,5 @@ #include +#include "../greeklib/xstrings.proto.h" #include "adddomain.proto.h" diff --git a/src/morphlib/beta2rtf.c b/src/morphlib/beta2rtf.c index e3b75ba..9515ec1 100755 --- a/src/morphlib/beta2rtf.c +++ b/src/morphlib/beta2rtf.c @@ -1,6 +1,8 @@ #include +#include #include #include +#include "beta2smarta.proto.h" #include "libfiles.h" #define SEGSIZE 100000 #define MAXDOMAINS 256 @@ -106,7 +108,7 @@ conv_defline(char *s, FILE *fout) beta2smk(s,result); fprintf(fout,"%s}\\par\\pard\\plain}\n", result ); - return; + return(0); } if( has_pref(s,":xref") ) { while(*s&&!isspace(*s)) s++; @@ -114,14 +116,14 @@ conv_defline(char *s, FILE *fout) beta2smk(s,result); fprintf(fout,"\\s6{%s}\\par\\pard\\plain\n", result ); - return; + return(0); } if( has_pref(s,":le:") || has_pref(s,":cv:") ) { *(s+3) = '$'; beta2smk(s+3,result); fprintf(fout,"\\s7\\sb160 \\b\\f20\\fs24{%s}\\par\\pard\\plain\n", result); - return; + return(0); } if( has_pref(s,":comm") ) { while(*s&&!isspace(*s)) s++; @@ -129,7 +131,7 @@ conv_defline(char *s, FILE *fout) beta2smk(s,result); fprintf(fout,"\\s8{%s}\\par\n", result ); - return; + return(0); } fprintf(fout,"%s\\par\n", s ); diff --git a/src/morphlib/beta2smarta.c b/src/morphlib/beta2smarta.c index 8bb7cbc..60e0cfa 100755 --- a/src/morphlib/beta2smarta.c +++ b/src/morphlib/beta2smarta.c @@ -1,5 +1,6 @@ #include #include +#include "../greeklib/xstrings.proto.h" #define ACUTEFLAG 01 #define GRAVEFLAG 02 #define CIRCUMFLAG 04 diff --git a/src/morphlib/conjstem.c b/src/morphlib/conjstem.c index e20dc02..0e781b2 100755 --- a/src/morphlib/conjstem.c +++ b/src/morphlib/conjstem.c @@ -1,5 +1,7 @@ #include #include +#include "../greeklib/xstrings.proto.h" +#include "../greeklib/strsqz.proto.h" #include "conjstem.proto.h" @@ -37,7 +39,7 @@ fixperf(char *s) register char *p; if( *(lastn(s,1)) != 'k' ) - return; + return(0); p = lastn(s,2); if (Is_dental(*p) || *p == 'z') { @@ -114,7 +116,7 @@ conjoin(char *stem, char *e) */ if( (Is_dental(*p) || *p == 'z' || *p == 'n' ) && !Xstrncmp(e,"ss",2) ) { Xstrncpy(p,e,MAXWORDSIZE-(int)(p-stem)); - return; + return(0); } do { diff --git a/src/morphlib/endio.c b/src/morphlib/endio.c index 2ae28a7..304e189 100755 --- a/src/morphlib/endio.c +++ b/src/morphlib/endio.c @@ -1,4 +1,5 @@ #include +#include "../greeklib/vaxwords.proto.h" #include "endio.proto.h" diff --git a/src/morphlib/endio.proto.h b/src/morphlib/endio.proto.h index 2019d9e..3e4708b 100755 --- a/src/morphlib/endio.proto.h +++ b/src/morphlib/endio.proto.h @@ -4,3 +4,4 @@ int WriteEnding(FILE *, gk_string *, int); int ReadEnding(FILE *, gk_string *, int); int set_endheader(FILE *, int); int get_endheader(FILE *, int *); +int localtrimwhite(char *,int); diff --git a/src/morphlib/fixacc.c b/src/morphlib/fixacc.c index 5598b42..907b850 100755 --- a/src/morphlib/fixacc.c +++ b/src/morphlib/fixacc.c @@ -1,4 +1,17 @@ #include +#include "antepenform.proto.h" +#include "gkstring.proto.h" +#include "is_thirdmono.proto.h" +#include "morphflags.proto.h" +#include "penultform.proto.h" +#include "setlang.proto.h" +#include "ulttakescirc.proto.h" +#include "../greeklib/getquantity.proto.h" +#include "../greeklib/isdiphth.proto.h" +#include "../greeklib/naccents.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/quantprim.proto.h" +#include "../greeklib/xstrings.proto.h" #include "fixacc.proto.h" static fixnacc2(char *, gk_string *, word_form, int, bool); @@ -10,13 +23,13 @@ putsimpleacc(char *s) MorphFlags * mflags; char tmpw[MAXWORDSIZE]; - if( cur_lang() == LATIN || cur_lang() == ITALIAN ) return; + if( cur_lang() == LATIN || cur_lang() == ITALIAN ) return(0); gkword = (gk_word *) CreatGkword(1); if( ! gkword ) { fprintf(stderr,"no memory for gstring in putsimpleacc\n"); - return; + return(0); } mflags = (MorphFlags *)calloc(1,sizeof * mflags); @@ -33,16 +46,16 @@ FixRecAcc(gk_word *gkform, MorphFlags *mflags, char *word) word_form form_info; - if( cur_lang() == LATIN || cur_lang() == ITALIAN ) return; + if( cur_lang() == LATIN || cur_lang() == ITALIAN ) return(0); form_info = forminfo_of(gkform); /* if accent's already there, forget it */ for (p=word;*p;p++) if (Is_accent(*p)) - return; + return(0); if (getsyll(word,ULTIMA,0) == P_ERR) - return; /* avoid core dumps */ + return(0); /* avoid core dumps */ /* * see if this word must be accented on the final syllable of the stem @@ -57,7 +70,7 @@ FixRecAcc(gk_word *gkform, MorphFlags *mflags, char *word) p = getsyll(word,ULTIMA,0); if( Accent_optional(mflags) ) - return; + return(0); if( ulttakescirc(ends_gstr_of(gkform),forminfo_of(ends_gstr_of(gkform))) ) { addaccent(word,CIRCUMFLEX,p); } else { @@ -72,7 +85,7 @@ FixRecAcc(gk_word *gkform, MorphFlags *mflags, char *word) addaccent(word,ACUTE,p); else { /* no antepenult */ if( Accent_optional(mflags) ) - return; + return(0); p = getsyll(word,PENULT,0); if (p == P_ERR) p = getsyll(word,ULTIMA,0); @@ -118,7 +131,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if( cur_lang() == LATIN || cur_lang() == ITALIAN ) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } /* @@ -127,12 +140,12 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if( ! nsylls(stem) && ! nsylls(endstring) ) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } if( has_morphflag(mflags,PROCLITIC) ) { Xstrncpy(word,stem,MAXWORDSIZE); - return; + return(0); } if( case_of(form_info) == GENITIVE || case_of(form_info) == DATIVE ) is_oblique = YES; @@ -145,7 +158,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if (Is_accent(*p)) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } @@ -153,7 +166,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if (Is_accent(*p)) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } /* * grc 7/15/89 @@ -164,7 +177,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if( Accent_optional(mflags) && has_morphflag(mflags,ENCLITIC) ) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } @@ -185,7 +198,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if( Accent_optional(mflags) ) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } ep = getsyll(endstring,ULTIMA,0); if( is_diphth(ep,endstring)) { @@ -196,7 +209,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e Xstrncat(tmp,endstring,MAXWORDSIZE); /* stripmetachars(tmp);*/ Xstrncpy(word,tmp,MAXWORDSIZE); - return; + return(0); } else if( has_morphflag(morphflags_of(stemgstr),SUFF_ACC) || is_thirdmono(stemgstr,gstring, stem,endstring,form_info,is_ending) || nsylls(stem) == 0 ) { @@ -208,7 +221,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if( Accent_optional(mflags) ) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } */ if( nsylls(endstring) >= 1 ) { @@ -218,7 +231,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e Xstrncat(tmp,endstring,MAXWORDSIZE); /* stripmetachars(tmp);*/ Xstrncpy(word,tmp,MAXWORDSIZE); - return; + return(0); } else if(nsylls(endstring) == 0 ) { char * p; @@ -232,7 +245,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e fixnacc2(p,gstring,form_info,is_ending,is_oblique); Xstrncpy(word,tmp,MAXWORDSIZE); } - return; + return(0); } } @@ -256,7 +269,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e if( Accent_optional(mflags) ) { Xstrncpy(word,stem,MAXWORDSIZE); Xstrncat(word,endstring,MAXWORDSIZE); - return; + return(0); } addaccent(workstem,CIRCUMFLEX,p); } else if((quantprim(endstring,ULTIMA,YES,is_oblique)==LONG) || @@ -278,7 +291,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e Xstrncpy(tmp,workstem,MAXWORDSIZE); Xstrncat(tmp,endstring,MAXWORDSIZE); Xstrncpy(word,tmp,MAXWORDSIZE); - return; + return(0); } /* * this final, odd case is for words such as "diw=ruc, diw/ruxos", where we @@ -314,7 +327,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e Xstrncpy(tmp,workstem,MAXWORDSIZE); Xstrncat(tmp,endstring,MAXWORDSIZE); Xstrncpy(word,tmp,MAXWORDSIZE); - return; + return(0); } Xstrncpy(tmp,workstem,MAXWORDSIZE); @@ -335,11 +348,11 @@ fixnacc2(char *targstring, gk_string *gstring, word_form form_info, int is_endin is_contr = has_morphflag(mflags,CONTRACTED); - if( cur_lang() == LATIN || cur_lang() == ITALIAN ) return; + if( cur_lang() == LATIN || cur_lang() == ITALIAN ) return(0); /* if accent's already there, forget it */ for (p=targstring;*p;p++) if (Is_accent(*p)) - return; + return(0); /* * grc 7/27/89 * @@ -363,7 +376,7 @@ fixnacc2(char *targstring, gk_string *gstring, word_form form_info, int is_endin p = getsyll(targstring,PENULT,is_ending); if (p == P_ERR) { if( Accent_optional(mflags) ) { - return; + return(0); } p = getsyll(targstring,ULTIMA,is_ending); if( ulttakescirc(gstring,form_info) ) { @@ -380,7 +393,7 @@ fixnacc2(char *targstring, gk_string *gstring, word_form form_info, int is_endin addaccent(targstring,ACUTE,p); else { /* no antepenult */ if( Accent_optional(mflags) ) { - return; + return(0); } p = getsyll(targstring,PENULT,is_ending); if (p == P_ERR) diff --git a/src/morphlib/fixacc.proto.h b/src/morphlib/fixacc.proto.h index 75d1a07..071c8d6 100755 --- a/src/morphlib/fixacc.proto.h +++ b/src/morphlib/fixacc.proto.h @@ -3,3 +3,4 @@ int putsimpleacc(char *); int FixRecAcc(gk_word *, MorphFlags *, char *); int FixPersAcc(gk_string *, MorphFlags *, gk_string *, char *, char *, word_form, int); +int FixPersAcc2(gk_string *, MorphFlags *, gk_string *, char *, char *, word_form, int); From 042e156a93c77e20bfa1662c95944aae9279747f Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 29 Jun 2017 11:59:57 +0100 Subject: [PATCH 04/10] More morphlib updates for LLVM --- src/morphlib/gkstring.c | 14 ++++++++++---- src/morphlib/gkstring.proto.h | 8 ++++---- src/morphlib/morphkeys.proto.h | 2 -- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/morphlib/gkstring.c b/src/morphlib/gkstring.c index ece4002..a29f1ff 100755 --- a/src/morphlib/gkstring.c +++ b/src/morphlib/gkstring.c @@ -1,5 +1,11 @@ #include +#include "morphflags.proto.h" +#include "morphkeys.proto.h" +#include "morphstrcmp.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/isblank.proto.h" +#include "gkstring.proto.h" gk_string * CreatGkString(int num) @@ -20,7 +26,7 @@ FreeGkString(gk_string *gstring) { if( ! gstring ) { fprintf(stderr,"hey! asked to free NULL gstring \n"); - return; + return(0); } /* printf("free gstring \n"); @@ -73,7 +79,7 @@ ClearGkstring(gk_string *gstr) gk_string *CreatGkString(); *gstr = BlnkGstr; - return; + return(0); /* gstring = CreatGkString(1); *gstr = * gstring; @@ -85,7 +91,7 @@ FreeGkword(gk_word *Gkword) { if( ! Gkword ) { fprintf(stderr,"hey! asked to free NULL gkword \n"); - return; + return(0); } if( totanal_of(Gkword) && analysis_of(Gkword) ) FreeGkAnal(analysis_of(Gkword)); @@ -524,7 +530,7 @@ int char dialbuf[MAXWORDSIZE]; dialbuf[0] = 0; - AddDialect(di,dialbuf); + AddDialect(di,dialbuf, " "); fprintf(f,"%s ", dialbuf); /* for(i=0;i<(((int)sizeof di) * 8);i++) { diff --git a/src/morphlib/gkstring.proto.h b/src/morphlib/gkstring.proto.h index 296c878..832bcee 100755 --- a/src/morphlib/gkstring.proto.h +++ b/src/morphlib/gkstring.proto.h @@ -21,14 +21,14 @@ int PrntDomains(char *, FILE *); int PrntMorphFlags(MorphFlags *, FILE *); int PrntVerbInfo(word_form, FILE *); int PrntParadigmInfo(word_form, FILE *); -int AddParadigmInfo(char *, word_form); -int AddPersNumInfo(char *, word_form); +int AddParadigmInfo(char *, word_form, char *); +int AddPersNumInfo(char *, word_form, char *); int PrntPersNumInfo(word_form, FILE *); int PrntAdjInfo(word_form, FILE *); -int AddAdjInfo(char *, word_form); +int AddAdjInfo(char *, word_form, char *); int PrntStemtype(Stemtype, FILE *); int PrntDialect(Dialect, FILE *); -int AddDialect(Dialect, char *); +int AddDialect(Dialect, char *, char *); Dialect AndDialect(Dialect, Dialect); int xInsertGstr(gk_string *, gk_string *, int, int (*compare )(), int); int GetTableLine(char *, int, FILE *); diff --git a/src/morphlib/morphkeys.proto.h b/src/morphlib/morphkeys.proto.h index 740f319..fba5c8c 100755 --- a/src/morphlib/morphkeys.proto.h +++ b/src/morphlib/morphkeys.proto.h @@ -2,7 +2,6 @@ /* morphkeys.c */ int ScanAsciiKeys(char *, gk_word *, gk_string *, gk_string *); char *NextEndTable(int *, Stemtype); -/* char *NameOfDerivtype(Derivtype); char *NameOfStemtype(Stemtype); char *NameOfDomain(Stemtype); @@ -12,7 +11,6 @@ char *NameOfTense(word_form); char *NameOfMood(word_form); char *NameOfVoice(word_form); char *NameOfDialect(Dialect); -*/ int DomainNames(char *, char *, char *); int DialectNames(Dialect, char *, char *); int GeogRegionNames(GeogRegion, char *, char *); From b8b83e6a407e60a9cc9818ef94dd49d7a927fc80 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 29 Jun 2017 16:08:32 +0100 Subject: [PATCH 05/10] Finish updating morphlib to build with LLVM --- src/includes/contract.h | 1 - src/morphlib/gktoasc.proto.h | 1 + src/morphlib/indkeys.c | 4 ++++ src/morphlib/is_thirdmono.c | 4 ++++ src/morphlib/loadeuph.c | 5 ++++ src/morphlib/markstem.c | 4 ++++ src/morphlib/morphflags.c | 4 +++- src/morphlib/morphkeys.c | 14 ++++++++---- src/morphlib/morphpath.c | 3 ++- src/morphlib/morphstrcmp.c | 1 + src/morphlib/morphstrcmp.proto.h | 1 + src/morphlib/new_val.c | 2 ++ src/morphlib/numovable.c | 4 ++++ src/morphlib/penultform.c | 1 + src/morphlib/pres_redup.c | 3 ++- src/morphlib/preverb.c | 39 ++++++++++++++++++++------------ src/morphlib/preverb2.c | 10 ++++++++ src/morphlib/preverb3.c | 2 ++ src/morphlib/retrentry.c | 3 +++ src/morphlib/smk2beta.c | 6 ++--- src/morphlib/sprntGkflags.c | 2 ++ src/morphlib/standphon.c | 4 +++- src/morphlib/ultform.c | 1 + src/morphlib/ulttakescirc.c | 1 + 24 files changed, 93 insertions(+), 27 deletions(-) create mode 100755 src/morphlib/gktoasc.proto.h diff --git a/src/includes/contract.h b/src/includes/contract.h index 79ae3ab..be1f2ef 100755 --- a/src/includes/contract.h +++ b/src/includes/contract.h @@ -6,7 +6,6 @@ #include #define MAXCONTRACTS 10 #define MAXSUBSTRING 10 -Dialect AndDialect(); #include "libfiles.h" diff --git a/src/morphlib/gktoasc.proto.h b/src/morphlib/gktoasc.proto.h new file mode 100755 index 0000000..51efd9e --- /dev/null +++ b/src/morphlib/gktoasc.proto.h @@ -0,0 +1 @@ +int set_gkorder(char *); diff --git a/src/morphlib/indkeys.c b/src/morphlib/indkeys.c index 14636ad..71488e2 100755 --- a/src/morphlib/indkeys.c +++ b/src/morphlib/indkeys.c @@ -1,6 +1,10 @@ #include #include #include +#include "morphstrcmp.proto.h" +#include "../greeklib/isblank.proto.h" +#include "../greeklib/keyio.proto.h" +#include "../greeklib/xstrings.proto.h" #define DECALPHA 1 #include "indkeys.proto.h" diff --git a/src/morphlib/is_thirdmono.c b/src/morphlib/is_thirdmono.c index f5ace8d..a82d50f 100755 --- a/src/morphlib/is_thirdmono.c +++ b/src/morphlib/is_thirdmono.c @@ -1,4 +1,8 @@ #include +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "morphflags.proto.h" #include "is_thirdmono.h" #include "is_thirdmono.proto.h" diff --git a/src/morphlib/loadeuph.c b/src/morphlib/loadeuph.c index a898652..2293c10 100755 --- a/src/morphlib/loadeuph.c +++ b/src/morphlib/loadeuph.c @@ -1,4 +1,9 @@ #include +#include "gkstring.proto.h" +#include "morphflags.proto.h" +#include "nextkey.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/xstrings.proto.h" #include "loadeuph.proto.h" diff --git a/src/morphlib/markstem.c b/src/morphlib/markstem.c index 3251bb7..8eb6089 100755 --- a/src/morphlib/markstem.c +++ b/src/morphlib/markstem.c @@ -12,6 +12,10 @@ */ #include +#include "morphflags.proto.h" +#include "../greeklib/endsinstr.proto.h" +#include "../greeklib/getquantity.proto.h" +#include "../greeklib/longbyposition.proto.h" #include "markstem.proto.h" markstem(char *stemstr, gk_string *gstr) diff --git a/src/morphlib/morphflags.c b/src/morphlib/morphflags.c index 77997b9..7bfbb1b 100755 --- a/src/morphlib/morphflags.c +++ b/src/morphlib/morphflags.c @@ -1,5 +1,7 @@ #include +#include "morphflags.proto.h" + add_morphflags(gk_string *gstr, MorphFlags * Flags) { unsigned char * Mf = morphflags_of(gstr); @@ -205,7 +207,7 @@ void * zogalloc(size_t, size_t); init_prvb_tab(void) { - if( prvb_tab ) return; + if( prvb_tab ) return(0); prvb_tab = (char *)calloc((size_t)(TABSIZE+1),(size_t)(sizeof * prvb_tab) ); if (! prvb_tab) { diff --git a/src/morphlib/morphkeys.c b/src/morphlib/morphkeys.c index 3163108..2964ed6 100755 --- a/src/morphlib/morphkeys.c +++ b/src/morphlib/morphkeys.c @@ -7,8 +7,12 @@ #include "morphkeys.h" #include #include -#include "../greeklib/xstrings.proto.h" #include "gkstring.proto.h" +#include "morphflags.proto.h" +#include "morphkeys.proto.h" +#include "nextkey.proto.h" +#include "../greeklib/binlook.proto.h" +#include "../greeklib/xstrings.proto.h" #ifdef LIGHTSPEED /* @@ -373,7 +377,7 @@ DomainNames(char *domp, char *res, char *dels) *res = 0; if( ! di ) - return; + return(0); mf = (Morph_flags)di; while( morph_args->morph_key[0] ) { @@ -386,7 +390,7 @@ DomainNames(char *domp, char *res, char *dels) } morph_args++; } - return; + return(0); } GeogRegionNames(GeogRegion gr, char *res, char *dels) @@ -402,7 +406,7 @@ DomainNames(char *domp, char *res, char *dels) *res = 0; if( ! gr ) - return; + return(0); mf = (Morph_flags)gr; while( morph_args->morph_key[0] ) { @@ -413,7 +417,7 @@ DomainNames(char *domp, char *res, char *dels) } morph_args++; } - return; + return(0); } char * diff --git a/src/morphlib/morphpath.c b/src/morphlib/morphpath.c index e410529..995fc22 100755 --- a/src/morphlib/morphpath.c +++ b/src/morphlib/morphpath.c @@ -1,4 +1,5 @@ #include +#include "setlang.proto.h" #include "morphpath.proto.h" static filesopened = 0; @@ -55,7 +56,7 @@ MorphPathName(char *shorts, char *full) if( ! s ) { printf("MORPHLIB not set in your environment!\n"); - return; + return(0); } if( cur_lang() == LATIN ) diff --git a/src/morphlib/morphstrcmp.c b/src/morphlib/morphstrcmp.c index 61732d5..6a0aea9 100755 --- a/src/morphlib/morphstrcmp.c +++ b/src/morphlib/morphstrcmp.c @@ -1,4 +1,5 @@ #include +#include "gktoasc.proto.h" #include "morphstrcmp.proto.h" diff --git a/src/morphlib/morphstrcmp.proto.h b/src/morphlib/morphstrcmp.proto.h index c25cc58..be81f00 100755 --- a/src/morphlib/morphstrcmp.proto.h +++ b/src/morphlib/morphstrcmp.proto.h @@ -5,3 +5,4 @@ int morphstrncmp(char *, char *, size_t); int dictstrcmp(char *, char *); int dictstrncmp(char *, char *, size_t); int init_comptab(void); +int init_betatab(void); diff --git a/src/morphlib/new_val.c b/src/morphlib/new_val.c index a71173c..48bd231 100755 --- a/src/morphlib/new_val.c +++ b/src/morphlib/new_val.c @@ -1,4 +1,6 @@ #include +#include "adddomain.proto.h" +#include "morphflags.proto.h" #include "new_val.proto.h" diff --git a/src/morphlib/numovable.c b/src/morphlib/numovable.c index c1eaf0c..cacada8 100755 --- a/src/morphlib/numovable.c +++ b/src/morphlib/numovable.c @@ -1,4 +1,8 @@ #include +#include "morphflags.proto.h" +#include "../greeklib/endsinstr.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/xstrings.proto.h" #include "numovable.proto.h" diff --git a/src/morphlib/penultform.c b/src/morphlib/penultform.c index 597c802..21ddf74 100755 --- a/src/morphlib/penultform.c +++ b/src/morphlib/penultform.c @@ -1,4 +1,5 @@ #include +#include "morphflags.proto.h" #include "penultform.proto.h" diff --git a/src/morphlib/pres_redup.c b/src/morphlib/pres_redup.c index 84f759a..5dacaeb 100755 --- a/src/morphlib/pres_redup.c +++ b/src/morphlib/pres_redup.c @@ -1,8 +1,9 @@ #include +#include "augment.proto.h" #include "pres_redup.proto.h" pres_redupl(char *s) { simpleredupit(s,0,'i'); -} \ No newline at end of file +} diff --git a/src/morphlib/preverb.c b/src/morphlib/preverb.c index 9dbc414..dc92982 100755 --- a/src/morphlib/preverb.c +++ b/src/morphlib/preverb.c @@ -11,6 +11,17 @@ #include #include +#include "augment.proto.h" +#include "morphflags.proto.h" +#include "preverb2.proto.h" +#include "setlang.proto.h" +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/aspirate.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../greeklib/strsqz.proto.h" +#include "../greeklib/xstrings.proto.h" #include "preverb.proto.h" static comp_preverb(char *, int, MorphFlags *); @@ -189,7 +200,7 @@ rstprevb(char *word, char *prevb, gk_string *gstr) MorphFlags * oddpb = morphflags_of(gstr); fullpb[0] = 0; - if( Is_indeclform(oddpb) ) return; + if( Is_indeclform(oddpb) ) return(0); if( cur_lang() == LATIN || cur_lang() == ITALIAN ) { if( !has_morphflag(oddpb,RAW_PREVERB) ) { @@ -350,7 +361,7 @@ rstprevb(char *word, char *prevb, gk_string *gstr) strcat(work,word); strcpy(word,work); - return; + return(0); } } @@ -382,7 +393,7 @@ rstprevb(char *word, char *prevb, gk_string *gstr) stripbreath(tmpword); /* avoid forms such as a)na-oi)/gw */ Xstrncat(work,tmpword,MAXWORDSIZE); Xstrncpy(word,work,MAXWORDSIZE); - return; + return(0); } set_morphflag(morphflags_of(&TmpGstr),0); @@ -675,7 +686,7 @@ shift_eis_to_es(char *s) while(*s) { if(!Xstrncmp(s,"eis",3) || !Xstrncmp(s,"ei)s",4) ) { strcpy(s+1,s+2); - return; + return(0); } s++; } @@ -689,7 +700,7 @@ shift_pros_to_poti(char *s) strcpy(tmp,s+4); strcpy(s,"poti"); strcat(s,tmp); - return; + return(0); } s++; } @@ -703,7 +714,7 @@ shift_pros_to_proti(char *s) strcpy(tmp,s+4); strcpy(s,"proti"); strcat(s,tmp); - return; + return(0); } s++; } @@ -717,12 +728,12 @@ shift_upo_to_upai(char *s) strcpy(tmp,s+3); strcpy(s,"upai"); strcat(s,tmp); - return; + return(0); } else if(!Xstrncmp(s,"u(po",4) ) { strcpy(tmp,s+4); strcpy(s,"u(pai"); strcat(s,tmp); - return; + return(0); } s++; } @@ -736,12 +747,12 @@ shift_uper_to_upeir(char *s) strcpy(tmp,s+4); strcpy(s,"upeir"); strcat(s,tmp); - return; + return(0); } else if(!Xstrncmp(s,"u(per",5) ) { strcpy(tmp,s+5); strcpy(s,"u(peir"); strcat(s,tmp); - return; + return(0); } s++; } @@ -755,7 +766,7 @@ shift_para_to_parai(char *s) strcpy(tmp,s+4); strcpy(s,"parai"); strcat(s,tmp); - return; + return(0); } s++; } @@ -769,7 +780,7 @@ shift_meta_to_peda(char *s) strcpy(tmp,s+4); strcpy(s,"peda"); strcat(s,tmp); - return; + return(0); } s++; } @@ -783,13 +794,13 @@ shift_en_to_eni(char *s) strcpy(tmp,s+3); strcpy(s,"e)ni"); strcat(s,tmp); - return; + return(0); } if(!Xstrncmp(s,"en",2) && Xstrncmp(s,"eni",3)) { strcpy(tmp,s+2); strcpy(s,"eni"); strcat(s,tmp); - return; + return(0); } s++; } diff --git a/src/morphlib/preverb2.c b/src/morphlib/preverb2.c index be8749f..ad4010e 100755 --- a/src/morphlib/preverb2.c +++ b/src/morphlib/preverb2.c @@ -1,6 +1,16 @@ #include #include +#include "gkstring.proto.h" +#include "morphflags.proto.h" +#include "preverb3.proto.h" +#include "setlang.proto.h" +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/do_dissim.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../greeklib/xstrings.proto.h" #include "preverb2.proto.h" static exp_prevb2(char *, char *, gk_string *); diff --git a/src/morphlib/preverb3.c b/src/morphlib/preverb3.c index 47e93ec..49ed1dc 100755 --- a/src/morphlib/preverb3.c +++ b/src/morphlib/preverb3.c @@ -1,4 +1,6 @@ #include +#include "morphflags.proto.h" +#include "../greeklib/xstrings.proto.h" #include "preverb3.proto.h" diff --git a/src/morphlib/retrentry.c b/src/morphlib/retrentry.c index 231f218..84bc132 100755 --- a/src/morphlib/retrentry.c +++ b/src/morphlib/retrentry.c @@ -1,5 +1,8 @@ #include #include +#include "../greeklib/binlook.proto.h" +#include "../greeklib/keyio.proto.h" +#include "../greeklib/xstrings.proto.h" #define LINDEXSUFFIX "lindex" #include "retrentry.proto.h" diff --git a/src/morphlib/smk2beta.c b/src/morphlib/smk2beta.c index 1601d1e..472f376 100755 --- a/src/morphlib/smk2beta.c +++ b/src/morphlib/smk2beta.c @@ -188,7 +188,7 @@ printf("%d) Xlit_table [%s]\n", Beta_SMK[i].keycode , Xlit_table[Beta_SMK[i].key set_cur_font(int n, char *s) { - if( fromsmk ) return; + if( fromsmk ) return(0); if( n != cur_font ) { switch(n) { @@ -233,7 +233,7 @@ trap_upper(char *res, char *s) tmp[1] = tolower(*s); tmp[2] = 0; strcat(res,tmp); - return; + return(0); } if( islower(*s) ) { @@ -244,7 +244,7 @@ trap_upper(char *res, char *s) tmp[1] = *s; tmp[2] = 0; strcat(res,tmp); - return; + return(0); } tmp[0] = 0; diff --git a/src/morphlib/sprntGkflags.c b/src/morphlib/sprntGkflags.c index 1110f95..8e89066 100755 --- a/src/morphlib/sprntGkflags.c +++ b/src/morphlib/sprntGkflags.c @@ -1,4 +1,6 @@ #include +#include "morphflags.proto.h" +#include "morphkeys.proto.h" #include "sprntGkflags.h" diff --git a/src/morphlib/standphon.c b/src/morphlib/standphon.c index 47d56d2..3c17244 100755 --- a/src/morphlib/standphon.c +++ b/src/morphlib/standphon.c @@ -1,4 +1,6 @@ #include +#include "morphflags.proto.h" +#include "../greeklib/addbreath.proto.h" #include "standphon.proto.h" @@ -68,4 +70,4 @@ stand_phonetics(gk_word *Gkword) s++; } -} \ No newline at end of file +} diff --git a/src/morphlib/ultform.c b/src/morphlib/ultform.c index faf56e9..53e478a 100755 --- a/src/morphlib/ultform.c +++ b/src/morphlib/ultform.c @@ -1,4 +1,5 @@ #include +#include "morphflags.proto.h" #include "ultform.proto.h" diff --git a/src/morphlib/ulttakescirc.c b/src/morphlib/ulttakescirc.c index 69e8682..ff34215 100755 --- a/src/morphlib/ulttakescirc.c +++ b/src/morphlib/ulttakescirc.c @@ -1,4 +1,5 @@ #include +#include "morphflags.proto.h" #include "ulttakescirc.proto.h" From 708ca123467ea726a546dae90a01312532a9687f Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 29 Jun 2017 17:07:01 +0100 Subject: [PATCH 06/10] Make gkends build with LLVM --- src/gkends/acccompos.c | 5 +++++ src/gkends/checkforbreath.c | 8 ++++++-- src/gkends/contract.c | 10 ++++++++++ src/gkends/countendtables.c | 4 ++++ src/gkends/endindex.c | 4 +++- src/gkends/euphend.c | 2 ++ src/gkends/expendmain.c | 3 +++ src/gkends/expendtable.c | 8 +++++++- src/gkends/expsuffmain.c | 4 ++++ src/gkends/expwordmain.c | 5 +++++ src/gkends/fixeta.c | 2 ++ src/gkends/getcurrend.c | 3 +++ src/gkends/imain.c | 3 +++ src/gkends/indexendtables.c | 11 +++++++++++ src/gkends/merge.c | 1 + src/gkends/mkend.c | 19 ++++++++++++++++--- src/gkends/retrends.c | 15 +++++++++++++-- src/gkends/smain.c | 3 +++ src/gkends/stor.c | 7 +++++++ src/gkends/stor.proto.h | 1 + 20 files changed, 109 insertions(+), 9 deletions(-) diff --git a/src/gkends/acccompos.c b/src/gkends/acccompos.c index e43fccf..33c9743 100755 --- a/src/gkends/acccompos.c +++ b/src/gkends/acccompos.c @@ -1,6 +1,11 @@ #include #include +#include "../greeklib/hasaccent.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/fixacc.proto.h" +#include "../morphlib/morphflags.proto.h" #include "acccompos.proto.h" char * skip_to_syll(); diff --git a/src/gkends/checkforbreath.c b/src/gkends/checkforbreath.c index 20c226b..0598d88 100755 --- a/src/gkends/checkforbreath.c +++ b/src/gkends/checkforbreath.c @@ -1,4 +1,8 @@ #include +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/setlang.proto.h" #include "checkforbreath.proto.h" @@ -7,11 +11,11 @@ CheckForBreathing(gk_string *gstr) char * s = gkstring_of(gstr); int rbreath = 0; - if( cur_lang() == LATIN || cur_lang() == ITALIAN) return; + if( cur_lang() == LATIN || cur_lang() == ITALIAN) return(0); if( (rbreath=has_morphflag(morphflags_of(gstr),NEEDS_RBREATH)) ) zap_morphflag(morphflags_of(gstr),NEEDS_RBREATH); if( ! Is_vowel(*s) || getbreath(s) != NOBREATH ) { - return; + return(0); } addbreath(s,rbreath ? ROUGHBR : SMOOTHBR); diff --git a/src/gkends/contract.c b/src/gkends/contract.c index 9ae2cbf..c61dde1 100755 --- a/src/gkends/contract.c +++ b/src/gkends/contract.c @@ -5,6 +5,16 @@ #include "contract.h" #include +#include "acccompos.proto.h" +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../morphlib/fixacc.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/setlang.proto.h" #include "contract.proto.h" diff --git a/src/gkends/countendtables.c b/src/gkends/countendtables.c index 04a6869..ace98e7 100755 --- a/src/gkends/countendtables.c +++ b/src/gkends/countendtables.c @@ -1,5 +1,9 @@ #include #include "endfiles.h" +#include "../morphlib/endio.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphstrcmp.proto.h" +#include "../morphlib/nextkey.proto.h" #define MAX_END_TABLE 12000 char ** endlines; static int endcount = 0; diff --git a/src/gkends/endindex.c b/src/gkends/endindex.c index c60af2c..860ec99 100755 --- a/src/gkends/endindex.c +++ b/src/gkends/endindex.c @@ -1,6 +1,8 @@ #include #include - +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/vaxwords.proto.h" +#include "../greeklib/xstrings.proto.h" #include "../morphlib/morphstrcmp.proto.h" #include "endfiles.h" #include "gkdict.h" diff --git a/src/gkends/euphend.c b/src/gkends/euphend.c index 12ce388..770147a 100755 --- a/src/gkends/euphend.c +++ b/src/gkends/euphend.c @@ -1,4 +1,6 @@ #include +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" #include "euphend.proto.h" diff --git a/src/gkends/expendmain.c b/src/gkends/expendmain.c index d69f518..efa17dd 100755 --- a/src/gkends/expendmain.c +++ b/src/gkends/expendmain.c @@ -1,7 +1,10 @@ +#include #include char fname[80]; static gk_string Gstr; #include "compostypes.h" +#include "expendtable.proto.h" +#include "../morphlib/setlang.proto.h" #include "expendmain.proto.h" diff --git a/src/gkends/expendtable.c b/src/gkends/expendtable.c index 304964e..104bacb 100755 --- a/src/gkends/expendtable.c +++ b/src/gkends/expendtable.c @@ -8,8 +8,14 @@ * thus, "w" gets placed after "eis". */ #include -#include "endfiles.h" #include "compostypes.h" +#include "endfiles.h" +#include "mkend.proto.h" +#include "stor.proto.h" +#include "../greeklib/isblank.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" #include "expendtable.proto.h" gk_string * CreatGkString(); diff --git a/src/gkends/expsuffmain.c b/src/gkends/expsuffmain.c index a2db288..6459caa 100755 --- a/src/gkends/expsuffmain.c +++ b/src/gkends/expsuffmain.c @@ -1,6 +1,10 @@ +#include #include #include #include "compostypes.h" +#include "expendtable.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/setlang.proto.h" #include "expsuffmain.proto.h" diff --git a/src/gkends/expwordmain.c b/src/gkends/expwordmain.c index 3379de1..43f59d9 100755 --- a/src/gkends/expwordmain.c +++ b/src/gkends/expwordmain.c @@ -1,4 +1,9 @@ +#include #include +#include "expendtable.proto.h" +#include "stor.proto.h" +#include "../greeklib/isblank.proto.h" +#include "../morphlib/setlang.proto.h" char fname[80]; static gk_string Gstr; #include "compostypes.h" diff --git a/src/gkends/fixeta.c b/src/gkends/fixeta.c index e7e92e2..3f74ff4 100755 --- a/src/gkends/fixeta.c +++ b/src/gkends/fixeta.c @@ -1,4 +1,6 @@ #include +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" #define MAXEUPHS 5 #include "fixeta.proto.h" diff --git a/src/gkends/getcurrend.c b/src/gkends/getcurrend.c index 17787b0..72d1714 100755 --- a/src/gkends/getcurrend.c +++ b/src/gkends/getcurrend.c @@ -1,5 +1,8 @@ #include #include "endfiles.h" +#include "../greeklib/Fclose.proto.h" +#include "../morphlib/endio.proto.h" +#include "../morphlib/gkstring.proto.h" #define ENDCACHESIZE 45 #include "getcurrend.proto.h" diff --git a/src/gkends/imain.c b/src/gkends/imain.c index 04f3770..9aa323b 100755 --- a/src/gkends/imain.c +++ b/src/gkends/imain.c @@ -1,4 +1,7 @@ +#include #include +#include "indexendtables.proto.h" +#include "../morphlib/setlang.proto.h" static gk_string Gstr; char fname[MAXWORDSIZE]; static gk_word Gkword; diff --git a/src/gkends/indexendtables.c b/src/gkends/indexendtables.c index 69d1535..dac4fd9 100755 --- a/src/gkends/indexendtables.c +++ b/src/gkends/indexendtables.c @@ -1,7 +1,18 @@ #include #include "endfiles.h" #include "nextsufftab.proto.h" +#include "../greeklib/hasaccent.proto.h" +#include "../greeklib/hasdiaer.proto.h" +#include "../greeklib/hasquant.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../morphlib/endio.proto.h" +#include "../morphlib/errormess.proto.h" +#include "../morphlib/gkstring.proto.h" #include "../morphlib/morphkeys.proto.h" +#include "../morphlib/morphstrcmp.proto.h" +#include "../morphlib/nextkey.proto.h" #define MAX_END_TABLE 20000 char ** endlines; static int endcount = 0; diff --git a/src/gkends/merge.c b/src/gkends/merge.c index 242d660..ee4a75e 100755 --- a/src/gkends/merge.c +++ b/src/gkends/merge.c @@ -1,4 +1,5 @@ #include +#include "retrends.proto.h" #include "merge.proto.h" diff --git a/src/gkends/mkend.c b/src/gkends/mkend.c index 2118439..ba3bd5a 100755 --- a/src/gkends/mkend.c +++ b/src/gkends/mkend.c @@ -1,5 +1,18 @@ #include +#include "acccompos.proto.h" +#include "checkforbreath.proto.h" #include "endfiles.h" +#include "merge.proto.h" +#include "stor.proto.h" +#include "../greeklib/do_dissim.proto.h" +#include "../greeklib/isblank.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/numovable.proto.h" +#include "../morphlib/setlang.proto.h" #include "mkend.proto.h" static mk_compend(gk_string *, gk_string *, char *, char *); @@ -33,7 +46,7 @@ static gk_string BlankGstr; *s = 0; mk_compend(Have,Avoid,savestr,s+1); - return; + return(0); } s++; } @@ -57,7 +70,7 @@ static gk_string BlankGstr; mk_end(gkstring_of(euph_forms+i),euph_forms+i,&AvoidGstr); } FreeGkString(euph_forms); - return; + return(0); } /* * allow only one contraction per ending for now @@ -91,7 +104,7 @@ printf("no contr in: "); PrntGkStr(Have,stdout); mk_end(gkstring_of(&TmpGstr),&TmpGstr,&AvoidGstr); } - if( do_dissim(gkstring_of(Have))) { + if( do_dissim(gkstring_of(Have), STEMTYPE)) { add_morphflag(morphflags_of(Have),DISSIMILATION); } AddNewGstr(Have); diff --git a/src/gkends/retrends.c b/src/gkends/retrends.c index e3b0aaf..2b16e95 100755 --- a/src/gkends/retrends.c +++ b/src/gkends/retrends.c @@ -1,6 +1,17 @@ #include #include #include "endfiles.h" +#include "euphend.proto.h" +#include "../greeklib/hasaccent.proto.h" +#include "../greeklib/hasquant.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/markstem.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/morphstrcmp.proto.h" +#include "../morphlib/setlang.proto.h" #ifdef LIGHTSPEED char * GetEndString(); @@ -694,7 +705,7 @@ static if( sofar == 0 ) { *gstrings = *newgstr; - return; + return(0); } /* @@ -711,7 +722,7 @@ printf("starting with: "); PrntGkFlags(newgstr,stdout); printf("\n", rval ); if( rval > 0 ) { *(gstrings+i) = *newgstr; - return; + return(0); } *(gstrings+i) = *(gstrings+i-1); } diff --git a/src/gkends/smain.c b/src/gkends/smain.c index 368fe52..29c1f41 100755 --- a/src/gkends/smain.c +++ b/src/gkends/smain.c @@ -1,4 +1,7 @@ +#include #include +#include "indexendtables.proto.h" +#include "../morphlib/setlang.proto.h" static gk_string Gstr; char fname[MAXWORDSIZE]; diff --git a/src/gkends/stor.c b/src/gkends/stor.c index cb5af78..8d06d8c 100755 --- a/src/gkends/stor.c +++ b/src/gkends/stor.c @@ -1,4 +1,11 @@ #include +#include "../greeklib/isdiphth.proto.h" +#include "../greeklib/stripchar.proto.h" +#include "../greeklib/stripzeroend.proto.h" +#include "../morphlib/endio.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/setlang.proto.h" static gk_string * StoreGstr; #define MAXENDINGS 10000 diff --git a/src/gkends/stor.proto.h b/src/gkends/stor.proto.h index 0eec6ba..235f4cd 100755 --- a/src/gkends/stor.proto.h +++ b/src/gkends/stor.proto.h @@ -3,6 +3,7 @@ int InitGstrMem(void); int AddNewGstr(gk_string *); int PrntNewGstrings(FILE *, int); +int ResetGstrBuf(void); int LPrntGstr(gk_string *, FILE *); int new_parad(gk_string *, gk_string *); int hyphtodiaer(char *); From d07e7ce7fd253489e0fd87c4a56aadbe6dcf0142 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 5 Jul 2017 15:54:42 +0100 Subject: [PATCH 07/10] Make gkdict build with LLVM --- src/anal/checkstem.c | 1 - src/anal/checkstem.proto.h | 1 + src/gkdict/compnoun.c | 3 +++ src/gkdict/conj1.l | 1 + src/gkdict/derivio.c | 17 ++++++++++++++++- src/gkdict/dictio.c | 15 +++++++++++++++ src/gkdict/indcomps.c | 3 ++- src/gkdict/indexnoms.main.c | 5 ++++- src/gkdict/indexstems.c | 17 ++++++++++++++++- src/gkdict/indexvbs.main.c | 5 ++++- src/gkdict/latnom.l | 15 ++++++++++----- src/gkdict/latnom.proto.h | 18 ++++++++++++++++++ src/gkdict/latvb.l | 15 ++++++++++----- src/gkdict/latvb.proto.h | 10 ++++++++++ src/gkdict/newlems.c | 12 ++++++++++-- src/gkdict/newlems.proto.h | 4 ++++ src/gkdict/newlems2.c | 15 +++++++++------ src/gkdict/newlems2.proto.h | 15 +++++++++++++++ src/gkdict/setquant.l | 4 ++++ src/gkdict/setquant.proto.h | 7 +++++++ src/gkdict/splitlat.l | 4 ++++ src/gkdict/splitlat.proto.h | 4 ++++ src/gkdict/splitlems.l | 4 ++++ src/gkdict/splitlems.proto.h | 5 +++++ src/gkends/endindex.proto.h | 1 + 25 files changed, 177 insertions(+), 24 deletions(-) create mode 100644 src/gkdict/latnom.proto.h create mode 100644 src/gkdict/latvb.proto.h create mode 100755 src/gkdict/newlems.proto.h create mode 100755 src/gkdict/newlems2.proto.h create mode 100644 src/gkdict/setquant.proto.h create mode 100644 src/gkdict/splitlat.proto.h create mode 100644 src/gkdict/splitlems.proto.h diff --git a/src/anal/checkstem.c b/src/anal/checkstem.c index 8a85791..9dcea00 100755 --- a/src/anal/checkstem.c +++ b/src/anal/checkstem.c @@ -2,7 +2,6 @@ #define MAXAUGSTEMS 12 #include "checkstem.proto.h" -int comstemtypes(char *, char *, char *); static wantcurstemtype(char *, char *); extern verbose; static int digstem = 0; diff --git a/src/anal/checkstem.proto.h b/src/anal/checkstem.proto.h index 3d4e821..ebefb04 100755 --- a/src/anal/checkstem.proto.h +++ b/src/anal/checkstem.proto.h @@ -4,3 +4,4 @@ int checkstem(char *, char *, gk_string *[], char *[], int); int stemexists(char *, char *, char *, int); int setstemvars(char *, char *, char *, char *, char *); char *parsefield(char *, char *, int, int); +int comstemtypes(char *, char *, char *); diff --git a/src/gkdict/compnoun.c b/src/gkdict/compnoun.c index e2d1790..6b403f8 100755 --- a/src/gkdict/compnoun.c +++ b/src/gkdict/compnoun.c @@ -1,6 +1,9 @@ #include #include #include +#include "../anal/checkstem.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripquant.proto.h" int is_nomhead(char * heads,char * headkeys); diff --git a/src/gkdict/conj1.l b/src/gkdict/conj1.l index 1afc4fb..362c716 100755 --- a/src/gkdict/conj1.l +++ b/src/gkdict/conj1.l @@ -43,6 +43,7 @@ %% +#include #include char orthstem[BUFSIZ]; diff --git a/src/gkdict/derivio.c b/src/gkdict/derivio.c index a667f7c..32837fa 100755 --- a/src/gkdict/derivio.c +++ b/src/gkdict/derivio.c @@ -1,4 +1,19 @@ +#include +#include +#include #include +#include "../gkdict/derivio.proto.h" +#include "../gkdict/dictio.proto.h" +#include "../gkends/endindex.proto.h" +#include "../gkends/retrends.proto.h" +#include "../greeklib/hasdiaer.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/augment.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/morphkeys.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/setlang.proto.h" #include "derivio.proto.h" static checkforderiv2(char *stemstr, char *stemkeys, char *had_redupl, char *redupstem); @@ -323,7 +338,7 @@ checkmultredups(char *asuffkeys, char *dstem, char *dstemkeys, char *suffix, cha gstr = CreatGkString(1); if( ! gkform ) { fprintf(stderr,"no memory for gkform in checkmultredups of [%s]\n",asuffkeys); - return; + return(0); } set_workword(gkform,dstem); diff --git a/src/gkdict/dictio.c b/src/gkdict/dictio.c index 0d27cad..ba0d55c 100755 --- a/src/gkdict/dictio.c +++ b/src/gkdict/dictio.c @@ -1,6 +1,21 @@ #include #include #include +#include +#include "../gkdict/derivio.proto.h" +#include "../gkends/endindex.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/isblank.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/stripmeta.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/errormess.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/preverb.proto.h" +#include "../morphlib/trimwhite.proto.h" +#include "../morphlib/retrentry.proto.h" #define STEMCACHE 0 FILE * getlemmstart(); endtags * init_preind(), *init_dict(); diff --git a/src/gkdict/indcomps.c b/src/gkdict/indcomps.c index 2a64380..3fe1e8b 100755 --- a/src/gkdict/indcomps.c +++ b/src/gkdict/indcomps.c @@ -1,6 +1,7 @@ #include #include #include +#include "../morphlib/gkstring.proto.h" #include #define MAX_END_TABLE 50000 @@ -20,7 +21,7 @@ main() char * s; char * tailp; - while(gets(line)) { + while(fgets(line, 5000, stdin)) { Gstr = Blnk; if( !strncmp(":le:",line,4) ) strcpy(curlemma,line+4); if( strncmp(":aj:",line,4) && strncmp(":no:",line,4) ) { diff --git a/src/gkdict/indexnoms.main.c b/src/gkdict/indexnoms.main.c index b834bd0..e1c85ca 100755 --- a/src/gkdict/indexnoms.main.c +++ b/src/gkdict/indexnoms.main.c @@ -1,4 +1,7 @@ +#include #include +#include "../gkdict/indexstems.proto.h" +#include "../morphlib/setlang.proto.h" #include "indexnoms.main.proto.h" int verbose = 0; @@ -30,7 +33,7 @@ char * argv[]; index_vbs(3,0,0); */ - index_noms(3,0,0,0); + index_noms(3,0,0); /* index_list(WORDLIST,":le:",5); diff --git a/src/gkdict/indexstems.c b/src/gkdict/indexstems.c index 03b928c..f083b41 100755 --- a/src/gkdict/indexstems.c +++ b/src/gkdict/indexstems.c @@ -1,8 +1,23 @@ #include #include #include - #include +#include "../greeklib/hasaccent.proto.h" +#include "../greeklib/hasdiaer.proto.h" +#include "../greeklib/hasquant.proto.h" +#include "../greeklib/issubstring.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/stripstemsep.proto.h" +#include "../morphlib/errormess.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/indkeys.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/morphstrcmp.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/numovable.proto.h" + #define MAX_END_TABLE 150000 gk_word GkWord; diff --git a/src/gkdict/indexvbs.main.c b/src/gkdict/indexvbs.main.c index 2abb00d..d94f99d 100755 --- a/src/gkdict/indexvbs.main.c +++ b/src/gkdict/indexvbs.main.c @@ -1,4 +1,7 @@ +#include #include +#include "../gkdict/indexstems.proto.h" +#include "../morphlib/setlang.proto.h" #include "indexstems.main.proto.h" int verbose = 0; @@ -23,6 +26,6 @@ char * argv[]; } } - index_vbs(3,0,0,0); + index_vbs(3,0,0); } diff --git a/src/gkdict/latnom.l b/src/gkdict/latnom.l index 75b8341..80952b6 100755 --- a/src/gkdict/latnom.l +++ b/src/gkdict/latnom.l @@ -1,4 +1,8 @@ +%{ +#include "latnom.proto.h" +%} + %% ^[A-Za-z][a-z\^\_\-]+"ter\t"$ dump_adv(); @@ -16,6 +20,7 @@ %% +#include #include #define MAXORTH 12 unsigned char orthtab[MAXORTH][BUFSIZ]; @@ -100,7 +105,7 @@ set_orthalt(int tlen) strcpy(curpat,yytext+tlen); if( !strcmp(curpat,"trisyl.") || ! strcmp(curpat,"dissyl.") - || !strcmp(curpat,"quadrisyl.") ) return; + || !strcmp(curpat,"quadrisyl.") ) return(0); s = strchr(curpat,0); while(s>=curpat&&!isalpha(*s)) s--; @@ -496,7 +501,7 @@ dump_form3(int n) { if( dumped_stem ) { ECHO; - return; + return(0); } @@ -505,7 +510,7 @@ dump_form3(int n) printf(":wd:%s\tadverb\n\n", curstem ); if( orthtab[0][0] ) printf(":wd:%s\tadverb orth\n\n", orthtab[0] ); - return; + return(0); } @@ -527,11 +532,11 @@ trimstem(unsigned char * curs, int trimn) */ if(trimn=='e'&&!strcmp((s-1),"is")) { *(s-1) = 0; - return; + return(0); } if(trimn=='o'&&!strcmp((s-1),"us")) { *(s-1) = 0; - return; + return(0); } while(s>=curs && *s != trimn ) { s--; diff --git a/src/gkdict/latnom.proto.h b/src/gkdict/latnom.proto.h new file mode 100644 index 0000000..c4352b2 --- /dev/null +++ b/src/gkdict/latnom.proto.h @@ -0,0 +1,18 @@ + +/* latnom.c */ +int dump_adv(); +int set_lemma(char *); +int set_orth(int); +int sameend(char *, char *); +int set_orthalt(int ); +int unique_lastc(char *, int, int); +int dump_adj(int, char *, char *, char *); +int dump_nom(int, char *, char *, char *); +int dump_ent(int, char *, char *, char *, char *); +int dump_form(char *); +int is_itype(unsigned char *, unsigned char *); +int dump_form2(int n); +int dump_adj1(int n); +int dump_form3(int n); +int trimstem(unsigned char *, int); +int is_prevborth(char *); diff --git a/src/gkdict/latvb.l b/src/gkdict/latvb.l index 51d5b51..861e44e 100755 --- a/src/gkdict/latvb.l +++ b/src/gkdict/latvb.l @@ -1,4 +1,8 @@ +%{ +#include "latvb.proto.h" +%} + %% ^[A-Za-z\^\_\-]+o[#1-9]* set_lemma(); @@ -10,6 +14,7 @@ %% +#include #include int sawi = 0; @@ -280,21 +285,21 @@ set_orth() if(!strcmp("adf-",yytext) ) { if( ! strncmp(orthstem,"af-f",4) ) { orthstem[1] = 'd'; - return; + return(0); } } if(!strcmp("adl-",yytext) ) { if( ! strncmp(orthstem,"al-l",4) ) { orthstem[1] = 'd'; - return; + return(0); } } if(!strcmp("adn-",yytext) ) { if( ! strncmp(orthstem,"an-n",4) ) { orthstem[1] = 'd'; - return; + return(0); } } @@ -309,10 +314,10 @@ set_orth() orthstem[1] = 'd'; } - return; + return(0); } orthstem[0] = 0; -return; +return(0); while(*t && *t !='<') { diff --git a/src/gkdict/latvb.proto.h b/src/gkdict/latvb.proto.h new file mode 100644 index 0000000..652a75f --- /dev/null +++ b/src/gkdict/latvb.proto.h @@ -0,0 +1,10 @@ + +/* latvb.c */ +int do_itype(); +int is_spectype(); +int set_lemma(); +int doderiv(char *); +int set_orth(); +int doverb(char *); +int do_vstems(char *, int); +int truncstem(char *, int); diff --git a/src/gkdict/newlems.c b/src/gkdict/newlems.c index 8031b96..66d1a4e 100755 --- a/src/gkdict/newlems.c +++ b/src/gkdict/newlems.c @@ -1,5 +1,13 @@ -#include +#include +#include +#include +#include "../gkends/endindex.proto.h" +#include "../greeklib/hasaccent.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripmeta.proto.h" +#include "../morphlib/fixacc.proto.h" +#include "newlems.proto.h" char half1[BUFSIZ]; @@ -10,7 +18,7 @@ main() char curw[BUFSIZ]; char *hp; - while(gets(line)) { + while(fgets(line, BUFSIZ, stdin)) { strcpy(savel,line); hp = strtok(line," \t"); if( ! hp ) continue; diff --git a/src/gkdict/newlems.proto.h b/src/gkdict/newlems.proto.h new file mode 100755 index 0000000..e1521ae --- /dev/null +++ b/src/gkdict/newlems.proto.h @@ -0,0 +1,4 @@ + +/* newlems.c */ +int buildw(char *, char *, char *); +int checkcurw(char* ); diff --git a/src/gkdict/newlems2.c b/src/gkdict/newlems2.c index 048d9d7..c10c899 100755 --- a/src/gkdict/newlems2.c +++ b/src/gkdict/newlems2.c @@ -1,10 +1,13 @@ +#include #include +#include "../greeklib/checkaccent.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/standword.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripmeta.proto.h" + +#include "newlems2.proto.h" -int do_simpnom(char *, char*); -int dump_nom(char *stem,int trunc, char * tags); -int probe_fem(char *); -int do_regnom(char*stem,char*key1,char*key2,char*key3); -int dump_entry(char *stem,int trunc, char * tags,char * etag,FILE *); FILE * fverbs; main() @@ -23,7 +26,7 @@ main() exit(-1); } - while(gets(line)) { + while(fgets(line, BUFSIZ, stdin)) { if( ! line[0]) continue; if( ! isdigit(line[0])) continue; strcpy(savel,line); diff --git a/src/gkdict/newlems2.proto.h b/src/gkdict/newlems2.proto.h new file mode 100755 index 0000000..cb2b7ee --- /dev/null +++ b/src/gkdict/newlems2.proto.h @@ -0,0 +1,15 @@ + +/* newlems2.c */ +int do_simpnom(char *, char*); +int dump_nom(char *, int, char *); +int probe_fem(char *); +int do_regnom(char *, char*, char*, char *); +int dump_entry(char *, int, char *, char *,FILE *); +void circ2long(char *); +int dump_adj(char *, int, char *); +int dump_nom(char *, int, char *); +int dump_entry(char *, int, char *, char *, FILE *); +int is_verb(char *); +int is_adverb(char *, char *); +int dump_acc_nom(char *,int, char *); +int is_teos(char *); diff --git a/src/gkdict/setquant.l b/src/gkdict/setquant.l index 0a683f4..6b29617 100755 --- a/src/gkdict/setquant.l +++ b/src/gkdict/setquant.l @@ -1,4 +1,8 @@ +%{ +#include "setquant.proto.h" +%} + %% diff --git a/src/gkdict/setquant.proto.h b/src/gkdict/setquant.proto.h new file mode 100644 index 0000000..8f4e40c --- /dev/null +++ b/src/gkdict/setquant.proto.h @@ -0,0 +1,7 @@ + +/* setquant.c */ +int set_quant(); +int set_quant2(); +int quantcmp(char *, char *, int); +int is_match(char *, char *, int); +int addquant(char *, int); diff --git a/src/gkdict/splitlat.l b/src/gkdict/splitlat.l index 9b738c7..352ed26 100755 --- a/src/gkdict/splitlat.l +++ b/src/gkdict/splitlat.l @@ -1,4 +1,8 @@ +%{ +#include "splitlat.proto.h" +%} + %% "v. a.\t"[^<]+"" newentr(); diff --git a/src/gkdict/splitlat.proto.h b/src/gkdict/splitlat.proto.h new file mode 100644 index 0000000..bd3a80f --- /dev/null +++ b/src/gkdict/splitlat.proto.h @@ -0,0 +1,4 @@ + +/* splitlat.c */ +int newentr2(); +int newentr(); diff --git a/src/gkdict/splitlems.l b/src/gkdict/splitlems.l index 5c7238f..e78f31a 100755 --- a/src/gkdict/splitlems.l +++ b/src/gkdict/splitlems.l @@ -1,4 +1,8 @@ +%{ +#include "splitlems.proto.h" +%} + %% ^[A-Za-z\^\_\-]+[#1-9]* set_lemma(); diff --git a/src/gkdict/splitlems.proto.h b/src/gkdict/splitlems.proto.h new file mode 100644 index 0000000..01d2dfe --- /dev/null +++ b/src/gkdict/splitlems.proto.h @@ -0,0 +1,5 @@ + +/* splitlems.c */ +int add_lemma(); +int set_lemma(); +int dump_orth(); diff --git a/src/gkends/endindex.proto.h b/src/gkends/endindex.proto.h index 1ed6107..1a96ebe 100755 --- a/src/gkends/endindex.proto.h +++ b/src/gkends/endindex.proto.h @@ -6,3 +6,4 @@ int chckvstem(char *, char *); int chckdvend(char *, char *); endind *init_endind(char *, endind *); int checkendind(endind *, char *, char *, int (*scmp )()); +int chckdictent(char *, char *); From 222f7f8175b832ab5fd99623d1030fe729b34c20 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 5 Jul 2017 17:06:38 +0100 Subject: [PATCH 08/10] Make gener build with LLVM --- src/gener/combconj.c | 24 ++++++++++++++++++++---- src/gener/combconj.proto.h | 10 ++++++++++ src/gener/conjmain.c | 5 ++++- src/gener/conjsys.c | 11 +++++++++-- src/gener/conjsys.proto.h | 14 ++++++++++++++ src/gener/genermain.c | 4 ++++ src/gener/genmisc.c | 1 + src/gener/genmisc.proto.h | 6 ++++++ src/gener/gensynform.c | 29 +++++++++++++++++++++-------- src/gener/gensynform.proto.h | 12 ++++++++++++ src/gener/genwd.c | 24 ++++++++++++++++++------ src/gener/genwd.proto.h | 12 ++++++++++++ src/gener/ppasstype.c | 5 ++++- src/gener/ppasstype.proto.h | 4 ++++ src/gener/stypemain.c | 3 ++- src/greeklib/standalpha.proto.h | 3 +++ 16 files changed, 144 insertions(+), 23 deletions(-) create mode 100644 src/gener/combconj.proto.h create mode 100644 src/gener/conjsys.proto.h create mode 100644 src/gener/genmisc.proto.h create mode 100644 src/gener/gensynform.proto.h create mode 100644 src/gener/genwd.proto.h create mode 100644 src/gener/ppasstype.proto.h create mode 100755 src/greeklib/standalpha.proto.h diff --git a/src/gener/combconj.c b/src/gener/combconj.c index caaa719..ee1e588 100755 --- a/src/gener/combconj.c +++ b/src/gener/combconj.c @@ -1,4 +1,20 @@ #include +#include "../gkends/retrends.proto.h" +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/do_dissim.proto.h" +#include "../greeklib/isdiphth.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/augment.proto.h" +#include "../morphlib/addninfix.proto.h" +#include "../morphlib/conjstem.proto.h" +#include "../morphlib/endio.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/pres_redup.proto.h" +#include "ppasstype.proto.h" +#include "combconj.proto.h" static char origformula[LONGSTRING]; static char curlemma[LONGSTRING]; @@ -226,7 +242,7 @@ printf("pflag %o stype %o vstem %o\n", ppartflag , stemtype_of(gstr2) , PPARTMAS printf("str1 [%s] str2 [%s] rval %d\n", gkstring_of(gstr1), gkstring_of(gstr2), rval ); */ if( rval ) { - Dialect d, AndDialect(); + Dialect d; char *getaccp(); strcpy(word,stemstr); @@ -393,7 +409,7 @@ char *s; { if( ! foddfile ) { foddfile = fopen("oddfile","w"); - if( ! foddfile) return; + if( ! foddfile) return(1); } fprintf(foddfile,"%s\t%s\n", curlemma , s ); } @@ -408,7 +424,7 @@ char * oddptr; char curbuf[BUFSIZ*4]; char curformula[BUFSIZ*4]; char * s; -return; +return(0); strcpy(curformula,origformula); curbuf[0] = 0; @@ -472,7 +488,7 @@ conjoinX(gk_string *gstr,char * s1,char * s2) if( ! newgstr ) { /*fprintf(stderr,"no contracts for [%s]\n", gkstring_of(gstr) );*/ - return; + return(0); } /* diff --git a/src/gener/combconj.proto.h b/src/gener/combconj.proto.h new file mode 100644 index 0000000..3c57573 --- /dev/null +++ b/src/gener/combconj.proto.h @@ -0,0 +1,10 @@ + +/* combconj.c */ +int combine_conj(FILE *, char *, char *, char *, char *, char *, char *); +int DoConjStem(FILE *, char *, gk_string *, char *,Stemtype, char *, char *, char *); +Stemtype ConjGkstr(gk_string *, char *, char *, char *, char *, char *); +int CheckConjPpart(FILE *, char *, gk_string *, gk_string *, char *, char *, char *); +int add_oddstuff(char *); +int DataBaseFormat(char *, gk_string *, char *, char *, char *); +int MatchSuff(char *, char *); +int conjoinX(gk_string *, char *, char *); diff --git a/src/gener/conjmain.c b/src/gener/conjmain.c index 7ea9549..f665fe2 100755 --- a/src/gener/conjmain.c +++ b/src/gener/conjmain.c @@ -1,5 +1,8 @@ #include +#include #include +#include "conjsys.proto.h" +#include "../morphlib/setlang.proto.h" main(argc,argv) @@ -42,7 +45,7 @@ char * argv[]; strcpy(filename,"conjfile"); if( (f=fopen(filename,"r")) == NULL ) { fprintf(stdout,"Filename?\n" ); - gets(filename); + fgets(filename, 80, stdin); if( (f=fopen(filename,"r")) == NULL ) { fprintf(stderr,"Could not open [%s]\n", filename ); exit(-1); diff --git a/src/gener/conjsys.c b/src/gener/conjsys.c index 2204eb7..f30357a 100755 --- a/src/gener/conjsys.c +++ b/src/gener/conjsys.c @@ -1,5 +1,12 @@ #include #include +#include "../gkends/retrends.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "combconj.proto.h" +#include "conjsys.proto.h" /* #define FULLKEYS "pr fu ao pf pp ap"*/ #define DEFPPARTS 1 char *fullkeys[] = { @@ -87,7 +94,7 @@ int conjmode; if( ! strncmp(":de:",linebuf,4) ) { if( ! npparts && wantpparts && (irreg_conj() || fullconj)) { - show_defvals(fout,fullconj ? DEFPPARTS : 1 ); + show_defvals(fout); fprintf(fout,"\n"); } npparts = 0; @@ -226,7 +233,7 @@ printf("rval %d stembuf [%s] global [%s] deriv [%s] tk [%s]\n", rval, } if( ! npparts && wantpparts && (irreg_conj() || fullconj ) ) - show_defvals(fout,fullconj ? DEFPPARTS : 1 ); + show_defvals(fout); } diff --git a/src/gener/conjsys.proto.h b/src/gener/conjsys.proto.h new file mode 100644 index 0000000..763dd39 --- /dev/null +++ b/src/gener/conjsys.proto.h @@ -0,0 +1,14 @@ + +/* conjsys.c */ +int GenConjForms(FILE *, FILE *, int); +int show_defvals(FILE *); +int set_newlemma(char *); +int noppart(char *); +int is_empty(char *); +int has_pref(char *, char *); +int need_ppart(char *); +int check_vsdupl(char *, FILE *); +int need_codupl(char *); +int regular_entry(char *); +int has_alpha(char *); +int irreg_conj(); diff --git a/src/gener/genermain.c b/src/gener/genermain.c index 22edb66..c92968f 100755 --- a/src/gener/genermain.c +++ b/src/gener/genermain.c @@ -1,4 +1,8 @@ #include +#include +#include +#include "../greeklib/Fclose.proto.h" +#include "gensynform.proto.h" int quickflag = 0; main(argc,argv) diff --git a/src/gener/genmisc.c b/src/gener/genmisc.c index 3257e1d..71030ae 100755 --- a/src/gener/genmisc.c +++ b/src/gener/genmisc.c @@ -1,4 +1,5 @@ #include +#include "../greeklib/xstrings.proto.h" set_baseentry(source,baseentry,n) char * source; diff --git a/src/gener/genmisc.proto.h b/src/gener/genmisc.proto.h new file mode 100644 index 0000000..3565d47 --- /dev/null +++ b/src/gener/genmisc.proto.h @@ -0,0 +1,6 @@ + +/* genmisc.c */ +int set_baseentry(char *, char *, int); +int clear_globs(char *); +int SawBadForm(char *, char *, char *); +int ShowOddKeys(char *, char *); diff --git a/src/gener/gensynform.c b/src/gener/gensynform.c index 8c1af4b..1717eff 100755 --- a/src/gener/gensynform.c +++ b/src/gener/gensynform.c @@ -1,4 +1,17 @@ #include +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/isblank.proto.h" +#include "../greeklib/standalpha.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/stripmeta.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/beta2smarta.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/morphkeys.proto.h" +#include "genmisc.proto.h" +#include "gensynform.proto.h" #define NextStem(f,stem,stemkeys) NextDictLine(f,stem,stemkeys,":") #define NextLemma(f,lemma,lemmakeys) NextDictLine(f,lemma,lemmakeys,":le:") @@ -275,7 +288,7 @@ char * keys; gstr = CreatGkString(1); if( ! gstr ) { fprintf(stderr,"no memory for gstr in paradigm keys\n"); - return; + return(1); } avoidgstr = CreatGkString(1); @@ -283,7 +296,7 @@ char * keys; FreeGkString(gstr); gstr = NULL; fprintf(stderr,"no memory for avoidgstr in paradigm keys\n"); - return; + return(1); } dummyword = CreatGkword(1); @@ -292,7 +305,7 @@ char * keys; FreeGkString(gstr); gstr = avoidgstr = NULL; fprintf(stderr,"no memory for dummyword in paradigm keys\n"); - return; + return(1); } @@ -453,7 +466,7 @@ PrntSynForms(Gkword,gkform,fout) printf("formcnt=%d\n", formcnt); */ - if( ! gkform ) return; + if( ! gkform ) return(1); /* fprintf(stderr,"formcnt:%d\n", formcnt ); @@ -481,7 +494,7 @@ printf("formcnt=%d\n", formcnt); if( strcmp(tmp2,tmplem) && !is_exception(tmp2,tmplem) ) fprintf(fout,":st:%s %s\n", tmp, lemma_of(Gkword)); } - return; + return(0); } if( print_mode == FULL_DUMP ) { for(i=0;i #include #include +#include "../greeklib/isblank.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripacute.proto.h" +#include "../greeklib/stripmeta.proto.h" +#include "../greeklib/stripstemsep.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/augment.proto.h" +#include "../morphlib/errormess.proto.h" +#include "../morphlib/fixacc.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/preverb.proto.h" +#include "genwd.proto.h" #define SKIPLINE 100 -static AddWdEndings( gk_word * , gk_string * , gk_word * , int ); #define NextStem(f,stem,stemkeys) NextDictLine(f,stem,stemkeys,":") #define NextLemma(f,lemma,lemmakeys) NextDictLine(f,lemma,lemmakeys,":le:") @@ -12,7 +26,6 @@ gk_string * chckendings(); gk_word * GenStemForms(gk_word *, char *, int); gk_word * GenIrregForm(gk_word *, char *, int); -Dialect AndDialect(); int CompGkForms(gk_word *gkform1, gk_word *gkform2); gk_string BlankGstr; @@ -42,7 +55,7 @@ GenDictEntry(Gkword,dentry) /*printf("endstring: [%s] keys:%s\n", endstring_of(&TmpGkword), keys );*/ gkforms = GenStemForms(&TmpGkword,keys,0); - if( ! gkforms ) return; + if( ! gkforms ) return(0); for(formcnt=0;workword_of((gkforms+formcnt))[0];formcnt++) ; @@ -71,7 +84,7 @@ GenDictEntry(Gkword,dentry) Gkword = CreatGkword(1 ); if( ! Gkword ) { fprintf(stderr,"could not allocate memory for Gkword in GenNxtWord\n"); - return; + return(1); } for(;;) { @@ -381,7 +394,6 @@ gk_word * } #define MAX_FORM_VARIANTS 12 -static AddWdEndings(Gkword,Endings,Forms,maxforms) gk_word * Gkword; gk_string * Endings; @@ -398,7 +410,7 @@ static CurBuf = CreatGkword(MAX_FORM_VARIANTS+1); if( ! CurBuf) { fprintf(stderr,"no memory for CurBuf in AddWdEndings: raww [%s]\n", rawword_of(Gkword) ); - return; + return(0); } SaveGkWord = * Gkword; diff --git a/src/gener/genwd.proto.h b/src/gener/genwd.proto.h new file mode 100644 index 0000000..1958970 --- /dev/null +++ b/src/gener/genwd.proto.h @@ -0,0 +1,12 @@ + +/* genwd.c */ +int GenDictEntry(gk_word *, char *); +int GenNxtWord(FILE *, int, FILE *); +gk_word * GenStemForms(gk_word *, char *, int); +gk_word * GenIrregForm(gk_word *, char *, int); +int NextDictLine(FILE *, char *, char *, char *); +int AddWdEndings(gk_word *, gk_string *, gk_word *, int); +int BuildAWord(gk_word *, gk_string *, gk_word *); +int BuildANoun(gk_word *, gk_string *, gk_word *); +int BuildAVerb(gk_word *, gk_string *, gk_word *); +int MonoSyllVb(gk_word *, word_form, char *); diff --git a/src/gener/ppasstype.c b/src/gener/ppasstype.c index 0cd4d6b..5a0170d 100755 --- a/src/gener/ppasstype.c +++ b/src/gener/ppasstype.c @@ -1,4 +1,7 @@ #include +#include "../greeklib/endsinstr.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "ppasstype.proto.h" gk_string * ppass_table = NULL; static int nppass = 0; @@ -12,7 +15,7 @@ gk_string * gstr; Stemtype GetStemNum(); - if( ! get_ppasstype(origstem,newstem,stemname) ) return; + if( ! get_ppasstype(origstem,newstem,stemname) ) return(0); strcpy(origstem,newstem); set_stemtype(gstr,GetStemNum(stemname)); } diff --git a/src/gener/ppasstype.proto.h b/src/gener/ppasstype.proto.h new file mode 100644 index 0000000..b042882 --- /dev/null +++ b/src/gener/ppasstype.proto.h @@ -0,0 +1,4 @@ + +/* ppasstype.c */ +int makeppass(char *, gk_string *); +int get_ppasstype(char *, char *, char *); diff --git a/src/gener/stypemain.c b/src/gener/stypemain.c index 558bfc0..baa5f05 100755 --- a/src/gener/stypemain.c +++ b/src/gener/stypemain.c @@ -1,3 +1,4 @@ +#include #include gk_word GkWord, BlankGkWord; @@ -8,7 +9,7 @@ main() char curlemma[LONGSTRING]; char *s; - while(gets(line)) { + while(fgets(line, 2000, stdin)) { if( !strncmp(":le:",line,4)) { strcpy(curlemma,line+4); continue; diff --git a/src/greeklib/standalpha.proto.h b/src/greeklib/standalpha.proto.h new file mode 100755 index 0000000..f44a3f6 --- /dev/null +++ b/src/greeklib/standalpha.proto.h @@ -0,0 +1,3 @@ + +/* standalpha.c */ +int standalpha(char *); From 0da1bf754b86b8c8b7fa76def57744b969e2cee1 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 6 Jul 2017 09:08:10 +0100 Subject: [PATCH 09/10] Make anal/ build with LLVM This should be everything buildable, I believe, so next job is to test the output. --- src/anal/checkcrasis.c | 4 ++++ src/anal/checkdict.c | 8 ++++++++ src/anal/checkgenwds.c | 17 +++++++++++++++++ src/anal/checkgenwds.proto.h | 2 ++ src/anal/checkhalf1.c | 14 ++++++++++++++ src/anal/checkindecl.c | 6 ++++++ src/anal/checkirreg.c | 18 ++++++++++++++++++ src/anal/checknom.c | 11 +++++++++++ src/anal/checkstem.c | 8 ++++++++ src/anal/checkstem.proto.h | 1 + src/anal/checkstring.c | 22 ++++++++++++++++++++++ src/anal/checkstring.proto.h | 2 ++ src/anal/checkverb.c | 7 +++++++ src/anal/checkword.c | 4 ++++ src/anal/deverb.c | 18 +++++++++++++++++- src/anal/deverb.proto.h | 12 ++++++++++++ src/anal/dictstems.c | 7 +++++++ src/anal/findbase.c | 10 +++++++++- src/anal/findbase.proto.h | 4 ++++ src/anal/prntanal.c | 13 ++++++++++--- src/anal/propname.c | 22 ++++++++++++++++++---- src/anal/prvb.c | 4 ++++ src/anal/stdiomorph.c | 9 +++++++++ src/gkdict/compnoun.proto.h | 5 +++++ src/gkends/endindex.proto.h | 2 ++ src/greeklib/standword.proto.h | 1 + src/morphlib/preverb3.proto.h | 1 + src/morphlib/sprntGkflags.h | 1 + 28 files changed, 224 insertions(+), 9 deletions(-) create mode 100644 src/anal/deverb.proto.h create mode 100644 src/anal/findbase.proto.h create mode 100644 src/gkdict/compnoun.proto.h diff --git a/src/anal/checkcrasis.c b/src/anal/checkcrasis.c index 0cf9e9b..4d4b401 100755 --- a/src/anal/checkcrasis.c +++ b/src/anal/checkcrasis.c @@ -1,4 +1,8 @@ #include +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/setlang.proto.h" +#include "checkstring.proto.h" #define MAXCRASIS 12 #include "checkcrasis.proto.h" diff --git a/src/anal/checkdict.c b/src/anal/checkdict.c index ae399ce..9140857 100755 --- a/src/anal/checkdict.c +++ b/src/anal/checkdict.c @@ -1,5 +1,13 @@ #include #include +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/subchar.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/is_thirdmono.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "checkgenwds.proto.h" #define MAXPPARTS 12 #include "checkdict.proto.h" diff --git a/src/anal/checkgenwds.c b/src/anal/checkgenwds.c index b9147a8..e786f61 100755 --- a/src/anal/checkgenwds.c +++ b/src/anal/checkgenwds.c @@ -1,4 +1,21 @@ +#include #include +#include "../gkends/endindex.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/standword.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripacute.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/stripmeta.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../greeklib/zap2ndbreath.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/morphstrcmp.proto.h" +#include "../morphlib/setlang.proto.h" +#include "docrasis.proto.h" +#include "prntanal.proto.h" #include "checkgenwds.proto.h" diff --git a/src/anal/checkgenwds.proto.h b/src/anal/checkgenwds.proto.h index 436a01f..311e990 100755 --- a/src/anal/checkgenwds.proto.h +++ b/src/anal/checkgenwds.proto.h @@ -1,5 +1,7 @@ /* checkgenwds.c */ +int show_totanals(); +int show_totlems(); int CheckGenWords(gk_word *, gk_word *); int AddAnalysis(gk_word *, gk_word *); int merge_anal_dialects(gk_analysis *, gk_analysis *); diff --git a/src/anal/checkhalf1.c b/src/anal/checkhalf1.c index 3b63f32..8ab6e1f 100755 --- a/src/anal/checkhalf1.c +++ b/src/anal/checkhalf1.c @@ -1,4 +1,18 @@ #include +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/isdiphth.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/setlang.proto.h" +#include "checkdict.proto.h" +#include "checkstem.proto.h" +#include "checkstring.proto.h" #define MAX_POSS_STEMS 10 #include "checkhalf1.proto.h" diff --git a/src/anal/checkindecl.c b/src/anal/checkindecl.c index b0000dd..f7238ec 100755 --- a/src/anal/checkindecl.c +++ b/src/anal/checkindecl.c @@ -1,5 +1,11 @@ +#include +#include #include #include +#include "../gkdict/dictio.proto.h" +#include "../greeklib/subchar.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "checkgenwds.proto.h" #define MAXSTEMS 10 #include "checkindecl.proto.h" diff --git a/src/anal/checkirreg.c b/src/anal/checkirreg.c index fb00c98..285f05a 100755 --- a/src/anal/checkirreg.c +++ b/src/anal/checkirreg.c @@ -1,4 +1,22 @@ +#include #include +#include +#include "../gkdict/dictio.proto.h" +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/subchar.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/preverb2.proto.h" +#include "../morphlib/setlang.proto.h" +#include "checkgenwds.proto.h" +#include "checkirreg.proto.h" #define MAXIRREGS 10 #define MAXIRR 3 diff --git a/src/anal/checknom.c b/src/anal/checknom.c index 890d8f4..da566eb 100755 --- a/src/anal/checknom.c +++ b/src/anal/checknom.c @@ -1,5 +1,16 @@ #include +#include #include +#include +#include +#include "../gkdict/compnoun.proto.h" +#include "../gkdict/dictio.proto.h" +#include "../gkends/endindex.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "checkhalf1.proto.h" +#include "checkstem.proto.h" #include "checknom.proto.h" static gotnom(gk_word *); diff --git a/src/anal/checkstem.c b/src/anal/checkstem.c index 9dcea00..fdc9cf5 100755 --- a/src/anal/checkstem.c +++ b/src/anal/checkstem.c @@ -1,4 +1,12 @@ +#include +#include #include +#include +#include "../gkdict/dictio.proto.h" +#include "../greeklib/Fclose.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/augment.proto.h" #define MAXAUGSTEMS 12 #include "checkstem.proto.h" diff --git a/src/anal/checkstem.proto.h b/src/anal/checkstem.proto.h index ebefb04..02e5f5f 100755 --- a/src/anal/checkstem.proto.h +++ b/src/anal/checkstem.proto.h @@ -5,3 +5,4 @@ int stemexists(char *, char *, char *, int); int setstemvars(char *, char *, char *, char *, char *); char *parsefield(char *, char *, int, int); int comstemtypes(char *, char *, char *); +int longeststem(char *); diff --git a/src/anal/checkstring.c b/src/anal/checkstring.c index d90ea11..2022247 100755 --- a/src/anal/checkstring.c +++ b/src/anal/checkstring.c @@ -1,4 +1,26 @@ #include +#include +#include "../gkends/endindex.proto.h" +#include "../greeklib/beta_tolower.proto.h" +#include "../greeklib/checkaccent.proto.h" +#include "../greeklib/hasaccent.proto.h" +#include "../greeklib/naccents.proto.h" +#include "../greeklib/nsylls.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/cmpend.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/preverb3.proto.h" +#include "../morphlib/setlang.proto.h" +#include "checkcrasis.proto.h" +#include "checkindecl.proto.h" +#include "checkirreg.proto.h" +#include "checknom.proto.h" +#include "checkword.proto.h" +#include "prntanal.proto.h" + #include "checkstring.proto.h" static checkstring4(gk_word *); static add_apostrvowel(char *, char *, char *); diff --git a/src/anal/checkstring.proto.h b/src/anal/checkstring.proto.h index 2494762..90485da 100755 --- a/src/anal/checkstring.proto.h +++ b/src/anal/checkstring.proto.h @@ -12,3 +12,5 @@ int AddWantDialect(Dialect); int ZapWantDialect(Dialect); Dialect GetWantDialect(void); int updateDialect(Dialect); +int cntlems(gk_word *); +int u2v(char *); diff --git a/src/anal/checkverb.c b/src/anal/checkverb.c index 9923648..6f72041 100755 --- a/src/anal/checkverb.c +++ b/src/anal/checkverb.c @@ -1,5 +1,12 @@ #include #include +#include +#include "../gkends/endindex.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "checkirreg.proto.h" +#include "prvb.proto.h" #include "checkverb.proto.h" diff --git a/src/anal/checkword.c b/src/anal/checkword.c index fe3849e..95ea374 100755 --- a/src/anal/checkword.c +++ b/src/anal/checkword.c @@ -1,4 +1,8 @@ #include +#include "../morphlib/morphflags.proto.h" +#include "checkindecl.proto.h" +#include "checknom.proto.h" +#include "checkverb.proto.h" #include "checkword.proto.h" diff --git a/src/anal/deverb.c b/src/anal/deverb.c index c524816..66e0a29 100755 --- a/src/anal/deverb.c +++ b/src/anal/deverb.c @@ -1,4 +1,20 @@ +#include +#include +#include +#include #include +#include "../gkdict/derivio.proto.h" +#include "../gkdict/dictio.proto.h" +#include "../gkends/endindex.proto.h" +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/stripstemsep.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/preverb2.proto.h" +#include "../morphlib/setlang.proto.h" +#include "deverb.proto.h" int quickflag = 0; int comstemtypes1(char *,char *, char *, char *); int comstemtypes(char *, char *, char *); @@ -23,7 +39,7 @@ main() char reskeys[BUFSIZ]; int rval; - while(gets(line)) { + while(fgets(line, BUFSIZ, stdin)) { transkeys[0] = keys[0] = reskeys[0] = 0; strcpy(tmp,line); s = line; diff --git a/src/anal/deverb.proto.h b/src/anal/deverb.proto.h new file mode 100644 index 0000000..2a73447 --- /dev/null +++ b/src/anal/deverb.proto.h @@ -0,0 +1,12 @@ + +/* deverb.c */ +int comstemtypes1(char *,char *, char *, char *); +int comstemtypes(char *, char *, char *); +int testcmpstem(char *, char *, char *, char *,char *); +int testcmpstem2(char *, char *, char *, char *, char *); +int testcmpstem3(char *, char *, char *, char *, char *); +int checkvcomp(char *, char *, char *, char *); +int chcknstem(char *, char *); +int comNomstemtypes(char *, char *, char *, char *); +int firstkey(char *); +int zaptabs(char *); diff --git a/src/anal/dictstems.c b/src/anal/dictstems.c index 7f6b637..582e6a6 100755 --- a/src/anal/dictstems.c +++ b/src/anal/dictstems.c @@ -1,5 +1,12 @@ #include #include +#include "../greeklib/isblank.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripquant.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/morphstrcmp.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../greeklib/Fclose.proto.h" #include "dictstems.proto.h" diff --git a/src/anal/findbase.c b/src/anal/findbase.c index f37051b..24736d6 100755 --- a/src/anal/findbase.c +++ b/src/anal/findbase.c @@ -1,4 +1,12 @@ +#include +#include +#include #include +#include "../gkdict/dictio.proto.h" +#include "../greeklib/issubstring.proto.h" +#include "../greeklib/stripmeta.proto.h" + +#include "findbase.proto.h" int quickflag = 0; @@ -6,7 +14,7 @@ main() { char line[BUFSIZ*10]; - while(gets(line)) { + while(fgets(line, BUFSIZ*10, stdin)) { strcpy(line,line+4); if( is_substring("ew_",line) || is_substring("aw_",line)) { check_ew(line); diff --git a/src/anal/findbase.proto.h b/src/anal/findbase.proto.h new file mode 100644 index 0000000..e191e15 --- /dev/null +++ b/src/anal/findbase.proto.h @@ -0,0 +1,4 @@ + +/* findbase.c */ +int check_ew(char *); +int check_ih(char *); diff --git a/src/anal/prntanal.c b/src/anal/prntanal.c index 61de3fc..50882ee 100755 --- a/src/anal/prntanal.c +++ b/src/anal/prntanal.c @@ -1,4 +1,11 @@ #include +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/beta2smarta.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphkeys.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/setlang.proto.h" +#include "../morphlib/sprntGkflags.h" static char * pbuf = NULL; #define NEWLINE "\r" @@ -468,7 +475,7 @@ DumpOneAnalysis(gk_word *Gkword, PrntFlags prntflags, gk_analysis *anal, FILE *f } */ fprintf(fout,"\n"); - return; + return(0); } if( prntflags & DBASEFORMAT ) { char tmp[BUFSIZ]; @@ -505,7 +512,7 @@ DumpOneAnalysis(gk_word *Gkword, PrntFlags prntflags, gk_analysis *anal, FILE *f fprintf(fout,"%s\t%s\n", gkstring_of(ends_gstr_of(anal)),tmp ); tmp[0] = 0; - return; + return(0); fprintf(fout,"%s\t", lemma_of(anal) ); fprintf(fout,"%s\t", rawword_of(anal) ); @@ -533,7 +540,7 @@ DumpOneAnalysis(gk_word *Gkword, PrntFlags prntflags, gk_analysis *anal, FILE *f DumpDbGkString(ends_gstr_of(anal),fout); } fprintf(fout,"\n"); - return; + return(0); } /* diff --git a/src/anal/propname.c b/src/anal/propname.c index aec8de5..de5c1d5 100755 --- a/src/anal/propname.c +++ b/src/anal/propname.c @@ -1,4 +1,18 @@ +#include +#include #include +#include "../gkends/endindex.proto.h" +#include "../greeklib/getbreath.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../greeklib/stripacc.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../greeklib/stripdiaer.proto.h" +#include "../greeklib/subchar.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/nextkey.proto.h" +#include "../morphlib/trimwhite.proto.h" +#include "checkdict.proto.h" +#include "checkstring.proto.h" #include "propname.proto.h" int quickflag = 0; @@ -22,7 +36,7 @@ main(void) fname[0] = 0; fprintf(stderr,"use stdout? "); - gets(line); + fgets(line, BUFSIZ*4, stdin); if(line[0] == 'y' ) { fprintf(stderr,"type in forms\n"); @@ -30,7 +44,7 @@ main(void) finput = stdin; } else { fprintf(stderr,"word file? "); - gets(fname); + fgets(fname, BUFSIZ, stdin); strcpy(inpname,fname); strcat(inpname,".words"); @@ -59,7 +73,7 @@ main(void) if( ! fname[0] ) { printf("basename? "); - gets(fname); + fgets(fname, BUFSIZ, stdin); } strcpy(tmp,fname); strcat(tmp,".enames"); @@ -431,7 +445,7 @@ init_pnametab() char line[BUFSIZ]; int i = 0; - if( pnames ) return; + if( pnames ) return(0); for(pnames=0;pnames<10000;pnames++) { if( ! fgets(line,sizeof line,fpnames) ) { if( pnames == 1 ) pnames = 0; diff --git a/src/anal/prvb.c b/src/anal/prvb.c index c27a36c..b5070a3 100755 --- a/src/anal/prvb.c +++ b/src/anal/prvb.c @@ -1,5 +1,9 @@ #include #include +#include "checkhalf1.proto.h" +#include "../morphlib/gkstring.proto.h" +#include "../morphlib/morphflags.proto.h" +#include "../morphlib/preverb2.proto.h" #include "prvb.proto.h" diff --git a/src/anal/stdiomorph.c b/src/anal/stdiomorph.c index a2252ac..80e5070 100755 --- a/src/anal/stdiomorph.c +++ b/src/anal/stdiomorph.c @@ -1,8 +1,17 @@ #include +#include #include #include #include #include +#include +#include "../greeklib/addbreath.proto.h" +#include "../greeklib/stripbreath.proto.h" +#include "../greeklib/xstrings.proto.h" +#include "../morphlib/setlang.proto.h" +#include "../morphlib/trimwhite.proto.h" +#include "checkgenwds.proto.h" +#include "checkstring.proto.h" #include "stdiomorph.proto.h" #ifndef CLOCKS_PER_SEC #define CLOCKS_PER_SEC 1000000 /* ANSI C clock ticks per sec */ diff --git a/src/gkdict/compnoun.proto.h b/src/gkdict/compnoun.proto.h new file mode 100644 index 0000000..3aba9ba --- /dev/null +++ b/src/gkdict/compnoun.proto.h @@ -0,0 +1,5 @@ + +/* compnoun.c */ +int is_nomhead(char *, char *); +int checkforcompnoun(char *, char *, char *); +int setup_headtab(); diff --git a/src/gkends/endindex.proto.h b/src/gkends/endindex.proto.h index 1a96ebe..64c802d 100755 --- a/src/gkends/endindex.proto.h +++ b/src/gkends/endindex.proto.h @@ -7,3 +7,5 @@ int chckdvend(char *, char *); endind *init_endind(char *, endind *); int checkendind(endind *, char *, char *, int (*scmp )()); int chckdictent(char *, char *); +int chckcmpvb(char *, char *); +int chckend(char *); diff --git a/src/greeklib/standword.proto.h b/src/greeklib/standword.proto.h index 50cd02c..bbe48dd 100755 --- a/src/greeklib/standword.proto.h +++ b/src/greeklib/standword.proto.h @@ -2,3 +2,4 @@ /* standword.c */ int standword(char *); int striphyph(char *); +int zap2acc(char *); diff --git a/src/morphlib/preverb3.proto.h b/src/morphlib/preverb3.proto.h index d29929f..2f9a329 100755 --- a/src/morphlib/preverb3.proto.h +++ b/src/morphlib/preverb3.proto.h @@ -2,3 +2,4 @@ /* preverb3.c */ int nextpreverb(char *, char *, char *, gk_string *); int has_rawpreverb(char *, gk_string *); +int is_rawpreverb(char *); diff --git a/src/morphlib/sprntGkflags.h b/src/morphlib/sprntGkflags.h index bf9e239..15992af 100755 --- a/src/morphlib/sprntGkflags.h +++ b/src/morphlib/sprntGkflags.h @@ -1,3 +1,4 @@ /* xsprintGKflags.c */ int JakeSprintGkFlags(gk_string *, char *, char *, int, int); +int GregSprintGkFlags(gk_string *, char *, char *, int, int); From e9e05b80ebfab1adc557727280a31ca0e53cc4ba Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 11 Jul 2017 13:11:35 +0100 Subject: [PATCH 10/10] Fix getsyll calls in morphlib --- src/morphlib/fixacc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/morphlib/fixacc.c b/src/morphlib/fixacc.c index 907b850..1407044 100755 --- a/src/morphlib/fixacc.c +++ b/src/morphlib/fixacc.c @@ -54,7 +54,7 @@ FixRecAcc(gk_word *gkform, MorphFlags *mflags, char *word) if (Is_accent(*p)) return(0); - if (getsyll(word,ULTIMA,0) == P_ERR) + if (getsyll(word,ULTIMA) == P_ERR) return(0); /* avoid core dumps */ /* @@ -64,10 +64,10 @@ FixRecAcc(gk_word *gkform, MorphFlags *mflags, char *word) if (getquantity(word,ULTIMA,NULL_P, YES,NO) == LONG) { - p = getsyll(word,PENULT,0); + p = getsyll(word,PENULT); if (p == P_ERR ) { - p = getsyll(word,ULTIMA,0); + p = getsyll(word,ULTIMA); if( Accent_optional(mflags) ) return(0); @@ -80,15 +80,15 @@ FixRecAcc(gk_word *gkform, MorphFlags *mflags, char *word) addaccent(word,ACUTE,p); } } else { /* short ultima */ - p = getsyll(word,ANTEPENULT,0); + p = getsyll(word,ANTEPENULT); if (p != P_ERR && ! penult_form(ends_gstr_of(gkform),form_info)) addaccent(word,ACUTE,p); else { /* no antepenult */ if( Accent_optional(mflags) ) return(0); - p = getsyll(word,PENULT,0); + p = getsyll(word,PENULT); if (p == P_ERR) - p = getsyll(word,ULTIMA,0); + p = getsyll(word,ULTIMA); /* * note that proclitics are indeclinable, so we don't deal with accenting them @@ -200,7 +200,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e Xstrncat(word,endstring,MAXWORDSIZE); return(0); } - ep = getsyll(endstring,ULTIMA,0); + ep = getsyll(endstring,ULTIMA); if( is_diphth(ep,endstring)) { ep--; } @@ -239,7 +239,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e Xstrncpy(tmp,stem,MAXWORDSIZE); Xstrncat(tmp,endstring,MAXWORDSIZE); - p = getsyll2(tmp,ULTIMA,0); + p = getsyll2(tmp,ULTIMA); if( p != P_ERR ) { fixnacc2(p,gstring,form_info,is_ending,is_oblique); @@ -259,7 +259,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e else if( penult_form(stemgstr,form_info) || has_morphflag(morphflags_of(gstring),STEM_ACC) || nsylls(stem) == 1 ) { - p = getsyll(workstem,ULTIMA,0); + p = getsyll(workstem,ULTIMA); if( nsylls(endstring) == 1 && /* * "poli-t + ai" becomes "poli=tai" @@ -302,7 +302,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e * :no:ai)gonu c_xos ant_acc masc fem */ else if( antepen_form(stemgstr,form_info) ) { - p = getsyll(workstem,PENULT,0); + p = getsyll(workstem,PENULT); if( nsylls(endstring) == 0 && (getquantity(workstem,PENULT,NULL_P,NO,is_oblique)==LONG) && @@ -317,7 +317,7 @@ FixPersAcc2(gk_string *gstring, MorphFlags *mflags, gk_string *stemgstr, char *e * diwru + xwn --> diwru/xwn * diwru + xessi --> diwru/xessi */ - p = getsyll(workstem,ULTIMA,0); + p = getsyll(workstem,ULTIMA); addaccent(workstem,ACUTE,p); } else /* @@ -373,12 +373,12 @@ fixnacc2(char *targstring, gk_string *gstring, word_form form_info, int is_endin if (getquantity(targstring,ULTIMA,NULL_P,is_ending,is_oblique) == LONG|| ((nsylls(targstring) ==1 ) && (is_ending&&is_contr))) { - p = getsyll(targstring,PENULT,is_ending); + p = getsyll(targstring,PENULT); if (p == P_ERR) { if( Accent_optional(mflags) ) { return(0); } - p = getsyll(targstring,ULTIMA,is_ending); + p = getsyll(targstring,ULTIMA); if( ulttakescirc(gstring,form_info) ) { addaccent(targstring,CIRCUMFLEX,p); } else { @@ -388,16 +388,16 @@ fixnacc2(char *targstring, gk_string *gstring, word_form form_info, int is_endin addaccent(targstring,ACUTE,p); } } else { /* short ultima */ - p = getsyll(targstring,ANTEPENULT,is_ending); + p = getsyll(targstring,ANTEPENULT); if (p != P_ERR) /* if it has an antepenult */ addaccent(targstring,ACUTE,p); else { /* no antepenult */ if( Accent_optional(mflags) ) { return(0); } - p = getsyll(targstring,PENULT,is_ending); + p = getsyll(targstring,PENULT); if (p == P_ERR) - p = getsyll(targstring,ULTIMA,is_ending); + p = getsyll(targstring,ULTIMA); if (getquantity(targstring,PENULT,NULL_P,is_ending,is_oblique&&!is_contr) == LONG && ! Is_enclitic(mflags) ) { addaccent(targstring,CIRCUMFLEX,p); } else { /* short penult or none at all */