File: test.c

package info (click to toggle)
hfsplus 1.0.4-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,944 kB
  • sloc: ansic: 7,726; sh: 431; makefile: 55
file content (60 lines) | stat: -rw-r--r-- 1,778 bytes parent folder | download | duplicates (7)
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
/*
 * libhfsp - library for reading and writing Macintosh HFS+ volumes
 *
 * This is a test file used for development. I hope it will be
 * gone when this ever becomes final.
 * 
 * Copyright (C) 2000 Klaus Halfmann <klaus.halfmann@feri.de>
 * Original code 1996-1998 by Robert Leslie <rob@mars.rog>
 * other work 2000 from Brad Boyer (flar@pants.nu) 
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: test.c,v 1.2 2002/03/16 08:17:39 klaus Exp $
 */

# ifdef HAVE_CONFIG_H
#  include "config.h"
# endif                                                                         

#include <stdio.h>

#include "libhfsp.h"
#include "volume.h"
#include "btree.h"
#include "record.h"

int main(int argc, char* argv[])
{
    volume  v;
    btree   b;
    record  root, ls;
    UInt16  i;
    if (volume_open(&v, argv[1], 1, HFSP_MODE_RDONLY))
	perror(hfsp_error);

    if (volume_get_extends_tree(&v))
	perror(hfsp_error);

    /*
    UInt32  j;
    for (j=0xFFA0; j < 0xFFB0 ; j++)
	printf("allocated %lX %d\n", j,		volume_allocated(&v, j));
    */
    
    if (volume_close(&v))		    
	perror(hfsp_error);
    return 0;
}