diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2010-01-25 20:25:28 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-01-25 20:53:57 +0100 |
commit | c664f80f22b98dcbf02e8b797f5ac7d85d499626 (patch) | |
tree | 09b6c612c33a496a0466d9a8a6d713687c09bec7 | |
parent | 445fc378b5e75457d92cfada30abc5d0fa5724c2 (diff) | |
download | ofono-c664f80f22b98dcbf02e8b797f5ac7d85d499626.tar.bz2 |
Add at_util_call_compare_by_id function
-rw-r--r-- | drivers/atmodem/atutil.c | 14 | ||||
-rw-r--r-- | drivers/atmodem/atutil.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index ab529991..28a192a4 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -77,6 +77,20 @@ gint at_util_call_compare_by_phone_number(gconstpointer a, gconstpointer b) sizeof(struct ofono_phone_number)); } +gint at_util_call_compare_by_id(gconstpointer a, gconstpointer b) +{ + const struct ofono_call *call = a; + unsigned int id = GPOINTER_TO_UINT(b); + + if (id < call->id) + return -1; + + if (id > call->id) + return 1; + + return 0; +} + gint at_util_call_compare(gconstpointer a, gconstpointer b) { const struct ofono_call *ca = a; diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h index 0ab207df..fc5b041d 100644 --- a/drivers/atmodem/atutil.h +++ b/drivers/atmodem/atutil.h @@ -23,6 +23,7 @@ void decode_at_error(struct ofono_error *error, const char *final); void dump_response(const char *func, gboolean ok, GAtResult *result); gint at_util_call_compare_by_status(gconstpointer a, gconstpointer b); gint at_util_call_compare_by_phone_number(gconstpointer a, gconstpointer b); +gint at_util_call_compare_by_id(gconstpointer a, gconstpointer b); gint at_util_call_compare(gconstpointer a, gconstpointer b); GSList *at_util_parse_clcc(GAtResult *result); gboolean at_util_parse_reg(GAtResult *result, const char *prefix, |