1 /* 2 * libhfs - library for reading and writing Macintosh HFS volumes. 3 * 4 * a record contains a key and a folder or file and is part 5 * of a btree. 6 * 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) 10 * 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. 15 * 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. 20 * 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, 24 * MA 02110-1301, USA. 25 * 26 * $Id: record.h,v 1.10 2000/10/01 17:08:05 hasi Exp $ 27 */ 28 29 /* Compare two cat_keys ... */ 30 extern int record_key_compare(void* k1, void* k2); 31 32 /* Compare two extent_keys ... */ 33 extern int record_extent_key_compare(void* k1, void* k2); 34 35 /* read a catalog key into a given buffer */ 36 extern void* record_readkey(void* p, void* buf); 37 38 /* read an extent key into a given buffer */ 39 extern void* record_extent_readkey(void* p, void* buf); 40 41 /* intialize the record to the first record of the tree 42 * which is (per design) the root node. 43 */ 44 extern int record_init_root(record* r, btree* tree); 45 46 /* intialize the record to the folder given by cnid. 47 */ 48 extern int record_init_cnid(record* r, btree* tree, UInt32 cnid); 49 50 /* intialize the record to the first record of the parent. 51 */ 52 extern int record_init_parent(record* r, record* parent); 53 54 /* intialize the record by searching for the given string in the given folder. 55 * 56 * parent and r may be the same. 57 */ 58 extern int record_init_string_parent(record* r, record* parent, char* key); 59 60 /* move record up in folder hierarchy (if possible) */ 61 extern int record_up(record* r); 62 63 /* move record foreward to next entry. 64 * 65 * In case of an error the value of *r is undefined ! 66 */ 67 extern int record_next(record* r); 68 69 /* intialize the extent_record to the extent identified by 70 * a given file */ 71 extern int record_init_file(extent_record* r, btree* tree, 72 UInt8 forktype, UInt32 fileId, UInt32 blockindex); 73 74 /* move foreward to next entent record. */ 75 extern int record_next_extent(extent_record *r); 76 77 #ifdef DEBUG 78 /* Dump all the record information to stdout */ 79 extern void record_print(record* r); 80 #endif 81