atutil.h needs GAtChat and GAtResult definitions and we do not have
these definitions inside emulator.c.
---
 src/emulator.c |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/src/emulator.c b/src/emulator.c
index 0817b5d..6071615 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -37,6 +37,28 @@
 
 #define RING_TIMEOUT 3
 
+#define CALLBACK_WITH_FAILURE(cb, args...)             \
+       do {                                            \
+               struct ofono_error cb_e;                \
+               cb_e.type = OFONO_ERROR_TYPE_FAILURE;   \
+               cb_e.error = 0;                         \
+                                                       \
+               cb(&cb_e, ##args);                      \
+       } while (0)                                     \
+
+#define CALLBACK_WITH_SUCCESS(cb, args...)             \
+       do {                                            \
+               struct ofono_error e;                   \
+               e.type = OFONO_ERROR_TYPE_NO_ERROR;     \
+               e.error = 0;                            \
+               cb(&e, ##args);                         \
+       } while (0)
+
+struct cb_data {
+       void *cb;
+       void *data;
+};
+
 struct ofono_emulator {
        struct ofono_atom *atom;
        enum ofono_emulator_type type;
@@ -65,6 +87,17 @@ struct indicator {
        gboolean mandatory;
 };
 
+static inline struct cb_data *cb_data_new(void *cb, void *data)
+{
+       struct cb_data *ret;
+
+       ret = g_new0(struct cb_data, 1);
+       ret->cb = cb;
+       ret->data = data;
+
+       return ret;
+}
+
 static void emulator_debug(const char *str, void *data)
 {
        ofono_info("%s: %s\n", (char *)data, str);
-- 
1.7.9.5

_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to