diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-charsets.c | 16 | ||||
-rw-r--r-- | src/mm-charsets.h | 18 | ||||
-rw-r--r-- | src/mm-sms-part-3gpp.c | 6 | ||||
-rw-r--r-- | src/tests/test-charsets.c | 18 |
4 files changed, 29 insertions, 29 deletions
diff --git a/src/mm-charsets.c b/src/mm-charsets.c index fb47b0ae..56a745dd 100644 --- a/src/mm-charsets.c +++ b/src/mm-charsets.c @@ -637,10 +637,10 @@ mm_charset_get_encoded_len (const char *utf8, } guint8 * -gsm_unpack (const guint8 *gsm, - guint32 num_septets, - guint8 start_offset, /* in _bits_ */ - guint32 *out_unpacked_len) +mm_charset_gsm_unpack (const guint8 *gsm, + guint32 num_septets, + guint8 start_offset, /* in _bits_ */ + guint32 *out_unpacked_len) { GByteArray *unpacked; int i; @@ -673,10 +673,10 @@ gsm_unpack (const guint8 *gsm, } guint8 * -gsm_pack (const guint8 *src, - guint32 src_len, - guint8 start_offset, - guint32 *out_packed_len) +mm_charset_gsm_pack (const guint8 *src, + guint32 src_len, + guint8 start_offset, + guint32 *out_packed_len) { guint8 *packed; guint octet = 0, lshift, plen; diff --git a/src/mm-charsets.h b/src/mm-charsets.h index a85f3dc7..c0b309e3 100644 --- a/src/mm-charsets.h +++ b/src/mm-charsets.h @@ -62,15 +62,15 @@ guint mm_charset_get_encoded_len (const char *utf8, MMModemCharset charset, guint *out_unsupported); -guint8 *gsm_unpack (const guint8 *gsm, - guint32 num_septets, - guint8 start_offset, /* in bits */ - guint32 *out_unpacked_len); - -guint8 *gsm_pack (const guint8 *src, - guint32 src_len, - guint8 start_offset, /* in bits */ - guint32 *out_packed_len); +guint8 *mm_charset_gsm_unpack (const guint8 *gsm, + guint32 num_septets, + guint8 start_offset, /* in bits */ + guint32 *out_unpacked_len); + +guint8 *mm_charset_gsm_pack (const guint8 *src, + guint32 src_len, + guint8 start_offset, /* in bits */ + guint32 *out_packed_len); gchar *mm_charset_take_and_convert_to_utf8 (gchar *str, MMModemCharset charset); diff --git a/src/mm-sms-part-3gpp.c b/src/mm-sms-part-3gpp.c index 3f4d6c06..8fd255ea 100644 --- a/src/mm-sms-part-3gpp.c +++ b/src/mm-sms-part-3gpp.c @@ -132,7 +132,7 @@ sms_decode_address (const guint8 *address, int len) if (addrtype == SMS_NUMBER_TYPE_ALPHA) { guint8 *unpacked; guint32 unpacked_len; - unpacked = gsm_unpack (address, (len * 4) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (address, (len * 4) / 7, 0, &unpacked_len); utf8 = (char *)mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len); g_free (unpacked); @@ -242,7 +242,7 @@ sms_decode_text (const guint8 *text, int len, MMSmsEncoding encoding, int bit_of if (encoding == MM_SMS_ENCODING_GSM7) { mm_dbg ("Converting SMS part text from GSM7 to UTF8..."); - unpacked = gsm_unpack ((const guint8 *) text, len, bit_offset, &unpacked_len); + unpacked = mm_charset_gsm_unpack ((const guint8 *) text, len, bit_offset, &unpacked_len); utf8 = (char *) mm_charset_gsm_unpacked_to_utf8 (unpacked, unpacked_len); mm_dbg (" Got UTF-8 text: '%s'", utf8); g_free (unpacked); @@ -956,7 +956,7 @@ mm_sms_part_3gpp_get_submit_pdu (MMSmsPart *part, *udl_ptr, mm_sms_part_get_concat_sequence (part) ? "with" : "without"); - packed = gsm_pack (unpacked, unlen, shift, &packlen); + packed = mm_charset_gsm_pack (unpacked, unlen, shift, &packlen); g_free (unpacked); if (!packed || packlen == 0) { g_free (packed); diff --git a/src/tests/test-charsets.c b/src/tests/test-charsets.c index edc38023..9ae23faf 100644 --- a/src/tests/test-charsets.c +++ b/src/tests/test-charsets.c @@ -100,7 +100,7 @@ test_gsm7_unpack_basic (void) guint8 *unpacked; guint32 unpacked_len = 0; - unpacked = gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); g_assert (unpacked); g_assert_cmpint (unpacked_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (unpacked, expected, unpacked_len), ==, 0); @@ -121,7 +121,7 @@ test_gsm7_unpack_7_chars (void) * we expect to get the number of characters that were specified. */ - unpacked = gsm_unpack (gsm, 7 , 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (gsm, 7 , 0, &unpacked_len); g_assert (unpacked); g_assert_cmpint (unpacked_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (unpacked, expected, unpacked_len), ==, 0); @@ -154,7 +154,7 @@ test_gsm7_unpack_all_chars (void) guint32 unpacked_len = 0; int i; - unpacked = gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); + unpacked = mm_charset_gsm_unpack (gsm, (sizeof (gsm) * 8) / 7, 0, &unpacked_len); g_assert (unpacked); g_assert_cmpint (unpacked_len, ==, 148); @@ -176,7 +176,7 @@ test_gsm7_pack_basic (void) guint8 *packed; guint32 packed_len = 0; - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -198,7 +198,7 @@ test_gsm7_pack_7_chars (void) * the intended message to remove it when required. */ - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -237,7 +237,7 @@ test_gsm7_pack_all_chars (void) for (c = 0; c < sizeof (ext); c++) g_byte_array_append (unpacked, &ext[c], 1); - packed = gsm_pack (unpacked->data, unpacked->len, 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked->data, unpacked->len, 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); @@ -260,7 +260,7 @@ test_gsm7_pack_24_chars (void) * are packed into an exact number of bytes. */ - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, 21); @@ -286,7 +286,7 @@ test_gsm7_pack_last_septet_alone (void) * septet will be in an octet by itself) packs correctly. */ - packed = gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 0, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); @@ -301,7 +301,7 @@ test_gsm7_pack_7_chars_offset (void) guint8 *packed; guint32 packed_len = 0; - packed = gsm_pack (unpacked, sizeof (unpacked), 5, &packed_len); + packed = mm_charset_gsm_pack (unpacked, sizeof (unpacked), 5, &packed_len); g_assert (packed); g_assert_cmpint (packed_len, ==, sizeof (expected)); g_assert_cmpint (memcmp (packed, expected, packed_len), ==, 0); |