Add at_util_call_compare_by_id function
authorSjur Brændeland <sjur.brandeland@stericsson.com>
Mon, 25 Jan 2010 19:25:28 +0000 (20:25 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 25 Jan 2010 19:53:57 +0000 (20:53 +0100)
drivers/atmodem/atutil.c
drivers/atmodem/atutil.h

index ab52999..28a192a 100644 (file)
@@ -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;
index 0ab207d..fc5b041 100644 (file)
@@ -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,