1 /* @(#)mkisofs.h 1.152 16/12/13 joerg */
3 * Header file mkisofs.h - assorted structure definitions and typecasts.
5 * Written by Eric Youngdale (1993).
7 * Copyright 1993 Yggdrasil Computing, Incorporated
8 * Copyright (c) 1999,2000-2016 J. Schilling
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 23/2/2000 */
27 /* DUPLICATES_ONCE Alex Kopylov cdrtools@bootcd.ru 19.06.2004 */
29 #include <schily/mconfig.h> /* Must be before stdio.h for LARGEFILE support */
30 #include <schily/stdio.h>
31 #include <schily/types.h>
32 #include <schily/time.h>
33 #include <schily/stat.h>
34 #include <schily/stdlib.h>
35 #include <schily/unistd.h> /* Needed for for LARGEFILE support */
36 #include <schily/string.h>
37 #include <schily/dirent.h>
38 #include <schily/utypes.h>
39 #include <schily/standard.h>
40 #include <schily/nlsdefs.h>
41 #include <schily/ctype.h>
42 #include <schily/libport.h> /* Define missing prototypes */
53 * XXX Hack until fseeko()/ftello() are available everywhere or until
54 * XXX we know a secure way to let autoconf ckeck for fseeko()/ftello()
55 * XXX without defining FILE_OFFSETBITS to 64 in confdefs.h
69 #include <schily/siconv.h>
71 extern siconvt_t
*in_nls
; /* input UNICODE conversion table */
72 extern siconvt_t
*out_nls
; /* output UNICODE conversion table */
73 extern siconvt_t
*hfs_inls
; /* input HFS UNICODE conversion table */
74 extern siconvt_t
*hfs_onls
; /* output HFS UNICODE conversion table */
77 * Structure used to pass arguments via trewalk() to walkfun().
80 void *dir
; /* Pointer to struct directory *root */
81 char *name
; /* NULL or alternative short name */
89 unsigned char finderinfo
[32];
90 char name
[HFS_MAX_FLEN
+ 1];
91 /* should have fields for dates here as well */
93 struct hfs_info
*next
;
96 #endif /* APPLE_HYB */
99 * Our version of "struct timespec".
100 * Currently only used with UDF.
102 typedef struct timesp
{
107 struct directory_entry
{
108 struct directory_entry
*next
;
109 struct directory_entry
*jnext
;
110 struct iso_directory_record isorec
;
111 unsigned int starting_block
;
113 int mxpart
; /* Extent number */
114 unsigned short priority
;
115 unsigned char jreclen
; /* Joliet record len */
119 struct directory
*filedir
;
120 struct directory_entry
*parent_rec
;
121 struct directory_entry
*mxroot
; /* Pointer to orig entry */
122 unsigned int de_flags
;
124 mode_t mode
; /* used for udf */
125 dev_t rdev
; /* used for udf devices */
126 uid_t uid
; /* used for udf */
127 gid_t gid
; /* used for udf */
128 timesp atime
; /* timespec for atime */
129 timesp mtime
; /* timespec for mtime */
130 timesp ctime
; /* timespec for ctime */
132 ino_t inode
; /* Used in the hash table */
133 dev_t dev
; /* Used in the hash table */
134 unsigned char *rr_attributes
;
135 unsigned int rr_attr_size
;
136 unsigned int total_rr_attr_size
;
137 unsigned int got_rr_name
;
139 struct directory_entry
*assoc
; /* entry has a resource fork */
140 hfsdirent
*hfs_ent
; /* HFS parameters */
141 off_t hfs_off
; /* offset to real start of fork */
142 int hfs_type
; /* type of HFS Unix file */
143 #endif /* APPLE_HYB */
145 int sort
; /* sort weight for entry */
148 int udf_file_entry_sector
; /* also used as UDF unique ID */
150 #ifdef DUPLICATES_ONCE
151 unsigned char *digest_fast
;
152 unsigned char *digest_full
;
157 struct file_hash
*next
;
158 ino_t inode
; /* Used in the hash table */
159 dev_t dev
; /* Used in the hash table */
160 nlink_t nlink
; /* Used to compute new link count */
161 unsigned int starting_block
;
163 #if defined(SORTING) || defined(DUPLICATES_ONCE)
164 struct directory_entry
*de
;
170 * This structure is used to control the output of fragments to the cdrom
171 * image. Everything that will be written to the output image will eventually
172 * go through this structure. There are two pieces - first is the sizing where
173 * we establish extent numbers for everything, and the second is when we actually
174 * generate the contents and write it to the output image.
176 * This makes it trivial to extend mkisofs to write special things in the image.
177 * All you need to do is hook an additional structure in the list, and the rest
180 * The three passes each do the following:
182 * The 'size' pass determines the size of each component and assigns the extent number
183 * for that component.
185 * The 'generate' pass will adjust the contents and pointers as required now that extent
186 * numbers are assigned. In some cases, the contents of the record are also generated.
188 * The 'write' pass actually writes the data to the disc.
190 struct output_fragment
{
191 struct output_fragment
*of_next
;
192 int (*of_size
) __PR((UInt32_t
));
193 int (*of_generate
) __PR((void));
194 int (*of_write
) __PR((FILE *));
195 char *of_name
; /* Textual description */
196 unsigned int of_start_extent
; /* For consist check */
199 extern struct output_fragment
*out_list
;
200 extern struct output_fragment
*out_tail
;
202 extern struct output_fragment startpad_desc
;
203 extern struct output_fragment voldesc_desc
;
204 extern struct output_fragment xvoldesc_desc
;
205 extern struct output_fragment joliet_desc
;
206 extern struct output_fragment torito_desc
;
207 extern struct output_fragment end_vol
;
208 extern struct output_fragment version_desc
;
209 extern struct output_fragment pathtable_desc
;
210 extern struct output_fragment jpathtable_desc
;
211 extern struct output_fragment dirtree_desc
;
212 extern struct output_fragment dirtree_clean
;
213 extern struct output_fragment jdirtree_desc
;
214 extern struct output_fragment extension_desc
;
215 extern struct output_fragment files_desc
;
216 extern struct output_fragment interpad_desc
;
217 extern struct output_fragment endpad_desc
;
218 extern struct output_fragment sunboot_desc
;
219 extern struct output_fragment sunlabel_desc
;
220 extern struct output_fragment genboot_desc
;
221 extern struct output_fragment strfile_desc
;
222 extern struct output_fragment strdir_desc
;
223 extern struct output_fragment strpath_desc
;
226 extern struct output_fragment hfs_desc
;
228 #endif /* APPLE_HYB */
231 * This structure holds the information necessary to create a valid
232 * DVD-Video image. Basically it's how much to pad the files so the
233 * file offsets described in the video_ts.ifo and vts_xx_0.ifo are
234 * the correct one in the image that we create.
248 int number_of_vob_files
;
249 int realsize_vob
[10];
254 title_set_t
*title_set
;
256 #endif /* DVD_AUD_VID */
259 * This structure describes one complete directory. It has pointers
260 * to other directories in the overall tree so that it is clear where
261 * this directory lives in the tree, and it also must contain pointers
262 * to the contents of the directory. Note that subdirectories of this
263 * directory exist twice in this stucture. Once in the subdir chain,
264 * and again in the contents chain.
267 struct directory
*next
; /* Next directory at same level as this one */
268 struct directory
*subdir
; /* First subdirectory in this directory */
269 struct directory
*parent
;
270 struct directory_entry
*contents
;
271 struct directory_entry
*jcontents
;
272 struct directory_entry
*self
;
273 char *whole_name
; /* Entire source path */
274 char *de_path
; /* Entire path iside ISO-9660 */
275 char *de_name
; /* Last path name component */
276 unsigned int ce_bytes
; /* Number of bytes of CE entries read */
282 unsigned int jextent
;
283 unsigned int path_index
;
284 unsigned int jpath_index
;
285 unsigned short dir_flags
;
286 unsigned short dir_nlink
;
288 hfsdirent
*hfs_ent
; /* HFS parameters */
289 struct hfs_info
*hfs_info
; /* list of info for all entries in dir */
290 #endif /* APPLE_HYB */
292 int sort
; /* sort weight for child files */
296 struct deferred_write
{
297 struct deferred_write
*next
;
302 struct directory_entry
*s_entry
;
305 unsigned int dw_flags
;
311 struct eltorito_boot_entry_info
{
312 struct eltorito_boot_entry_info
*next
;
321 #define ELTORITO_BOOT_ID 1
322 #define ELTORITO_SECTION_HEADER 2
325 * Valid if (type & ELTORITO_BOOT_ID) != 0
331 typedef struct ldate
{
338 extern struct directory
*root
;
339 extern struct directory
*reloc_dir
;
340 extern UInt32_t next_extent
;
341 extern UInt32_t last_extent
;
342 extern UInt32_t last_extent_written
;
343 extern UInt32_t session_start
;
345 extern unsigned int path_table_size
;
346 extern unsigned int path_table
[4];
347 extern unsigned int path_blocks
;
348 extern char *path_table_l
;
349 extern char *path_table_m
;
351 extern unsigned int jpath_table_size
;
352 extern unsigned int jpath_table
[4];
353 extern unsigned int jpath_blocks
;
354 extern char *jpath_table_l
;
355 extern char *jpath_table_m
;
357 extern struct iso_directory_record root_record
;
358 extern struct iso_directory_record jroot_record
;
360 extern int check_oldnames
;
361 extern int check_session
;
362 extern int use_eltorito
;
363 extern int hard_disk_boot
;
364 extern int not_bootable
;
365 extern int no_emul_boot
;
366 extern int load_addr
;
367 extern int load_size
;
368 extern int boot_info_table
;
369 extern int use_RockRidge
;
372 extern int use_Joliet
;
373 extern int rationalize
;
374 extern int rationalize_uid
;
375 extern int rationalize_gid
;
376 extern int rationalize_filemode
;
377 extern int rationalize_dirmode
;
378 extern uid_t uid_to_use
;
379 extern gid_t gid_to_use
;
380 extern int filemode_to_use
;
381 extern int dirmode_to_use
;
382 extern int new_dir_mode
;
383 extern int follow_links
;
384 extern int cache_inodes
;
385 #ifdef DUPLICATES_ONCE
386 extern int duplicates_once
;
391 extern int all_files
;
392 extern int generate_tables
;
393 extern int print_size
;
394 extern int split_output
;
395 extern int use_graft_ptrs
;
396 extern int jhide_trans_tbl
;
397 extern int hide_rr_moved
;
398 extern int omit_period
;
399 extern int omit_version_number
;
401 extern int transparent_compression
;
402 extern Uint RR_relocation_depth
;
403 extern int do_largefiles
;
404 extern off_t maxnonlarge
;
405 extern int iso9660_level
;
406 extern int iso9660_namelen
;
407 extern int full_iso9660_filenames
;
408 extern int nolimitpathtables
;
409 extern int relaxed_filenames
;
410 extern int allow_lowercase
;
411 extern int allow_multidot
;
412 extern int iso_translate
;
413 extern int allow_leading_dots
;
414 extern int use_fileversion
;
415 extern int split_SL_component
;
416 extern int split_SL_field
;
417 extern char *trans_tbl
;
419 #define JMAX 64 /* maximum Joliet file name length (spec) */
420 #define JLONGMAX 103 /* out of spec Joliet file name length */
421 extern int jlen
; /* selected maximum Joliet file name length */
425 #define DVD_SPEC_NONE 0x0
426 #define DVD_SPEC_VIDEO 0x1
427 #define DVD_SPEC_AUDIO 0x2
428 #define DVD_SPEC_HYBRD (DVD_SPEC_VIDEO | DVD_SPEC_AUDIO)
429 extern int dvd_audio
;
430 extern int dvd_hybrid
;
431 extern int dvd_video
;
432 extern int dvd_aud_vid_flag
;
433 #endif /* DVD_AUD_VID */
436 extern int donotwrite_macpart
;
439 extern int apple_hyb
; /* create HFS hybrid */
440 extern int apple_ext
; /* use Apple extensions */
441 extern int apple_both
; /* common flag (for above) */
442 extern int hfs_extra
; /* extra ISO extents (hfs_ce_size) */
443 extern hce_mem
*hce
; /* libhfs/mkisofs extras */
444 extern int use_mac_name
; /* use Mac name for ISO9660/Joliet/RR */
445 extern int create_dt
; /* create the Desktp files */
446 extern char *hfs_boot_file
; /* name of HFS boot file */
447 extern char *magic_file
; /* magic file for CREATOR/TYPE matching */
448 extern int hfs_last
; /* order in which to process map/magic files */
449 extern char *deftype
; /* default Apple TYPE */
450 extern char *defcreator
; /* default Apple CREATOR */
451 extern int gen_pt
; /* generate HFS partition table */
452 extern char *autoname
; /* Autostart filename */
453 extern int afe_size
; /* Apple File Exchange block size */
454 extern char *hfs_volume_id
; /* HFS volume ID */
455 extern int icon_pos
; /* Keep Icon position */
456 extern int hfs_lock
; /* lock HFS volume (read-only) */
457 extern char *hfs_bless
; /* name of folder to 'bless' (System Folder) */
458 extern char *hfs_parms
; /* low level HFS parameters */
460 #define MAP_LAST 1 /* process magic then map file */
461 #define MAG_LAST 2 /* process map then magic file */
465 #endif /* PREP_BOOT */
468 extern char *prep_boot_image
[4];
469 extern int use_prep_boot
;
470 extern int use_chrp_boot
;
472 #endif /* PREP_BOOT */
473 #endif /* APPLE_HYB */
480 extern int stat_filter
__PR((char *, struct stat
*));
481 extern int lstat_filter
__PR((char *, struct stat
*));
482 extern int sort_tree
__PR((struct directory
*));
483 extern void attach_dot_entries
__PR((struct directory
* dirnode
,
484 struct stat
* this_stat
,
485 struct stat
* parent_stat
));
486 extern struct directory
*
487 find_or_create_directory
__PR((struct directory
*,
489 struct directory_entry
* self
, int));
490 extern void finish_cl_pl_entries
__PR((void));
491 extern int scan_directory_tree
__PR((struct directory
* this_dir
,
493 struct directory_entry
* self
));
495 extern int insert_file_entry
__PR((struct directory
*, char *,
496 char *, struct stat
*, int));
498 extern struct directory_entry
*
499 dup_directory_entry
__PR((struct directory_entry
*s_entry
));
500 extern void generate_iso9660_directories
__PR((struct directory
*, FILE *));
501 extern void dump_tree
__PR((struct directory
* node
));
502 extern struct directory_entry
*search_tree_file
__PR((struct
503 directory
* node
, char *filename
));
504 extern void init_fstatbuf
__PR((void));
505 extern struct stat root_statbuf
;
506 extern struct stat fstatbuf
;
509 extern void init_boot_catalog
__PR((const char *path
));
510 extern void insert_boot_cat
__PR((void));
511 extern void get_boot_entry
__PR((void));
512 extern int new_boot_entry
__PR((void));
513 extern void ex_boot_enoent
__PR((char *msg
, char *pname
));
516 extern int sparc_boot_label
__PR((char *label
));
517 extern int sunx86_boot_label
__PR((char *label
));
518 extern int scan_sparc_boot
__PR((char *files
));
519 extern int scan_sunx86_boot
__PR((char *files
));
520 extern int make_sun_label
__PR((void));
521 extern int make_sunx86_label
__PR((void));
524 extern void set_721
__PR((void *, UInt32_t
));
525 extern void set_722
__PR((void *, UInt32_t
));
526 extern void set_723
__PR((void *, UInt32_t
));
527 extern void set_731
__PR((void *, UInt32_t
));
528 extern void set_732
__PR((void *, UInt32_t
));
529 extern void set_733
__PR((void *, UInt32_t
));
531 extern UInt32_t get_711
__PR((void *));
532 extern UInt32_t get_721
__PR((void *));
533 extern UInt32_t get_723
__PR((void *));
534 extern UInt32_t get_731
__PR((void *));
535 extern UInt32_t get_732
__PR((void *));
536 extern UInt32_t get_733
__PR((void *));
539 extern int sort_directory
__PR((struct directory_entry
**, int));
540 extern void generate_one_directory
__PR((struct directory
*, FILE *));
541 extern void memcpy_max
__PR((char *, char *, int));
542 extern int oneblock_size
__PR((UInt32_t starting_extent
));
543 extern struct iso_primary_descriptor vol_desc
;
544 extern void xfwrite
__PR((void *buffer
, int size
, int count
, FILE * file
, int submode
, BOOL islast
));
545 extern void outputlist_insert
__PR((struct output_fragment
* frag
));
548 extern Ulong get_adj_size
__PR((int Csize
));
549 extern int adj_size
__PR((int Csize
, UInt32_t start_extent
, int extra
));
550 extern void adj_size_other
__PR((struct directory
* dpnt
));
551 extern int insert_padding_file
__PR((int size
));
552 extern int gen_mac_label
__PR((struct deferred_write
*));
555 extern void gen_prepboot_label
__PR((unsigned char *));
557 #endif /* PREP_BOOT */
558 #endif /* APPLE_HYB */
562 extern FILE *in_image
;
564 extern int open_merge_image
__PR((char *path
));
565 extern int close_merge_image
__PR((void));
566 extern struct iso_directory_record
*
567 merge_isofs
__PR((char *path
));
568 extern unsigned char *parse_xa
__PR((unsigned char *pnt
, int *lenp
,
569 struct directory_entry
* dpnt
));
570 extern int rr_flags
__PR((struct iso_directory_record
*idr
));
571 extern int merge_previous_session
__PR((struct directory
*,
572 struct iso_directory_record
*, char *, char *));
573 extern int get_session_start
__PR((int *));
577 extern void convert_to_unicode
__PR((unsigned char *buffer
,
578 int size
, char *source
, siconvt_t
*inls
));
579 extern int joliet_strlen
__PR((const char *string
, size_t maxlen
,
582 extern void conv_charset
__PR((unsigned char *to
, size_t *tosizep
,
583 unsigned char *from
, size_t *fromsizep
,
586 extern int joliet_sort_tree
__PR((struct directory
* node
));
589 extern int matches
__PR((char *));
590 extern int add_match
__PR((char *));
593 struct dirent
*readdir_add_files
__PR((char **, char *, DIR *));
597 extern void iso9660_check
__PR((struct iso_directory_record
*idr
, struct directory_entry
*ndr
));
598 extern int iso9660_file_length
__PR((const char *name
,
599 struct directory_entry
* sresult
, int flag
));
602 extern int iso9660_date
__PR((char *, time_t));
603 extern int iso9660_ldate
__PR((char *, time_t, int, int));
604 extern void add_hash
__PR((struct directory_entry
*));
605 extern struct file_hash
*find_hash
__PR((struct directory_entry
*spnt
));
607 extern void flush_hash
__PR((void));
608 extern void add_directory_hash
__PR((dev_t
, ino_t
));
609 extern struct file_hash
*find_directory_hash
__PR((dev_t
, ino_t
));
610 extern void flush_file_hash
__PR((void));
611 extern int delete_file_hash
__PR((struct directory_entry
*));
612 extern struct directory_entry
*find_file_hash
__PR((char *));
613 extern void add_file_hash
__PR((struct directory_entry
*));
615 extern int generate_xa_rr_attributes
__PR((char *, char *,
616 struct directory_entry
*,
617 struct stat
*, struct stat
*,
619 extern char *generate_rr_extension_record
__PR((char *id
,
621 char *source
, int *size
));
623 extern int check_prev_session
__PR((struct directory_entry
**, int len
,
624 struct directory_entry
*,
627 struct directory_entry
**));
629 extern void match_cl_re_entries
__PR((void));
630 extern void finish_cl_pl_for_prev_session
__PR((void));
631 extern char *find_rr_attribute
__PR((unsigned char *pnt
, int len
, char *attr_type
));
633 extern void udf_set_extattr_macresfork
__PR((unsigned char *buf
, off_t size
, unsigned rba
));
634 extern void udf_set_extattr_freespace
__PR((unsigned char *buf
, off_t size
, unsigned rba
));
635 extern int udf_get_symlinkcontents
__PR((char *, char *, off_t
*));
638 extern void do_inode
__PR((struct directory
*dpnt
));
639 extern void do_dir_nlink
__PR((struct directory
*dpnt
));
643 extern int make_mac_volume
__PR((struct directory
* dpnt
, UInt32_t start_extent
));
644 extern int write_fork
__PR((hfsfile
* hfp
, long tot
));
648 extern void del_hfs_info
__PR((struct hfs_info
*));
649 extern int get_hfs_dir
__PR((char *, char *, struct directory_entry
*));
650 extern int get_hfs_info
__PR((char *, char *, struct directory_entry
*));
651 extern int get_hfs_rname
__PR((char *, char *, char *));
652 extern int hfs_exclude
__PR((char *));
653 extern void print_hfs_info
__PR((struct directory_entry
*));
654 extern void hfs_init
__PR((char *, unsigned short, unsigned int));
655 extern void delete_rsrc_ent
__PR((struct directory_entry
*));
656 extern void clean_hfs
__PR((void));
657 extern void perr
__PR((char *));
658 extern void set_root_info
__PR((char *));
659 extern int file_is_resource
__PR((char *fname
, int hfstype
));
660 extern int hfs_excludepath
__PR((char *));
664 extern int make_desktop
__PR((hfsvol
*, int));
670 extern void gen_prepboot_label
__PR((MacLabel
* mac_label
));
672 extern int gen_mac_label
__PR((defer
*));
674 extern int autostart
__PR((void));
678 extern char *get_magic_match
__PR((const char *));
679 extern void clean_magic
__PR((void));
681 #endif /* APPLE_HYB */
685 * The callback function for treewalk() from walk.c
687 #ifdef _SCHILY_WALK_H
688 EXPORT
int walkfunc
__PR((char *nm
, struct stat
*fs
, int type
,
689 struct WALK
*state
));
693 extern char *extension_record
;
694 extern UInt32_t extension_record_extent
;
695 /*extern int n_data_extents;*/
696 extern BOOL archive_isreg
;
697 extern dev_t archive_dev
;
698 extern ino_t archive_ino
;
701 * These are a few goodies that can be specified on the command line, and are
702 * filled into the root record
704 extern char *preparer
;
705 extern char *publisher
;
706 extern char *copyright
;
708 extern char *abstract
;
710 extern char *volset_id
;
711 extern char *system_id
;
712 extern char *volume_id
;
713 extern char *boot_catalog
;
714 extern char *boot_image
;
715 extern char *genboot_image
;
716 extern int ucs_level
;
717 extern int volume_set_size
;
718 extern int volume_sequence_number
;
720 extern struct eltorito_boot_entry_info
*first_boot_entry
;
721 extern struct eltorito_boot_entry_info
*last_boot_entry
;
722 extern struct eltorito_boot_entry_info
*current_boot_entry
;
724 extern UInt32_t null_inodes
;
725 extern BOOL correct_inodes
;
727 extern BOOL long_rr_time
; /* TRUE: use long (17 Byte) time format */
729 extern char *findgequal
__PR((char *));
730 extern void *e_malloc
__PR((size_t));
731 extern char *e_strdup
__PR((const char *));
734 * Note: always use these macros to avoid problems.
736 * ISO_ROUND_UP(X) may cause an integer overflow and thus give
737 * incorrect results. So avoid it if possible.
739 * ISO_BLOCKS(X) is overflow safe. Prefer this when ever it is possible.
741 #define SECTOR_SIZE (2048)
742 #define ISO_ROUND_UP(X) (((X) + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1))
743 #define ISO_BLOCKS(X) (((X) / SECTOR_SIZE) + (((X)%SECTOR_SIZE)?1:0))
745 #define ROUND_UP(X, Y) (((X + (Y - 1)) / Y) * Y)
749 * ISO blocks == 2048, HFS blocks == 512
751 #define HFS_BLK_CONV (SECTOR_SIZE/HFS_BLOCKSZ)
753 #define HFS_ROUND_UP(X) ISO_ROUND_UP(((X)*HFS_BLOCKSZ)) /* XXX ??? */
754 #define HFS_BLOCKS(X) (ISO_BLOCKS(X) * HFS_BLK_CONV)
756 #define USE_MAC_NAME(E) (use_mac_name && ((E)->hfs_ent != NULL) && (E)->hfs_type)
757 #endif /* APPLE_HYB */
760 * Inode and device values for special purposes.
762 #define PREV_SESS_DEV ((dev_t)-2)
763 #define TABLE_INODE ((ino_t)-2)
764 #define UNCACHED_INODE ((ino_t)-1)
765 #define UNCACHED_DEVICE ((dev_t)-1)
768 * The highest value used for the inodes we assign to files that do not have
769 * a starting block address (zero length files, symlinks, dev nodes, pipes,
771 * We need to make sure that these numbers are valid ISO-9660 block addresses,
772 * this is why we use unsigned 32-bit integer values.
773 * We need to make sure that the inode numbers assigned for zero sized files
774 * is in a proper range, this is why we use numbers above the range of block
775 * addresses we use in the image. We start counting backwards from 0xFFFFFFF0
776 * to leave enough space for special numbers from the range listed above.
778 #define NULL_INO_MAX ((UInt32_t)0xFFFFFFF0)
781 #define STAT_INODE(X) (X.st_ino[0])
782 #define PATH_SEPARATOR ']'
783 #define SPATH_SEPARATOR ""
785 #define STAT_INODE(X) (X.st_ino)
786 #define PATH_SEPARATOR '/'
787 #define SPATH_SEPARATOR "/"
791 * When using multi-session, indicates that we can reuse the
792 * TRANS.TBL information for this directory entry. If this flag
793 * is set for all entries in a directory, it means we can just
794 * reuse the TRANS.TBL and not generate a new one.
796 #define SAFE_TO_REUSE_TABLE_ENTRY 0x01 /* de_flags only */
797 #define DIR_HAS_DOT 0x02 /* dir_flags only */
798 #define DIR_HAS_DOTDOT 0x04 /* dir_flags only */
799 #define INHIBIT_JOLIET_ENTRY 0x08
800 #define INHIBIT_RR_ENTRY 0x10 /* not used */
801 #define RELOCATED_DIRECTORY 0x20 /* de_flags only */
802 #define INHIBIT_ISO9660_ENTRY 0x40
803 #define MEMORY_FILE 0x80 /* de_flags only */
804 #define HIDDEN_FILE 0x100 /* de_flags only */
805 #define DIR_WAS_SCANNED 0x200 /* dir_flags only */
806 #define RESOURCE_FORK 0x400 /* de_flags only */
807 #define IS_SYMLINK 0x800 /* de_flags only */
808 #define MULTI_EXTENT 0x1000 /* de_flags only */
809 #define INHIBIT_UDF_ENTRY 0x2000
812 * Volume sequence number to use in all of the iso directory records.
817 * Make sure we have a definition for this. If not, take a very conservative
819 * POSIX requires the max pathname component lenght to be defined in limits.h
820 * If variable, it may be undefined. If undefined, there should be
821 * a definition for _POSIX_NAME_MAX in limits.h or in unistd.h
822 * As _POSIX_NAME_MAX is defined to 14, we cannot use it.
823 * XXX Eric's wrong comment:
824 * XXX From what I can tell SunOS is the only one with this trouble.
826 #include <schily/limits.h>
830 #define NAME_MAX FILENAME_MAX
838 #define PATH_MAX FILENAME_MAX
840 #define PATH_MAX 1024
845 * Cygwin seems to have PATH_MAX == 260 which is less than the usable
846 * path length. We raise PATH_MAX to at least 1024 for now for all platforms
847 * unless someone reports problems with mkisofs memory size.
851 #define PATH_MAX 1024
855 * XXX JS: Some structures have odd lengths!
856 * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length.
857 * For this reason, we cannot use sizeof (struct iso_path_table) or
858 * sizeof (struct iso_directory_record) to compute on disk sizes.
859 * Instead, we use offsetof(..., name) and add the name size.
863 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
869 extern int create_udfsymlinks
;
871 #if !defined(HAVE_MEMSET) && !defined(memset)
872 #define memset(s, c, n) fillbytes(s, n, c)
874 #if !defined(HAVE_MEMCHR) && !defined(memchr)
875 #define memchr(s, c, n) findbytes(s, n, c)
877 #if !defined(HAVE_MEMCPY) && !defined(memcpy)
878 #define memcpy(s1, s2, n) movebytes(s2, s1, n)
880 #if !defined(HAVE_MEMMOVE) && !defined(memmove)
881 #define memmove(s1, s2, n) movebytes(s2, s1, n)