1 |
\hypertarget{group__dict}{ |
2 |
\section{Dictionary} |
3 |
\label{group__dict}\index{Dictionary@{Dictionary}} |
4 |
} |
5 |
|
6 |
|
7 |
\subsection{Detailed Description} |
8 |
\begin{Desc} |
9 |
\item[]Generic object-oriented dictionary support. It implements a container which pairs pointer-sized keys with pointer-sized values. Values are accessed via arbitrary user-defined keys. \end{Desc} |
10 |
|
11 |
|
12 |
\subsection*{Data Structures} |
13 |
\begin{CompactItemize} |
14 |
\item |
15 |
struct \hyperlink{structpeak__dict__init__entry}{peak\_\-dict\_\-init\_\-entry} |
16 |
\begin{CompactList}\small\item\em Structure containing a key and value pair to be used at the creation of the dictionary. \item\end{CompactList}\item |
17 |
struct \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} |
18 |
\begin{CompactList}\small\item\em Structure containing the callbacks for keys of a dictionary. \item\end{CompactList}\item |
19 |
struct \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} |
20 |
\begin{CompactList}\small\item\em Structure containing the callbacks for values of a dictionary. \item\end{CompactList}\end{CompactItemize} |
21 |
\subsection*{Typedefs} |
22 |
\begin{CompactItemize} |
23 |
\item |
24 |
\hypertarget{group__dict_ga0}{ |
25 |
typedef \_\-\_\-peak\_\-dict $\ast$ \hyperlink{group__dict_ga0}{peak\_\-dict}} |
26 |
\label{group__dict_ga0} |
27 |
|
28 |
\begin{CompactList}\small\item\em Opaque dictionary pointer type. \item\end{CompactList}\item |
29 |
\hypertarget{group__dict_ga1}{ |
30 |
typedef void $\ast$($\ast$ \hyperlink{group__dict_ga1}{peak\_\-dict\_\-retain\_\-callback} )(const void $\ast$value)} |
31 |
\label{group__dict_ga1} |
32 |
|
33 |
\begin{CompactList}\small\item\em Dictionary's key or value retain callback. \item\end{CompactList}\item |
34 |
\hypertarget{group__dict_ga2}{ |
35 |
typedef void($\ast$ \hyperlink{group__dict_ga2}{peak\_\-dict\_\-release\_\-callback} )(const void $\ast$value)} |
36 |
\label{group__dict_ga2} |
37 |
|
38 |
\begin{CompactList}\small\item\em Dictionary's key or value release callback. \item\end{CompactList}\item |
39 |
typedef int($\ast$ \hyperlink{group__dict_ga3}{peak\_\-dict\_\-equal\_\-callback} )(const void $\ast$val1, const void $\ast$val2) |
40 |
\begin{CompactList}\small\item\em Dictionary's key equal callback. \item\end{CompactList}\item |
41 |
typedef uint32\_\-t($\ast$ \hyperlink{group__dict_ga4}{peak\_\-dict\_\-hash\_\-callback} )(const void $\ast$value) |
42 |
\begin{CompactList}\small\item\em Dictionary's key callback. \item\end{CompactList}\item |
43 |
\hypertarget{group__dict_ga21}{ |
44 |
typedef void($\ast$ \hyperlink{group__dict_ga21}{peak\_\-dict\_\-apply\_\-func} )(const void $\ast$key, const void $\ast$value, void $\ast$context)} |
45 |
\label{group__dict_ga21} |
46 |
|
47 |
\begin{CompactList}\small\item\em Apply function pointer type. See \hyperlink{group__dict_ga28}{peak\_\-dict\_\-apply()}. \item\end{CompactList}\end{CompactItemize} |
48 |
\subsection*{Functions} |
49 |
\begin{CompactItemize} |
50 |
\item |
51 |
\hyperlink{group__dict_ga0}{peak\_\-dict} \hyperlink{group__dict_ga22}{peak\_\-dict\_\-create} (const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} $\ast$key\_\-ops, const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} $\ast$value\_\-ops, const \hyperlink{structpeak__dict__init__entry}{peak\_\-dict\_\-init\_\-entry} $\ast$init\_\-values, int num\_\-values) |
52 |
\begin{CompactList}\small\item\em Create a new dictionary. \item\end{CompactList}\item |
53 |
int \hyperlink{group__dict_ga23}{peak\_\-dict\_\-get\_\-count} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict) |
54 |
\begin{CompactList}\small\item\em Returns the number of values currently in the dictionary. \item\end{CompactList}\item |
55 |
const void $\ast$ \hyperlink{group__dict_ga24}{peak\_\-dict\_\-get\_\-value} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, const void $\ast$key) |
56 |
\begin{CompactList}\small\item\em Retrieves the value associated with the given key. \item\end{CompactList}\item |
57 |
void \hyperlink{group__dict_ga25}{peak\_\-dict\_\-get\_\-all} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, const void $\ast$$\ast$keys, const void $\ast$$\ast$values) |
58 |
\begin{CompactList}\small\item\em Retrieves all key and value pairs. \item\end{CompactList}\item |
59 |
void \hyperlink{group__dict_ga26}{peak\_\-dict\_\-apply} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, \hyperlink{group__dict_ga21}{peak\_\-dict\_\-apply\_\-func} applier, void $\ast$context) |
60 |
\begin{CompactList}\small\item\em Call a function once for each value in the dictionary. \item\end{CompactList}\item |
61 |
void \hyperlink{group__dict_ga27}{peak\_\-dict\_\-add} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, const void $\ast$key, const void $\ast$value) |
62 |
\begin{CompactList}\small\item\em \char`\"{}Add if absent\char`\"{} a key and value pair to the dictionary. \item\end{CompactList}\item |
63 |
void \hyperlink{group__dict_ga28}{peak\_\-dict\_\-set} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, const void $\ast$key, const void $\ast$value) |
64 |
\begin{CompactList}\small\item\em \char`\"{}Add if absent, replace is present\char`\"{} a key and value pair. \item\end{CompactList}\item |
65 |
void \hyperlink{group__dict_ga29}{peak\_\-dict\_\-replace} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, const void $\ast$key, const void $\ast$value) |
66 |
\begin{CompactList}\small\item\em \char`\"{}Replace if present\char`\"{} a key and value pair. \item\end{CompactList}\item |
67 |
void \hyperlink{group__dict_ga30}{peak\_\-dict\_\-remove} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict, const void $\ast$key) |
68 |
\begin{CompactList}\small\item\em Remove a key and value pair from the dictionary. \item\end{CompactList}\item |
69 |
void \hyperlink{group__dict_ga31}{peak\_\-dict\_\-clear} (\hyperlink{group__dict_ga0}{peak\_\-dict} dict) |
70 |
\begin{CompactList}\small\item\em Remove all values from the dictionary. \item\end{CompactList}\end{CompactItemize} |
71 |
\subsection*{Variables} |
72 |
\begin{CompactItemize} |
73 |
\item |
74 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga5}{peak\_\-dict\_\-null\_\-key\_\-ops} |
75 |
\item |
76 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga6}{peak\_\-dict\_\-null\_\-key\_\-ops} |
77 |
\item |
78 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga7}{peak\_\-dict\_\-string\_\-key\_\-ops} |
79 |
\item |
80 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga8}{peak\_\-dict\_\-string\_\-key\_\-ops} |
81 |
\item |
82 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga9}{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops} |
83 |
\item |
84 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga10}{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops} |
85 |
\item |
86 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga11}{peak\_\-dict\_\-stringcase\_\-key\_\-ops} |
87 |
\item |
88 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga12}{peak\_\-dict\_\-stringcase\_\-key\_\-ops} |
89 |
\item |
90 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga13}{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops} |
91 |
\item |
92 |
const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga14}{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops} |
93 |
\item |
94 |
const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga15}{peak\_\-dict\_\-null\_\-value\_\-ops} |
95 |
\item |
96 |
const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga16}{peak\_\-dict\_\-null\_\-value\_\-ops} |
97 |
\item |
98 |
const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga17}{peak\_\-dict\_\-string\_\-value\_\-ops} |
99 |
\item |
100 |
const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga18}{peak\_\-dict\_\-string\_\-value\_\-ops} |
101 |
\item |
102 |
const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga19}{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops} |
103 |
\item |
104 |
const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga20}{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops} |
105 |
\end{CompactItemize} |
106 |
|
107 |
|
108 |
\subsection{Typedef Documentation} |
109 |
\hypertarget{group__dict_ga3}{ |
110 |
\index{dict@{dict}!peak_dict_equal_callback@{peak\_\-dict\_\-equal\_\-callback}} |
111 |
\index{peak_dict_equal_callback@{peak\_\-dict\_\-equal\_\-callback}!dict@{dict}} |
112 |
\subsubsection[peak\_\-dict\_\-equal\_\-callback]{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ \hyperlink{group__dict_ga3}{peak\_\-dict\_\-equal\_\-callback})(const void $\ast$val1, const void $\ast$val2)}} |
113 |
\label{group__dict_ga3} |
114 |
|
115 |
|
116 |
Dictionary's key equal callback. |
117 |
|
118 |
Should return 0 if the objects match or another value otherwise (eg. 1). \hypertarget{group__dict_ga4}{ |
119 |
\index{dict@{dict}!peak_dict_hash_callback@{peak\_\-dict\_\-hash\_\-callback}} |
120 |
\index{peak_dict_hash_callback@{peak\_\-dict\_\-hash\_\-callback}!dict@{dict}} |
121 |
\subsubsection[peak\_\-dict\_\-hash\_\-callback]{\setlength{\rightskip}{0pt plus 5cm}typedef uint32\_\-t($\ast$ \hyperlink{group__dict_ga4}{peak\_\-dict\_\-hash\_\-callback})(const void $\ast$value)}} |
122 |
\label{group__dict_ga4} |
123 |
|
124 |
|
125 |
Dictionary's key callback. |
126 |
|
127 |
Should return a good 32-bits hash value. |
128 |
|
129 |
\subsection{Function Documentation} |
130 |
\hypertarget{group__dict_ga27}{ |
131 |
\index{dict@{dict}!peak_dict_add@{peak\_\-dict\_\-add}} |
132 |
\index{peak_dict_add@{peak\_\-dict\_\-add}!dict@{dict}} |
133 |
\subsubsection[peak\_\-dict\_\-add]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-add (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, const void $\ast$ {\em key}, const void $\ast$ {\em value})}} |
134 |
\label{group__dict_ga27} |
135 |
|
136 |
|
137 |
\char`\"{}Add if absent\char`\"{} a key and value pair to the dictionary. |
138 |
|
139 |
\begin{Desc} |
140 |
\item[Parameters:] |
141 |
\begin{description} |
142 |
\item[{\em dict}]The dictionary reference. \item[{\em key}]The key to add. It's retained by the dictionary using the retain callback provided when the dictionary was created. \item[{\em value}]The value to add, associated with the previous {\em key\/}. It's retained by the dictionary using the retain callback provided when the dictionary was created. \end{description} |
143 |
\end{Desc} |
144 |
\hypertarget{group__dict_ga26}{ |
145 |
\index{dict@{dict}!peak_dict_apply@{peak\_\-dict\_\-apply}} |
146 |
\index{peak_dict_apply@{peak\_\-dict\_\-apply}!dict@{dict}} |
147 |
\subsubsection[peak\_\-dict\_\-apply]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-apply (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, \hyperlink{group__dict_ga21}{peak\_\-dict\_\-apply\_\-func} {\em applier}, void $\ast$ {\em context})}} |
148 |
\label{group__dict_ga26} |
149 |
|
150 |
|
151 |
Call a function once for each value in the dictionary. |
152 |
|
153 |
\begin{Desc} |
154 |
\item[Parameters:] |
155 |
\begin{description} |
156 |
\item[{\em dict}]The dictionary reference. \item[{\em applier}]The callback function. \item[{\em context}]A pointer-sized user-defined value, which is passed to the applier function. This parameter is not used by the library itself otherwise. \end{description} |
157 |
\end{Desc} |
158 |
\hypertarget{group__dict_ga31}{ |
159 |
\index{dict@{dict}!peak_dict_clear@{peak\_\-dict\_\-clear}} |
160 |
\index{peak_dict_clear@{peak\_\-dict\_\-clear}!dict@{dict}} |
161 |
\subsubsection[peak\_\-dict\_\-clear]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-clear (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict})}} |
162 |
\label{group__dict_ga31} |
163 |
|
164 |
|
165 |
Remove all values from the dictionary. |
166 |
|
167 |
\begin{Desc} |
168 |
\item[Parameters:] |
169 |
\begin{description} |
170 |
\item[{\em dict}]The dictionary reference. \end{description} |
171 |
\end{Desc} |
172 |
\hypertarget{group__dict_ga22}{ |
173 |
\index{dict@{dict}!peak_dict_create@{peak\_\-dict\_\-create}} |
174 |
\index{peak_dict_create@{peak\_\-dict\_\-create}!dict@{dict}} |
175 |
\subsubsection[peak\_\-dict\_\-create]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{group__dict_ga0}{peak\_\-dict} peak\_\-dict\_\-create (const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} $\ast$ {\em key\_\-ops}, const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} $\ast$ {\em value\_\-ops}, const \hyperlink{structpeak__dict__init__entry}{peak\_\-dict\_\-init\_\-entry} $\ast$ {\em init\_\-values}, int {\em num\_\-values})}} |
176 |
\label{group__dict_ga22} |
177 |
|
178 |
|
179 |
Create a new dictionary. |
180 |
|
181 |
All peak's dictionary are created mutable, you can always add or remove elements. Immutable dictionary might be added in the future. |
182 |
|
183 |
\begin{Desc} |
184 |
\item[Parameters:] |
185 |
\begin{description} |
186 |
\item[{\em key\_\-ops}]A pointer to an user-defined operations structure \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} on keys. A copy of the pointed structure is made, so you can reuse or deallocate the structure after this call. \item[{\em value\_\-ops}]A pointer to an user-defined operations structure \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} on values. A copy of the pointed structure is made, so you can reuse or deallocate the structure after this call. \item[{\em init\_\-values}]A C array of \hyperlink{structpeak__dict__init__entry}{peak\_\-dict\_\-init\_\-entry} to be immediately added in the dictionary or {\tt NULL} if you want to create an empty dictionary. The array can be freed after the call. The key's retain callback, if any, is called for each item. Same thing for each value. \item[{\em num\_\-values}]Number of \hyperlink{structpeak__dict__init__entry}{peak\_\-dict\_\-init\_\-entry} structures in the {\em init\_\-values\/} C array. Use 0 if you want an empty dictionary.\end{description} |
187 |
\end{Desc} |
188 |
\begin{Desc} |
189 |
\item[Returns:]A pointer to a new allocated dictionary or {\tt NULL} if the operation failed. Use \hyperlink{group__alloc_ga7}{peak\_\-release()} when you want to dispose it. \end{Desc} |
190 |
\hypertarget{group__dict_ga25}{ |
191 |
\index{dict@{dict}!peak_dict_get_all@{peak\_\-dict\_\-get\_\-all}} |
192 |
\index{peak_dict_get_all@{peak\_\-dict\_\-get\_\-all}!dict@{dict}} |
193 |
\subsubsection[peak\_\-dict\_\-get\_\-all]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-get\_\-all (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, const void $\ast$$\ast$ {\em keys}, const void $\ast$$\ast$ {\em values})}} |
194 |
\label{group__dict_ga25} |
195 |
|
196 |
|
197 |
Retrieves all key and value pairs. |
198 |
|
199 |
This method fills the two buffers with the keys and values from the dictionary. The keys and values C arrays are parallel to each other but the order or the pairs is not defined. |
200 |
|
201 |
\begin{Desc} |
202 |
\item[Parameters:] |
203 |
\begin{description} |
204 |
\item[{\em dict}]The dictionary reference. \item[{\em keys}]A buffer large enough to hold all pointer-sized keys or {\tt NULL}. \item[{\em values}]A buffer large enough to hold all pointer-sized values or {\tt NULL}. \end{description} |
205 |
\end{Desc} |
206 |
\hypertarget{group__dict_ga23}{ |
207 |
\index{dict@{dict}!peak_dict_get_count@{peak\_\-dict\_\-get\_\-count}} |
208 |
\index{peak_dict_get_count@{peak\_\-dict\_\-get\_\-count}!dict@{dict}} |
209 |
\subsubsection[peak\_\-dict\_\-get\_\-count]{\setlength{\rightskip}{0pt plus 5cm}int peak\_\-dict\_\-get\_\-count (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict})}} |
210 |
\label{group__dict_ga23} |
211 |
|
212 |
|
213 |
Returns the number of values currently in the dictionary. |
214 |
|
215 |
\begin{Desc} |
216 |
\item[Parameters:] |
217 |
\begin{description} |
218 |
\item[{\em dict}]The dictionary reference.\end{description} |
219 |
\end{Desc} |
220 |
\begin{Desc} |
221 |
\item[Returns:]Number of values currently in the dictionary. \end{Desc} |
222 |
\hypertarget{group__dict_ga24}{ |
223 |
\index{dict@{dict}!peak_dict_get_value@{peak\_\-dict\_\-get\_\-value}} |
224 |
\index{peak_dict_get_value@{peak\_\-dict\_\-get\_\-value}!dict@{dict}} |
225 |
\subsubsection[peak\_\-dict\_\-get\_\-value]{\setlength{\rightskip}{0pt plus 5cm}const void$\ast$ peak\_\-dict\_\-get\_\-value (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, const void $\ast$ {\em key})}} |
226 |
\label{group__dict_ga24} |
227 |
|
228 |
|
229 |
Retrieves the value associated with the given key. |
230 |
|
231 |
This method will use the hash and equal key callbacks provided when the dictionary was created. |
232 |
|
233 |
\begin{Desc} |
234 |
\item[Parameters:] |
235 |
\begin{description} |
236 |
\item[{\em dict}]The dictionary reference. \item[{\em key}]The key for which to find a match in the dictionary.\end{description} |
237 |
\end{Desc} |
238 |
\begin{Desc} |
239 |
\item[Returns:]Number of values currently in the dictionary. \end{Desc} |
240 |
\hypertarget{group__dict_ga30}{ |
241 |
\index{dict@{dict}!peak_dict_remove@{peak\_\-dict\_\-remove}} |
242 |
\index{peak_dict_remove@{peak\_\-dict\_\-remove}!dict@{dict}} |
243 |
\subsubsection[peak\_\-dict\_\-remove]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-remove (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, const void $\ast$ {\em key})}} |
244 |
\label{group__dict_ga30} |
245 |
|
246 |
|
247 |
Remove a key and value pair from the dictionary. |
248 |
|
249 |
\begin{Desc} |
250 |
\item[Parameters:] |
251 |
\begin{description} |
252 |
\item[{\em dict}]The dictionary reference. \item[{\em key}]The key of the value to remove in the dictionary. They are released by the dictionary using the release callbacks provided when the dictionary was created, if any. \end{description} |
253 |
\end{Desc} |
254 |
\hypertarget{group__dict_ga29}{ |
255 |
\index{dict@{dict}!peak_dict_replace@{peak\_\-dict\_\-replace}} |
256 |
\index{peak_dict_replace@{peak\_\-dict\_\-replace}!dict@{dict}} |
257 |
\subsubsection[peak\_\-dict\_\-replace]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-replace (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, const void $\ast$ {\em key}, const void $\ast$ {\em value})}} |
258 |
\label{group__dict_ga29} |
259 |
|
260 |
|
261 |
\char`\"{}Replace if present\char`\"{} a key and value pair. |
262 |
|
263 |
\begin{Desc} |
264 |
\item[Parameters:] |
265 |
\begin{description} |
266 |
\item[{\em dict}]The dictionary reference. \item[{\em key}]The key of the value to replace in the dictionary. \item[{\em value}]The value to replace, associated with the previous {\em key\/}. The old one is released by the dictionary using the release callback and the new one is retained using the retain callback, both provided when the dictionary was created. \end{description} |
267 |
\end{Desc} |
268 |
\hypertarget{group__dict_ga28}{ |
269 |
\index{dict@{dict}!peak_dict_set@{peak\_\-dict\_\-set}} |
270 |
\index{peak_dict_set@{peak\_\-dict\_\-set}!dict@{dict}} |
271 |
\subsubsection[peak\_\-dict\_\-set]{\setlength{\rightskip}{0pt plus 5cm}void peak\_\-dict\_\-set (\hyperlink{group__dict_ga0}{peak\_\-dict} {\em dict}, const void $\ast$ {\em key}, const void $\ast$ {\em value})}} |
272 |
\label{group__dict_ga28} |
273 |
|
274 |
|
275 |
\char`\"{}Add if absent, replace is present\char`\"{} a key and value pair. |
276 |
|
277 |
\begin{Desc} |
278 |
\item[Parameters:] |
279 |
\begin{description} |
280 |
\item[{\em dict}]The dictionary reference. \item[{\em key}]The key to set. If the key isn't already in the dictionary, it's retained using the retain callback provided when the dictionary was created. \item[{\em value}]The value to set, associated with the previous {\em key\/}. It's retained by the dictionary using the retain callback provided when the dictionary was created. \end{description} |
281 |
\end{Desc} |
282 |
|
283 |
|
284 |
\subsection{Variable Documentation} |
285 |
\hypertarget{group__dict_ga6}{ |
286 |
\index{dict@{dict}!peak_dict_null_key_ops@{peak\_\-dict\_\-null\_\-key\_\-ops}} |
287 |
\index{peak_dict_null_key_ops@{peak\_\-dict\_\-null\_\-key\_\-ops}!dict@{dict}} |
288 |
\subsubsection[peak\_\-dict\_\-null\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga6}{peak\_\-dict\_\-null\_\-key\_\-ops}}} |
289 |
\label{group__dict_ga6} |
290 |
|
291 |
|
292 |
Predefined callbacks structure appropriate for use when keys of a dictionary are unknown objects and you want nothing to be performed as retain/release, and you can't provide better equality or hashing function than pointer-related ones. \hypertarget{group__dict_ga5}{ |
293 |
\index{dict@{dict}!peak_dict_null_key_ops@{peak\_\-dict\_\-null\_\-key\_\-ops}} |
294 |
\index{peak_dict_null_key_ops@{peak\_\-dict\_\-null\_\-key\_\-ops}!dict@{dict}} |
295 |
\subsubsection[peak\_\-dict\_\-null\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga6}{peak\_\-dict\_\-null\_\-key\_\-ops}}} |
296 |
\label{group__dict_ga5} |
297 |
|
298 |
|
299 |
{\bf Initial value:} |
300 |
|
301 |
\footnotesize\begin{verbatim} |
302 |
{ |
303 |
NULL, NULL, __peak_dict_ptr_equal, __peak_dict_ptr_hash |
304 |
} |
305 |
\end{verbatim}\normalsize |
306 |
Predefined callbacks structure appropriate for use when keys of a dictionary are unknown objects and you want nothing to be performed as retain/release, and you can't provide better equality or hashing function than pointer-related ones. \hypertarget{group__dict_ga16}{ |
307 |
\index{dict@{dict}!peak_dict_null_value_ops@{peak\_\-dict\_\-null\_\-value\_\-ops}} |
308 |
\index{peak_dict_null_value_ops@{peak\_\-dict\_\-null\_\-value\_\-ops}!dict@{dict}} |
309 |
\subsubsection[peak\_\-dict\_\-null\_\-value\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga16}{peak\_\-dict\_\-null\_\-value\_\-ops}}} |
310 |
\label{group__dict_ga16} |
311 |
|
312 |
|
313 |
Predefined callbacks structure appropriate for use when values of a dictionary are unknown objects. \hypertarget{group__dict_ga15}{ |
314 |
\index{dict@{dict}!peak_dict_null_value_ops@{peak\_\-dict\_\-null\_\-value\_\-ops}} |
315 |
\index{peak_dict_null_value_ops@{peak\_\-dict\_\-null\_\-value\_\-ops}!dict@{dict}} |
316 |
\subsubsection[peak\_\-dict\_\-null\_\-value\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga16}{peak\_\-dict\_\-null\_\-value\_\-ops}}} |
317 |
\label{group__dict_ga15} |
318 |
|
319 |
|
320 |
{\bf Initial value:} |
321 |
|
322 |
\footnotesize\begin{verbatim} |
323 |
{ |
324 |
NULL, NULL |
325 |
} |
326 |
\end{verbatim}\normalsize |
327 |
Predefined callbacks structure appropriate for use when values of a dictionary are unknown objects. \hypertarget{group__dict_ga10}{ |
328 |
\index{dict@{dict}!peak_dict_string_copy_key_ops@{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops}} |
329 |
\index{peak_dict_string_copy_key_ops@{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops}!dict@{dict}} |
330 |
\subsubsection[peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga10}{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops}}} |
331 |
\label{group__dict_ga10} |
332 |
|
333 |
|
334 |
Predefined callbacks structure appropriate for use when keys of a dictionary are strings to be copied by the dictionary. \hypertarget{group__dict_ga9}{ |
335 |
\index{dict@{dict}!peak_dict_string_copy_key_ops@{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops}} |
336 |
\index{peak_dict_string_copy_key_ops@{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops}!dict@{dict}} |
337 |
\subsubsection[peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga10}{peak\_\-dict\_\-string\_\-copy\_\-key\_\-ops}}} |
338 |
\label{group__dict_ga9} |
339 |
|
340 |
|
341 |
{\bf Initial value:} |
342 |
|
343 |
\footnotesize\begin{verbatim} |
344 |
{ |
345 |
(peak_dict_retain_callback)peak_strdup, |
346 |
(peak_dict_release_callback)peak_deallocate, |
347 |
__peak_dict_string_equal, |
348 |
__peak_dict_string_hash |
349 |
} |
350 |
\end{verbatim}\normalsize |
351 |
Predefined callbacks structure appropriate for use when keys of a dictionary are strings to be copied by the dictionary. \hypertarget{group__dict_ga20}{ |
352 |
\index{dict@{dict}!peak_dict_string_copy_value_ops@{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops}} |
353 |
\index{peak_dict_string_copy_value_ops@{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops}!dict@{dict}} |
354 |
\subsubsection[peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga20}{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops}}} |
355 |
\label{group__dict_ga20} |
356 |
|
357 |
|
358 |
Predefined callbacks structure appropriate for use when values of a dictionary are strings to be copied by the dictionary. \hypertarget{group__dict_ga19}{ |
359 |
\index{dict@{dict}!peak_dict_string_copy_value_ops@{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops}} |
360 |
\index{peak_dict_string_copy_value_ops@{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops}!dict@{dict}} |
361 |
\subsubsection[peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga20}{peak\_\-dict\_\-string\_\-copy\_\-value\_\-ops}}} |
362 |
\label{group__dict_ga19} |
363 |
|
364 |
|
365 |
{\bf Initial value:} |
366 |
|
367 |
\footnotesize\begin{verbatim} |
368 |
{ |
369 |
(peak_dict_retain_callback)peak_strdup, |
370 |
(peak_dict_release_callback)peak_deallocate |
371 |
} |
372 |
\end{verbatim}\normalsize |
373 |
Predefined callbacks structure appropriate for use when values of a dictionary are strings to be copied by the dictionary. \hypertarget{group__dict_ga8}{ |
374 |
\index{dict@{dict}!peak_dict_string_key_ops@{peak\_\-dict\_\-string\_\-key\_\-ops}} |
375 |
\index{peak_dict_string_key_ops@{peak\_\-dict\_\-string\_\-key\_\-ops}!dict@{dict}} |
376 |
\subsubsection[peak\_\-dict\_\-string\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga8}{peak\_\-dict\_\-string\_\-key\_\-ops}}} |
377 |
\label{group__dict_ga8} |
378 |
|
379 |
|
380 |
Predefined callbacks structure appropriate for use when keys of a dictionary are constant strings. \hypertarget{group__dict_ga7}{ |
381 |
\index{dict@{dict}!peak_dict_string_key_ops@{peak\_\-dict\_\-string\_\-key\_\-ops}} |
382 |
\index{peak_dict_string_key_ops@{peak\_\-dict\_\-string\_\-key\_\-ops}!dict@{dict}} |
383 |
\subsubsection[peak\_\-dict\_\-string\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga8}{peak\_\-dict\_\-string\_\-key\_\-ops}}} |
384 |
\label{group__dict_ga7} |
385 |
|
386 |
|
387 |
{\bf Initial value:} |
388 |
|
389 |
\footnotesize\begin{verbatim} |
390 |
{ |
391 |
NULL, NULL, __peak_dict_string_equal, __peak_dict_string_hash |
392 |
} |
393 |
\end{verbatim}\normalsize |
394 |
Predefined callbacks structure appropriate for use when keys of a dictionary are constant strings. \hypertarget{group__dict_ga18}{ |
395 |
\index{dict@{dict}!peak_dict_string_value_ops@{peak\_\-dict\_\-string\_\-value\_\-ops}} |
396 |
\index{peak_dict_string_value_ops@{peak\_\-dict\_\-string\_\-value\_\-ops}!dict@{dict}} |
397 |
\subsubsection[peak\_\-dict\_\-string\_\-value\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga18}{peak\_\-dict\_\-string\_\-value\_\-ops}}} |
398 |
\label{group__dict_ga18} |
399 |
|
400 |
|
401 |
Predefined callbacks structure appropriate for use when values of a dictionary are constant strings. \hypertarget{group__dict_ga17}{ |
402 |
\index{dict@{dict}!peak_dict_string_value_ops@{peak\_\-dict\_\-string\_\-value\_\-ops}} |
403 |
\index{peak_dict_string_value_ops@{peak\_\-dict\_\-string\_\-value\_\-ops}!dict@{dict}} |
404 |
\subsubsection[peak\_\-dict\_\-string\_\-value\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__value__ops__s}{peak\_\-dict\_\-value\_\-ops\_\-s} \hyperlink{group__dict_ga18}{peak\_\-dict\_\-string\_\-value\_\-ops}}} |
405 |
\label{group__dict_ga17} |
406 |
|
407 |
|
408 |
{\bf Initial value:} |
409 |
|
410 |
\footnotesize\begin{verbatim} |
411 |
{ |
412 |
NULL, NULL |
413 |
} |
414 |
\end{verbatim}\normalsize |
415 |
Predefined callbacks structure appropriate for use when values of a dictionary are constant strings. \hypertarget{group__dict_ga14}{ |
416 |
\index{dict@{dict}!peak_dict_stringcase_copy_key_ops@{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops}} |
417 |
\index{peak_dict_stringcase_copy_key_ops@{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops}!dict@{dict}} |
418 |
\subsubsection[peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga14}{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops}}} |
419 |
\label{group__dict_ga14} |
420 |
|
421 |
|
422 |
Predefined callbacks structure appropriate for use when keys of a dictionary are strings ignoring case to be copied by the dictionary. \hypertarget{group__dict_ga13}{ |
423 |
\index{dict@{dict}!peak_dict_stringcase_copy_key_ops@{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops}} |
424 |
\index{peak_dict_stringcase_copy_key_ops@{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops}!dict@{dict}} |
425 |
\subsubsection[peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga14}{peak\_\-dict\_\-stringcase\_\-copy\_\-key\_\-ops}}} |
426 |
\label{group__dict_ga13} |
427 |
|
428 |
|
429 |
{\bf Initial value:} |
430 |
|
431 |
\footnotesize\begin{verbatim} |
432 |
{ |
433 |
(peak_dict_retain_callback)peak_strdup, |
434 |
(peak_dict_release_callback)peak_deallocate, |
435 |
__peak_dict_stringcase_equal, |
436 |
__peak_dict_stringcase_hash |
437 |
} |
438 |
\end{verbatim}\normalsize |
439 |
Predefined callbacks structure appropriate for use when keys of a dictionary are strings ignoring case to be copied by the dictionary. \hypertarget{group__dict_ga12}{ |
440 |
\index{dict@{dict}!peak_dict_stringcase_key_ops@{peak\_\-dict\_\-stringcase\_\-key\_\-ops}} |
441 |
\index{peak_dict_stringcase_key_ops@{peak\_\-dict\_\-stringcase\_\-key\_\-ops}!dict@{dict}} |
442 |
\subsubsection[peak\_\-dict\_\-stringcase\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga12}{peak\_\-dict\_\-stringcase\_\-key\_\-ops}}} |
443 |
\label{group__dict_ga12} |
444 |
|
445 |
|
446 |
Predefined callbacks structure appropriate for use when keys of a dictionary are constant strings ignoring case. \hypertarget{group__dict_ga11}{ |
447 |
\index{dict@{dict}!peak_dict_stringcase_key_ops@{peak\_\-dict\_\-stringcase\_\-key\_\-ops}} |
448 |
\index{peak_dict_stringcase_key_ops@{peak\_\-dict\_\-stringcase\_\-key\_\-ops}!dict@{dict}} |
449 |
\subsubsection[peak\_\-dict\_\-stringcase\_\-key\_\-ops]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structpeak__dict__key__ops__s}{peak\_\-dict\_\-key\_\-ops\_\-s} \hyperlink{group__dict_ga12}{peak\_\-dict\_\-stringcase\_\-key\_\-ops}}} |
450 |
\label{group__dict_ga11} |
451 |
|
452 |
|
453 |
{\bf Initial value:} |
454 |
|
455 |
\footnotesize\begin{verbatim} |
456 |
{ |
457 |
NULL, NULL, __peak_dict_stringcase_equal, __peak_dict_stringcase_hash |
458 |
} |
459 |
\end{verbatim}\normalsize |
460 |
Predefined callbacks structure appropriate for use when keys of a dictionary are constant strings ignoring case. |