From 531f18d827dd515befa8a91f5ac80c6b3872498d Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Thu, 19 Dec 2024 08:51:52 +0100
Subject: GUI: add basic configuration
It is simply not feasible to write the text file by hand on Windows.
---
src/stardict.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
(limited to 'src/stardict.c')
diff --git a/src/stardict.c b/src/stardict.c
index 6775553..8fb2f68 100644
--- a/src/stardict.c
+++ b/src/stardict.c
@@ -357,6 +357,20 @@ error:
return ret_val;
}
+/// Read an .ifo file.
+/// @return StardictInfo *. Deallocate with stardict_info_free();
+StardictInfo *
+stardict_info_new (const gchar *filename, GError **error)
+{
+ StardictInfo *ifo = g_new (StardictInfo, 1);
+ if (!load_ifo (ifo, filename, error))
+ {
+ g_free (ifo);
+ return NULL;
+ }
+ return ifo;
+}
+
/// List all dictionary files located in a path.
/// @return GList