aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/elm_prefs_cc_out.c
blob: 8913b71712a3ef2cc91f4ea10d503d3a41015d41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#include "elm_prefs_cc.h"
#include "elm_prefs_edd.x"

Elm_Prefs_File *elm_prefs_file = NULL;

void
data_init()
{
   eet_init();
   _elm_prefs_descriptors_init();
}

void
data_shutdown()
{
   _elm_prefs_descriptors_shutdown();
   eet_shutdown();
}

void
data_write()
{
   Eina_List *l;
   Eet_File *ef;
   Elm_Prefs_Page_Node *page;

   if (!elm_prefs_file || !elm_prefs_file->pages)
     {
        ERR("No data to put in \"%s\"", file_out);
        exit(-1);
     }

   ef = eet_open(file_out, EET_FILE_MODE_WRITE);
   if (!ef)
     {
        ERR("Unable to open \"%s\" for writing output", file_out);
        exit(-1);
     }

   EINA_LIST_FOREACH (elm_prefs_file->pages, l, page)
     {
        if (!(eet_data_write
              (ef, _page_edd, page->name, page, EET_COMPRESSION_DEFAULT)))
          ERR("Failed to write page %s to file %s", page->name, file_out);
     }

   eet_close(ef);
}