charsets: ensure all methods are prefixed with 'mm_'
This commit is contained in:
@@ -2395,7 +2395,7 @@ encode (MMIfaceModem3gppUssd *self,
|
||||
len++;
|
||||
}
|
||||
|
||||
packed = gsm_pack (gsm, len, 0, &packed_len);
|
||||
packed = mm_charset_gsm_pack (gsm, len, 0, &packed_len);
|
||||
hex = mm_utils_bin2hexstr (packed, packed_len);
|
||||
g_free (packed);
|
||||
g_free (gsm);
|
||||
@@ -2414,7 +2414,7 @@ decode (MMIfaceModem3gppUssd *self,
|
||||
guint32 unpacked_len;
|
||||
|
||||
bin = mm_utils_hexstr2bin (reply, &bin_len);
|
||||
unpacked = gsm_unpack ((guint8*) bin, (bin_len * 8) / 7, 0, &unpacked_len);
|
||||
unpacked = mm_charset_gsm_unpack ((guint8*) bin, (bin_len * 8) / 7, 0, &unpacked_len);
|
||||
/* if the last character in a 7-byte block is padding, then drop it */
|
||||
if ((bin_len % 7 == 0) && (unpacked[unpacked_len - 1] == 0x0d))
|
||||
unpacked_len--;
|
||||
|
||||
+8
-8
@@ -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;
|
||||
|
||||
+8
-8
@@ -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 *mm_charset_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_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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user