diff options
author | Zhenhua Zhang <zhenhua.zhang@intel.com> | 2009-10-29 01:22:06 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-10-28 17:30:02 -0500 |
commit | 17903940c5d356cb0bfb44d26bce422ec2ec06f6 (patch) | |
tree | 61390a22269110196610aff9e66478728239df77 /drivers/atmodem/atutil.c | |
parent | 6d31b05b9520e856065d6477457d8a55c0bcff21 (diff) | |
download | ofono-17903940c5d356cb0bfb44d26bce422ec2ec06f6.tar.bz2 |
Refactor: Move & Rename functions to atutil.c
Move and rename call_compare and call_compare_by_status to atutil.c.
These will be utilized by other drivers, including hfpmodem.
Diffstat (limited to 'drivers/atmodem/atutil.c')
-rw-r--r-- | drivers/atmodem/atutil.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/atmodem/atutil.c b/drivers/atmodem/atutil.c index 5d9ceb85..578522f6 100644 --- a/drivers/atmodem/atutil.c +++ b/drivers/atmodem/atutil.c @@ -55,3 +55,29 @@ void decode_at_error(struct ofono_error *error, const char *final) error->error = 0; } } + +gint at_util_call_compare_by_status(gconstpointer a, gconstpointer b) +{ + const struct ofono_call *call = a; + int status = GPOINTER_TO_INT(b); + + if (status != call->status) + return 1; + + return 0; +} + +gint at_util_call_compare(gconstpointer a, gconstpointer b) +{ + const struct ofono_call *ca = a; + const struct ofono_call *cb = b; + + if (ca->id < cb->id) + return -1; + + if (ca->id > cb->id) + return 1; + + return 0; +} + |