Logo Search packages:      
Sourcecode: wengophone version File versions  Download package

int osip_message_set_from ( osip_message_t sip,
const char *  hvalue 
)

Set the From header.

Parameters:
sip The element to work on.
hvalue The string describing the element.

Definition at line 42 of file osip_from.c.

References osip_message::from, osip_message::message_property, osip_from_free(), osip_from_init(), and osip_from_parse().

Referenced by parser_init().

{
  int i;

  if (hvalue == NULL || hvalue[0] == '\0')
    return 0;

  if (sip->from != NULL)
    return -1;
  i = osip_from_init (&(sip->from));
  if (i != 0)
    return -1;
  sip->message_property = 2;
  i = osip_from_parse (sip->from, hvalue);
  if (i != 0)
    {
      osip_from_free (sip->from);
      sip->from = NULL;
      return -1;
    }
  return 0;
}


Generated by  Doxygen 1.6.0   Back to index