~ubuntu-branches/ubuntu/hoary/cdrtools/hoary

« back to all changes in this revision

Viewing changes to libhfs_iso/hfs.h

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2002-04-09 10:03:06 UTC
  • Revision ID: james.westby@ubuntu.com-20020409100306-t4hagiv7gm0fhggv
Tags: upstream-1.10
ImportĀ upstreamĀ versionĀ 1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @(#)hfs.h    1.3 01/03/20 joerg */
 
2
/*
 
3
 * hfsutils - tools for reading and writing Macintosh HFS volumes
 
4
 * Copyright (C) 1996, 1997 Robert Leslie
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
 */
 
20
 
 
21
# include <time.h>
 
22
# include <standard.h>
 
23
 
 
24
#ifdef APPLE_HYB
 
25
#include "hybrid.h"
 
26
 
 
27
/* don't need device locking for mkhybrid */
 
28
#ifndef NODEVLOCKS
 
29
#define NODEVLOCKS
 
30
#endif /* NODEVLOCKS */
 
31
 
 
32
#endif /* APPLE_HYB */
 
33
 
 
34
# define HFS_BLOCKSZ    512
 
35
# define HFS_MAX_FLEN   31
 
36
# define HFS_MAX_VLEN   27
 
37
 
 
38
typedef struct _hfsvol_  hfsvol;
 
39
typedef struct _hfsfile_ hfsfile;
 
40
typedef struct _hfsdir_  hfsdir;
 
41
 
 
42
typedef struct {
 
43
  char name[HFS_MAX_VLEN + 1];  /* name of volume */
 
44
  int flags;                    /* volume flags */
 
45
  unsigned long totbytes;       /* total bytes on volume */
 
46
  unsigned long freebytes;      /* free bytes on volume */
 
47
  time_t crdate;                /* volume creation date */
 
48
  time_t mddate;                /* last volume modification date */
 
49
} hfsvolent;
 
50
 
 
51
/* taken from v3.2.6 */
 
52
typedef struct {
 
53
  char name[HFS_MAX_FLEN + 1];  /* catalog name (MacOS Standard Roman) */
 
54
  int flags;                    /* bit flags */
 
55
  unsigned long cnid;           /* catalog node id (CNID) */
 
56
  unsigned long parid;          /* CNID of parent directory */
 
57
 
 
58
  time_t crdate;                /* date of creation */
 
59
  time_t mddate;                /* date of last modification */
 
60
  time_t bkdate;                /* date of last backup */
 
61
 
 
62
  short fdflags;                /* Macintosh Finder flags */
 
63
 
 
64
  struct {
 
65
    signed short v;             /* Finder icon vertical coordinate */
 
66
    signed short h;             /* horizontal coordinate */
 
67
  } fdlocation;
 
68
 
 
69
  union {
 
70
    struct {
 
71
      unsigned long dsize;      /* size of data fork */
 
72
      unsigned long rsize;      /* size of resource fork */
 
73
 
 
74
      char type[5];             /* file type code (plus null) */
 
75
      char creator[5];          /* file creator code (plus null) */
 
76
    } file;
 
77
 
 
78
    struct {
 
79
      unsigned short valence;   /* number of items in directory */
 
80
 
 
81
      struct {
 
82
        signed short top;       /* top edge of folder's rectangle */
 
83
        signed short left;      /* left edge */
 
84
        signed short bottom;    /* bottom edge */
 
85
        signed short right;     /* right edge */
 
86
      } rect;
 
87
 
 
88
      /* mkhybrid extra */
 
89
      signed short view;        /* Folder's view */
 
90
 
 
91
      struct {
 
92
        signed short v;         /* Scoll vertical position */
 
93
        signed short h;         /* Scoll horizontal position */
 
94
      } frscroll;
 
95
    } dir;
 
96
  } u;
 
97
} hfsdirent;
 
98
 
 
99
 
 
100
# define HFS_ISDIR              0x01
 
101
# define HFS_ISLOCKED           0x02
 
102
 
 
103
# define HFS_CNID_ROOTPAR       1
 
104
# define HFS_CNID_ROOTDIR       2
 
105
# define HFS_CNID_EXT           3
 
106
# define HFS_CNID_CAT           4
 
107
# define HFS_CNID_BADALLOC      5
 
108
 
 
109
# define HFS_FNDR_ISONDESK              (1 <<  0)
 
110
# define HFS_FNDR_COLOR                 0x0e
 
111
# define HFS_FNDR_COLORRESERVED         (1 <<  4)
 
112
# define HFS_FNDR_REQUIRESSWITCHLAUNCH  (1 <<  5)
 
113
# define HFS_FNDR_ISSHARED              (1 <<  6)
 
114
# define HFS_FNDR_HASNOINITS            (1 <<  7)
 
115
# define HFS_FNDR_HASBEENINITED         (1 <<  8)
 
116
# define HFS_FNDR_RESERVED              (1 <<  9)
 
117
# define HFS_FNDR_HASCUSTOMICON         (1 << 10)
 
118
# define HFS_FNDR_ISSTATIONERY          (1 << 11)
 
119
# define HFS_FNDR_NAMELOCKED            (1 << 12)
 
120
# define HFS_FNDR_HASBUNDLE             (1 << 13)
 
121
# define HFS_FNDR_ISINVISIBLE           (1 << 14)
 
122
# define HFS_FNDR_ISALIAS               (1 << 15)
 
123
 
 
124
extern char *hfs_error;
 
125
/*extern unsigned char hfs_charorder[];*/
 
126
 
 
127
#ifdef APPLE_HYB
 
128
hfsvol *hfs_mount       __PR((hce_mem *, int, int));
 
129
#else
 
130
hfsvol *hfs_mount       __PR((char *, int, int));
 
131
#endif /* APPLE_HYB */
 
132
 
 
133
int hfs_flush           __PR((hfsvol *));
 
134
void hfs_flushall       __PR((void));
 
135
#ifdef APPLE_HYB
 
136
int hfs_umount          __PR((hfsvol *, long, long));
 
137
#else
 
138
int hfs_umount          __PR((hfsvol *));
 
139
#endif /* APPLE_HYB */
 
140
void hfs_umountall      __PR((void));
 
141
hfsvol *hfs_getvol      __PR((char *));
 
142
void hfs_setvol         __PR((hfsvol *));
 
143
 
 
144
int hfs_vstat           __PR((hfsvol *, hfsvolent *));
 
145
#ifdef APPLE_HYB
 
146
int hfs_format          __PR((hce_mem *, int, char *));
 
147
#else
 
148
int hfs_format          __PR((char *, int, char *));
 
149
#endif /* APPLE_HYB */
 
150
 
 
151
int hfs_chdir           __PR((hfsvol *, char *));
 
152
long hfs_getcwd         __PR((hfsvol *));
 
153
int hfs_setcwd          __PR((hfsvol *, long));
 
154
int hfs_dirinfo         __PR((hfsvol *, long *, char *));
 
155
 
 
156
hfsdir *hfs_opendir     __PR((hfsvol *, char *));
 
157
int hfs_readdir         __PR((hfsdir *, hfsdirent *));
 
158
int hfs_closedir        __PR((hfsdir *));
 
159
 
 
160
hfsfile *hfs_open       __PR((hfsvol *, char *));
 
161
int hfs_setfork         __PR((hfsfile *, int));
 
162
int hfs_getfork         __PR((hfsfile *));
 
163
long hfs_read           __PR((hfsfile *, void *, unsigned long));
 
164
long hfs_write          __PR((hfsfile *, void *, unsigned long));
 
165
int hfs_truncate        __PR((hfsfile *, unsigned long));
 
166
long hfs_lseek          __PR((hfsfile *, long, int));
 
167
#ifdef APPLE_HYB
 
168
int hfs_close           __PR((hfsfile *, long, long));
 
169
#else
 
170
int hfs_close           __PR((hfsfile *));
 
171
#endif /* APPLE_HYB */
 
172
 
 
173
int hfs_stat            __PR((hfsvol *, char *, hfsdirent *));
 
174
int hfs_fstat           __PR((hfsfile *, hfsdirent *));
 
175
int hfs_setattr         __PR((hfsvol *, char *, hfsdirent *));
 
176
int hfs_fsetattr        __PR((hfsfile *, hfsdirent *));
 
177
 
 
178
int hfs_mkdir           __PR((hfsvol *, char *));
 
179
int hfs_rmdir           __PR((hfsvol *, char *));
 
180
 
 
181
int hfs_create          __PR((hfsvol *, char *, char *, char *));
 
182
int hfs_delete          __PR((hfsvol *, char *));
 
183
 
 
184
int hfs_rename          __PR((hfsvol *, char *, char *));
 
185
 
 
186
#ifdef APPLE_HYB
 
187
unsigned short hfs_get_drAllocPtr       __PR((hfsfile *));
 
188
int hfs_set_drAllocPtr                  __PR((hfsfile *, unsigned short, int size));
 
189
void hfs_vsetbless                      __PR((hfsvol *, unsigned long));
 
190
#endif /* APPLE_HYB */