Lots of random fixes:

Rework the MMCallbackInfo callback invocation.
Always use g_error_literal() where it makes sense.
Replace sleep() calls, with timeouts to not block the whole MM.
This commit is contained in:
Tambet Ingo
2008-12-09 15:41:51 +02:00
parent a504fb408a
commit d1d94de6a1
12 changed files with 199 additions and 182 deletions

View File

@@ -5,18 +5,26 @@
#include "mm-modem.h"
typedef struct {
typedef struct _MMCallbackInfo MMCallbackInfo;
typedef void (*MMCallbackInfoInvokeFn) (MMCallbackInfo *info);
struct _MMCallbackInfo {
GData *qdata;
MMModem *modem;
MMModemFn async_callback;
MMModemUIntFn uint_callback;
MMModemStringFn str_callback;
MMCallbackInfoInvokeFn invoke_fn;
GCallback callback;
gpointer user_data;
GError *error;
guint pending_id;
} MMCallbackInfo;
};
MMCallbackInfo *mm_callback_info_new_full (MMModem *modem,
MMCallbackInfoInvokeFn invoke_fn,
GCallback callback,
gpointer user_data);
MMCallbackInfo *mm_callback_info_new (MMModem *modem,
MMModemFn callback,