This file is indexed.

/usr/share/gtk-doc/html/libgpod/libgpod-The-Itdb-iTunesDB-structure.html is in libgpod-doc 0.8.2-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>iPod database reading/writing</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="libgpod Reference Manual">
<link rel="up" href="itunesdb.html" title="Part I. iPod database">
<link rel="prev" href="itunesdb.html" title="Part I. iPod database">
<link rel="next" href="libgpod-File-handling-functions.html" title="File handling functions">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="itunesdb.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="itunesdb.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">libgpod Reference Manual</th>
<td><a accesskey="n" href="libgpod-File-handling-functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgpod-The-Itdb-iTunesDB-structure.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libgpod-The-Itdb-iTunesDB-structure.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgpod-The-Itdb-iTunesDB-structure"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgpod-The-Itdb-iTunesDB-structure.top_of_page"></a>iPod database reading/writing</span></h2>
<p>iPod database reading/writing — Functions to read, write, and create an iPod database</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgpod-The-Itdb-iTunesDB-structure.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct              <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB">Itdb_iTunesDB</a>;
                    <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB-Private" title="Itdb_iTunesDB_Private">Itdb_iTunesDB_Private</a>;
enum                <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbFileError" title="enum ItdbFileError">ItdbFileError</a>;
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *     <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-new" title="itdb_new ()">itdb_new</a>                            (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free" title="itdb_free ()">itdb_free</a>                           (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *     <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse" title="itdb_parse ()">itdb_parse</a>                          (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mp</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-write" title="itdb_write ()">itdb_write</a>                          (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-set-mountpoint" title="itdb_set_mountpoint ()">itdb_set_mountpoint</a>                 (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mp</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-get-mountpoint" title="itdb_get_mountpoint ()">itdb_get_mountpoint</a>                 (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-init-ipod" title="itdb_init_ipod ()">itdb_init_ipod</a>                      (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mountpoint</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *model_number</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *ipod_name</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number" title="itdb_tracks_number ()">itdb_tracks_number</a>                  (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number-nontransferred" title="itdb_tracks_number_nontransferred ()">itdb_tracks_number_nontransferred</a>   (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-playlists-number" title="itdb_playlists_number ()">itdb_playlists_number</a>               (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);
<span class="returnvalue">void</span>                (<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc" title="ItdbUserDataDestroyFunc ()">*ItdbUserDataDestroyFunc</a>)          (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> userdata</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            (<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc" title="ItdbUserDataDuplicateFunc ()">*ItdbUserDataDuplicateFunc</a>)        (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> userdata</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.description"></a><h2>Description</h2>
<p>
These functions are for reading, writing, creating, and deleting an iPod
database and getting the total number of tracks and playlists.
</p>
<p>
Overview of using an iPod database:
</p>
<p>
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse" title="itdb_parse ()"><code class="function">itdb_parse()</code></a>: read the iTunesDB and ArtworkDB
</p>
<p>
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-write" title="itdb_write ()"><code class="function">itdb_write()</code></a>: write the iTunesDB and ArtworkDB
</p>
<p>
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse" title="itdb_parse ()"><code class="function">itdb_parse()</code></a> will return a <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> structure with GLists
containing all tracks the playlists in the database.  Each track is
represented by an <a class="link" href="libgpod-Tracks.html#Itdb-Track" title="struct Itdb_Track"><span class="type">Itdb_Track</span></a>.   Each playlist is represented by an
<a class="link" href="libgpod-Playlists.html#Itdb-Playlist" title="struct Itdb_Playlist"><span class="type">Itdb_Playlist</span></a>.  See the <a class="link" href="libgpod-Tracks.html" title="Tracks">Tracks</a>
and <a class="link" href="libgpod-Playlists.html" title="Playlists">Playlists</a> sections for
details on tracks and playlists, respectively.
</p>
<p>
Each <a class="link" href="libgpod-Playlists.html#Itdb-Playlist" title="struct Itdb_Playlist"><span class="type">Itdb_Playlist</span></a> has a GList called <em class="parameter"><code>members</code></em> which contains all of
the tracks in the playlist.  Tracks referenced in a playlist must also
be present in the <em class="parameter"><code>tracks</code></em> GList of the <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>.
</p>
<p>
The iPod must contain one master playlist (MPL) containing all tracks
accessible on the iPod through the Music-&gt;Tracks/Albums/Artists/etc.
menu.  In addition to the MPL there can be a number of normal
playlists accessible through the Music-&gt;Playlists menu on the iPod.
Tracks that are a member of one of these normal playlists must also be
a member of the MPL.
</p>
<p>
The Podcasts playlist is just another playlist with some internal
flags set differently.  Tracks in the Podcasts playlist are not
normally members of the MPL (so on the iPod they will only show up
under the Podcasts menu). All tracks referenced must be in the
<em class="parameter"><code>tracks</code></em> GList of the <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>, however.
</p>
<p>
Each track may have a thumbnail associated with it. You can retrieve a
<a href="http://library.gnome.org/devel/gdk3/gdk-Bitmaps-and-Pixmaps.html#GdkPixmap"><span class="type">GdkPixmap</span></a> of the thumbnail using <a class="link" href="libgpod-Artwork.html#itdb-artwork-get-pixbuf" title="itdb_artwork_get_pixbuf ()"><code class="function">itdb_artwork_get_pixbuf()</code></a>.  A
thumbnail can be added with <a class="link" href="libgpod-Tracks.html#itdb-track-set-thumbnails" title="itdb_track_set_thumbnails ()"><code class="function">itdb_track_set_thumbnails()</code></a>.  A thumbnail
can be removed with <a class="link" href="libgpod-Tracks.html#itdb-track-remove-thumbnails" title="itdb_track_remove_thumbnails ()"><code class="function">itdb_track_remove_thumbnails()</code></a>.  Please see the
<a class="link" href="libgpod-Artwork.html" title="Artwork">Artwork</a> section for more
details on artwork related functions and structures.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Be aware that iTunes additionally stores the artwork as tags
in the original music file. That's also from where the data is
read when artwork is displayed in iTunes, and there can be more
than one piece of artwork. libgpod does not store the artwork as
tags in the original music file. As a consequence, if iTunes
attempts to access the artwork, it will find none, and remove
libgpod's artwork. Luckily, iTunes will only attempt to access
the artwork if you select a track in iTunes.  To work around
this, gtkpod keeps a list of the original filename of all
artwork and silently adds the thumbnails if they were 'lost'.
Your application might want to do something similar, or you can
supply patches for (optionally!) adding tags to the original music
files.
</p>
</div>
<p>
The <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>, <a class="link" href="libgpod-Playlists.html#Itdb-Playlist" title="struct Itdb_Playlist"><span class="type">Itdb_Playlist</span></a> and <a class="link" href="libgpod-Tracks.html#Itdb-Track" title="struct Itdb_Track"><span class="type">Itdb_Track</span></a> structures each
have <em class="parameter"><code>userdata</code></em> and <em class="parameter"><code>usertype</code></em> fields that can be used by the
application to store additional application-specific data. If
<em class="parameter"><code>userdata</code></em> is a pointer to an external structure, you can supply a
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc" title="ItdbUserDataDuplicateFunc ()"><span class="type">ItdbUserDataDuplicateFunc</span></a> and a <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc" title="ItdbUserDataDestroyFunc ()"><span class="type">ItdbUserDataDestroyFunc</span></a> so that this
data can be duplicated or freed automatically with a call to the
library <code class="function">_duplicate()</code>/<code class="function">_free()</code> functions.
</p>
</div>
<div class="refsect1">
<a name="libgpod-The-Itdb-iTunesDB-structure.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="Itdb-iTunesDB"></a><h3>struct Itdb_iTunesDB</h3>
<pre class="programlisting">struct Itdb_iTunesDB {
    GList *tracks;
    GList *playlists;
    gchar *filename;
    Itdb_Device *device;
    guint32 version;
    guint64 id;
    gint32 tzoffset;
    /* reserved for future use */
    gint32 reserved_int2;
    Itdb_iTunesDB_Private *priv;
    gpointer reserved2;
    /* below is for use by application */
    guint64 usertype;
    gpointer userdata;
    /* functions called to duplicate/free userdata */
    ItdbUserDataDuplicateFunc userdata_duplicate;
    ItdbUserDataDestroyFunc userdata_destroy;
};
</pre>
<p>
Structure representing an iTunes database
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.tracks"></a>tracks</code></em>;</span></p></td>
<td>A list of tracks in the database (<a class="link" href="libgpod-Tracks.html#Itdb-Track" title="struct Itdb_Track"><span class="type">Itdb_Track</span></a>)</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.playlists"></a>playlists</code></em>;</span></p></td>
<td>A list of playlists in the database (<a class="link" href="libgpod-Playlists.html#Itdb-Playlist" title="struct Itdb_Playlist"><span class="type">Itdb_Playlist</span></a>)</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.filename"></a>filename</code></em>;</span></p></td>
<td>The filename of the iTunesDB</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="libgpod-Device.html#Itdb-Device" title="Itdb_Device"><span class="type">Itdb_Device</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.device"></a>device</code></em>;</span></p></td>
<td>iPod device info (<a class="link" href="libgpod-Device.html#Itdb-Device" title="Itdb_Device"><span class="type">Itdb_Device</span></a>)</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.version"></a>version</code></em>;</span></p></td>
<td>The version number of the iTunesDB</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.id"></a>id</code></em>;</span></p></td>
<td>A 64 bit id value for the iTunesDB</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint32"><span class="type">gint32</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.tzoffset"></a>tzoffset</code></em>;</span></p></td>
<td>offset in seconds from UTC</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint32"><span class="type">gint32</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.reserved-int2"></a>reserved_int2</code></em>;</span></p></td>
<td>Reserved for future use</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB-Private" title="Itdb_iTunesDB_Private"><span class="type">Itdb_iTunesDB_Private</span></a> *<em class="structfield"><code><a name="Itdb-iTunesDB.priv"></a>priv</code></em>;</span></p></td>
<td>Private data</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.reserved2"></a>reserved2</code></em>;</span></p></td>
<td>Reserved for future use</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.usertype"></a>usertype</code></em>;</span></p></td>
<td>For use by application</td>
</tr>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.userdata"></a>userdata</code></em>;</span></p></td>
<td>For use by application</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc" title="ItdbUserDataDuplicateFunc ()"><span class="type">ItdbUserDataDuplicateFunc</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.userdata-duplicate"></a>userdata_duplicate</code></em>;</span></p></td>
<td>A function to duplicate <span class="type">userdata</span>
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc" title="ItdbUserDataDestroyFunc ()"><span class="type">ItdbUserDataDestroyFunc</span></a> <em class="structfield"><code><a name="Itdb-iTunesDB.userdata-destroy"></a>userdata_destroy</code></em>;</span></p></td>
<td>A function to free <span class="type">userdata</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="Itdb-iTunesDB-Private"></a><h3>Itdb_iTunesDB_Private</h3>
<pre class="programlisting">typedef struct {
    GList *mhsd5_playlists;
    guint16 platform;
    guint16 unk_0x22;
    guint64 id_0x24;
    guint16 lang;
    guint64 pid;
    gint32 unk_0x50;
    gint32 unk_0x54;
    gint16 audio_language;
    gint16 subtitle_language;
    gint16 unk_0xa4;
    gint16 unk_0xa6;
    gint16 unk_0xa8;
    gchar *genius_cuid;
} Itdb_iTunesDB_Private;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="ItdbFileError"></a><h3>enum ItdbFileError</h3>
<pre class="programlisting">typedef enum
{
    ITDB_FILE_ERROR_SEEK,
    ITDB_FILE_ERROR_CORRUPT,
    ITDB_FILE_ERROR_NOTFOUND,
    ITDB_FILE_ERROR_RENAME,
    ITDB_FILE_ERROR_ITDB_CORRUPT
} ItdbFileError;
</pre>
<p>
Error codes for iTunesDB file
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="ITDB-FILE-ERROR-SEEK:CAPS"></a><span class="term"><code class="literal">ITDB_FILE_ERROR_SEEK</code></span></p></td>
<td>file corrupt: illegal seek occured
</td>
</tr>
<tr>
<td><p><a name="ITDB-FILE-ERROR-CORRUPT:CAPS"></a><span class="term"><code class="literal">ITDB_FILE_ERROR_CORRUPT</code></span></p></td>
<td>file corrupt
</td>
</tr>
<tr>
<td><p><a name="ITDB-FILE-ERROR-NOTFOUND:CAPS"></a><span class="term"><code class="literal">ITDB_FILE_ERROR_NOTFOUND</code></span></p></td>
<td>file not found
</td>
</tr>
<tr>
<td><p><a name="ITDB-FILE-ERROR-RENAME:CAPS"></a><span class="term"><code class="literal">ITDB_FILE_ERROR_RENAME</code></span></p></td>
<td>file could not be renamed
</td>
</tr>
<tr>
<td><p><a name="ITDB-FILE-ERROR-ITDB-CORRUPT:CAPS"></a><span class="term"><code class="literal">ITDB_FILE_ERROR_ITDB_CORRUPT</code></span></p></td>
<td>iTunesDB in memory corrupt
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-new"></a><h3>itdb_new ()</h3>
<pre class="programlisting"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *     itdb_new                            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable
values.
</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> :</span></p></td>
<td>a newly created Itdb_iTunesDB to be freed with <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free" title="itdb_free ()"><code class="function">itdb_free()</code></a>
when it's no longer needed</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-free"></a><h3>itdb_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                itdb_free                           (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>
Free the memory taken by <em class="parameter"><code>itdb</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-parse"></a><h3>itdb_parse ()</h3>
<pre class="programlisting"><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="returnvalue">Itdb_iTunesDB</span></a> *     itdb_parse                          (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mp</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parse the Itdb_iTunesDB of the iPod located at <em class="parameter"><code>mp</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>mp</code></em> :</span></p></td>
<td>mount point of the iPod (eg "/mnt/ipod") in local encoding</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> or NULL</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly allocated <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> struct holding the tracks and
the playlists present on the iPod at <em class="parameter"><code>mp</code></em>, NULL if <em class="parameter"><code>mp</code></em> isn't an iPod mount
point. If non-NULL, the <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> is to be freed with <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free" title="itdb_free ()"><code class="function">itdb_free()</code></a> when
it's no longer needed</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-write"></a><h3>itdb_write ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            itdb_write                          (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Write out an iTunesDB. It reassigns unique IDs to all tracks. 
An existing "Play Counts" file is renamed to "Play Counts.bak" if
the export was successful.
An existing "OTGPlaylistInfo" file is removed if the export was
successful.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>the <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> to write to disk</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> or NULL</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em> is
set accordingly.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-set-mountpoint"></a><h3>itdb_set_mountpoint ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                itdb_set_mountpoint                 (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mp</code></em>);</pre>
<p>
Sets the mountpoint of <em class="parameter"><code>itdb</code></em>. Always use this function to set the
mountpoint of an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> as it will reset the number of
available /iPod_Control/Music/F.. dirs. It doesn't attempt to parse
an iPod database that may be present on the iPod at <em class="parameter"><code>mp</code></em>.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>Calling this function removes the artwork in the
<a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> database using this <a class="link" href="libgpod-Device.html#Itdb-Device" title="Itdb_Device"><span class="type">Itdb_Device</span></a> which was read from the
iPod.</p>
</div>
<p>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mp</code></em> :</span></p></td>
<td>new mount point</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.1.3</p>
</div>
<hr>
<div class="refsect2">
<a name="itdb-get-mountpoint"></a><h3>itdb_get_mountpoint ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       itdb_get_mountpoint                 (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>
Retrieve a reference to the mountpoint of <em class="parameter"><code>itdb</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <em class="parameter"><code>itdb</code></em> mountpoint, this string shouldn't be freed
nor modified</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.4.0</p>
</div>
<hr>
<div class="refsect2">
<a name="itdb-init-ipod"></a><h3>itdb_init_ipod ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            itdb_init_ipod                      (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *mountpoint</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *model_number</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *ipod_name</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Initialise an iPod device from scratch. The function attempts to
create a blank database, complete with master playlist and device
information as well as the directory structure required for the
type of iPod.
<em class="parameter"><code>model_number</code></em> is used to tell libgpod about the exact iPod
model, which is needed for proper artwork writing. <em class="parameter"><code>model_number</code></em> can be
found from the table returned by itdb_device_get_ipod_info_table (for
example). On recent distros with iPods released
in the last few years (starting with the iPod Color), it should be fine
to pass in a NULL <em class="parameter"><code>model_number</code></em> while still getting artwork writing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>mountpoint</code></em> :</span></p></td>
<td>the iPod mountpoint</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>model_number</code></em> :</span></p></td>
<td>the iPod model number, can be NULL</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ipod_name</code></em> :</span></p></td>
<td>the name to give to the iPod. Will be displayed in
gtkpod or itunes</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> or NULL</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>TRUE when successful, FALSE if a failure has occurred.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.4.0</p>
</div>
<hr>
<div class="refsect2">
<a name="itdb-tracks-number"></a><h3>itdb_tracks_number ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             itdb_tracks_number                  (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>
Counts the number of tracks stored in <em class="parameter"><code>itdb</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of tracks in <em class="parameter"><code>itdb</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-tracks-number-nontransferred"></a><h3>itdb_tracks_number_nontransferred ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             itdb_tracks_number_nontransferred   (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>
Counts the number of non-transferred tracks in <em class="parameter"><code>itdb</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of tracks in <em class="parameter"><code>itdb</code></em> that haven't been transferred
to the iPod yet (ie the number of <a class="link" href="libgpod-Tracks.html#Itdb-Track" title="struct Itdb_Track"><span class="type">Itdb_Track</span></a> in which the transferred field
is false)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="itdb-playlists-number"></a><h3>itdb_playlists_number ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a>             itdb_playlists_number               (<em class="parameter"><code><a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a> *itdb</code></em>);</pre>
<p>
Counts the number of playlists stored in <em class="parameter"><code>itdb</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>itdb</code></em> :</span></p></td>
<td>an <a class="link" href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB" title="struct Itdb_iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of playlists in <em class="parameter"><code>itdb</code></em> (including the master
playlist)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ItdbUserDataDestroyFunc"></a><h3>ItdbUserDataDestroyFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*ItdbUserDataDestroyFunc)          (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> userdata</code></em>);</pre>
<p>
Function called to free userdata
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>userdata</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> to user data</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ItdbUserDataDuplicateFunc"></a><h3>ItdbUserDataDuplicateFunc ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            (*ItdbUserDataDuplicateFunc)        (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> userdata</code></em>);</pre>
<p>
Function called to duplicate userdata
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>userdata</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> to user data</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>