home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / CDWOS2D.EXE / include / cdwfsctl.h
Encoding:
C/C++ Source or Header  |  1998-12-22  |  7.5 KB  |  197 lines

  1. /*******************************************************************************
  2.  
  3.    Header    : FSCtl definitions for the RSJ CDWFS file system
  4.  
  5.    Purpose   : defines constants and structures for the application interface
  6.            to the file system through FSCtl calls.
  7.  
  8.    Author    : CM, RSJ Software
  9.  
  10.    Date      : 06/94
  11.  
  12.    Modifications:
  13.  
  14.       CM 12/94      - new FSCtl call "CDWFS_GET_CACHE_INFO" returns information
  15.      V1.07        about the total cache size as well as the current cache
  16.             position. This information is used by "cdwcpy.dll" to
  17.             optimize copy operations with many files (>10,000).
  18.  
  19.                   - new function 'XCopyToCD2()' adds the parameter 'verbose'
  20.                 which, if != 0, causes each file name to be printed
  21.             to stdout
  22.  
  23.       CM 08/95      - new FSCtl call 'CDWFS_SET_SPEED' allows changing the
  24.      V1.20        recording speed of the CD recorder.
  25.  
  26.       CM 07/96      - new attach information field 'scsi_error'. This flag
  27.      V1.69        is set if SCSI errors have occurred during the attach
  28.             sequence.
  29.  
  30.       CM 12/96      - removed some of the FSCtls which have been used
  31.      V2.00        internally by XCopyToCD and similar functions
  32.  
  33.           - added a new field (tdev) to ATTACH_INFO which allows
  34.             specifying the target device to be attached. Valid
  35.             target device names can be found in the documentation
  36.             about CD-View. Default should be "CDR:".
  37.       
  38.       CM 10/97    - added new mode for format command (FORMAT_ERASE_RW_DISK)
  39.          V2.50      to support RW recorders
  40.  
  41.    (c) Copyright RSJ Software GmbH 1994-1996. All rights reserved
  42.  
  43. *******************************************************************************/
  44.  
  45. #ifdef __IBMC__
  46. #define CDW_LINKAGE APIRET _System
  47. #define _far
  48. #else
  49. #define CDW_LINKAGE USHORT _far _cdecl
  50. #endif
  51.  
  52. /* ---------------------------- FSCtl function codes ------------------------ */
  53.  
  54. #define CDWFS_FORMAT          0xc771
  55. #define CDWFS_RECOVER          0xc772
  56. #define CDWFS_CHKDSK          0xc773
  57. #define CDWFS_NEXTERROR       0xc774
  58. #define CDWFS_SET_SPEED       0xc778
  59.  
  60. /* new FSCtls for V2.0 */
  61. #define CDWFS_CONNECT          0xc780
  62. #define CDWFS_REQUEST          0xc781
  63. #define CDWFS_DISCONNECT      0xc782
  64.  
  65. /* new FSCtls for V2.72 */
  66. #define CDWFS_SET_BOOTFILE        0xc783
  67.  
  68. /* -------------------------- typedefs and structures ----------------------- */
  69.  
  70. #pragma pack(1)
  71.  
  72. /*******************************************************************************
  73.  
  74.   'FLUSH_MODE' defines the various modes available for the detach request.
  75.  
  76. *******************************************************************************/
  77.  
  78. typedef enum {
  79.   FLUSH_NONE,            /* just detach drive (no data written!) */
  80.   FLUSH_CACHE,            /* write cache buffer to disk */
  81.   FLUSH_DIRECTORY,        /* write cache buffer + directory to disk */
  82.   FLUSH_SESSION,        /* write PVD + session header to disk */
  83.   FLUSH_SEAL            /* like FLUSH_SESSION, but make CD read-only */
  84.   } enum_FLUSH_MODE;
  85.  
  86. /* use a short to prevent sizeof(enum) differences */
  87. typedef short FLUSH_MODE;
  88.  
  89. /*******************************************************************************
  90.  
  91.   'FORMAT_MODE' defines the various format modes which can be used in the
  92.   CDWFS_FORMAT request.
  93.  
  94. *******************************************************************************/
  95.  
  96. typedef enum {
  97.   FORMAT_EMPTY_MEDIUM,        /* format only if CD is entirely empty */
  98.   FORMAT_UNSEAL,        /* make CD writable (works even for 3rd party CDs) */
  99.   FORMAT_ERASE_RW_DISK          /* completely erase RW disk */
  100.   } enum_FORMAT_MODE;
  101.  
  102. /* use a short to prevent sizeof(enum) differences */
  103. typedef short FORMAT_MODE;
  104.  
  105. /*******************************************************************************
  106.  
  107.   'ATTACH_INFO' contains the information which is used to attach a drive
  108.   letter to the file system
  109.  
  110. *******************************************************************************/
  111.  
  112. typedef struct {
  113.   short       len;        /* length of this structure */
  114.   char          device[20];    /* name of the SCSI device */
  115.   short       sessions_to_skip; /* number of sessions to skip (open last...) */
  116.   short       formatted;    /* != 0, if medium is formatted */
  117.  
  118.   /* extension for V1.69 (return whether or not SCSI errors have occurred) */
  119.   short       scsi_error;    /* != 0, if SCSI error has occurred during attach */
  120.  
  121.   /* extension for V2.00
  122.    *
  123.    * instead of a SCSI device driver name, we're specifying the name of the
  124.    * target device, that is, the recorder to be used. The name of the SCSI
  125.    * device driver (device) is ignored.
  126.    */
  127.   char          tdev[_MAX_PATH];    /* name of the target device (e.g. "CDR:") */
  128.  
  129.   } ATTACH_INFO;
  130.  
  131. /*******************************************************************************
  132.  
  133.   'DETACH_INFO' contains the information which is written into the primary
  134.   volume descriptor of the CD when 'flush_mode' is greater than FLUSH_CACHE.
  135.  
  136. *******************************************************************************/
  137.  
  138. typedef struct {
  139.   short       len;            /* length of this structure */
  140.   FLUSH_MODE  flush_mode;        /* type of flush requested */
  141.   char          vol_set_id[128];        /* volume set identifier */
  142.   char          publisher_id[128];    /* publisher identifier */
  143.   char          preparer_id[128];     /* data preparer identifier */
  144.   char          app_id[128];        /* application identifier */
  145.   char          cpyrght_file[37];     /* name of copyright file in root */
  146.   char          abstrct_file[37];     /* name of abstract file in root */
  147.   char          biblio_file[37];        /* name of bibliographic file in root */
  148.   } DETACH_INFO;
  149.  
  150. /*******************************************************************************
  151.  
  152.   'CHKDSK_DATA' defines the information which is returned by the
  153.   FSCTL_CHKDSK request.
  154.  
  155. *******************************************************************************/
  156.  
  157. typedef struct {
  158.   char          copyright[100];        /* copyright string with version information */
  159.   long          file_count;        /* number of files on the CD */
  160.   long          dir_count;        /* number of directories on the CD */
  161.   long          file_disk_usage;        /* volume space occupied by files */
  162.   long          dir_disk_usage;        /* volume space occupied by directories */
  163.   short       finalized_sessions;   /* number of finalized sessions on the CD */
  164.   short       open_session;        /* currently open session */
  165.   short       track_count;        /* number of tracks on the CD */
  166.   short       reserved_track;        /* currently reserved track */
  167.   short       fixation_recommended; /* power calibration area almost full */
  168.   short       modified;         /* CD has been modified */
  169.   DETACH_INFO pvd_info;         /* information about the PVD */
  170.   } CHKDSK_DATA;
  171.  
  172. /*******************************************************************************
  173.  
  174.   'SPEED_INFO' is used to specify the recording speed as well as the write
  175.   mode (emulation write or physical write).
  176.  
  177. *******************************************************************************/
  178.  
  179. typedef struct {
  180.   short       speed_factor;        /* 1 = 150K, 2 = 300K, 4 = 600K, ... */
  181.   short       emulation_write;        /* if set, the CD will not be mpdified */
  182.   } SPEED_INFO;
  183.  
  184. #pragma pack()
  185.  
  186. /* ------------------------ function prototypes ----------------------------- */
  187.  
  188. extern CDW_LINKAGE CopyToCD   (char   _far *source,
  189.                    char   _far *target);
  190.  
  191. extern CDW_LINKAGE XCopyToCD  (char   _far *source,
  192.                    char   _far *target);
  193.  
  194. extern CDW_LINKAGE XCopyToCD2 (char   _far *source,
  195.                    char   _far *target,
  196.                    short        verbose);
  197.