home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / isofs / iso.h next >
Encoding:
C/C++ Source or Header  |  1992-07-09  |  4.8 KB  |  140 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    iso.h,v $
  29.  * Revision 2.2  92/07/08  16:17:09  mrt
  30.  *     BSDSS
  31.  *     [92/06/25  18:06:34  rwd]
  32.  * 
  33.  *
  34.  */
  35.  
  36. #define ISODCL(from, to) (to - from + 1)
  37.  
  38. struct iso_volume_descriptor {
  39.     char type[ISODCL(1,1)]; /* 711 */
  40.     char id[ISODCL(2,6)];
  41.     char version[ISODCL(7,7)];
  42.     char data[ISODCL(8,2048)];
  43. };
  44.  
  45. /* volume descriptor types */
  46. #define ISO_VD_PRIMARY 1
  47. #define ISO_VD_END 255
  48.  
  49. #define ISO_STANDARD_ID "CD001"
  50.  
  51. struct iso_primary_descriptor {
  52.     char type            [ISODCL (  1,   1)]; /* 711 */
  53.     char id                [ISODCL (  2,   6)];
  54.     char version            [ISODCL (  7,   7)]; /* 711 */
  55.     char unused1            [ISODCL (  8,   8)];
  56.     char system_id            [ISODCL (  9,  40)]; /* achars */
  57.     char volume_id            [ISODCL ( 41,  72)]; /* dchars */
  58.     char unused2            [ISODCL ( 73,  80)];
  59.     char volume_space_size        [ISODCL ( 81,  88)]; /* 733 */
  60.     char unused3            [ISODCL ( 89, 120)];
  61.     char volume_set_size        [ISODCL (121, 124)]; /* 723 */
  62.     char volume_sequence_number    [ISODCL (125, 128)]; /* 723 */
  63.     char logical_block_size        [ISODCL (129, 132)]; /* 723 */
  64.     char path_table_size        [ISODCL (133, 140)]; /* 733 */
  65.     char type_l_path_table        [ISODCL (141, 144)]; /* 731 */
  66.     char opt_type_l_path_table    [ISODCL (145, 148)]; /* 731 */
  67.     char type_m_path_table        [ISODCL (149, 152)]; /* 732 */
  68.     char opt_type_m_path_table    [ISODCL (153, 156)]; /* 732 */
  69.     char root_directory_record    [ISODCL (157, 190)]; /* 9.1 */
  70.     char volume_set_id        [ISODCL (191, 318)]; /* dchars */
  71.     char publisher_id        [ISODCL (319, 446)]; /* achars */
  72.     char preparer_id        [ISODCL (447, 574)]; /* achars */
  73.     char application_id        [ISODCL (575, 702)]; /* achars */
  74.     char copyright_file_id        [ISODCL (703, 739)]; /* 7.5 dchars */
  75.     char abstract_file_id        [ISODCL (740, 776)]; /* 7.5 dchars */
  76.     char bibliographic_file_id    [ISODCL (777, 813)]; /* 7.5 dchars */
  77.     char creation_date        [ISODCL (814, 830)]; /* 8.4.26.1 */
  78.     char modification_date        [ISODCL (831, 847)]; /* 8.4.26.1 */
  79.     char expiration_date        [ISODCL (848, 864)]; /* 8.4.26.1 */
  80.     char effective_date        [ISODCL (865, 881)]; /* 8.4.26.1 */
  81.     char file_structure_version    [ISODCL (882, 882)]; /* 711 */
  82.     char unused4            [ISODCL (883, 883)];
  83.     char application_data        [ISODCL (884, 1395)];
  84.     char unused5            [ISODCL (1396, 2048)];
  85. };
  86.  
  87. struct iso_directory_record {
  88.     char length            [ISODCL (1, 1)]; /* 711 */
  89.     char ext_attr_length        [ISODCL (2, 2)]; /* 711 */
  90.     char extent            [ISODCL (3, 10)]; /* 733 */
  91.     char size            [ISODCL (11, 18)]; /* 733 */
  92.     char date            [ISODCL (19, 25)]; /* 7 by 711 */
  93.     char flags            [ISODCL (26, 26)];
  94.     char file_unit_size        [ISODCL (27, 27)]; /* 711 */
  95.     char interleave            [ISODCL (28, 28)]; /* 711 */
  96.     char volume_sequence_number    [ISODCL (29, 32)]; /* 723 */
  97.     char name_len            [ISODCL (33, 33)]; /* 711 */
  98.     char name            [0];
  99. };
  100.  
  101. struct iso_mnt {
  102.     int logical_block_size;
  103.     int volume_space_size;
  104.     struct vnode *im_devvp;
  105.     char im_fsmnt[50];
  106.     
  107.     int im_ronly;
  108.     int im_fmod;
  109.     struct mount *im_mountp;
  110.     dev_t im_dev;
  111.  
  112.     int im_bshift;
  113.     int im_bmask;
  114.     int im_bsize;
  115.  
  116.     char root[ISODCL (157, 190)];
  117.     int root_extent;
  118.     int root_size;
  119. };
  120.  
  121. #define VFSTOISOFS(mp)    ((struct iso_mnt *)((mp)->mnt_data))
  122.  
  123. #define iso_blkoff(imp, loc) ((loc) & ~(imp)->im_bmask)
  124. #define iso_lblkno(imp, loc) ((loc) >> (imp)->im_bshift)
  125. #define iso_blksize(imp, ip, lbn) ((imp)->im_bsize)
  126. #define iso_lblktosize(imp, blk) ((blk) << (imp)->im_bshift)
  127.  
  128.  
  129. int isofs_mount __P((struct mount *mp, char *path, caddr_t data,
  130.     struct nameidata *ndp, struct proc *p));
  131. int isofs_start __P((struct mount *mp, int flags, struct proc *p));
  132. int isofs_unmount __P((struct mount *mp, int mntflags, struct proc *p));
  133. int isofs_root __P((struct mount *mp, struct vnode **vpp));
  134. int isofs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
  135. int isofs_sync __P((struct mount *mp, int waitfor));
  136. int isofs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp));
  137. int isofs_vptofh __P((struct vnode *vp, struct fid *fhp));
  138. int isofs_init __P(());
  139.  
  140.