aboutsummaryrefslogtreecommitdiff
path: root/src/add-pronunciation.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-09-03 23:17:17 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-09-04 00:13:34 +0200
commit8d19acd91af9592d862ef2a7aa8e95eea4160152 (patch)
treefb2a422cf9446829c41e152415f128b47babe938 /src/add-pronunciation.c
parentdd2bd04a07030f15e6eb6875041f95c74023dd35 (diff)
downloadtdv-8d19acd91af9592d862ef2a7aa8e95eea4160152.tar.gz
tdv-8d19acd91af9592d862ef2a7aa8e95eea4160152.tar.xz
tdv-8d19acd91af9592d862ef2a7aa8e95eea4160152.zip
Add a tool to transform dictionaries
Diffstat (limited to 'src/add-pronunciation.c')
-rw-r--r--src/add-pronunciation.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/src/add-pronunciation.c b/src/add-pronunciation.c
index 6ca5ad3..26261f9 100644
--- a/src/add-pronunciation.c
+++ b/src/add-pronunciation.c
@@ -282,32 +282,6 @@ stardict_info_copy (StardictInfo *dest, const StardictInfo *src)
}
}
-/// Write a list of data fields back to a dictionary.
-static gboolean
-write_fields (Generator *generator, GList *fields, gboolean sts, GError **error)
-{
- while (fields)
- {
- StardictEntryField *field = fields->data;
- if (!sts && !generator_write_type (generator, field->type, error))
- return FALSE;
-
- gboolean mark_end = !sts || fields->next != NULL;
- if (g_ascii_islower (field->type))
- {
- if (!generator_write_string (generator,
- field->data, mark_end, error))
- return FALSE;
- }
- else if (!generator_write_raw (generator,
- field->data, field->data_size, mark_end, error))
- return FALSE;
-
- fields = fields->next;
- }
- return TRUE;
-}
-
int
main (int argc, char *argv[])
{
@@ -516,8 +490,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
start_link.next = entry->fields;
start_link.data = &field;
- if (!write_fields (generator, &start_link,
- info->same_type_sequence != NULL, &error)
+ if (!generator_write_fields (generator, &start_link, &error)
|| !generator_finish_entry (generator,
stardict_iterator_get_word (iterator), &error))
{