2 * libhfs - library for reading and writing Macintosh HFS volumes.
4 * a record contains a key and a folder or file and is part
7 * Copyright (C) 2000 Klaus Halfmann <khalfmann@libra.de>
8 * Original 1996-1998 Robert Leslie <rob@mars.org>
9 * Additional work by Brad Boyer (flar@pants.nu)
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
26 * $Id: record.h,v 1.10 2000/10/01 17:08:05 hasi Exp $
29 /* Compare two cat_keys ... */
30 extern int record_key_compare(void* k1, void* k2);
32 /* Compare two extent_keys ... */
33 extern int record_extent_key_compare(void* k1, void* k2);
35 /* read a catalog key into a given buffer */
36 extern void* record_readkey(void* p, void* buf);
38 /* read an extent key into a given buffer */
39 extern void* record_extent_readkey(void* p, void* buf);
41 /* intialize the record to the first record of the tree
42 * which is (per design) the root node.
44 extern int record_init_root(record* r, btree* tree);
46 /* intialize the record to the folder given by cnid.
48 extern int record_init_cnid(record* r, btree* tree, UInt32 cnid);
50 /* intialize the record to the first record of the parent.
52 extern int record_init_parent(record* r, record* parent);
54 /* intialize the record by searching for the given string in the given folder.
56 * parent and r may be the same.
58 extern int record_init_string_parent(record* r, record* parent, char* key);
60 /* move record up in folder hierarchy (if possible) */
61 extern int record_up(record* r);
63 /* move record foreward to next entry.
65 * In case of an error the value of *r is undefined !
67 extern int record_next(record* r);
69 /* intialize the extent_record to the extent identified by
71 extern int record_init_file(extent_record* r, btree* tree,
72 UInt8 forktype, UInt32 fileId, UInt32 blockindex);
74 /* move foreward to next entent record. */
75 extern int record_next_extent(extent_record *r);
78 /* Dump all the record information to stdout */
79 extern void record_print(record* r);