1
/* @(#)hfs.h 1.3 01/03/20 joerg */
3
* hfsutils - tools for reading and writing Macintosh HFS volumes
4
* Copyright (C) 1996, 1997 Robert Leslie
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.
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.
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.
22
# include <standard.h>
27
/* don't need device locking for mkhybrid */
30
#endif /* NODEVLOCKS */
32
#endif /* APPLE_HYB */
34
# define HFS_BLOCKSZ 512
35
# define HFS_MAX_FLEN 31
36
# define HFS_MAX_VLEN 27
38
typedef struct _hfsvol_ hfsvol;
39
typedef struct _hfsfile_ hfsfile;
40
typedef struct _hfsdir_ hfsdir;
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 */
51
/* taken from v3.2.6 */
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 */
58
time_t crdate; /* date of creation */
59
time_t mddate; /* date of last modification */
60
time_t bkdate; /* date of last backup */
62
short fdflags; /* Macintosh Finder flags */
65
signed short v; /* Finder icon vertical coordinate */
66
signed short h; /* horizontal coordinate */
71
unsigned long dsize; /* size of data fork */
72
unsigned long rsize; /* size of resource fork */
74
char type[5]; /* file type code (plus null) */
75
char creator[5]; /* file creator code (plus null) */
79
unsigned short valence; /* number of items in directory */
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 */
89
signed short view; /* Folder's view */
92
signed short v; /* Scoll vertical position */
93
signed short h; /* Scoll horizontal position */
100
# define HFS_ISDIR 0x01
101
# define HFS_ISLOCKED 0x02
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
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)
124
extern char *hfs_error;
125
/*extern unsigned char hfs_charorder[];*/
128
hfsvol *hfs_mount __PR((hce_mem *, int, int));
130
hfsvol *hfs_mount __PR((char *, int, int));
131
#endif /* APPLE_HYB */
133
int hfs_flush __PR((hfsvol *));
134
void hfs_flushall __PR((void));
136
int hfs_umount __PR((hfsvol *, long, long));
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 *));
144
int hfs_vstat __PR((hfsvol *, hfsvolent *));
146
int hfs_format __PR((hce_mem *, int, char *));
148
int hfs_format __PR((char *, int, char *));
149
#endif /* APPLE_HYB */
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 *));
156
hfsdir *hfs_opendir __PR((hfsvol *, char *));
157
int hfs_readdir __PR((hfsdir *, hfsdirent *));
158
int hfs_closedir __PR((hfsdir *));
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));
168
int hfs_close __PR((hfsfile *, long, long));
170
int hfs_close __PR((hfsfile *));
171
#endif /* APPLE_HYB */
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 *));
178
int hfs_mkdir __PR((hfsvol *, char *));
179
int hfs_rmdir __PR((hfsvol *, char *));
181
int hfs_create __PR((hfsvol *, char *, char *, char *));
182
int hfs_delete __PR((hfsvol *, char *));
184
int hfs_rename __PR((hfsvol *, char *, char *));
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 */