sw_result
sw_text_record_string_iterator_init
(
sw_text_record_string_iterator * iterator,
sw_const_string text_record_string)
sw_result
my_resolve_func(
sw_discovery_resolve_handler handler,
sw_discovery discovery,
sw_discovery_resolve_id id,
sw_const_string name,
sw_const_string type,
sw_const_string domain,
sw_ipv4_address address,
sw_port port,
sw_const_string text_record_string,
sw_octets text_record,
sw_ulong text_record_len,
sw_opaque extra)
{
sw_text_record_string_iterator it;
if (sw_text_record_string_iterator_init(&it, text_record_string) != SW_OKAY)
{
fprintf(stderr, "init failed\n");
return SW_E_FAIL;
}
...
}
sw_text_record_string_iterator_fina
sw_result
sw_text_record_string_iterator_fina
(
sw_text_record_string_iterator it)
sw_result
my_resolve_func(
sw_discovery_resolve_handler handler,
sw_discovery discovery,
sw_discovery_resolve_id id,
sw_const_string name,
sw_const_string type,
sw_const_string domain,
sw_ipv4_address address,
sw_port port,
sw_const_string text_record_string,
sw_octets text_record,
sw_ulong text_record_len,
sw_opaque extra)
{
sw_text_record_string_iterator it;
if (sw_text_record_string_iterator_init(&it, text_record_string) != SW_OKAY)
{
fprintf(stderr, "init failed\n");
return SW_E_FAIL;
}
...
sw_text_record_string_iterator_fina(it);
...
}
sw_text_record_string_iterator_init
sw_result
sw_text_record_string_iterator_next
(
sw_text_record_string_iterator iterator,
sw_char key[255],
sw_char val[255])
sw_result
my_resolve_func(
sw_discovery_resolve_handler handler,
sw_discovery discovery,
sw_discovery_resolve_id id,
sw_const_string name,
sw_const_string type,
sw_const_string domain,
sw_ipv4_address address,
sw_port port,
sw_const_string text_record_string,
sw_octets text_record,
sw_ulong text_record_len,
sw_opaque extra)
{
sw_text_record_string_iterator it;
sw_char key[255];
sw_char val[255];
if (sw_text_record_string_iterator_init(&it, text_record_string) != SW_OKAY)
{
fprintf(stderr, "init failed\n");
return SW_E_FAIL;
}
while (sw_text_record_string_iterator_next(it, key, val) == SW_OKAY)
{
...
}
sw_text_record_string_iterator_fina(it);
...
}
sw_text_record_string_iterator_init
, sw_text_record_string_iterator_fina