File: libiptcdata-data.html

package info (click to toggle)
libiptcdata 1.0.2%2Blibtool01-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,916 kB
  • ctags: 978
  • sloc: sh: 9,445; ansic: 4,092; xml: 2,798; makefile: 123; python: 62; sed: 16
file content (1120 lines) | stat: -rw-r--r-- 56,588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>IPTC Data</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="libiptcdata Reference Manual">
<link rel="up" href="ch01.html" title="IPTC Data Manipulation">
<link rel="prev" href="ch01.html" title="IPTC Data Manipulation">
<link rel="next" href="libiptcdata-dataset.html" title="Datasets">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="IPTC Data Manipulation">
<link rel="chapter" href="ch02.html" title="Format-specific Functions">
<link rel="chapter" href="ch03.html" title="Helper Functions">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libiptcdata Reference Manual</th>
<td><a accesskey="n" href="libiptcdata-dataset.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2605403" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2575110" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libiptcdata-data"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2605403"></a><span class="refentrytitle">IPTC Data</span>
</h2>
<p>IPTC Data &#8212; creating, loading, saving, and editing a collection of IPTC datasets</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">



                    <a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>;
<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           <a class="link" href="libiptcdata-data.html#iptc-data-new">iptc_data_new</a>                       (void);
<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           <a class="link" href="libiptcdata-data.html#iptc-data-new-mem">iptc_data_new_mem</a>                   (<a class="link" href="libiptcdata-mem.html#IptcMem">IptcMem</a> *mem);
void                <a class="link" href="libiptcdata-data.html#iptc-data-ref">iptc_data_ref</a>                       (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);
void                <a class="link" href="libiptcdata-data.html#iptc-data-unref">iptc_data_unref</a>                     (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);
void                <a class="link" href="libiptcdata-data.html#iptc-data-free">iptc_data_free</a>                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);

<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           <a class="link" href="libiptcdata-data.html#iptc-data-new-from-jpeg">iptc_data_new_from_jpeg</a>             (const char *path);
<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           <a class="link" href="libiptcdata-data.html#iptc-data-new-from-data">iptc_data_new_from_data</a>             (unsigned char *buf,
                                                         unsigned int size);

int                 <a class="link" href="libiptcdata-data.html#iptc-data-load">iptc_data_load</a>                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned char *buf,
                                                         unsigned int size);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-save">iptc_data_save</a>                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned char **buf,
                                                         unsigned int *size);
void                <a class="link" href="libiptcdata-data.html#iptc-data-free-buf">iptc_data_free_buf</a>                  (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned char *buf);

<a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a>*        <a class="link" href="libiptcdata-data.html#iptc-data-get-dataset">iptc_data_get_dataset</a>               (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag);
<a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a>*        <a class="link" href="libiptcdata-data.html#iptc-data-get-next-dataset">iptc_data_get_next_dataset</a>          (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset">iptc_data_add_dataset</a>               (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-before">iptc_data_add_dataset_before</a>        (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *newds);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-after">iptc_data_add_dataset_after</a>         (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *newds);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-remove-dataset">iptc_data_remove_dataset</a>            (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds);

void                (<a class="link" href="libiptcdata-data.html#IptcDataForeachDataSetFunc">*IptcDataForeachDataSetFunc</a>)       (<a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *dataset,
                                                         void *user_data);
void                <a class="link" href="libiptcdata-data.html#iptc-data-foreach-dataset">iptc_data_foreach_dataset</a>           (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-data.html#IptcDataForeachDataSetFunc">IptcDataForeachDataSetFunc</a> func,
                                                         void *user_data);

void                <a class="link" href="libiptcdata-data.html#iptc-data-sort">iptc_data_sort</a>                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);

enum                <a class="link" href="libiptcdata-data.html#IptcEncoding">IptcEncoding</a>;
<a class="link" href="libiptcdata-data.html#IptcEncoding">IptcEncoding</a>        <a class="link" href="libiptcdata-data.html#iptc-data-get-encoding">iptc_data_get_encoding</a>              (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-set-encoding-utf8">iptc_data_set_encoding_utf8</a>         (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);

#define             <a class="link" href="libiptcdata-data.html#IPTC-IIM-VERSION:CAPS">IPTC_IIM_VERSION</a>
int                 <a class="link" href="libiptcdata-data.html#iptc-data-set-version">iptc_data_set_version</a>               (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned int version);

int                 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-with-value">iptc_data_add_dataset_with_value</a>    (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag,
                                                         unsigned int value,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcValidate">IptcValidate</a> validate);
int                 <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset-with-contents">iptc_data_add_dataset_with_contents</a> (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag,
                                                         unsigned char *buf,
                                                         unsigned int size,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcValidate">IptcValidate</a> validate);

void                <a class="link" href="libiptcdata-data.html#iptc-data-dump">iptc_data_dump</a>                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned int indent);
void                <a class="link" href="libiptcdata-data.html#iptc-data-log">iptc_data_log</a>                       (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-log.html#IptcLog">IptcLog</a> *log);

</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2575110"></a><h2>Description</h2>
<p>
The <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object is the top-level container for a collection of IPTC metadata tags.
Each of these tags is stored in an <a class="link" href="libiptcdata-dataset.html#IptcDataSet"><span class="type">IptcDataSet</span></a> object.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2575142"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2575152"></a><h3>
<a name="IptcData"></a>IptcData</h3>
<a class="indexterm" name="id2575164"></a><pre class="programlisting">typedef struct {
        IptcDataSet **datasets;
        unsigned int count;

	IptcDataPrivate *priv;
} IptcData;
</pre>
<p>
Represents the collection of datasets that make up a IPTC data block.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a>&#160;**<em class="structfield"><code>datasets</code></em>;</span></p></td>
<td>array of pointers to the datasets in the collection
</td>
</tr>
<tr>
<td><p><span class="term">unsigned&#160;int&#160;<em class="structfield"><code>count</code></em>;</span></p></td>
<td>the number of datasets in the collection
</td>
</tr>
<tr>
<td><p><span class="term">IptcDataPrivate&#160;*<em class="structfield"><code>priv</code></em>;</span></p></td>
<td>private data

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2575252"></a><h3>
<a name="iptc-data-new"></a>iptc_data_new ()</h3>
<a class="indexterm" name="id2575264"></a><pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           iptc_data_new                       (void);</pre>
<p>
Allocates a new collection of datasets, which is initialized to be
empty.  The default memory allocation functions (malloc, etc.) are
used.  If you need custom memory management functions, use
<a class="link" href="libiptcdata-data.html#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"><span class="type">IptcData</span></a>
refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref"><code class="function">iptc_data_unref()</code></a> when finished with the pointer.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object, NULL on error
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2621606"></a><h3>
<a name="iptc-data-new-mem"></a>iptc_data_new_mem ()</h3>
<a class="indexterm" name="id2621617"></a><pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           iptc_data_new_mem                   (<a class="link" href="libiptcdata-mem.html#IptcMem">IptcMem</a> *mem);</pre>
<p>
Allocates a new collection of datasets, which is initialized to be
empty, using custom memory management functions.  This allocation
will set the <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref"><code class="function">iptc_data_unref()</code></a> when
finished with the object.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>mem</code></em>&#160;:</span></p></td>
<td> Pointer to an <a class="link" href="libiptcdata-mem.html#IptcMem"><span class="type">IptcMem</span></a> object that defines custom memory managment
functions.  The refcount of <em class="parameter"><code>mem</code></em> will be incremented.  It is decremented
when the returned <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object is freed.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object, NULL on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2621719"></a><h3>
<a name="iptc-data-ref"></a>iptc_data_ref ()</h3>
<a class="indexterm" name="id2621732"></a><pre class="programlisting">void                iptc_data_ref                       (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);</pre>
<p>
Increments the reference count of an <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object.  This function
should be called whenever a copy of a pointer is made by the application.
<a class="link" href="libiptcdata-data.html#iptc-data-unref"><code class="function">iptc_data_unref()</code></a> can then be used when the pointer is no longer needed
to ensure that the object is freed once the object is completely unused.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the referenced pointer
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2621801"></a><h3>
<a name="iptc-data-unref"></a>iptc_data_unref ()</h3>
<a class="indexterm" name="id2621814"></a><pre class="programlisting">void                iptc_data_unref                     (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);</pre>
<p>
Decrements the reference count of an <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object.  The object will
automatically be freed when the count reaches 0.  This function should
be called whenever a pointer is no longer needed by an application.  It
is also good practice to set the local copy of the pointer to NULL to
shield against accidently reusing the value.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the unreferenced pointer
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2621875"></a><h3>
<a name="iptc-data-free"></a>iptc_data_free ()</h3>
<a class="indexterm" name="id2621887"></a><pre class="programlisting">void                iptc_data_free                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);</pre>
<p>
Frees an <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object.  This function should be used only for error
handling since <a class="link" href="libiptcdata-data.html#iptc-data-unref"><code class="function">iptc_data_unref()</code></a> provides a safer mechanism for freeing
that allows multiple components to have access to an object.  This
function decrements the reference count of any datasets contained by the
object.  This will generally cause them to be freed as well unless other
parts of the application are referencing them individually.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the object to free
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2621959"></a><h3>
<a name="iptc-data-new-from-jpeg"></a>iptc_data_new_from_jpeg ()</h3>
<a class="indexterm" name="id2621971"></a><pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           iptc_data_new_from_jpeg             (const char *path);</pre>
<p>
Allocates a new collection of datasets which is initialized by decoding
the IPTC data in JPEG file <em class="parameter"><code>path</code></em>.  This allocation will set the <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a>
refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref"><code class="function">iptc_data_unref()</code></a> when finished with the object.
This is a convenience function that reads the contents of the file,
creates a new <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object, parses the file with
<a class="link" href="libiptcdata-jpeg.html#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"><code class="function">iptc_jpeg_ps3_find_iptc()</code></a>, and loads the
data with <a class="link" href="libiptcdata-data.html#iptc-data-load"><code class="function">iptc_data_load()</code></a>.  If more fine-grained error detection
is needed, those functions should be used individually.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em>&#160;:</span></p></td>
<td> filesystem path of the jpeg file to be read
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object.  NULL on error (including
parsing errors or if the file did not include IPTC data).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622102"></a><h3>
<a name="iptc-data-new-from-data"></a>iptc_data_new_from_data ()</h3>
<a class="indexterm" name="id2622113"></a><pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcData">IptcData</a>*           iptc_data_new_from_data             (unsigned char *buf,
                                                         unsigned int size);</pre>
<p>
Allocates a new collection of datasets which is initialized by decoding
the contents of <em class="parameter"><code>buf</code></em>.  This allocation will set the <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a>
refcount to 1, so use <a class="link" href="libiptcdata-data.html#iptc-data-unref"><code class="function">iptc_data_unref()</code></a> when finished with the object.
This is simply a convenience function that can be duplicated by calling
<a class="link" href="libiptcdata-data.html#iptc-data-new"><code class="function">iptc_data_new()</code></a> followed by <a class="link" href="libiptcdata-data.html#iptc-data-load"><code class="function">iptc_data_load()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></p></td>
<td> the buffer of IPTC data to be decoded
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></p></td>
<td> the length to be read in bytes
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> pointer to the new <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object.  NULL on error (including
parsing errors in the contents of <em class="parameter"><code>buf</code></em>).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622255"></a><h3>
<a name="iptc-data-load"></a>iptc_data_load ()</h3>
<a class="indexterm" name="id2622267"></a><pre class="programlisting">int                 iptc_data_load                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned char *buf,
                                                         unsigned int size);</pre>
<p>
Parses a buffer containing raw IPTC data and adds the datasets
to the <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object <em class="parameter"><code>data</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> object to be populated with the loaded datasets
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></p></td>
<td> data buffer to be parsed, containing IPTC data
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></p></td>
<td> length of data buffer to be parsed
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on failure.  Note that in the failure
case, some datasets may still have been added to <em class="parameter"><code>data</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622394"></a><h3>
<a name="iptc-data-save"></a>iptc_data_save ()</h3>
<a class="indexterm" name="id2622406"></a><pre class="programlisting">int                 iptc_data_save                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned char **buf,
                                                         unsigned int *size);</pre>
<p>
Outputs a collection of datasets as an IPTC bytestream.  No memory allocation
is required in advance.  <em class="parameter"><code>buf</code></em> should point to a NULL pointer that will be set
to the address of the output buffer by this function.  <em class="parameter"><code>size</code></em> will contain
this buffer's length after completion.  The object <em class="parameter"><code>data</code></em> is unmodified by this
function.  The application should free the output buffer using
<a class="link" href="libiptcdata-data.html#iptc-data-free-buf"><code class="function">iptc_data_free_buf()</code></a> when it is no longer needed.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection of datasets to be saved
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></p></td>
<td> pointer to a pointer that will hold the address of the output buffer
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></p></td>
<td> pointer to an integer that will hold the length of the output buffer
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on failure.  In the failure case, <em class="parameter"><code>buf</code></em> should still
be checked for a non-NULL value, and freed using <a class="link" href="libiptcdata-data.html#iptc-data-free-buf"><code class="function">iptc_data_free_buf()</code></a> if
necessary.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622562"></a><h3>
<a name="iptc-data-free-buf"></a>iptc_data_free_buf ()</h3>
<a class="indexterm" name="id2622575"></a><pre class="programlisting">void                iptc_data_free_buf                  (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned char *buf);</pre>
<p>
Frees a temporary buffer created from an <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object by the
<a class="link" href="libiptcdata-data.html#iptc-data-save"><code class="function">iptc_data_save()</code></a> function.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object that allocated the buffer
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></p></td>
<td> the buffer to free
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622670"></a><h3>
<a name="iptc-data-get-dataset"></a>iptc_data_get_dataset ()</h3>
<a class="indexterm" name="id2622681"></a><pre class="programlisting"><a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a>*        iptc_data_get_dataset               (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag);</pre>
<p>
Finds the first occurence of a dataset inside a collection with
the specified record and tag identifiers.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection to search
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>record</code></em>&#160;:</span></p></td>
<td> record identifier of dataset
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em>&#160;:</span></p></td>
<td> tag identifier (dataset number) of dataset
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> pointer to dataset if found, NULL if no matching dataset found
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622787"></a><h3>
<a name="iptc-data-get-next-dataset"></a>iptc_data_get_next_dataset ()</h3>
<a class="indexterm" name="id2622799"></a><pre class="programlisting"><a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a>*        iptc_data_get_next_dataset          (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag);</pre>
<p>
Finds the next occurence of a dataset inside a collection with
the specified record and tag identifiers following <em class="parameter"><code>ds</code></em>.  This is useful
when a collection contains more than one dataset with the same record
and tag identifier (for example, the keywords tag appears once for
each keyword in the IPTC metadata).  When <em class="parameter"><code>ds</code></em> is NULL, this function
is equivalent to <a class="link" href="libiptcdata-data.html#iptc-data-get-dataset"><code class="function">iptc_data_get_dataset()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection to search
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ds</code></em>&#160;:</span></p></td>
<td> dataset where the search should originate (can be NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>record</code></em>&#160;:</span></p></td>
<td> record identifier of dataset
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em>&#160;:</span></p></td>
<td> tag identifier (dataset number) of dataset
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> pointer to dataset if found, NULL if no matching dataset found
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2622924"></a><h3>
<a name="iptc-data-add-dataset"></a>iptc_data_add_dataset ()</h3>
<a class="indexterm" name="id2622934"></a><pre class="programlisting">int                 iptc_data_add_dataset               (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds);</pre>
<p>
Adds an <a class="link" href="libiptcdata-dataset.html#IptcDataSet"><span class="type">IptcDataSet</span></a> at the end of an existing collection.  A
dataset can only be a member of a single collection.  This
function will increment the reference count of <em class="parameter"><code>dataset</code></em>, so if
the application no longer intends to use <em class="parameter"><code>dataset</code></em> directly, it
should call <a class="link" href="libiptcdata-dataset.html#iptc-dataset-unref"><code class="function">iptc_dataset_unref()</code></a> immediately following this call.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the collection to which the dataset will be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ds</code></em>&#160;:</span></p></td>
<td> dataset to add
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623037"></a><h3>
<a name="iptc-data-add-dataset-before"></a>iptc_data_add_dataset_before ()</h3>
<a class="indexterm" name="id2623050"></a><pre class="programlisting">int                 iptc_data_add_dataset_before        (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *newds);</pre>
<p>
Same as <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset"><code class="function">iptc_data_add_dataset()</code></a>, except the <em class="parameter"><code>dataset</code></em> will be added
before an existing dataset <em class="parameter"><code>ds</code></em>, so that if they are enumerated,
<em class="parameter"><code>newds</code></em> will appear before <em class="parameter"><code>ds</code></em> in the collection.  <em class="parameter"><code>ds</code></em> must be
a dataset already present in the collection.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the collection to which the dataset will be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ds</code></em>&#160;:</span></p></td>
<td> existing dataset before which <em class="parameter"><code>newds</code></em> will be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>newds</code></em>&#160;:</span></p></td>
<td> dataset to add
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623186"></a><h3>
<a name="iptc-data-add-dataset-after"></a>iptc_data_add_dataset_after ()</h3>
<a class="indexterm" name="id2623197"></a><pre class="programlisting">int                 iptc_data_add_dataset_after         (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *newds);</pre>
<p>
Same as <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset"><code class="function">iptc_data_add_dataset()</code></a>, except the <em class="parameter"><code>dataset</code></em> will be added
after an existing dataset <em class="parameter"><code>ds</code></em>, so that if they are enumerated,
<em class="parameter"><code>newds</code></em> will appear after <em class="parameter"><code>ds</code></em> in the collection.  <em class="parameter"><code>ds</code></em> must be a
dataset already present in the collection.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the collection to which the dataset will be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ds</code></em>&#160;:</span></p></td>
<td> existing dataset after which <em class="parameter"><code>newds</code></em> will be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>newds</code></em>&#160;:</span></p></td>
<td> dataset to add
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623332"></a><h3>
<a name="iptc-data-remove-dataset"></a>iptc_data_remove_dataset ()</h3>
<a class="indexterm" name="id2623342"></a><pre class="programlisting">int                 iptc_data_remove_dataset            (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *ds);</pre>
<p>
Removes a dataset from a collection.  This function also calls
<a class="link" href="libiptcdata-dataset.html#iptc-dataset-unref"><code class="function">iptc_dataset_unref()</code></a> on <em class="parameter"><code>ds</code></em>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> the collection from which to remove an entry
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ds</code></em>&#160;:</span></p></td>
<td> the dataset to remove from the collection
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623432"></a><h3>
<a name="IptcDataForeachDataSetFunc"></a>IptcDataForeachDataSetFunc ()</h3>
<a class="indexterm" name="id2623443"></a><pre class="programlisting">void                (*IptcDataForeachDataSetFunc)       (<a class="link" href="libiptcdata-dataset.html#IptcDataSet">IptcDataSet</a> *dataset,
                                                         void *user_data);</pre>
<p>
Application callback executed for each dataset from
<a class="link" href="libiptcdata-data.html#iptc-data-foreach-dataset"><code class="function">iptc_data_foreach_dataset()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dataset</code></em>&#160;:</span></p></td>
<td>the dataset
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td>the same <em class="parameter"><code>user_data</code></em> passed to <a class="link" href="libiptcdata-data.html#iptc-data-foreach-dataset"><code class="function">iptc_data_foreach_dataset()</code></a>


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623525"></a><h3>
<a name="iptc-data-foreach-dataset"></a>iptc_data_foreach_dataset ()</h3>
<a class="indexterm" name="id2623536"></a><pre class="programlisting">void                iptc_data_foreach_dataset           (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-data.html#IptcDataForeachDataSetFunc">IptcDataForeachDataSetFunc</a> func,
                                                         void *user_data);</pre>
<p>
Iterates through each dataset in the collection and calls the
callback function on that dataset.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection through which to iterate
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td> callback function
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td> arbitrary user data to be passed to the callback
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623622"></a><h3>
<a name="iptc-data-sort"></a>iptc_data_sort ()</h3>
<a class="indexterm" name="id2623632"></a><pre class="programlisting">void                iptc_data_sort                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);</pre>
<p>
Sorts a collection of datasets in ascending order first by record
number and second by tag number.  It can be useful to call this
function before saving IPTC data in order to maintain a more
organized file.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection of datasets to sort
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623681"></a><h3>
<a name="IptcEncoding"></a>enum IptcEncoding</h3>
<a class="indexterm" name="id2623691"></a><pre class="programlisting">typedef enum {
	IPTC_ENCODING_UNKNOWN = 0,
	IPTC_ENCODING_UNSPECIFIED = 1,
	IPTC_ENCODING_UTF8 = 2
} IptcEncoding;
</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623707"></a><h3>
<a name="iptc-data-get-encoding"></a>iptc_data_get_encoding ()</h3>
<a class="indexterm" name="id2623717"></a><pre class="programlisting"><a class="link" href="libiptcdata-data.html#IptcEncoding">IptcEncoding</a>        iptc_data_get_encoding              (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);</pre>
<p>
Identifies the character encoding of the collection of datasets as
specified by the "character set" dataset (1:90).  The specification
allows this dataset to contain control sequences from the ISO 2022
standard.  Unfortunately, this standard is very complicated and
generally not used by application writers.  Thus, rather than
attempt to decode any possible any possible control sequence, this
function only attempts to recognize the control sequence that identifies
the UTF-8 character set.  If found, this function will return
<span class="type">IPTC_ENCODING_UTF8</span>.  All character-based datasets in record 2 and
higher are then expected to contain data encoded in the UTF-8
character set.  Otherwise, this function will return
<span class="type">IPTC_ENCODING_UNKNOWN</span>, meaning that any other character set
might be used, including ISO 2022 control sequences that have not
been decoded.  If dataset 1:90 is not present, this function returns
<span class="type">IPTC_ENCODING_UNSPECIFIED</span>, in which case character-based datasets
will usually be plain ASCII, although broken applications may have
used some other encoding.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection of datasets
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <span class="type">IPTC_ENCODING_UTF8</span>, <span class="type">IPTC_ENCODING_UNKNOWN</span>, or
<span class="type">IPTC_ENCODING_UNSPECIFIED</span>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623827"></a><h3>
<a name="iptc-data-set-encoding-utf8"></a>iptc_data_set_encoding_utf8 ()</h3>
<a class="indexterm" name="id2623838"></a><pre class="programlisting">int                 iptc_data_set_encoding_utf8         (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data);</pre>
<p>
Sets the contents of the "character set" dataset (1:90) to contain
the control sequence that indicates UTF-8 as the character encoding
for any character-based datasets in record 2 or higher.  If dataset
1:90 is not present, it will be added to the collection.  Any prior
value of dataset 1:90 will be overwritten by this function.
Note that some third-party applications (notably Picasa) will ignore
all your IPTC data if this option is set.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection of datasets for which to specify the encoding
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623901"></a><h3>
<a name="IPTC-IIM-VERSION:CAPS"></a>IPTC_IIM_VERSION</h3>
<a class="indexterm" name="id2623911"></a><pre class="programlisting">#define IPTC_IIM_VERSION	4
</pre>
<p>
The version of the IPTC IIM specification implemented by this library.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623926"></a><h3>
<a name="iptc-data-set-version"></a>iptc_data_set_version ()</h3>
<a class="indexterm" name="id2623936"></a><pre class="programlisting">int                 iptc_data_set_version               (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned int version);</pre>
<p>
Specifies the version of the IIM specification used by this library by
setting the value of datasets 1:00 and 2:00.  It is recommended to set the
version number to <a class="link" href="libiptcdata-data.html#IPTC-IIM-VERSION:CAPS"><span class="type">IPTC_IIM_VERSION</span></a>, which specifies the version
implemented by this library (currently 4).  If datasets 1:00 or 2:00 are
not present, they will be added to the collection.  Any prior value of
the datasets will be overwritten by this function.  To ensure strict
compliance with the standard, this function should be called before
saving a collection of datasets.  However, in practice, some applications
(notably Picasa) will ignore all your IPTC data if this option is set.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection of datasets for which to specify the version
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em>&#160;:</span></p></td>
<td> version number to write
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> 0 on success, -1 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624028"></a><h3>
<a name="iptc-data-add-dataset-with-value"></a>iptc_data_add_dataset_with_value ()</h3>
<a class="indexterm" name="id2624040"></a><pre class="programlisting">int                 iptc_data_add_dataset_with_value    (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag,
                                                         unsigned int value,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcValidate">IptcValidate</a> validate);</pre>
<p>
This is a convenience function that creates a new dataset with the given
record and tag, adds it to the specified collection of datasets, and
stores the given numeric value as the contents of the dataset.  It is
equivalent to calling this sequence of functions: <a class="link" href="libiptcdata-dataset.html#iptc-dataset-new"><code class="function">iptc_dataset_new()</code></a>,
<a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-tag"><code class="function">iptc_dataset_set_tag()</code></a>, <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset"><code class="function">iptc_data_add_dataset()</code></a>,
and <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-value"><code class="function">iptc_dataset_set_value()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection to which the new dataset should be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>record</code></em>&#160;:</span></p></td>
<td> record number of the dataset to be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em>&#160;:</span></p></td>
<td> tag (dataset number) of the dataset to be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
<td> value for the dataset
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>validate</code></em>&#160;:</span></p></td>
<td> whether or not the passed value should be validated against
the IPTC specification for this dataset's tag.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> -1 on error, 0 if validation failed, the number of bytes copied
on success
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624215"></a><h3>
<a name="iptc-data-add-dataset-with-contents"></a>iptc_data_add_dataset_with_contents ()</h3>
<a class="indexterm" name="id2624228"></a><pre class="programlisting">int                 iptc_data_add_dataset_with_contents (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-tag.html#IptcRecord">IptcRecord</a> record,
                                                         <a class="link" href="libiptcdata-tag.html#IptcTag">IptcTag</a> tag,
                                                         unsigned char *buf,
                                                         unsigned int size,
                                                         <a class="link" href="libiptcdata-dataset.html#IptcValidate">IptcValidate</a> validate);</pre>
<p>
This is a convenience function that creates a new dataset with the given
record and tag, adds it to the specified collection of datasets, and
stores a copy of the given data buffer as the contents of the dataset.
It is equivalent to calling this sequence of functions: <a class="link" href="libiptcdata-dataset.html#iptc-dataset-new"><code class="function">iptc_dataset_new()</code></a>,
<a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-tag"><code class="function">iptc_dataset_set_tag()</code></a>, <a class="link" href="libiptcdata-data.html#iptc-data-add-dataset"><code class="function">iptc_data_add_dataset()</code></a>,
and <a class="link" href="libiptcdata-dataset.html#iptc-dataset-set-data"><code class="function">iptc_dataset_set_data()</code></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection to which the new dataset should be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>record</code></em>&#160;:</span></p></td>
<td> record number of the dataset to be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em>&#160;:</span></p></td>
<td> tag (dataset number) of the dataset to be added
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em>&#160;:</span></p></td>
<td> buffer containing the value
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>&#160;:</span></p></td>
<td> number of bytes to copy
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>validate</code></em>&#160;:</span></p></td>
<td> whether or not the passed value should be validated against
the IPTC specification for this dataset's tag.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> -1 on error, 0 if validation failed, the number of bytes copied
on success
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624422"></a><h3>
<a name="iptc-data-dump"></a>iptc_data_dump ()</h3>
<a class="indexterm" name="id2624432"></a><pre class="programlisting">void                iptc_data_dump                      (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         unsigned int indent);</pre>
<p>
A debugging aid that prints out the contents of a collection
of datasets to standard output.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection of datasets to print
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>indent</code></em>&#160;:</span></p></td>
<td> indentation level of the printout
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624498"></a><h3>
<a name="iptc-data-log"></a>iptc_data_log ()</h3>
<a class="indexterm" name="id2624509"></a><pre class="programlisting">void                iptc_data_log                       (<a class="link" href="libiptcdata-data.html#IptcData">IptcData</a> *data,
                                                         <a class="link" href="libiptcdata-log.html#IptcLog">IptcLog</a> *log);</pre>
<p>
Changes the logging object for a <a class="link" href="libiptcdata-data.html#IptcData"><span class="type">IptcData</span></a> object.  The logging
object determines how warning and error messages are relayed back
to the application.  This function also calls <a class="link" href="libiptcdata-log.html#iptc-log-ref"><code class="function">iptc_log_ref()</code></a> on
the new log object and <a class="link" href="libiptcdata-log.html#iptc-log-unref"><code class="function">iptc_log_unref()</code></a> on the previous log
object.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td> collection for which the log object should be changed.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>log</code></em>&#160;:</span></p></td>
<td> log object to use for the collection
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2624601"></a><div class="refsect2" lang="en"><a name="id2624602"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id2624604"></a></div>
</div>
</div>
</body>
</html>