Rename sms utilities properly
authorDenis Kenzior <denkenz@gmail.com>
Fri, 5 Jun 2009 18:29:03 +0000 (13:29 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Sat, 6 Jun 2009 00:58:09 +0000 (19:58 -0500)
Rename encode_sms to sms_encode
Rename decode_sms to sms_decode

drivers/atmodem/sms.c
src/smsutil.c
src/smsutil.h
unit/test-sms.c

index de35fc6..976c097 100644 (file)
@@ -492,7 +492,7 @@ static void construct_ack_pdu(struct sms_data *d)
 
        ackpdu.type = SMS_TYPE_DELIVER_REPORT_ACK;
 
-       if (!encode_sms(&ackpdu, &len, &tpdu_len, pdu))
+       if (!sms_encode(&ackpdu, &len, &tpdu_len, pdu))
                goto err;
 
        /* Constructing an <ackpdu> according to 27.005 Section 4.6 */
index 26df5b6..6ec2762 100644 (file)
@@ -1282,7 +1282,7 @@ static gboolean decode_command(const unsigned char *pdu, int len,
 }
 
 /* Buffer must be at least 164 (tpud) + 12 (SC address) bytes long */
-gboolean encode_sms(const struct sms *in, int *len, int *tpdu_len,
+gboolean sms_encode(const struct sms *in, int *len, int *tpdu_len,
                        unsigned char *pdu)
 {
        int offset = 0;
@@ -1345,7 +1345,7 @@ gboolean encode_sms(const struct sms *in, int *len, int *tpdu_len,
        return TRUE;
 }
 
-gboolean decode_sms(const unsigned char *pdu, int len, gboolean outgoing,
+gboolean sms_decode(const unsigned char *pdu, int len, gboolean outgoing,
                        int tpdu_len, struct sms *out)
 {
        unsigned char type;
index 13b70ed..2c42bd5 100644 (file)
@@ -295,10 +295,10 @@ struct sms_udh_iter {
        guint8 offset;
 };
 
-gboolean decode_sms(const unsigned char *pdu, int len, gboolean outgoing,
+gboolean sms_decode(const unsigned char *pdu, int len, gboolean outgoing,
                        int tpdu_len, struct sms *out);
 
-gboolean encode_sms(const struct sms *in, int *len, int *tpdu_len,
+gboolean sms_encode(const struct sms *in, int *len, int *tpdu_len,
                        unsigned char *pdu);
 
 int ud_len_in_octets(guint8 ud_len, guint8 dcs);
index 6057076..c581f99 100644 (file)
@@ -102,7 +102,7 @@ static void test_simple_deliver()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(simple_deliver) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, FALSE, 30, &sms);
+       ret = sms_decode(decoded_pdu, pdu_len, FALSE, 30, &sms);
 
        g_free(decoded_pdu);
 
@@ -188,7 +188,7 @@ static void test_alnum_sender()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(alnum_sender) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, FALSE, 27, &sms);
+       ret = sms_decode(decoded_pdu, pdu_len, FALSE, 27, &sms);
 
        g_free(decoded_pdu);
 
@@ -274,14 +274,14 @@ static void test_deliver_encode()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(simple_deliver) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, FALSE, 30, &sms);
+       ret = sms_decode(decoded_pdu, pdu_len, FALSE, 30, &sms);
 
        g_free(decoded_pdu);
 
        g_assert(ret);
        g_assert(sms.type == SMS_TYPE_DELIVER);
 
-       ret = encode_sms(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
+       ret = sms_encode(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
 
        if (g_test_verbose()) {
                int i;
@@ -306,14 +306,14 @@ static void test_deliver_encode()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(alnum_sender) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, FALSE, 27, &sms);
+       ret = sms_decode(decoded_pdu, pdu_len, FALSE, 27, &sms);
 
        g_free(decoded_pdu);
 
        g_assert(ret);
        g_assert(sms.type == SMS_TYPE_DELIVER);
 
-       ret = encode_sms(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
+       ret = sms_encode(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
 
        if (g_test_verbose()) {
                int i;
@@ -349,7 +349,7 @@ static void test_simple_submit()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(simple_submit) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, TRUE, 23, &sms);
+       ret = sms_decode(decoded_pdu, pdu_len, TRUE, 23, &sms);
 
        g_free(decoded_pdu);
 
@@ -438,14 +438,14 @@ static void test_submit_encode()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(simple_submit) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, TRUE, 23, &sms);
+       ret = sms_decode(decoded_pdu, pdu_len, TRUE, 23, &sms);
 
        g_free(decoded_pdu);
 
        g_assert(ret);
        g_assert(sms.type == SMS_TYPE_SUBMIT);
 
-       ret = encode_sms(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
+       ret = sms_encode(&sms, &encoded_pdu_len, &encoded_tpdu_len, pdu);
 
        if (g_test_verbose()) {
                int i;
@@ -492,7 +492,7 @@ static void test_udh_iter()
        g_assert(decoded_pdu);
        g_assert(pdu_len == (long)strlen(header_test) / 2);
 
-       ret = decode_sms(decoded_pdu, pdu_len, TRUE,
+       ret = sms_decode(decoded_pdu, pdu_len, TRUE,
                                header_test_len, &sms);
 
        g_free(decoded_pdu);