summaryrefslogtreecommitdiff
path: root/shared/nm-glib-aux/nm-keyfile-aux.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-03 12:07:37 +0200
committerThomas Haller <thaller@redhat.com>2019-05-07 16:41:21 +0200
commitb0693863c1f6c6bf31033499e222a6f6135411eb (patch)
tree97ad07032afa61b7c44bf9aded2f7ad6eafcf16e /shared/nm-glib-aux/nm-keyfile-aux.h
parent8c2fda7ca09e0fb5119e5ba15b242aa6a93fde99 (diff)
downloadNetworkManager-b0693863c1f6c6bf31033499e222a6f6135411eb.tar.gz
shared: add NMKeyFileDB API
It will be used for "/var/lib/NetworkManager/seen-bssids" and "/var/lib/NetworkManager/timestamps" which currently is implemented in NMSettingConnection.
Diffstat (limited to 'shared/nm-glib-aux/nm-keyfile-aux.h')
-rw-r--r--shared/nm-glib-aux/nm-keyfile-aux.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-keyfile-aux.h b/shared/nm-glib-aux/nm-keyfile-aux.h
index f7ef866c92..8563f4d186 100644
--- a/shared/nm-glib-aux/nm-keyfile-aux.h
+++ b/shared/nm-glib-aux/nm-keyfile-aux.h
@@ -21,4 +21,58 @@
#ifndef __NM_KEYFILE_AUX_H__
#define __NM_KEYFILE_AUX_H__
+/*****************************************************************************/
+
+typedef struct _NMKeyFileDB NMKeyFileDB;
+
+typedef void (*NMKeyFileDBLogFcn) (NMKeyFileDB *self,
+ int syslog_level,
+ gpointer user_data,
+ const char *fmt,
+ ...) G_GNUC_PRINTF (4, 5);
+
+typedef void (*NMKeyFileDBGotDirtyFcn) (NMKeyFileDB *self,
+ gpointer user_data);
+
+NMKeyFileDB *nm_key_file_db_new (const char *filename,
+ const char *group,
+ NMKeyFileDBLogFcn log_fcn,
+ NMKeyFileDBGotDirtyFcn got_dirty_fcn,
+ gpointer user_data);
+
+void nm_key_file_db_start (NMKeyFileDB *self);
+
+NMKeyFileDB *nm_key_file_db_ref (NMKeyFileDB *self);
+void nm_key_file_db_unref (NMKeyFileDB *self);
+
+void nm_key_file_db_destroy (NMKeyFileDB *self);
+
+const char *nm_key_file_db_get_filename (NMKeyFileDB *self);
+
+gboolean nm_key_file_db_is_dirty (NMKeyFileDB *self);
+
+char *nm_key_file_db_get_value (NMKeyFileDB *self,
+ const char *key);
+
+char **nm_key_file_db_get_string_list (NMKeyFileDB *self,
+ const char *key,
+ gsize *out_len);
+
+void nm_key_file_db_remove_key (NMKeyFileDB *self,
+ const char *key);
+
+void nm_key_file_db_set_value (NMKeyFileDB *self,
+ const char *key,
+ const char *value);
+
+void nm_key_file_db_set_string_list (NMKeyFileDB *self,
+ const char *key,
+ const char *const*value,
+ gssize len);
+
+void nm_key_file_db_to_file (NMKeyFileDB *self,
+ gboolean force);
+
+/*****************************************************************************/
+
#endif /* __NM_KEYFILE_AUX_H__ */