1 #ifndef _discovery_text_record_h
2 #define _discovery_text_record_h
5 * Copyright 2003, 2004 Porchdog Software. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted provided that the following conditions are met:
10 * 1. Redistributions of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright notice,
13 * this list of conditions and the following disclaimer in the documentation
14 * and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE HOWL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25 * OF THE POSSIBILITY OF SUCH DAMAGE.
27 * The views and conclusions contained in the software and documentation are those
28 * of the authors and should not be interpreted as representing official policies,
29 * either expressed or implied, of Porchdog Software.
32 #include <salt/salt.h>
34 #if defined(__cplusplus)
39 #define SW_TEXT_RECORD_MAX_LEN 255
42 struct _sw_text_record;
43 typedef struct _sw_text_record * sw_text_record;
44 struct _sw_text_record_iterator;
45 typedef struct _sw_text_record_iterator * sw_text_record_iterator;
46 struct _sw_text_record_string_iterator;
47 typedef struct _sw_text_record_string_iterator * sw_text_record_string_iterator;
55 sw_text_record * self);
64 sw_text_record_add_string(
66 sw_const_string string);
70 sw_text_record_add_key_and_string_value(
77 sw_text_record_add_key_and_binary_value(
95 * APIs for iterating through raw text records
98 sw_text_record_iterator_init(
99 sw_text_record_iterator * self,
100 sw_octets text_record,
101 sw_uint32 text_record_len);
105 sw_text_record_iterator_fina(
106 sw_text_record_iterator self);
110 sw_text_record_iterator_next(
111 sw_text_record_iterator self,
112 char key[SW_TEXT_RECORD_MAX_LEN],
113 sw_uint8 val[SW_TEXT_RECORD_MAX_LEN],
114 sw_uint32 * val_len);
118 * APIs for iterating through stringified text records
121 sw_text_record_string_iterator_init(
122 sw_text_record_string_iterator * self,
123 sw_const_string text_record_string);
127 sw_text_record_string_iterator_fina(
128 sw_text_record_string_iterator self);
132 sw_text_record_string_iterator_next(
133 sw_text_record_string_iterator self,
134 char key[SW_TEXT_RECORD_MAX_LEN],
135 char val[SW_TEXT_RECORD_MAX_LEN]);
138 #if defined(__cplusplus)