| 1 |
<html> |
| 2 |
<head> |
| 3 |
<title>libhfsp</title> |
| 4 |
</head> |
| 5 |
<body> |
| 6 |
<h2>libhfsp</h2> |
| 7 |
<p> |
| 8 |
This library can be used to prorammatically acces HFS+ |
| 9 |
volumes. The library in turn is used by utilities allowing |
| 10 |
user access to the volume. |
| 11 |
</p> |
| 12 |
<h3>objects exposed</h3> |
| 13 |
The library has some top level objects that are to be used |
| 14 |
by other programs:<ul> |
| 15 |
<li><a href="#volume">volume</a> identifies the volume as a whole. |
| 16 |
</li> |
| 17 |
</li>The <a href="#btree">btree</a> is used a cache for the records used |
| 18 |
later (this object will eventually be included in the volume later |
| 19 |
on). |
| 20 |
</li> |
| 21 |
<li> The <a href="#record">record</a> represent a file or folder.</li> |
| 22 |
</ul> |
| 23 |
<h3> Design principles </h3> |
| 24 |
In contrast to the original library by Robert Leslie this libray |
| 25 |
rarely uses malloc/free. This impoes, that all memory is contained |
| 26 |
in the objects shown above. As of now only the current <b>two</b> |
| 27 |
blocks are "cached". Performance may be poor when doing large |
| 28 |
transactions. function returning int return 0 on success and any |
| 29 |
other value (normally -1) on failure unless stated otherwise. |
| 30 |
functions returning pointers return NULL on error. In most |
| 31 |
cases <code>hfsp_error</code> and <code>errno</code> should be set. |
| 32 |
Byte swapping happens when reading structure from raw memory, |
| 33 |
this avoids any alignment problems. (In contrast to Brad Boyers |
| 34 |
aproach wich needs to swap (and assemble) the bytes on every acces.) |
| 35 |
The contentes of the raw HFS+ structures is usually <b>not</b> |
| 36 |
copied to other structures and remains embedded in the high |
| 37 |
level strcutures. In case you need such a value acces it directly |
| 38 |
(e.G. volume->vol.create_date - HFSPTIMEDIFF ) |
| 39 |
|
| 40 |
<h3> <a name="volume">volume</a> </h3> |
| 41 |
Call <code>volume_open()</code> to open a volume. |
| 42 |
You must call <code>volume_close()</code> to close the volume. |
| 43 |
all other <code>volume_</code> functions are used internally only |
| 44 |
use them when you really know what you are doing. |
| 45 |
<h3> <a name="btree">btree</a> </h3> |
| 46 |
The btree as of now is the catalog-file btree, althoug there are |
| 47 |
other btrees like the extends-file btree. I intend to make the |
| 48 |
btree a (more or less) private member of the volume. This will |
| 49 |
be done together with implementing a catalog-node cache superseeding |
| 50 |
the simple block cache at the volume. |
| 51 |
|
| 52 |
<h3> <a name="record">record</a> </h3> |
| 53 |
|
| 54 |
The record is used whenever a file or folder is needed. There |
| 55 |
is a sufficient set of methods to navigate around with records. |
| 56 |
Folders and FolderThreads can both be used when acces to the |
| 57 |
files of a folder is needed. File Threads are supported, althoug |
| 58 |
Apple does not use them. (The utility functions like hpls however |
| 59 |
suppress then since I dont know what to do with them.) |
| 60 |
As of now there is no concept of "opening" a record, for |
| 61 |
readonlny acces just take one of the forks and use the |
| 62 |
fork functkions found at the volume to acces the raw data. See |
| 63 |
hpcopy for examples how to do that. |
| 64 |
|
| 65 |
<p> |
| 66 |
This is work in progress, either be patient or provide help. |
| 67 |
</p> |
| 68 |
$Id: libhfsp.html,v 1.1.1.1 2002/03/05 19:50:28 klaus Exp $ |
| 69 |
</body> |
| 70 |
</html> |
| 71 |
|