aboutsummaryrefslogtreecommitdiff
path: root/src/ellinika
diff options
context:
space:
mode:
Diffstat (limited to 'src/ellinika')
-rw-r--r--src/ellinika/Makefile.am3
-rw-r--r--src/ellinika/elmorph.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ellinika/Makefile.am b/src/ellinika/Makefile.am
index 5f476ef..99a2918 100644
--- a/src/ellinika/Makefile.am
+++ b/src/ellinika/Makefile.am
@@ -73,6 +73,9 @@ DOT_X_FILES = elmorph.x utf8scm.x
73BUILT_SOURCES = $(DOT_X_FILES) 73BUILT_SOURCES = $(DOT_X_FILES)
74DISTCLEANFILES = $(DOT_X_FILES) 74DISTCLEANFILES = $(DOT_X_FILES)
75 75
76phoneme.h phoneme.c: phoneme.y
77elchr.c: phoneme.h
78
76pkglibnames=elmorph 79pkglibnames=elmorph
77 80
78install-data-hook: 81install-data-hook:
diff --git a/src/ellinika/elmorph.c b/src/ellinika/elmorph.c
index 5094db8..ab5dea4 100644
--- a/src/ellinika/elmorph.c
+++ b/src/ellinika/elmorph.c
@@ -129,7 +129,7 @@ _elstr_dup(struct elstr *elstr)
129 elnew = scm_gc_malloc(sizeof(*elstr), "Elstr"); 129 elnew = scm_gc_malloc(sizeof(*elstr), "Elstr");
130 elnew->str = calloc(elstr->len, sizeof(elnew->str[0])); 130 elnew->str = calloc(elstr->len, sizeof(elnew->str[0]));
131 if (!elnew->str) 131 if (!elnew->str)
132 scm_memory_error("_elstr_dup"); 132 scm_report_out_of_memory();
133 memcpy(elnew->str, elstr->str, sizeof(elstr->str[0]) * elstr->len); 133 memcpy(elnew->str, elstr->str, sizeof(elstr->str[0]) * elstr->len);
134 elnew->len = elstr->len; 134 elnew->len = elstr->len;
135 135
@@ -138,7 +138,7 @@ _elstr_dup(struct elstr *elstr)
138 sizeof(elnew->phoneme[0])); 138 sizeof(elnew->phoneme[0]));
139 if (!elnew->phoneme) { 139 if (!elnew->phoneme) {
140 free(elnew->str); 140 free(elnew->str);
141 scm_memory_error("_elstr_dup"); 141 scm_report_out_of_memory();
142 } 142 }
143 memcpy(elnew->phoneme, elstr->phoneme, 143 memcpy(elnew->phoneme, elstr->phoneme,
144 sizeof(elstr->phoneme[0]) * elstr->phoneme_count); 144 sizeof(elstr->phoneme[0]) * elstr->phoneme_count);
@@ -150,7 +150,7 @@ _elstr_dup(struct elstr *elstr)
150 elnew->sylmap = calloc(elstr->nsyl, sizeof(elnew->sylmap[0])); 150 elnew->sylmap = calloc(elstr->nsyl, sizeof(elnew->sylmap[0]));
151 if (!elnew->sylmap) { 151 if (!elnew->sylmap) {
152 free(elnew->str); 152 free(elnew->str);
153 scm_memory_error("_elstr_dup"); 153 scm_report_out_of_memory();
154 } 154 }
155 memcpy(elnew->sylmap, elstr->sylmap, 155 memcpy(elnew->sylmap, elstr->sylmap,
156 sizeof(elstr->sylmap[0]) * elstr->nsyl); 156 sizeof(elstr->sylmap[0]) * elstr->nsyl);
@@ -173,7 +173,7 @@ _elstr_concat(struct elstr *dest, struct elstr *src, const char *func_name)
173 wp = realloc(dest->str, 173 wp = realloc(dest->str,
174 sizeof(dest->str[0]) * (dest->len + src->len)); 174 sizeof(dest->str[0]) * (dest->len + src->len));
175 if (!wp) 175 if (!wp)
176 scm_memory_error(func_name); 176 scm_report_out_of_memory();
177 dest->str = wp; 177 dest->str = wp;
178 memcpy(dest->str + dest->len, 178 memcpy(dest->str + dest->len,
179 src->str, 179 src->str,
@@ -181,7 +181,7 @@ _elstr_concat(struct elstr *dest, struct elstr *src, const char *func_name)
181 dest->len += src->len; 181 dest->len += src->len;
182} 182}
183 183
184static scm_sizet 184static size_t
185_elstr_free(SCM smob) 185_elstr_free(SCM smob)
186{ 186{
187 struct elstr *elstr = (struct elstr *) SCM_CDR(smob); 187 struct elstr *elstr = (struct elstr *) SCM_CDR(smob);
@@ -789,7 +789,7 @@ _elstr_thema_aoristoy(SCM el, int destructive, const char *func_name)
789 } 789 }
790 } 790 }
791 if (elmorph_thema_aoristoy(elstr->str, elstr->len, &wc, &wclen)) 791 if (elmorph_thema_aoristoy(elstr->str, elstr->len, &wc, &wclen))
792 scm_memory_error(func_name); 792 scm_report_out_of_memory();
793 free(elstr->str); 793 free(elstr->str);
794 elstr->str = wc; 794 elstr->str = wc;
795 elstr->len = wclen; 795 elstr->len = wclen;

Return to:

Send suggestions and report system problems to the System administrator.