diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-07-29 13:29:45 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-07-30 17:19:55 -0500 |
commit | 7ad5b35a359eeb55cb68f20fb1a059d2638efbe8 (patch) | |
tree | 0cc36828e9e1ecec6ac866ff81510626800d40d1 /src/stkagent.c | |
parent | dc5a2609b3f884f4a75d3c98e5cd2726056db3a2 (diff) | |
download | ofono-7ad5b35a359eeb55cb68f20fb1a059d2638efbe8.tar.bz2 |
stkagent: Refactor stkagent api
Diffstat (limited to 'src/stkagent.c')
-rw-r--r-- | src/stkagent.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/stkagent.c b/src/stkagent.c index c5eab478..200221d0 100644 --- a/src/stkagent.c +++ b/src/stkagent.c @@ -39,19 +39,19 @@ typedef void (*stk_agent_request_return)(struct stk_agent *agent, DBusMessage *reply); struct stk_agent { - char *path; - char *bus; + char *path; /* Agent Path */ + char *bus; /* Agent bus */ + ofono_bool_t is_default; /* False if user-session */ + guint disconnect_watch; /* DBus disconnect watch */ + ofono_destroy_func removed_cb; + void *removed_data; DBusMessage *msg; DBusPendingCall *call; - guint disconnect_watch; guint cmd_send_source; stk_agent_request_return cmd_cb; int cmd_timeout; stk_agent_generic_cb user_cb; void *user_data; - ofono_bool_t is_default; - GDestroyNotify destroy_notify; - void *destroy_data; const struct stk_menu *request_selection_menu; }; @@ -108,11 +108,12 @@ ofono_bool_t stk_agent_matches(struct stk_agent *agent, return !strcmp(agent->path, path) && !strcmp(agent->bus, sender); } -void stk_agent_set_destroy_watch(struct stk_agent *agent, GDestroyNotify notify, +void stk_agent_set_removed_notify(struct stk_agent *agent, + ofono_destroy_func destroy, void *user_data) { - agent->destroy_notify = notify; - agent->destroy_data = user_data; + agent->removed_cb = destroy; + agent->removed_data = user_data; } void stk_agent_request_cancel(struct stk_agent *agent) @@ -163,8 +164,8 @@ void stk_agent_free(struct stk_agent *agent) stk_agent_request_terminate(agent); } - if (agent->destroy_notify) - agent->destroy_notify(agent->destroy_data); + if (agent->removed_cb) + agent->removed_cb(agent->removed_data); g_free(agent->path); g_free(agent->bus); |