Debian Codegraph @

docs/reference/html/libiptcdata-data.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>data: libiptcdata Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="libiptcdata Reference Manual">
8 <link rel="up" href="ch01.html" title="IPTC Data Manipulation">
9 <link rel="prev" href="ch01.html" title="IPTC Data Manipulation">
10 <link rel="next" href="libiptcdata-dataset.html" title="dataset">
11 <meta name="generator" content="GTK-Doc V1.28 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18 <a href="#libiptcdata-data.description" class="shortcut">Description</a></span>
19 </td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="ch01.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="libiptcdata-dataset.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
24 </tr></table>
25 <div class="refentry">
26 <a name="libiptcdata-data"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="libiptcdata-data.top_of_page"></a>data</span></h2>
30 <p>data</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="libiptcdata-data.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
37 <colgroup>
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
40 </colgroup>
41 <tbody>
42 <tr>
43 <td class="function_type">
44 <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
45 </td>
46 <td class="function_name">
47 <a class="link" href="libiptcdata-data.html#iptc-data-new" title="iptc_data_new ()">iptc_data_new</a> <span class="c_punctuation">()</span>
48 </td>
49 </tr>
50 <tr>
51 <td class="function_type">
52 <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
53 </td>
54 <td class="function_name">
55 <a class="link" href="libiptcdata-data.html#iptc-data-new-mem" title="iptc_data_new_mem ()">iptc_data_new_mem</a> <span class="c_punctuation">()</span>
56 </td>
57 </tr>
58 <tr>
59 <td class="function_type">
60 <span class="returnvalue">void</span>
61 </td>
62 <td class="function_name">
63 <a class="link" href="libiptcdata-data.html#iptc-data-ref" title="iptc_data_ref ()">iptc_data_ref</a> <span class="c_punctuation">()</span>
64 </td>
65 </tr>
66 <tr>
67 <td class="function_type">
68 <span class="returnvalue">void</span>
69 </td>
70 <td class="function_name">
71 <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()">iptc_data_unref</a> <span class="c_punctuation">()</span>
72 </td>
73 </tr>
74 <tr>
75 <td class="function_type">
76 <span class="returnvalue">void</span>
77 </td>
78 <td class="function_name">
79 <a class="link" href="libiptcdata-data.html#iptc-data-free" title="iptc_data_free ()">iptc_data_free</a> <span class="c_punctuation">()</span>
80 </td>
81 </tr>
82 <tr>
83 <td class="function_type">
84 <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
85 </td>
86 <td class="function_name">
87 <a class="link" href="libiptcdata-data.html#iptc-data-new-from-jpeg" title="iptc_data_new_from_jpeg ()">iptc_data_new_from_jpeg</a> <span class="c_punctuation">()</span>
88 </td>
89 </tr>
90 <tr>
91 <td class="function_type">
92 <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
93 </td>
94 <td class="function_name">
95 <a class="link" href="libiptcdata-data.html#iptc-data-new-from-data" title="iptc_data_new_from_data ()">iptc_data_new_from_data</a> <span class="c_punctuation">()</span>
96 </td>
97 </tr>
98 <tr>
99 <td class="function_type">
100 <span class="returnvalue">int</span>
101 </td>
102 <td class="function_name">
103 <a class="link" href="libiptcdata-data.html#iptc-data-load" title="iptc_data_load ()">iptc_data_load</a> <span class="c_punctuation">()</span>
104 </td>
105 </tr>
106 <tr>
107 <td class="function_type">
108 <span class="returnvalue">int</span>
109 </td>
110 <td class="function_name">
111 <a class="link" href="libiptcdata-data.html#iptc-data-save" title="iptc_data_save ()">iptc_data_save</a> <span class="c_punctuation">()</span>
112 </td>
113 </tr>
114 <tr>
115 <td class="function_type">
116 <span class="returnvalue">void</span>
117 </td>
118 <td class="function_name">
119 <a class="link" href="libiptcdata-data.html#iptc-data-free-buf" title="iptc_data_free_buf ()">iptc_data_free_buf</a> <span class="c_punctuation">()</span>
120 </td>
121 </tr>
122 <tr>
123 <td class="function_type">
124 <a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="returnvalue">IptcDataSet</span></a> *
125 </td>
126 <td class="function_name">
127 <a class="link" href="libiptcdata-data.html#iptc-data-get-dataset" title="iptc_data_get_dataset ()">iptc_data_get_dataset</a> <span class="c_punctuation">()</span>
128 </td>
129 </tr>
130 <tr>
131 <td class="function_type">
132 <a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="returnvalue">IptcDataSet</span></a> *
133 </td>
134 <td class="function_name">
135 <a class="link" href="libiptcdata-data.html#iptc-data-get-next-dataset" title="iptc_data_get_next_dataset ()">iptc_data_get_next_dataset</a> <span class="c_punctuation">()</span>
136 </td>
137 </tr>
138 <tr>
139 <td class="function_type">
140 <span class="returnvalue">int</span>
141 </td>
142 <td class="function_name">
143 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset" title="iptc_data_add_dataset ()">iptc_data_add_dataset</a> <span class="c_punctuation">()</span>
144 </td>
145 </tr>
146 <tr>
147 <td class="function_type">
148 <span class="returnvalue">int</span>
149 </td>
150 <td class="function_name">
151 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-before" title="iptc_data_add_dataset_before ()">iptc_data_add_dataset_before</a> <span class="c_punctuation">()</span>
152 </td>
153 </tr>
154 <tr>
155 <td class="function_type">
156 <span class="returnvalue">int</span>
157 </td>
158 <td class="function_name">
159 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-after" title="iptc_data_add_dataset_after ()">iptc_data_add_dataset_after</a> <span class="c_punctuation">()</span>
160 </td>
161 </tr>
162 <tr>
163 <td class="function_type">
164 <span class="returnvalue">int</span>
165 </td>
166 <td class="function_name">
167 <a class="link" href="libiptcdata-data.html#iptc-data-remove-dataset" title="iptc_data_remove_dataset ()">iptc_data_remove_dataset</a> <span class="c_punctuation">()</span>
168 </td>
169 </tr>
170 <tr>
171 <td class="function_type">
172 <span class="returnvalue">void</span>
173 </td>
174 <td class="function_name">
175 <span class="c_punctuation">(</span><a class="link" href="libiptcdata-data.html#IptcDataForeachDataSetFunc" title="IptcDataForeachDataSetFunc ()">*IptcDataForeachDataSetFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
176 </td>
177 </tr>
178 <tr>
179 <td class="function_type">
180 <span class="returnvalue">void</span>
181 </td>
182 <td class="function_name">
183 <a class="link" href="libiptcdata-data.html#iptc-data-foreach-dataset" title="iptc_data_foreach_dataset ()">iptc_data_foreach_dataset</a> <span class="c_punctuation">()</span>
184 </td>
185 </tr>
186 <tr>
187 <td class="function_type">
188 <span class="returnvalue">void</span>
189 </td>
190 <td class="function_name">
191 <a class="link" href="libiptcdata-data.html#iptc-data-sort" title="iptc_data_sort ()">iptc_data_sort</a> <span class="c_punctuation">()</span>
192 </td>
193 </tr>
194 <tr>
195 <td class="function_type">
196 <a class="link" href="libiptcdata-data.html#IptcEncoding" title="enum IptcEncoding"><span class="returnvalue">IptcEncoding</span></a>
197 </td>
198 <td class="function_name">
199 <a class="link" href="libiptcdata-data.html#iptc-data-get-encoding" title="iptc_data_get_encoding ()">iptc_data_get_encoding</a> <span class="c_punctuation">()</span>
200 </td>
201 </tr>
202 <tr>
203 <td class="function_type">
204 <span class="returnvalue">int</span>
205 </td>
206 <td class="function_name">
207 <a class="link" href="libiptcdata-data.html#iptc-data-set-encoding-utf8" title="iptc_data_set_encoding_utf8 ()">iptc_data_set_encoding_utf8</a> <span class="c_punctuation">()</span>
208 </td>
209 </tr>
210 <tr>
211 <td class="function_type">
212 <span class="returnvalue">int</span>
213 </td>
214 <td class="function_name">
215 <a class="link" href="libiptcdata-data.html#iptc-data-set-version" title="iptc_data_set_version ()">iptc_data_set_version</a> <span class="c_punctuation">()</span>
216 </td>
217 </tr>
218 <tr>
219 <td class="function_type">
220 <span class="returnvalue">int</span>
221 </td>
222 <td class="function_name">
223 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-with-value" title="iptc_data_add_dataset_with_value ()">iptc_data_add_dataset_with_value</a> <span class="c_punctuation">()</span>
224 </td>
225 </tr>
226 <tr>
227 <td class="function_type">
228 <span class="returnvalue">int</span>
229 </td>
230 <td class="function_name">
231 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-with-contents" title="iptc_data_add_dataset_with_contents ()">iptc_data_add_dataset_with_contents</a> <span class="c_punctuation">()</span>
232 </td>
233 </tr>
234 <tr>
235 <td class="function_type">
236 <span class="returnvalue">void</span>
237 </td>
238 <td class="function_name">
239 <a class="link" href="libiptcdata-data.html#iptc-data-dump" title="iptc_data_dump ()">iptc_data_dump</a> <span class="c_punctuation">()</span>
240 </td>
241 </tr>
242 <tr>
243 <td class="function_type">
244 <span class="returnvalue">void</span>
245 </td>
246 <td class="function_name">
247 <a class="link" href="libiptcdata-data.html#iptc-data-log" title="iptc_data_log ()">iptc_data_log</a> <span class="c_punctuation">()</span>
248 </td>
249 </tr>
250 </tbody>
251 </table></div>
252 </div>
253 <div class="refsect1">
254 <a name="libiptcdata-data.other"></a><h2>Types and Values</h2>
255 <div class="informaltable"><table class="informaltable" width="100%" border="0">
256 <colgroup>
257 <col width="150px" class="name">
258 <col class="description">
259 </colgroup>
260 <tbody>
261 <tr>
262 <td class="datatype_keyword">struct</td>
263 <td class="function_name"><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData">IptcData</a></td>
264 </tr>
265 <tr>
266 <td class="datatype_keyword">enum</td>
267 <td class="function_name"><a class="link" href="libiptcdata-data.html#IptcEncoding" title="enum IptcEncoding">IptcEncoding</a></td>
268 </tr>
269 <tr>
270 <td class="define_keyword">#define</td>
271 <td class="function_name"><a class="link" href="libiptcdata-data.html#IPTC-IIM-VERSION:CAPS" title="IPTC_IIM_VERSION">IPTC_IIM_VERSION</a></td>
272 </tr>
273 </tbody>
274 </table></div>
275 </div>
276 <div class="refsect1">
277 <a name="libiptcdata-data.description"></a><h2>Description</h2>
278 </div>
279 <div class="refsect1">
280 <a name="libiptcdata-data.functions_details"></a><h2>Functions</h2>
281 <div class="refsect2">
282 <a name="iptc-data-new"></a><h3>iptc_data_new ()</h3>
283 <pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
284 iptc_data_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
285 <p>Allocates a new collection of datasets, which is initialized to be
286 empty. The default memory allocation functions (malloc, etc.) are
287 used. If you need custom memory management functions, use
288 <a class="link" href="libiptcdata-data.html#iptc-data-new-mem" title="iptc_data_new_mem ()"><code class="function">iptc_data_new_mem()</code></a> instead. This allocation will set the <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a>
289 refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()"><code class="function">iptc_data_unref()</code></a> when finished with the pointer.</p>
290 <div class="refsect3">
291 <a name="iptc-data-new.returns"></a><h4>Returns</h4>
292 <p> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object, NULL on error</p>
293 </div>
294 </div>
295 <hr>
296 <div class="refsect2">
297 <a name="iptc-data-new-mem"></a><h3>iptc_data_new_mem ()</h3>
298 <pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
299 iptc_data_new_mem (<em class="parameter"><code><a class="link" href="libiptcdata-mem.html#IptcMem" title="IptcMem"><span class="type">IptcMem</span></a> *mem</code></em>);</pre>
300 <p>Allocates a new collection of datasets, which is initialized to be
301 empty, using custom memory management functions. This allocation
302 will set the <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()"><code class="function">iptc_data_unref()</code></a> when
303 finished with the object.</p>
304 <div class="refsect3">
305 <a name="iptc-data-new-mem.parameters"></a><h4>Parameters</h4>
306 <div class="informaltable"><table class="informaltable" width="100%" border="0">
307 <colgroup>
308 <col width="150px" class="parameters_name">
309 <col class="parameters_description">
310 <col width="200px" class="parameters_annotations">
311 </colgroup>
312 <tbody><tr>
313 <td class="parameter_name"><p>mem</p></td>
314 <td class="parameter_description"><p>Pointer to an <a class="link" href="libiptcdata-mem.html#IptcMem" title="IptcMem"><span class="type">IptcMem</span></a> object that defines custom memory managment
315 functions. The refcount of <em class="parameter"><code>mem</code></em>
316 will be incremented. It is decremented
317 when the returned <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object is freed.</p></td>
318 <td class="parameter_annotations"> </td>
319 </tr></tbody>
320 </table></div>
321 </div>
322 <div class="refsect3">
323 <a name="iptc-data-new-mem.returns"></a><h4>Returns</h4>
324 <p> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object, NULL on error</p>
325 </div>
326 </div>
327 <hr>
328 <div class="refsect2">
329 <a name="iptc-data-ref"></a><h3>iptc_data_ref ()</h3>
330 <pre class="programlisting"><span class="returnvalue">void</span>
331 iptc_data_ref (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>);</pre>
332 <p>Increments the reference count of an <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object. This function
333 should be called whenever a copy of a pointer is made by the application.
334 <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()"><code class="function">iptc_data_unref()</code></a> can then be used when the pointer is no longer needed
335 to ensure that the object is freed once the object is completely unused.</p>
336 <div class="refsect3">
337 <a name="iptc-data-ref.parameters"></a><h4>Parameters</h4>
338 <div class="informaltable"><table class="informaltable" width="100%" border="0">
339 <colgroup>
340 <col width="150px" class="parameters_name">
341 <col class="parameters_description">
342 <col width="200px" class="parameters_annotations">
343 </colgroup>
344 <tbody><tr>
345 <td class="parameter_name"><p>data</p></td>
346 <td class="parameter_description"><p>the referenced pointer</p></td>
347 <td class="parameter_annotations"> </td>
348 </tr></tbody>
349 </table></div>
350 </div>
351 </div>
352 <hr>
353 <div class="refsect2">
354 <a name="iptc-data-unref"></a><h3>iptc_data_unref ()</h3>
355 <pre class="programlisting"><span class="returnvalue">void</span>
356 iptc_data_unref (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>);</pre>
357 <p>Decrements the reference count of an <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object. The object will
358 automatically be freed when the count reaches 0. This function should
359 be called whenever a pointer is no longer needed by an application. It
360 is also good practice to set the local copy of the pointer to NULL to
361 shield against accidently reusing the value.</p>
362 <div class="refsect3">
363 <a name="iptc-data-unref.parameters"></a><h4>Parameters</h4>
364 <div class="informaltable"><table class="informaltable" width="100%" border="0">
365 <colgroup>
366 <col width="150px" class="parameters_name">
367 <col class="parameters_description">
368 <col width="200px" class="parameters_annotations">
369 </colgroup>
370 <tbody><tr>
371 <td class="parameter_name"><p>data</p></td>
372 <td class="parameter_description"><p>the unreferenced pointer</p></td>
373 <td class="parameter_annotations"> </td>
374 </tr></tbody>
375 </table></div>
376 </div>
377 </div>
378 <hr>
379 <div class="refsect2">
380 <a name="iptc-data-free"></a><h3>iptc_data_free ()</h3>
381 <pre class="programlisting"><span class="returnvalue">void</span>
382 iptc_data_free (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>);</pre>
383 <p>Frees an <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object. This function should be used only for error
384 handling since <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()"><code class="function">iptc_data_unref()</code></a> provides a safer mechanism for freeing
385 that allows multiple components to have access to an object. This
386 function decrements the reference count of any datasets contained by the
387 object. This will generally cause them to be freed as well unless other
388 parts of the application are referencing them individually.</p>
389 <div class="refsect3">
390 <a name="iptc-data-free.parameters"></a><h4>Parameters</h4>
391 <div class="informaltable"><table class="informaltable" width="100%" border="0">
392 <colgroup>
393 <col width="150px" class="parameters_name">
394 <col class="parameters_description">
395 <col width="200px" class="parameters_annotations">
396 </colgroup>
397 <tbody><tr>
398 <td class="parameter_name"><p>data</p></td>
399 <td class="parameter_description"><p>the object to free</p></td>
400 <td class="parameter_annotations"> </td>
401 </tr></tbody>
402 </table></div>
403 </div>
404 </div>
405 <hr>
406 <div class="refsect2">
407 <a name="iptc-data-new-from-jpeg"></a><h3>iptc_data_new_from_jpeg ()</h3>
408 <pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
409 iptc_data_new_from_jpeg (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>);</pre>
410 <p>Allocates a new collection of datasets which is initialized by decoding
411 the IPTC data in JPEG file <em class="parameter"><code>path</code></em>
412 . This allocation will set the <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a>
413 refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()"><code class="function">iptc_data_unref()</code></a> when finished with the object.
414 This is a convenience function that reads the contents of the file,
415 creates a new <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object, parses the file with
416 <a class="link" href="libiptcdata-jpeg.html#iptc-jpeg-read-ps3" title="iptc_jpeg_read_ps3 ()"><code class="function">iptc_jpeg_read_ps3()</code></a> and <a class="link" href="libiptcdata-jpeg.html#iptc-jpeg-ps3-find-iptc" title="iptc_jpeg_ps3_find_iptc ()"><code class="function">iptc_jpeg_ps3_find_iptc()</code></a>, and loads the
417 data with <a class="link" href="libiptcdata-data.html#iptc-data-load" title="iptc_data_load ()"><code class="function">iptc_data_load()</code></a>. If more fine-grained error detection
418 is needed, those functions should be used individually.</p>
419 <div class="refsect3">
420 <a name="iptc-data-new-from-jpeg.parameters"></a><h4>Parameters</h4>
421 <div class="informaltable"><table class="informaltable" width="100%" border="0">
422 <colgroup>
423 <col width="150px" class="parameters_name">
424 <col class="parameters_description">
425 <col width="200px" class="parameters_annotations">
426 </colgroup>
427 <tbody><tr>
428 <td class="parameter_name"><p>path</p></td>
429 <td class="parameter_description"><p>filesystem path of the jpeg file to be read</p></td>
430 <td class="parameter_annotations"> </td>
431 </tr></tbody>
432 </table></div>
433 </div>
434 <div class="refsect3">
435 <a name="iptc-data-new-from-jpeg.returns"></a><h4>Returns</h4>
436 <p> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object. NULL on error (including
437 parsing errors or if the file did not include IPTC data).</p>
438 </div>
439 </div>
440 <hr>
441 <div class="refsect2">
442 <a name="iptc-data-new-from-data"></a><h3>iptc_data_new_from_data ()</h3>
443 <pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="returnvalue">IptcData</span></a> *
444 iptc_data_new_from_data (<em class="parameter"><code>const unsigned <span class="type">char</span> *buf</code></em>,
445 <em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>);</pre>
446 <p>Allocates a new collection of datasets which is initialized by decoding
447 the contents of <em class="parameter"><code>buf</code></em>
448 . This allocation will set the <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a>
449 refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref" title="iptc_data_unref ()"><code class="function">iptc_data_unref()</code></a> when finished with the object.
450 This is simply a convenience function that can be duplicated by calling
451 <a class="link" href="libiptcdata-data.html#iptc-data-new" title="iptc_data_new ()"><code class="function">iptc_data_new()</code></a> followed by <a class="link" href="libiptcdata-data.html#iptc-data-load" title="iptc_data_load ()"><code class="function">iptc_data_load()</code></a>.</p>
452 <div class="refsect3">
453 <a name="iptc-data-new-from-data.parameters"></a><h4>Parameters</h4>
454 <div class="informaltable"><table class="informaltable" width="100%" border="0">
455 <colgroup>
456 <col width="150px" class="parameters_name">
457 <col class="parameters_description">
458 <col width="200px" class="parameters_annotations">
459 </colgroup>
460 <tbody>
461 <tr>
462 <td class="parameter_name"><p>buf</p></td>
463 <td class="parameter_description"><p>the buffer of IPTC data to be decoded</p></td>
464 <td class="parameter_annotations"> </td>
465 </tr>
466 <tr>
467 <td class="parameter_name"><p>size</p></td>
468 <td class="parameter_description"><p>the length to be read in bytes</p></td>
469 <td class="parameter_annotations"> </td>
470 </tr>
471 </tbody>
472 </table></div>
473 </div>
474 <div class="refsect3">
475 <a name="iptc-data-new-from-data.returns"></a><h4>Returns</h4>
476 <p> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object. NULL on error (including
477 parsing errors in the contents of <em class="parameter"><code>buf</code></em>
478 ).</p>
479 </div>
480 </div>
481 <hr>
482 <div class="refsect2">
483 <a name="iptc-data-load"></a><h3>iptc_data_load ()</h3>
484 <pre class="programlisting"><span class="returnvalue">int</span>
485 iptc_data_load (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
486 <em class="parameter"><code>const unsigned <span class="type">char</span> *buf</code></em>,
487 <em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>);</pre>
488 <p>Parses a buffer containing raw IPTC data and adds the datasets
489 to the <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object <em class="parameter"><code>data</code></em>
490 .</p>
491 <div class="refsect3">
492 <a name="iptc-data-load.parameters"></a><h4>Parameters</h4>
493 <div class="informaltable"><table class="informaltable" width="100%" border="0">
494 <colgroup>
495 <col width="150px" class="parameters_name">
496 <col class="parameters_description">
497 <col width="200px" class="parameters_annotations">
498 </colgroup>
499 <tbody>
500 <tr>
501 <td class="parameter_name"><p>data</p></td>
502 <td class="parameter_description"><p>object to be populated with the loaded datasets</p></td>
503 <td class="parameter_annotations"> </td>
504 </tr>
505 <tr>
506 <td class="parameter_name"><p>buf</p></td>
507 <td class="parameter_description"><p>data buffer to be parsed, containing IPTC data</p></td>
508 <td class="parameter_annotations"> </td>
509 </tr>
510 <tr>
511 <td class="parameter_name"><p>size</p></td>
512 <td class="parameter_description"><p>length of data buffer to be parsed</p></td>
513 <td class="parameter_annotations"> </td>
514 </tr>
515 </tbody>
516 </table></div>
517 </div>
518 <div class="refsect3">
519 <a name="iptc-data-load.returns"></a><h4>Returns</h4>
520 <p> 0 on success, -1 on failure. Note that in the failure
521 case, some datasets may still have been added to <em class="parameter"><code>data</code></em>
522 .</p>
523 </div>
524 </div>
525 <hr>
526 <div class="refsect2">
527 <a name="iptc-data-save"></a><h3>iptc_data_save ()</h3>
528 <pre class="programlisting"><span class="returnvalue">int</span>
529 iptc_data_save (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
530 <em class="parameter"><code>unsigned <span class="type">char</span> **buf</code></em>,
531 <em class="parameter"><code>unsigned <span class="type">int</span> *size</code></em>);</pre>
532 <p>Outputs a collection of datasets as an IPTC bytestream. No memory allocation
533 is required in advance. <em class="parameter"><code>buf</code></em>
534 should point to a NULL pointer that will be set
535 to the address of the output buffer by this function. <em class="parameter"><code>size</code></em>
536 will contain
537 this buffer's length after completion. The object <em class="parameter"><code>data</code></em>
538 is unmodified by this
539 function. The application should free the output buffer using
540 <a class="link" href="libiptcdata-data.html#iptc-data-free-buf" title="iptc_data_free_buf ()"><code class="function">iptc_data_free_buf()</code></a> when it is no longer needed.</p>
541 <div class="refsect3">
542 <a name="iptc-data-save.parameters"></a><h4>Parameters</h4>
543 <div class="informaltable"><table class="informaltable" width="100%" border="0">
544 <colgroup>
545 <col width="150px" class="parameters_name">
546 <col class="parameters_description">
547 <col width="200px" class="parameters_annotations">
548 </colgroup>
549 <tbody>
550 <tr>
551 <td class="parameter_name"><p>data</p></td>
552 <td class="parameter_description"><p>collection of datasets to be saved</p></td>
553 <td class="parameter_annotations"> </td>
554 </tr>
555 <tr>
556 <td class="parameter_name"><p>buf</p></td>
557 <td class="parameter_description"><p>pointer to a pointer that will hold the address of the output buffer</p></td>
558 <td class="parameter_annotations"> </td>
559 </tr>
560 <tr>
561 <td class="parameter_name"><p>size</p></td>
562 <td class="parameter_description"><p>pointer to an integer that will hold the length of the output buffer</p></td>
563 <td class="parameter_annotations"> </td>
564 </tr>
565 </tbody>
566 </table></div>
567 </div>
568 <div class="refsect3">
569 <a name="iptc-data-save.returns"></a><h4>Returns</h4>
570 <p> 0 on success, -1 on failure. In the failure case, <em class="parameter"><code>buf</code></em>
571 should still
572 be checked for a non-NULL value, and freed using <a class="link" href="libiptcdata-data.html#iptc-data-free-buf" title="iptc_data_free_buf ()"><code class="function">iptc_data_free_buf()</code></a> if
573 necessary.</p>
574 </div>
575 </div>
576 <hr>
577 <div class="refsect2">
578 <a name="iptc-data-free-buf"></a><h3>iptc_data_free_buf ()</h3>
579 <pre class="programlisting"><span class="returnvalue">void</span>
580 iptc_data_free_buf (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
581 <em class="parameter"><code>unsigned <span class="type">char</span> *buf</code></em>);</pre>
582 <p>Frees a temporary buffer created from an <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object by the
583 <a class="link" href="libiptcdata-data.html#iptc-data-save" title="iptc_data_save ()"><code class="function">iptc_data_save()</code></a> function.</p>
584 <div class="refsect3">
585 <a name="iptc-data-free-buf.parameters"></a><h4>Parameters</h4>
586 <div class="informaltable"><table class="informaltable" width="100%" border="0">
587 <colgroup>
588 <col width="150px" class="parameters_name">
589 <col class="parameters_description">
590 <col width="200px" class="parameters_annotations">
591 </colgroup>
592 <tbody>
593 <tr>
594 <td class="parameter_name"><p>data</p></td>
595 <td class="parameter_description"><p>the <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object that allocated the buffer</p></td>
596 <td class="parameter_annotations"> </td>
597 </tr>
598 <tr>
599 <td class="parameter_name"><p>buf</p></td>
600 <td class="parameter_description"><p>the buffer to free</p></td>
601 <td class="parameter_annotations"> </td>
602 </tr>
603 </tbody>
604 </table></div>
605 </div>
606 </div>
607 <hr>
608 <div class="refsect2">
609 <a name="iptc-data-get-dataset"></a><h3>iptc_data_get_dataset ()</h3>
610 <pre class="programlisting"><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="returnvalue">IptcDataSet</span></a> *
611 iptc_data_get_dataset (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
612 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcRecord" title="enum IptcRecord"><span class="type">IptcRecord</span></a> record</code></em>,
613 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcTag" title="enum IptcTag"><span class="type">IptcTag</span></a> tag</code></em>);</pre>
614 <p>Finds the first occurence of a dataset inside a collection with
615 the specified record and tag identifiers.</p>
616 <div class="refsect3">
617 <a name="iptc-data-get-dataset.parameters"></a><h4>Parameters</h4>
618 <div class="informaltable"><table class="informaltable" width="100%" border="0">
619 <colgroup>
620 <col width="150px" class="parameters_name">
621 <col class="parameters_description">
622 <col width="200px" class="parameters_annotations">
623 </colgroup>
624 <tbody>
625 <tr>
626 <td class="parameter_name"><p>data</p></td>
627 <td class="parameter_description"><p>collection to search</p></td>
628 <td class="parameter_annotations"> </td>
629 </tr>
630 <tr>
631 <td class="parameter_name"><p>record</p></td>
632 <td class="parameter_description"><p>record identifier of dataset</p></td>
633 <td class="parameter_annotations"> </td>
634 </tr>
635 <tr>
636 <td class="parameter_name"><p>tag</p></td>
637 <td class="parameter_description"><p>tag identifier (dataset number) of dataset</p></td>
638 <td class="parameter_annotations"> </td>
639 </tr>
640 </tbody>
641 </table></div>
642 </div>
643 <div class="refsect3">
644 <a name="iptc-data-get-dataset.returns"></a><h4>Returns</h4>
645 <p> pointer to dataset if found, NULL if no matching dataset found</p>
646 </div>
647 </div>
648 <hr>
649 <div class="refsect2">
650 <a name="iptc-data-get-next-dataset"></a><h3>iptc_data_get_next_dataset ()</h3>
651 <pre class="programlisting"><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="returnvalue">IptcDataSet</span></a> *
652 iptc_data_get_next_dataset (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
653 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *ds</code></em>,
654 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcRecord" title="enum IptcRecord"><span class="type">IptcRecord</span></a> record</code></em>,
655 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcTag" title="enum IptcTag"><span class="type">IptcTag</span></a> tag</code></em>);</pre>
656 <p>Finds the next occurence of a dataset inside a collection with
657 the specified record and tag identifiers following <em class="parameter"><code>ds</code></em>
658 . This is useful
659 when a collection contains more than one dataset with the same record
660 and tag identifier (for example, the keywords tag appears once for
661 each keyword in the IPTC metadata). When <em class="parameter"><code>ds</code></em>
662 is NULL, this function
663 is equivalent to <a class="link" href="libiptcdata-data.html#iptc-data-get-dataset" title="iptc_data_get_dataset ()"><code class="function">iptc_data_get_dataset()</code></a>.</p>
664 <div class="refsect3">
665 <a name="iptc-data-get-next-dataset.parameters"></a><h4>Parameters</h4>
666 <div class="informaltable"><table class="informaltable" width="100%" border="0">
667 <colgroup>
668 <col width="150px" class="parameters_name">
669 <col class="parameters_description">
670 <col width="200px" class="parameters_annotations">
671 </colgroup>
672 <tbody>
673 <tr>
674 <td class="parameter_name"><p>data</p></td>
675 <td class="parameter_description"><p>collection to search</p></td>
676 <td class="parameter_annotations"> </td>
677 </tr>
678 <tr>
679 <td class="parameter_name"><p>ds</p></td>
680 <td class="parameter_description"><p>dataset where the search should originate (can be NULL)</p></td>
681 <td class="parameter_annotations"> </td>
682 </tr>
683 <tr>
684 <td class="parameter_name"><p>record</p></td>
685 <td class="parameter_description"><p>record identifier of dataset</p></td>
686 <td class="parameter_annotations"> </td>
687 </tr>
688 <tr>
689 <td class="parameter_name"><p>tag</p></td>
690 <td class="parameter_description"><p>tag identifier (dataset number) of dataset</p></td>
691 <td class="parameter_annotations"> </td>
692 </tr>
693 </tbody>
694 </table></div>
695 </div>
696 <div class="refsect3">
697 <a name="iptc-data-get-next-dataset.returns"></a><h4>Returns</h4>
698 <p> pointer to dataset if found, NULL if no matching dataset found</p>
699 </div>
700 </div>
701 <hr>
702 <div class="refsect2">
703 <a name="iptc-data-add-dataset"></a><h3>iptc_data_add_dataset ()</h3>
704 <pre class="programlisting"><span class="returnvalue">int</span>
705 iptc_data_add_dataset (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
706 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *ds</code></em>);</pre>
707 <p>Adds an <a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> at the end of an existing collection. A
708 dataset can only be a member of a single collection. This
709 function will increment the reference count of <em class="parameter"><code>dataset</code></em>
710 , so if
711 the application no longer intends to use <em class="parameter"><code>dataset</code></em>
712 directly, it
713 should call <a class="link" href="libiptcdata-dataset.html#iptc-dataset-unref" title="iptc_dataset_unref ()"><code class="function">iptc_dataset_unref()</code></a> immediately following this call.</p>
714 <div class="refsect3">
715 <a name="iptc-data-add-dataset.parameters"></a><h4>Parameters</h4>
716 <div class="informaltable"><table class="informaltable" width="100%" border="0">
717 <colgroup>
718 <col width="150px" class="parameters_name">
719 <col class="parameters_description">
720 <col width="200px" class="parameters_annotations">
721 </colgroup>
722 <tbody>
723 <tr>
724 <td class="parameter_name"><p>data</p></td>
725 <td class="parameter_description"><p>the collection to which the dataset will be added</p></td>
726 <td class="parameter_annotations"> </td>
727 </tr>
728 <tr>
729 <td class="parameter_name"><p>ds</p></td>
730 <td class="parameter_description"><p>dataset to add</p></td>
731 <td class="parameter_annotations"> </td>
732 </tr>
733 </tbody>
734 </table></div>
735 </div>
736 <div class="refsect3">
737 <a name="iptc-data-add-dataset.returns"></a><h4>Returns</h4>
738 <p> 0 on success, -1 on error</p>
739 </div>
740 </div>
741 <hr>
742 <div class="refsect2">
743 <a name="iptc-data-add-dataset-before"></a><h3>iptc_data_add_dataset_before ()</h3>
744 <pre class="programlisting"><span class="returnvalue">int</span>
745 iptc_data_add_dataset_before (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
746 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *ds</code></em>,
747 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *newds</code></em>);</pre>
748 <p>Same as <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset" title="iptc_data_add_dataset ()"><code class="function">iptc_data_add_dataset()</code></a>, except the <em class="parameter"><code>dataset</code></em>
749 will be added
750 before an existing dataset <em class="parameter"><code>ds</code></em>
751 , so that if they are enumerated,
752 <em class="parameter"><code>newds</code></em>
753 will appear before <em class="parameter"><code>ds</code></em>
754 in the collection. <em class="parameter"><code>ds</code></em>
755 must be
756 a dataset already present in the collection.</p>
757 <div class="refsect3">
758 <a name="iptc-data-add-dataset-before.parameters"></a><h4>Parameters</h4>
759 <div class="informaltable"><table class="informaltable" width="100%" border="0">
760 <colgroup>
761 <col width="150px" class="parameters_name">
762 <col class="parameters_description">
763 <col width="200px" class="parameters_annotations">
764 </colgroup>
765 <tbody>
766 <tr>
767 <td class="parameter_name"><p>data</p></td>
768 <td class="parameter_description"><p>the collection to which the dataset will be added</p></td>
769 <td class="parameter_annotations"> </td>
770 </tr>
771 <tr>
772 <td class="parameter_name"><p>ds</p></td>
773 <td class="parameter_description"><p>existing dataset before which <em class="parameter"><code>newds</code></em>
774 will be added</p></td>
775 <td class="parameter_annotations"> </td>
776 </tr>
777 <tr>
778 <td class="parameter_name"><p>newds</p></td>
779 <td class="parameter_description"><p>dataset to add</p></td>
780 <td class="parameter_annotations"> </td>
781 </tr>
782 </tbody>
783 </table></div>
784 </div>
785 <div class="refsect3">
786 <a name="iptc-data-add-dataset-before.returns"></a><h4>Returns</h4>
787 <p> 0 on success, -1 on error</p>
788 </div>
789 </div>
790 <hr>
791 <div class="refsect2">
792 <a name="iptc-data-add-dataset-after"></a><h3>iptc_data_add_dataset_after ()</h3>
793 <pre class="programlisting"><span class="returnvalue">int</span>
794 iptc_data_add_dataset_after (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
795 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *ds</code></em>,
796 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *newds</code></em>);</pre>
797 <p>Same as <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset" title="iptc_data_add_dataset ()"><code class="function">iptc_data_add_dataset()</code></a>, except the <em class="parameter"><code>dataset</code></em>
798 will be added
799 after an existing dataset <em class="parameter"><code>ds</code></em>
800 , so that if they are enumerated,
801 <em class="parameter"><code>newds</code></em>
802 will appear after <em class="parameter"><code>ds</code></em>
803 in the collection. <em class="parameter"><code>ds</code></em>
804 must be a
805 dataset already present in the collection.</p>
806 <div class="refsect3">
807 <a name="iptc-data-add-dataset-after.parameters"></a><h4>Parameters</h4>
808 <div class="informaltable"><table class="informaltable" width="100%" border="0">
809 <colgroup>
810 <col width="150px" class="parameters_name">
811 <col class="parameters_description">
812 <col width="200px" class="parameters_annotations">
813 </colgroup>
814 <tbody>
815 <tr>
816 <td class="parameter_name"><p>data</p></td>
817 <td class="parameter_description"><p>the collection to which the dataset will be added</p></td>
818 <td class="parameter_annotations"> </td>
819 </tr>
820 <tr>
821 <td class="parameter_name"><p>ds</p></td>
822 <td class="parameter_description"><p>existing dataset after which <em class="parameter"><code>newds</code></em>
823 will be added</p></td>
824 <td class="parameter_annotations"> </td>
825 </tr>
826 <tr>
827 <td class="parameter_name"><p>newds</p></td>
828 <td class="parameter_description"><p>dataset to add</p></td>
829 <td class="parameter_annotations"> </td>
830 </tr>
831 </tbody>
832 </table></div>
833 </div>
834 <div class="refsect3">
835 <a name="iptc-data-add-dataset-after.returns"></a><h4>Returns</h4>
836 <p> 0 on success, -1 on error</p>
837 </div>
838 </div>
839 <hr>
840 <div class="refsect2">
841 <a name="iptc-data-remove-dataset"></a><h3>iptc_data_remove_dataset ()</h3>
842 <pre class="programlisting"><span class="returnvalue">int</span>
843 iptc_data_remove_dataset (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
844 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *ds</code></em>);</pre>
845 <p>Removes a dataset from a collection. This function also calls
846 <a class="link" href="libiptcdata-dataset.html#iptc-dataset-unref" title="iptc_dataset_unref ()"><code class="function">iptc_dataset_unref()</code></a> on <em class="parameter"><code>ds</code></em>
847 .</p>
848 <div class="refsect3">
849 <a name="iptc-data-remove-dataset.parameters"></a><h4>Parameters</h4>
850 <div class="informaltable"><table class="informaltable" width="100%" border="0">
851 <colgroup>
852 <col width="150px" class="parameters_name">
853 <col class="parameters_description">
854 <col width="200px" class="parameters_annotations">
855 </colgroup>
856 <tbody>
857 <tr>
858 <td class="parameter_name"><p>data</p></td>
859 <td class="parameter_description"><p>the collection from which to remove an entry</p></td>
860 <td class="parameter_annotations"> </td>
861 </tr>
862 <tr>
863 <td class="parameter_name"><p>ds</p></td>
864 <td class="parameter_description"><p>the dataset to remove from the collection</p></td>
865 <td class="parameter_annotations"> </td>
866 </tr>
867 </tbody>
868 </table></div>
869 </div>
870 <div class="refsect3">
871 <a name="iptc-data-remove-dataset.returns"></a><h4>Returns</h4>
872 <p> 0 on success, -1 on error</p>
873 </div>
874 </div>
875 <hr>
876 <div class="refsect2">
877 <a name="IptcDataForeachDataSetFunc"></a><h3>IptcDataForeachDataSetFunc ()</h3>
878 <pre class="programlisting"><span class="returnvalue">void</span>
879 <span class="c_punctuation">(</span>*IptcDataForeachDataSetFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcDataSet" title="struct IptcDataSet"><span class="type">IptcDataSet</span></a> *dataset</code></em>,
880 <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
881 </div>
882 <hr>
883 <div class="refsect2">
884 <a name="iptc-data-foreach-dataset"></a><h3>iptc_data_foreach_dataset ()</h3>
885 <pre class="programlisting"><span class="returnvalue">void</span>
886 iptc_data_foreach_dataset (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
887 <em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcDataForeachDataSetFunc" title="IptcDataForeachDataSetFunc ()"><span class="type">IptcDataForeachDataSetFunc</span></a> func</code></em>,
888 <em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
889 <p>Iterates through each dataset in the collection and calls the
890 callback function on that dataset.</p>
891 <div class="refsect3">
892 <a name="iptc-data-foreach-dataset.parameters"></a><h4>Parameters</h4>
893 <div class="informaltable"><table class="informaltable" width="100%" border="0">
894 <colgroup>
895 <col width="150px" class="parameters_name">
896 <col class="parameters_description">
897 <col width="200px" class="parameters_annotations">
898 </colgroup>
899 <tbody>
900 <tr>
901 <td class="parameter_name"><p>data</p></td>
902 <td class="parameter_description"><p>collection through which to iterate</p></td>
903 <td class="parameter_annotations"> </td>
904 </tr>
905 <tr>
906 <td class="parameter_name"><p>func</p></td>
907 <td class="parameter_description"><p>callback function</p></td>
908 <td class="parameter_annotations"> </td>
909 </tr>
910 <tr>
911 <td class="parameter_name"><p>user_data</p></td>
912 <td class="parameter_description"><p>arbitrary user data to be passed to the callback</p></td>
913 <td class="parameter_annotations"> </td>
914 </tr>
915 </tbody>
916 </table></div>
917 </div>
918 </div>
919 <hr>
920 <div class="refsect2">
921 <a name="iptc-data-sort"></a><h3>iptc_data_sort ()</h3>
922 <pre class="programlisting"><span class="returnvalue">void</span>
923 iptc_data_sort (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>);</pre>
924 <p>Sorts a collection of datasets in ascending order first by record
925 number and second by tag number. It can be useful to call this
926 function before saving IPTC data in order to maintain a more
927 organized file.</p>
928 <div class="refsect3">
929 <a name="iptc-data-sort.parameters"></a><h4>Parameters</h4>
930 <div class="informaltable"><table class="informaltable" width="100%" border="0">
931 <colgroup>
932 <col width="150px" class="parameters_name">
933 <col class="parameters_description">
934 <col width="200px" class="parameters_annotations">
935 </colgroup>
936 <tbody><tr>
937 <td class="parameter_name"><p>data</p></td>
938 <td class="parameter_description"><p>collection of datasets to sort</p></td>
939 <td class="parameter_annotations"> </td>
940 </tr></tbody>
941 </table></div>
942 </div>
943 </div>
944 <hr>
945 <div class="refsect2">
946 <a name="iptc-data-get-encoding"></a><h3>iptc_data_get_encoding ()</h3>
947 <pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcEncoding" title="enum IptcEncoding"><span class="returnvalue">IptcEncoding</span></a>
948 iptc_data_get_encoding (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>);</pre>
949 <p>Identifies the character encoding of the collection of datasets as
950 specified by the "character set" dataset (1:90). The specification
951 allows this dataset to contain control sequences from the ISO 2022
952 standard. Unfortunately, this standard is very complicated and
953 generally not used by application writers. Thus, rather than
954 attempt to decode any possible any possible control sequence, this
955 function only attempts to recognize the control sequence that identifies
956 the UTF-8 character set. If found, this function will return
957 <a class="link" href="libiptcdata-data.html#IPTC-ENCODING-UTF8:CAPS"><span class="type">IPTC_ENCODING_UTF8</span></a>. All character-based datasets in record 2 and
958 higher are then expected to contain data encoded in the UTF-8
959 character set. Otherwise, this function will return
960 <a class="link" href="libiptcdata-data.html#IPTC-ENCODING-UNKNOWN:CAPS"><span class="type">IPTC_ENCODING_UNKNOWN</span></a>, meaning that any other character set
961 might be used, including ISO 2022 control sequences that have not
962 been decoded. If dataset 1:90 is not present, this function returns
963 <a class="link" href="libiptcdata-data.html#IPTC-ENCODING-UNSPECIFIED:CAPS"><span class="type">IPTC_ENCODING_UNSPECIFIED</span></a>, in which case character-based datasets
964 will usually be plain ASCII, although broken applications may have
965 used some other encoding.</p>
966 <div class="refsect3">
967 <a name="iptc-data-get-encoding.parameters"></a><h4>Parameters</h4>
968 <div class="informaltable"><table class="informaltable" width="100%" border="0">
969 <colgroup>
970 <col width="150px" class="parameters_name">
971 <col class="parameters_description">
972 <col width="200px" class="parameters_annotations">
973 </colgroup>
974 <tbody><tr>
975 <td class="parameter_name"><p>data</p></td>
976 <td class="parameter_description"><p>collection of datasets</p></td>
977 <td class="parameter_annotations"> </td>
978 </tr></tbody>
979 </table></div>
980 </div>
981 <div class="refsect3">
982 <a name="iptc-data-get-encoding.returns"></a><h4>Returns</h4>
983 <p> <a class="link" href="libiptcdata-data.html#IPTC-ENCODING-UTF8:CAPS"><span class="type">IPTC_ENCODING_UTF8</span></a>, <a class="link" href="libiptcdata-data.html#IPTC-ENCODING-UNKNOWN:CAPS"><span class="type">IPTC_ENCODING_UNKNOWN</span></a>, or
984 <a class="link" href="libiptcdata-data.html#IPTC-ENCODING-UNSPECIFIED:CAPS"><span class="type">IPTC_ENCODING_UNSPECIFIED</span></a>.</p>
985 </div>
986 </div>
987 <hr>
988 <div class="refsect2">
989 <a name="iptc-data-set-encoding-utf8"></a><h3>iptc_data_set_encoding_utf8 ()</h3>
990 <pre class="programlisting"><span class="returnvalue">int</span>
991 iptc_data_set_encoding_utf8 (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>);</pre>
992 <p>Sets the contents of the "character set" dataset (1:90) to contain
993 the control sequence that indicates UTF-8 as the character encoding
994 for any character-based datasets in record 2 or higher. If dataset
995 1:90 is not present, it will be added to the collection. Any prior
996 value of dataset 1:90 will be overwritten by this function.
997 Note that some third-party applications (notably Picasa) will ignore
998 all your IPTC data if this option is set.</p>
999 <div class="refsect3">
1000 <a name="iptc-data-set-encoding-utf8.parameters"></a><h4>Parameters</h4>
1001 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1002 <colgroup>
1003 <col width="150px" class="parameters_name">
1004 <col class="parameters_description">
1005 <col width="200px" class="parameters_annotations">
1006 </colgroup>
1007 <tbody><tr>
1008 <td class="parameter_name"><p>data</p></td>
1009 <td class="parameter_description"><p>collection of datasets for which to specify the encoding</p></td>
1010 <td class="parameter_annotations"> </td>
1011 </tr></tbody>
1012 </table></div>
1013 </div>
1014 <div class="refsect3">
1015 <a name="iptc-data-set-encoding-utf8.returns"></a><h4>Returns</h4>
1016 <p> 0 on success, -1 on failure.</p>
1017 </div>
1018 </div>
1019 <hr>
1020 <div class="refsect2">
1021 <a name="iptc-data-set-version"></a><h3>iptc_data_set_version ()</h3>
1022 <pre class="programlisting"><span class="returnvalue">int</span>
1023 iptc_data_set_version (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
1024 <em class="parameter"><code>unsigned <span class="type">int</span> version</code></em>);</pre>
1025 <p>Specifies the version of the IIM specification used by this library by
1026 setting the value of datasets 1:00 and 2:00. It is recommended to set the
1027 version number to <a class="link" href="libiptcdata-data.html#IPTC-IIM-VERSION:CAPS" title="IPTC_IIM_VERSION"><span class="type">IPTC_IIM_VERSION</span></a>, which specifies the version
1028 implemented by this library (currently 4). If datasets 1:00 or 2:00 are
1029 not present, they will be added to the collection. Any prior value of
1030 the datasets will be overwritten by this function. To ensure strict
1031 compliance with the standard, this function should be called before
1032 saving a collection of datasets. However, in practice, some applications
1033 (notably Picasa) will ignore all your IPTC data if this option is set.</p>
1034 <div class="refsect3">
1035 <a name="iptc-data-set-version.parameters"></a><h4>Parameters</h4>
1036 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1037 <colgroup>
1038 <col width="150px" class="parameters_name">
1039 <col class="parameters_description">
1040 <col width="200px" class="parameters_annotations">
1041 </colgroup>
1042 <tbody>
1043 <tr>
1044 <td class="parameter_name"><p>data</p></td>
1045 <td class="parameter_description"><p>collection of datasets for which to specify the version</p></td>
1046 <td class="parameter_annotations"> </td>
1047 </tr>
1048 <tr>
1049 <td class="parameter_name"><p>version</p></td>
1050 <td class="parameter_description"><p>version number to write</p></td>
1051 <td class="parameter_annotations"> </td>
1052 </tr>
1053 </tbody>
1054 </table></div>
1055 </div>
1056 <div class="refsect3">
1057 <a name="iptc-data-set-version.returns"></a><h4>Returns</h4>
1058 <p> 0 on success, -1 on failure.</p>
1059 </div>
1060 </div>
1061 <hr>
1062 <div class="refsect2">
1063 <a name="iptc-data-add-dataset-with-value"></a><h3>iptc_data_add_dataset_with_value ()</h3>
1064 <pre class="programlisting"><span class="returnvalue">int</span>
1065 iptc_data_add_dataset_with_value (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
1066 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcRecord" title="enum IptcRecord"><span class="type">IptcRecord</span></a> record</code></em>,
1067 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcTag" title="enum IptcTag"><span class="type">IptcTag</span></a> tag</code></em>,
1068 <em class="parameter"><code>unsigned <span class="type">int</span> value</code></em>,
1069 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcValidate" title="enum IptcValidate"><span class="type">IptcValidate</span></a> validate</code></em>);</pre>
1070 <p>This is a convenience function that creates a new dataset with the given
1071 record and tag, adds it to the specified collection of datasets, and
1072 stores the given numeric value as the contents of the dataset. It is
1073 equivalent to calling this sequence of functions: <a class="link" href="libiptcdata-dataset.html#iptc-dataset-new" title="iptc_dataset_new ()"><code class="function">iptc_dataset_new()</code></a>,
1074 <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-tag" title="iptc_dataset_set_tag ()"><code class="function">iptc_dataset_set_tag()</code></a>, <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset" title="iptc_data_add_dataset ()"><code class="function">iptc_data_add_dataset()</code></a>,
1075 and <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-value" title="iptc_dataset_set_value ()"><code class="function">iptc_dataset_set_value()</code></a>.</p>
1076 <div class="refsect3">
1077 <a name="iptc-data-add-dataset-with-value.parameters"></a><h4>Parameters</h4>
1078 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1079 <colgroup>
1080 <col width="150px" class="parameters_name">
1081 <col class="parameters_description">
1082 <col width="200px" class="parameters_annotations">
1083 </colgroup>
1084 <tbody>
1085 <tr>
1086 <td class="parameter_name"><p>data</p></td>
1087 <td class="parameter_description"><p>collection to which the new dataset should be added</p></td>
1088 <td class="parameter_annotations"> </td>
1089 </tr>
1090 <tr>
1091 <td class="parameter_name"><p>record</p></td>
1092 <td class="parameter_description"><p>record number of the dataset to be added</p></td>
1093 <td class="parameter_annotations"> </td>
1094 </tr>
1095 <tr>
1096 <td class="parameter_name"><p>tag</p></td>
1097 <td class="parameter_description"><p>tag (dataset number) of the dataset to be added</p></td>
1098 <td class="parameter_annotations"> </td>
1099 </tr>
1100 <tr>
1101 <td class="parameter_name"><p>value</p></td>
1102 <td class="parameter_description"><p>value for the dataset</p></td>
1103 <td class="parameter_annotations"> </td>
1104 </tr>
1105 <tr>
1106 <td class="parameter_name"><p>validate</p></td>
1107 <td class="parameter_description"><p>whether or not the passed value should be validated against
1108 the IPTC specification for this dataset's tag.</p></td>
1109 <td class="parameter_annotations"> </td>
1110 </tr>
1111 </tbody>
1112 </table></div>
1113 </div>
1114 <div class="refsect3">
1115 <a name="iptc-data-add-dataset-with-value.returns"></a><h4>Returns</h4>
1116 <p> -1 on error, 0 if validation failed, the number of bytes copied
1117 on success</p>
1118 </div>
1119 </div>
1120 <hr>
1121 <div class="refsect2">
1122 <a name="iptc-data-add-dataset-with-contents"></a><h3>iptc_data_add_dataset_with_contents ()</h3>
1123 <pre class="programlisting"><span class="returnvalue">int</span>
1124 iptc_data_add_dataset_with_contents (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
1125 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcRecord" title="enum IptcRecord"><span class="type">IptcRecord</span></a> record</code></em>,
1126 <em class="parameter"><code><a class="link" href="libiptcdata-tag.html#IptcTag" title="enum IptcTag"><span class="type">IptcTag</span></a> tag</code></em>,
1127 <em class="parameter"><code>const unsigned <span class="type">char</span> *buf</code></em>,
1128 <em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>,
1129 <em class="parameter"><code><a class="link" href="libiptcdata-dataset.html#IptcValidate" title="enum IptcValidate"><span class="type">IptcValidate</span></a> validate</code></em>);</pre>
1130 <p>This is a convenience function that creates a new dataset with the given
1131 record and tag, adds it to the specified collection of datasets, and
1132 stores a copy of the given data buffer as the contents of the dataset.
1133 It is equivalent to calling this sequence of functions: <a class="link" href="libiptcdata-dataset.html#iptc-dataset-new" title="iptc_dataset_new ()"><code class="function">iptc_dataset_new()</code></a>,
1134 <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-tag" title="iptc_dataset_set_tag ()"><code class="function">iptc_dataset_set_tag()</code></a>, <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset" title="iptc_data_add_dataset ()"><code class="function">iptc_data_add_dataset()</code></a>,
1135 and <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-data" title="iptc_dataset_set_data ()"><code class="function">iptc_dataset_set_data()</code></a>.</p>
1136 <div class="refsect3">
1137 <a name="iptc-data-add-dataset-with-contents.parameters"></a><h4>Parameters</h4>
1138 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1139 <colgroup>
1140 <col width="150px" class="parameters_name">
1141 <col class="parameters_description">
1142 <col width="200px" class="parameters_annotations">
1143 </colgroup>
1144 <tbody>
1145 <tr>
1146 <td class="parameter_name"><p>data</p></td>
1147 <td class="parameter_description"><p>collection to which the new dataset should be added</p></td>
1148 <td class="parameter_annotations"> </td>
1149 </tr>
1150 <tr>
1151 <td class="parameter_name"><p>record</p></td>
1152 <td class="parameter_description"><p>record number of the dataset to be added</p></td>
1153 <td class="parameter_annotations"> </td>
1154 </tr>
1155 <tr>
1156 <td class="parameter_name"><p>tag</p></td>
1157 <td class="parameter_description"><p>tag (dataset number) of the dataset to be added</p></td>
1158 <td class="parameter_annotations"> </td>
1159 </tr>
1160 <tr>
1161 <td class="parameter_name"><p>buf</p></td>
1162 <td class="parameter_description"><p>buffer containing the value</p></td>
1163 <td class="parameter_annotations"> </td>
1164 </tr>
1165 <tr>
1166 <td class="parameter_name"><p>size</p></td>
1167 <td class="parameter_description"><p>number of bytes to copy</p></td>
1168 <td class="parameter_annotations"> </td>
1169 </tr>
1170 <tr>
1171 <td class="parameter_name"><p>validate</p></td>
1172 <td class="parameter_description"><p>whether or not the passed value should be validated against
1173 the IPTC specification for this dataset's tag.</p></td>
1174 <td class="parameter_annotations"> </td>
1175 </tr>
1176 </tbody>
1177 </table></div>
1178 </div>
1179 <div class="refsect3">
1180 <a name="iptc-data-add-dataset-with-contents.returns"></a><h4>Returns</h4>
1181 <p> -1 on error, 0 if validation failed, the number of bytes copied
1182 on success</p>
1183 </div>
1184 </div>
1185 <hr>
1186 <div class="refsect2">
1187 <a name="iptc-data-dump"></a><h3>iptc_data_dump ()</h3>
1188 <pre class="programlisting"><span class="returnvalue">void</span>
1189 iptc_data_dump (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
1190 <em class="parameter"><code>unsigned <span class="type">int</span> indent</code></em>);</pre>
1191 <p>A debugging aid that prints out the contents of a collection
1192 of datasets to standard output.</p>
1193 <div class="refsect3">
1194 <a name="iptc-data-dump.parameters"></a><h4>Parameters</h4>
1195 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1196 <colgroup>
1197 <col width="150px" class="parameters_name">
1198 <col class="parameters_description">
1199 <col width="200px" class="parameters_annotations">
1200 </colgroup>
1201 <tbody>
1202 <tr>
1203 <td class="parameter_name"><p>data</p></td>
1204 <td class="parameter_description"><p>collection of datasets to print</p></td>
1205 <td class="parameter_annotations"> </td>
1206 </tr>
1207 <tr>
1208 <td class="parameter_name"><p>indent</p></td>
1209 <td class="parameter_description"><p>indentation level of the printout</p></td>
1210 <td class="parameter_annotations"> </td>
1211 </tr>
1212 </tbody>
1213 </table></div>
1214 </div>
1215 </div>
1216 <hr>
1217 <div class="refsect2">
1218 <a name="iptc-data-log"></a><h3>iptc_data_log ()</h3>
1219 <pre class="programlisting"><span class="returnvalue">void</span>
1220 iptc_data_log (<em class="parameter"><code><a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> *data</code></em>,
1221 <em class="parameter"><code><a class="link" href="libiptcdata-log.html#IptcLog" title="IptcLog"><span class="type">IptcLog</span></a> *log</code></em>);</pre>
1222 <p>Changes the logging object for a <a class="link" href="libiptcdata-data.html#IptcData" title="struct IptcData"><span class="type">IptcData</span></a> object. The logging
1223 object determines how warning and error messages are relayed back
1224 to the application. This function also calls <a class="link" href="libiptcdata-log.html#iptc-log-ref" title="iptc_log_ref ()"><code class="function">iptc_log_ref()</code></a> on
1225 the new log object and <a class="link" href="libiptcdata-log.html#iptc-log-unref" title="iptc_log_unref ()"><code class="function">iptc_log_unref()</code></a> on the previous log
1226 object.</p>
1227 <div class="refsect3">
1228 <a name="iptc-data-log.parameters"></a><h4>Parameters</h4>
1229 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1230 <colgroup>
1231 <col width="150px" class="parameters_name">
1232 <col class="parameters_description">
1233 <col width="200px" class="parameters_annotations">
1234 </colgroup>
1235 <tbody>
1236 <tr>
1237 <td class="parameter_name"><p>data</p></td>
1238 <td class="parameter_description"><p>collection for which the log object should be changed.</p></td>
1239 <td class="parameter_annotations"> </td>
1240 </tr>
1241 <tr>
1242 <td class="parameter_name"><p>log</p></td>
1243 <td class="parameter_description"><p>log object to use for the collection</p></td>
1244 <td class="parameter_annotations"> </td>
1245 </tr>
1246 </tbody>
1247 </table></div>
1248 </div>
1249 </div>
1250 </div>
1251 <div class="refsect1">
1252 <a name="libiptcdata-data.other_details"></a><h2>Types and Values</h2>
1253 <div class="refsect2">
1254 <a name="IptcData"></a><h3>struct IptcData</h3>
1255 <pre class="programlisting">struct IptcData {
1256 IptcDataSet **datasets;
1257 unsigned int count;
1258
1259 IptcDataPrivate *priv;
1260 };
1261 </pre>
1262 </div>
1263 <hr>
1264 <div class="refsect2">
1265 <a name="IptcEncoding"></a><h3>enum IptcEncoding</h3>
1266 <div class="refsect3">
1267 <a name="IptcEncoding.members"></a><h4>Members</h4>
1268 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1269 <colgroup>
1270 <col width="300px" class="enum_members_name">
1271 <col class="enum_members_description">
1272 <col width="200px" class="enum_members_annotations">
1273 </colgroup>
1274 <tbody>
1275 <tr>
1276 <td class="enum_member_name"><p><a name="IPTC-ENCODING-UNKNOWN:CAPS"></a>IPTC_ENCODING_UNKNOWN</p></td>
1277 <td> </td>
1278 <td> </td>
1279 </tr>
1280 <tr>
1281 <td class="enum_member_name"><p><a name="IPTC-ENCODING-UNSPECIFIED:CAPS"></a>IPTC_ENCODING_UNSPECIFIED</p></td>
1282 <td> </td>
1283 <td> </td>
1284 </tr>
1285 <tr>
1286 <td class="enum_member_name"><p><a name="IPTC-ENCODING-UTF8:CAPS"></a>IPTC_ENCODING_UTF8</p></td>
1287 <td> </td>
1288 <td> </td>
1289 </tr>
1290 </tbody>
1291 </table></div>
1292 </div>
1293 </div>
1294 <hr>
1295 <div class="refsect2">
1296 <a name="IPTC-IIM-VERSION:CAPS"></a><h3>IPTC_IIM_VERSION</h3>
1297 <pre class="programlisting">#define IPTC_IIM_VERSION 4
1298 </pre>
1299 </div>
1300 </div>
1301 </div>
1302 <div class="footer">
1303 <hr>Generated by GTK-Doc V1.28</div>
1304 </body>
1305 </html>