238
238
LONGINT64 len, remain = ui->length;
239
239
LONGUINT64 offset = 0;
241
gchar *file_ext = g_strrstr(g_path_get_basename(ui->path), ".");
243
241
if ((fout = fopen(fname, "wb")) == NULL) {
244
242
/* make sure that it isn't just a missing directory before we abort */
245
243
char newbuf[32768];
785
783
g_debug("CS_CHMFILE >>> read bookinfo file = %s", bookinfo_file);
787
GError *error = NULL;
788
785
GKeyFile *keyfile = g_key_file_new();
790
787
gboolean rv = g_key_file_load_from_file(keyfile, bookinfo_file, G_KEY_FILE_NONE, NULL);
796
793
rv = g_key_file_load_from_file(keyfile, bookinfo_file, G_KEY_FILE_NONE, NULL);
799
priv->hhc = g_key_file_get_string(keyfile, "Bookinfo", "hhc", &error);
800
priv->hhk = g_key_file_get_string(keyfile, "Bookinfo", "hhk", &error);
801
priv->homepage = g_key_file_get_string(keyfile, "Bookinfo", "homepage", &error);
802
priv->bookname = g_key_file_get_string(keyfile, "Bookinfo", "bookname", &error);
803
priv->encoding = g_key_file_get_string(keyfile, "Bookinfo", "encoding", &error);
804
priv->variable_font = g_key_file_get_string(keyfile, "Bookinfo", "variable_font", &error);
805
priv->fixed_font = g_key_file_get_string(keyfile, "Bookinfo", "fixed_font", &error);
796
priv->hhc = g_key_file_get_string(keyfile, "Bookinfo", "hhc", NULL);
797
priv->hhk = g_key_file_get_string(keyfile, "Bookinfo", "hhk", NULL);
798
priv->homepage = g_key_file_get_string(keyfile, "Bookinfo", "homepage", NULL);
799
priv->bookname = g_key_file_get_string(keyfile, "Bookinfo", "bookname", NULL);
800
priv->encoding = g_key_file_get_string(keyfile, "Bookinfo", "encoding", NULL);
801
priv->variable_font = g_key_file_get_string(keyfile, "Bookinfo", "variable_font", NULL);
802
priv->fixed_font = g_key_file_get_string(keyfile, "Bookinfo", "fixed_font", NULL);
808
805
g_key_file_free(keyfile);
833
830
g_key_file_set_string(keyfile, "Bookinfo", "fixed_font", priv->fixed_font);
835
832
gsize length = 0;
836
GError *error = NULL;
837
gchar *contents = g_key_file_to_data(keyfile, &length, &error);
838
g_file_set_contents(bookinfo_file, contents, length, &error);
833
gchar *contents = g_key_file_to_data(keyfile, &length, NULL);
834
g_file_set_contents(bookinfo_file, contents, length, NULL);
840
836
g_key_file_free(keyfile);
841
837
g_free(contents);