summaryrefslogtreecommitdiff
path: root/src/smsutil.h
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2010-07-23 13:59:53 -0700
committerDenis Kenzior <denkenz@gmail.com>2010-07-23 17:26:12 -0500
commitca46f51c2d9366f07721f0f5f8828771a7aa93c5 (patch)
treef5d528cdd91c57b924ae38d58e93a564bdb76012 /src/smsutil.h
parent402a4b0750cfffc327e10de38f11eca2a72341d9 (diff)
downloadofono-ca46f51c2d9366f07721f0f5f8828771a7aa93c5.tar.gz
introduce DECLARE_SMS_ADDR_STR()
Introduce DECLARE_SMS_ADDR_STR(), which declares a string variable of the right size for passing to sms_assembly_decode_address(). This way we detach each client having to have the knowledge of what the right size is, leaving that decission to the infrastructure provider. Updated couple of sites in smsutil.c to use it vs a raw declaration.
Diffstat (limited to 'src/smsutil.h')
-rw-r--r--src/smsutil.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/smsutil.h b/src/smsutil.h
index 66ef6f8d..630fde48 100644
--- a/src/smsutil.h
+++ b/src/smsutil.h
@@ -432,6 +432,12 @@ gboolean sms_decode_unpacked_stk_pdu(const unsigned char *pdu, int len,
gboolean sms_encode(const struct sms *in, int *len, int *tpdu_len,
unsigned char *pdu);
+/*
+ * Length is based on the address being 12 hex characters plus a
+ * terminating NUL char. See sms_assembly_extract_address().
+ */
+#define DECLARE_SMS_ADDR_STR(a) char a[25]
+
gboolean sms_decode_address_field(const unsigned char *pdu, int len,
int *offset, gboolean sc,
struct sms_address *out);