summaryrefslogtreecommitdiff
path: root/src/lib/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/helpers.h')
-rw-r--r--src/lib/helpers.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/helpers.h b/src/lib/helpers.h
index eed1e6c..344410e 100644
--- a/src/lib/helpers.h
+++ b/src/lib/helpers.h
@@ -24,14 +24,11 @@
#ifndef __HELPERS_H
#define __HELPERS_H
-#include <stdio.h>
-
#include <glib.h>
+#include <stdio.h>
+#include <string.h>
#include "bluez-api.h"
-#ifdef OBEX_SUPPORT
-#include "obexd-api.h"
-#endif
/* DBus helpers */
gboolean intf_supported(const gchar *dbus_service_name, const gchar *dbus_object_path, const gchar *intf_name);
@@ -43,7 +40,7 @@ Device *find_device(Adapter *adapter, const gchar *name, GError **error);
/* Others helpers */
#define exit_if_error(error) G_STMT_START{ \
if (error) { \
- g_printerr("%s: %s\n", (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION && dbus_g_error_get_name(error) != NULL && strlen(dbus_g_error_get_name(error)) ? dbus_g_error_get_name(error) : "Error"), error->message); \
+ g_printerr("%s: %s\n", (error->domain == G_DBUS_ERROR && g_dbus_error_get_remote_error(error) != NULL && strlen(g_dbus_error_get_remote_error(error)) ? g_dbus_error_get_remote_error(error) : "Error"), error->message); \
exit(EXIT_FAILURE); \
}; }G_STMT_END
@@ -57,7 +54,8 @@ const gchar *name2uuid(const gchar *name);
/* FS helpers */
gboolean is_file(const gchar *filename, GError **error);
gboolean is_dir(const gchar *dirname, GError **error);
+gboolean read_access(const gchar *path, GError **error);
+gboolean write_access(const gchar *path, GError **error);
gchar *get_absolute_path(const gchar *path);
#endif /* __HELPERS_H */
-