From 236f1ffb36bf56efaefb99eb93e7b0eaa8be8650 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 18 Aug 2011 19:28:20 -0500 Subject: voicecall: Move stuff around --- src/voicecall.c | 96 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/voicecall.c') diff --git a/src/voicecall.c b/src/voicecall.c index 168ce964..ec04f8d2 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -262,6 +262,54 @@ static unsigned int voicecalls_num_connecting(struct ofono_voicecall *vc) return r; } +static gboolean voicecalls_have_active(struct ofono_voicecall *vc) +{ + GSList *l; + struct voicecall *v; + + for (l = vc->call_list; l; l = l->next) { + v = l->data; + + if (v->call->status == CALL_STATUS_ACTIVE || + v->call->status == CALL_STATUS_DIALING || + v->call->status == CALL_STATUS_ALERTING) + return TRUE; + } + + return FALSE; +} + +static gboolean voicecalls_have_with_status(struct ofono_voicecall *vc, + int status) +{ + GSList *l; + struct voicecall *v; + + for (l = vc->call_list; l; l = l->next) { + v = l->data; + + if (v->call->status == status) + return TRUE; + } + + return FALSE; +} + +static gboolean voicecalls_have_held(struct ofono_voicecall *vc) +{ + return voicecalls_have_with_status(vc, CALL_STATUS_HELD); +} + +static gboolean voicecalls_have_waiting(struct ofono_voicecall *vc) +{ + return voicecalls_have_with_status(vc, CALL_STATUS_WAITING); +} + +static gboolean voicecalls_have_incoming(struct ofono_voicecall *vc) +{ + return voicecalls_have_with_status(vc, CALL_STATUS_INCOMING); +} + static void dial_request_finish(struct ofono_voicecall *vc) { struct dial_request *dial_req = vc->dial_req; @@ -1040,44 +1088,6 @@ static int voicecalls_path_list(struct ofono_voicecall *vc, GSList *call_list, return 0; } -static gboolean voicecalls_have_active(struct ofono_voicecall *vc) -{ - GSList *l; - struct voicecall *v; - - for (l = vc->call_list; l; l = l->next) { - v = l->data; - - if (v->call->status == CALL_STATUS_ACTIVE || - v->call->status == CALL_STATUS_DIALING || - v->call->status == CALL_STATUS_ALERTING) - return TRUE; - } - - return FALSE; -} - -static gboolean voicecalls_have_with_status(struct ofono_voicecall *vc, - int status) -{ - GSList *l; - struct voicecall *v; - - for (l = vc->call_list; l; l = l->next) { - v = l->data; - - if (v->call->status == status) - return TRUE; - } - - return FALSE; -} - -static gboolean voicecalls_have_held(struct ofono_voicecall *vc) -{ - return voicecalls_have_with_status(vc, CALL_STATUS_HELD); -} - static GSList *voicecalls_held_list(struct ofono_voicecall *vc) { GSList *l; @@ -1120,16 +1130,6 @@ static GSList *voicecalls_active_list(struct ofono_voicecall *vc) return r; } -static gboolean voicecalls_have_waiting(struct ofono_voicecall *vc) -{ - return voicecalls_have_with_status(vc, CALL_STATUS_WAITING); -} - -static gboolean voicecalls_have_incoming(struct ofono_voicecall *vc) -{ - return voicecalls_have_with_status(vc, CALL_STATUS_INCOMING); -} - struct ofono_call *__ofono_voicecall_find_call_with_status( struct ofono_voicecall *vc, int status) { -- cgit v1.2.3