Mercurial > pidgin
comparison libpurple/protocols/myspace/message.c @ 17276:b9c0a8bb94b9
Add msim_msg_get_binary() - retrieves binary data values from an MsimMessage.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Fri, 01 Jun 2007 05:28:46 +0000 |
parents | 9accf6d6cd61 |
children | af7083a8ada7 |
comparison
equal
deleted
inserted
replaced
17275:f3ec513efb59 | 17276:b9c0a8bb94b9 |
---|---|
629 { | 629 { |
630 case MSIM_TYPE_INTEGER: | 630 case MSIM_TYPE_INTEGER: |
631 return GPOINTER_TO_UINT(elem->data); | 631 return GPOINTER_TO_UINT(elem->data); |
632 | 632 |
633 case MSIM_TYPE_STRING: | 633 case MSIM_TYPE_STRING: |
634 /* TODO: find out if we need larger integers */ | |
634 return (guint)atoi((gchar *)elem->data); | 635 return (guint)atoi((gchar *)elem->data); |
635 | 636 |
636 default: | 637 default: |
637 return 0; | 638 return 0; |
638 } | 639 } |
639 } | 640 } |
641 | |
642 /** Return the data of an element of a given name, as a binary GString. | |
643 * | |
644 * @return GString * of binary data, or NULL. | |
645 */ | |
646 GString *msim_msg_get_binary(MsimMessage *msg, gchar *name) | |
647 { | |
648 switch (elem->type) | |
649 { | |
650 case MSIM_TYPE_BINARY: | |
651 return (GString *)elem->data; | |
652 | |
653 default: | |
654 return NULL; | |
655 } | |
656 } |