1 | /* GConf |
---|
2 | * Copyright (C) 1999, 2000 Red Hat Inc. |
---|
3 | * |
---|
4 | * This library is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU Library General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This library is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * Library General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Library General Public |
---|
15 | * License along with this library; if not, write to the |
---|
16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
17 | * Boston, MA 02111-1307, USA. |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef GCONF_XML_DIR_H |
---|
21 | #define GCONF_XML_DIR_H |
---|
22 | |
---|
23 | #include <gconf/gconf.h> |
---|
24 | #include <libxml/tree.h> |
---|
25 | |
---|
26 | /* Dir stores the information about a given directory */ |
---|
27 | |
---|
28 | typedef struct _Dir Dir; |
---|
29 | Dir* dir_new (const gchar *keyname, |
---|
30 | const gchar *xml_root_dir, |
---|
31 | guint dir_mode, |
---|
32 | guint file_mode); |
---|
33 | Dir* dir_load (const gchar *key, |
---|
34 | const gchar *xml_root_dir, |
---|
35 | GError **err); |
---|
36 | void dir_destroy (Dir *d); |
---|
37 | void dir_clear_cache (Dir *d); |
---|
38 | gboolean dir_ensure_exists (Dir *d, |
---|
39 | GError **err); |
---|
40 | gboolean dir_sync (Dir *d, |
---|
41 | GError **err); |
---|
42 | |
---|
43 | const gchar* dir_get_name (Dir *d); |
---|
44 | |
---|
45 | /* key should have no slashes in it */ |
---|
46 | void dir_set_value (Dir *d, |
---|
47 | const gchar *relative_key, |
---|
48 | GConfValue *value, |
---|
49 | GError **err); |
---|
50 | GConfValue* dir_get_value (Dir *d, |
---|
51 | const gchar *relative_key, |
---|
52 | const gchar **locales, |
---|
53 | gchar **schema_name, |
---|
54 | GError **err); |
---|
55 | GConfMetaInfo* dir_get_metainfo (Dir *d, |
---|
56 | const gchar *relative_key, |
---|
57 | GError **err); |
---|
58 | void dir_unset_value (Dir *d, |
---|
59 | const gchar *relative_key, |
---|
60 | const gchar *locale, |
---|
61 | GError **err); |
---|
62 | GSList* dir_all_entries (Dir *d, |
---|
63 | const gchar **locales, |
---|
64 | GError **err); |
---|
65 | GSList* dir_all_subdirs (Dir *d, |
---|
66 | GError **err); |
---|
67 | void dir_set_schema (Dir *d, |
---|
68 | const gchar *relative_key, |
---|
69 | const gchar *schema_key, |
---|
70 | GError **err); |
---|
71 | GTime dir_get_last_access (Dir *d); |
---|
72 | |
---|
73 | gboolean dir_sync_pending (Dir *d); |
---|
74 | |
---|
75 | /* Marks for deletion; dir cache really has to implement directory |
---|
76 | deletion, since it is recursive */ |
---|
77 | void dir_mark_deleted (Dir *d); |
---|
78 | gboolean dir_is_deleted (Dir *d); |
---|
79 | |
---|
80 | |
---|
81 | /* random utility function */ |
---|
82 | #include <unistd.h> |
---|
83 | #include <sys/stat.h> |
---|
84 | #include <sys/types.h> |
---|
85 | guint mode_t_to_mode(mode_t orig); |
---|
86 | |
---|
87 | #endif |
---|