Add Russian translation provided by Валерий Крувялис <valkru@mail.ru>
[xiph-mirror.git] / positron / doc / pai.html
blobb2f8e801960bbec5718d9c246e75fd16f079ccd3
1 <html>
2 <head>
3 <link rel="stylesheet" type="text/css" href="style.css" />
4 <title>Positron Developer's Guide: PAI File Format</title>
5 </head>
6 <body>
7 <h1>Positron Developer's Guide: PAI File Format</h1>
9 <p>
10 This document explains the format of the PAI files. PAI files are
11 used in child databases to index the parent database. Each child
12 database has a PAI file containing one module for each record, deleted
13 or not. The module contains an entry for each record in the parent
14 database that has an access key corresponding to the record in the
15 child database. For example, the "Rock" record in the Genre child
16 database has an associated PAI module, which contains entries for each
17 song in the parent database in the "Rock" genre. This allows the
18 Neuros to quickly display all of the tracks in a particular category
19 quickly.
20 </p>
22 <p>
23 A record in a SAI file consists of a pointer to a MDB record, and to
24 its associated PAI module (if applicable). The pointer to the PAI
25 module does not point to the start of the module, however, but to the
26 location of the <emph>first entry within the module</emph>. See the
27 <a href="pai.html">PAI file format</a> for more information.
28 </p>
30 <table class="fielddef">
31 <tr><th>Word Offset</th><th>Size (words)</th><th>Description</th></tr>
32 <tr><td>0</td><td>2</td><td>Signature, "0x01162002"</td></tr>
33 <tr><td>2</td><td>6</td><td>Reserved (zero by default)</td></tr>
34 <tr><td>8</td><td>...</td><td>Module #1</td></tr>
35 <tr><td>...</td><td>...</td><td>...</td></tr>
36 <tr><td>...</td><td>...</td><td>Module #N</td></tr>
37 </table>
39 <h2>PAI Module</h2>
41 <table class="fielddef">
42 <tr><th>Word Offset</th><th>Size (words)</th><th>Description</th></tr>
43 <tr><td>0</td><td>1</td><td>Size of this module in words (including this one).
44 Note that the length of a PAI module must be multiple of 32 words. (M)</td></tr>
45 <tr><td>1</td><td>1</td><td>
46 16-bit flag describing the state of the module
47 <ul>
48 <li>Bit 0 = 0 if module contains at least one valid entry, 1 if module is empty</li>
49 <li>Bits 1-15 = Reserved (0 by default)
50 </u>
51 </td><tr>
52 <tr><td>2</td><td>1</td><td>Total number of entries (N)</td></tr>
53 <tr><td>3</td><td>3</td><td>Reserved (0 by default)</td></tr>
54 <tr><td>6</td><td>2</td><td>Pointer to beginning of a MDB record. (Note: the
55 PAI pointer in the <a href="sai.html#caveat">SAI</a> record associated with
56 this whole module points to this word.)</td></tr>
57 <tr><td>...</td><td>...</td><td>...</td></tr>
58 <tr><td>6+2*(N-1)</td><td>2</td><td>Pointer to beginning of a MDB record.</td></tr>
59 <tr><td>...</td><td>...</td><td>Empty entries are marked with zeros</td></tr>
60 <tr><td>M-2</td><td>2</td><td>Zeros, to mark the end of the module</td></tr>
62 </table>
64 </body>
65 </html>