summaryrefslogtreecommitdiff
path: root/package/libqb/patches/patch-docs_man3_qbmap_h_3
blob: d1d4feff84bf6fcca5ee500dc91da9051661f1d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
--- libqb-0.16.0.orig/docs/man3/qbmap.h.3	2013-07-25 20:16:18.000000000 +0200
+++ libqb-0.16.0/docs/man3/qbmap.h.3	2013-09-09 05:26:31.803806391 +0200
@@ -1,4 +1,4 @@
-.TH "qbmap.h" 3 "Thu Jul 25 2013" "Version 0.16.0" "libqb" \" -*- nroff -*-
+.TH "qbmap.h" 3 "Mon Sep 9 2013" "Version 0.16.0" "libqb" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
@@ -14,7 +14,7 @@ This provides a map interface to a Patri
 \fC#include <unistd\&.h>\fP
 .br
 
-.SS "Macros"
+.SS "Defines"
 
 .in +1c
 .ti -1c
@@ -137,13 +137,13 @@ The hashtable is NOT ordered, but ptrie
 Below is a simple example of how to iterate over a map\&. 
 .PP
 .nf
-const char *p;
-void *data;
-qb_map_iter_t *it = qb_map_iter_create(m);
-for (p = qb_map_iter_next(it, &data); p; p = qb_map_iter_next(it, &data)) {
-    printf('%s > %s\n', p, (char*) data);
-}
-qb_map_iter_free(it);
+ const char *p;
+ void *data;
+ qb_map_iter_t *it = qb_map_iter_create(m);
+ for (p = qb_map_iter_next(it, &data); p; p = qb_map_iter_next(it, &data)) {
+     printf('%s > %s\n', p, (char*) data);
+ }
+ qb_map_iter_free(it);
 
 .fi
 .PP
@@ -152,8 +152,8 @@ qb_map_iter_free(it);
 Deletion of items within the iterator is supported\&. But note do not free the item memory in the iterator\&. If you need to free the data items then register for a notifier and free the memory there\&. This is required as the items are reference counted\&. 
 .PP
 .nf
-qb_map_notify_add(m, NULL, my_map_free_handler,
-             QB_MAP_NOTIFY_FREE, NULL);
+ qb_map_notify_add(m, NULL, my_map_free_handler,
+                     QB_MAP_NOTIFY_FREE, NULL);
 
 .fi
 .PP
@@ -168,7 +168,7 @@ These allow you to get callbacks when va
 hashtable only supports deletion and replacement notificatins\&. There is also a special global callback for freeing deleted and replaced values (QB_MAP_NOTIFY_FREE)\&. 
 .RE
 .PP
-\fBSee Also:\fP
+\fBSee also:\fP
 .RS 4
 \fBqb_map_notify_add()\fP \fBqb_map_notify_del_2()\fP
 .RE
@@ -180,57 +180,47 @@ The ptrie supports prefixes in the itera
 .PP
 .PP
 .nf
-it = qb_map_pref_iter_create(m, 'aa');
-while ((p = qb_map_iter_next(it, &data)) != NULL) {
-    printf('%s > %s\n', p, (char*)data);
-}
-qb_map_iter_free(it);
+ it = qb_map_pref_iter_create(m, 'aa');
+ while ((p = qb_map_iter_next(it, &data)) != NULL) {
+     printf('%s > %s\n', p, (char*)data);
+ }
+ qb_map_iter_free(it);
 .fi
 .PP
 .PP
 The ptrie also supports prefixes in notifications: (remember to pass QB_MAP_NOTIFY_RECURSIVE into the notify_add\&. 
 .PP
 .nf
-qb_map_notify_add(m, 'root', my_map_notification,
-            (QB_MAP_NOTIFY_INSERTED|
-             QB_MAP_NOTIFY_DELETED|
-             QB_MAP_NOTIFY_REPLACED|
-             QB_MAP_NOTIFY_RECURSIVE),
-            NULL);
+ qb_map_notify_add(m, 'root', my_map_notification,
+                    (QB_MAP_NOTIFY_INSERTED|
+                     QB_MAP_NOTIFY_DELETED|
+                     QB_MAP_NOTIFY_REPLACED|
+                     QB_MAP_NOTIFY_RECURSIVE),
+                    NULL);
 
 .fi
 .PP
  
-.SH "Macro Definition Documentation"
+.SH "Define Documentation"
 .PP 
-.SS "#define QB_MAP_NOTIFY_DELETED   1"
-
-.SS "#define QB_MAP_NOTIFY_FREE   16"
-
-.SS "#define QB_MAP_NOTIFY_INSERTED   4"
-
-.SS "#define QB_MAP_NOTIFY_RECURSIVE   8"
-
-.SS "#define QB_MAP_NOTIFY_REPLACED   2"
-
+.SS "#define \fBQB_MAP_NOTIFY_DELETED\fP   1"
+.SS "#define \fBQB_MAP_NOTIFY_FREE\fP   16"
+.SS "#define \fBQB_MAP_NOTIFY_INSERTED\fP   4"
+.SS "#define \fBQB_MAP_NOTIFY_RECURSIVE\fP   8"
+.SS "#define \fBQB_MAP_NOTIFY_REPLACED\fP   2"
 .SH "Typedef Documentation"
 .PP 
 .SS "typedef struct qb_map_iter \fBqb_map_iter_t\fP"
-
 .PP
 This is an opaque data type representing an iterator instance\&. 
-.SS "typedef void(* qb_map_notify_fn)(uint32_t event, char *key, void *old_value, void *value, void *user_data)"
-
+.SS "typedef void(* \fBqb_map_notify_fn\fP)(uint32_t event, char *key, void *old_value, void *value, void *user_data)"
 .SS "typedef struct qb_map \fBqb_map_t\fP"
-
 .PP
 This is an opaque data type representing an instance of a map\&. 
-.SS "typedef int32_t(* qb_map_transverse_fn)(const char *key, void *value, void *user_data)"
-
+.SS "typedef int32_t(* \fBqb_map_transverse_fn\fP)(const char *key, void *value, void *user_data)"
 .SH "Function Documentation"
 .PP 
-.SS "\fBqb_map_t\fP* qb_hashtable_create (size_tmax_size)"
-
+.SS "\fBqb_map_t\fP* \fBqb_hashtable_create\fP (size_tmax_size)"
 .PP
 Create an unsorted map based on a hashtable\&. \fBParameters:\fP
 .RS 4
@@ -243,20 +233,16 @@ the map instance
 .RE
 .PP
 
-.SS "size_t qb_map_count_get (\fBqb_map_t\fP *map)"
-
+.SS "size_t \fBqb_map_count_get\fP (\fBqb_map_t\fP *map)"
 .PP
 Get the number of items in the map\&. 
-.SS "void qb_map_destroy (\fBqb_map_t\fP *map)"
-
+.SS "void \fBqb_map_destroy\fP (\fBqb_map_t\fP *map)"
 .PP
 Destroy the map, removes all the items from the map\&. 
-.SS "void qb_map_foreach (\fBqb_map_t\fP *map, \fBqb_map_transverse_fn\fPfunc, void *user_data)"
-
+.SS "void \fBqb_map_foreach\fP (\fBqb_map_t\fP *map, \fBqb_map_transverse_fn\fPfunc, void *user_data)"
 .PP
 Calls the given function for each of the key/value pairs in the map\&. The function is passed the key and value of each pair, and the given data parameter\&. The map is traversed in sorted order\&. 
-.SS "void* qb_map_get (\fBqb_map_t\fP *map, const char *key)"
-
+.SS "void* \fBqb_map_get\fP (\fBqb_map_t\fP *map, const char *key)"
 .PP
 Gets the value corresponding to the given key\&. \fBReturn values:\fP
 .RS 4
@@ -266,12 +252,10 @@ Gets the value corresponding to the give
 .RE
 .PP
 
-.SS "\fBqb_map_iter_t\fP* qb_map_iter_create (\fBqb_map_t\fP *map)"
-
+.SS "\fBqb_map_iter_t\fP* \fBqb_map_iter_create\fP (\fBqb_map_t\fP *map)"
 .PP
 Create an iterator\&. 
-.SS "void qb_map_iter_free (\fBqb_map_iter_t\fP *i)"
-
+.SS "void \fBqb_map_iter_free\fP (\fBqb_map_iter_t\fP *i)"
 .PP
 free the iterator \fBParameters:\fP
 .RS 4
@@ -279,8 +263,7 @@ free the iterator \fBParameters:\fP
 .RE
 .PP
 
-.SS "const char* qb_map_iter_next (\fBqb_map_iter_t\fP *i, void **value)"
-
+.SS "const char* \fBqb_map_iter_next\fP (\fBqb_map_iter_t\fP *i, void **value)"
 .PP
 Get the next item\&. \fBParameters:\fP
 .RS 4
@@ -297,8 +280,7 @@ Get the next item\&. \fBParameters:\fP
 .RE
 .PP
 
-.SS "int32_t qb_map_notify_add (\fBqb_map_t\fP *m, const char *key, \fBqb_map_notify_fn\fPfn, int32_tevents, void *user_data)"
-
+.SS "int32_t \fBqb_map_notify_add\fP (\fBqb_map_t\fP *m, const char *key, \fBqb_map_notify_fn\fPfn, int32_tevents, void *user_data)"
 .PP
 Add a notifier to the map\&. \fBParameters:\fP
 .RS 4
@@ -328,8 +310,7 @@ you can use key prefixes with trie maps\
 .RE
 .PP
 
-.SS "int32_t qb_map_notify_del (\fBqb_map_t\fP *m, const char *key, \fBqb_map_notify_fn\fPfn, int32_tevents)"
-
+.SS "int32_t \fBqb_map_notify_del\fP (\fBqb_map_t\fP *m, const char *key, \fBqb_map_notify_fn\fPfn, int32_tevents)"
 .PP
 Delete a notifier from the map\&. \fBNote:\fP
 .RS 4
@@ -355,8 +336,7 @@ the key,fn and events must match those y
 .RE
 .PP
 
-.SS "int32_t qb_map_notify_del_2 (\fBqb_map_t\fP *m, const char *key, \fBqb_map_notify_fn\fPfn, int32_tevents, void *user_data)"
-
+.SS "int32_t \fBqb_map_notify_del_2\fP (\fBqb_map_t\fP *m, const char *key, \fBqb_map_notify_fn\fPfn, int32_tevents, void *user_data)"
 .PP
 Delete a notifier from the map (including the userdata)\&. \fBNote:\fP
 .RS 4
@@ -384,8 +364,7 @@ the key, fn, events and userdata must ma
 .RE
 .PP
 
-.SS "\fBqb_map_iter_t\fP* qb_map_pref_iter_create (\fBqb_map_t\fP *map, const char *prefix)"
-
+.SS "\fBqb_map_iter_t\fP* \fBqb_map_pref_iter_create\fP (\fBqb_map_t\fP *map, const char *prefix)"
 .PP
 Create a prefix iterator\&. This will iterate over all items with the given prefix\&. 
 .PP
@@ -395,16 +374,13 @@ this is only supported by the trie\&.
 .RE
 .PP
 
-.SS "void qb_map_put (\fBqb_map_t\fP *map, const char *key, const void *value)"
-
+.SS "void \fBqb_map_put\fP (\fBqb_map_t\fP *map, const char *key, const void *value)"
 .PP
 Inserts a new key and value into a qb_map_t\&. If the key already exists in the qb_map_t, it gets replaced by the new key\&. 
-.SS "int32_t qb_map_rm (\fBqb_map_t\fP *map, const char *key)"
-
+.SS "int32_t \fBqb_map_rm\fP (\fBqb_map_t\fP *map, const char *key)"
 .PP
 Removes a key/value pair from a map\&. 
-.SS "\fBqb_map_t\fP* qb_skiplist_create (void)"
-
+.SS "\fBqb_map_t\fP* \fBqb_skiplist_create\fP (void)"
 .PP
 Create a sorted map using a skiplist\&. \fBReturns:\fP
 .RS 4
@@ -412,12 +388,10 @@ the map instance
 .RE
 .PP
 
-.SS "\fBqb_map_t\fP* qb_trie_create (void)"
-
+.SS "\fBqb_map_t\fP* \fBqb_trie_create\fP (void)"
 .PP
 Create a sorted map using a Patricia trie or 'Radix tree'\&.  
-.SS "void qb_trie_dump (\fBqb_map_t\fP *m)"
-
+.SS "void \fBqb_trie_dump\fP (\fBqb_map_t\fP *m)"
 .PP
 print out the nodes in the trie (for debug purposes) 
 .SH "Author"