sms: sms_assembly_encode_address export and rename

The new name better reflects the function's purpose.

We need to export it, as for generating unique message naming (for
persistence and D-Bus object naming), we'll be using the
address.
This commit is contained in:
Inaky Perez-Gonzalez 2010-07-23 13:59:54 -07:00 committed by Denis Kenzior
parent ca46f51c2d
commit 9517bf2991
2 changed files with 5 additions and 4 deletions

View File

@ -2293,8 +2293,7 @@ static gboolean sms_assembly_extract_address(const char *straddr,
return sms_decode_address_field(pdu, len, &offset, FALSE, out);
}
static gboolean sms_assembly_encode_address(const struct sms_address *in,
char *straddr)
gboolean sms_address_to_hex_string(const struct sms_address *in, char *straddr)
{
unsigned char pdu[12];
int offset = 0;
@ -2396,7 +2395,7 @@ static gboolean sms_assembly_store(struct sms_assembly *assembly,
if (!assembly->imsi)
return FALSE;
if (sms_assembly_encode_address(&node->addr, straddr) == FALSE)
if (sms_address_to_hex_string(&node->addr, straddr) == FALSE)
return FALSE;
len = sms_serialize(buf, sms);
@ -2419,7 +2418,7 @@ static void sms_assembly_backup_free(struct sms_assembly *assembly,
if (!assembly->imsi)
return;
if (sms_assembly_encode_address(&node->addr, straddr) == FALSE)
if (sms_address_to_hex_string(&node->addr, straddr) == FALSE)
return;
for (seq = 0; seq < node->max_fragments; seq++) {

View File

@ -500,6 +500,8 @@ GSList *sms_assembly_add_fragment(struct sms_assembly *assembly,
const struct sms_address *addr,
guint16 ref, guint8 max, guint8 seq);
void sms_assembly_expire(struct sms_assembly *assembly, time_t before);
gboolean sms_address_to_hex_string(const struct sms_address *in,
char *straddr);
struct status_report_assembly *status_report_assembly_new(const char *imsi);
void status_report_assembly_free(struct status_report_assembly *assembly);