summaryrefslogtreecommitdiffstats
path: root/private/utils/ntbackup/inc/dos_fs.h
blob: 12fd061cf618b4ac12e5a67a5bbde86cd6b54063 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
/**
Copyright(c) Maynard Electronics, Inc. 1984-89


	Name:		dos_fs.h

	Date Updated:	$./FDT$ $./FTM$

	Description:	This file contains the prototypes for the DOS
                    file system functions.

	$Log:   O:/LOGFILES/DOS_FS.H_V  $
 * 
 *    Rev 1.10   03 Nov 1992 16:29:58   TIMN
 * Added macros for processing streams
 * 
 *    Rev 1.9   21 Oct 1992 13:09:06   CARLS
 * changed DOS_SetHandObjSizeLo to DOS_SetHandObjSize because size is now UINT64
 * 
 *    Rev 1.8   29 Sep 1992 17:47:28   CHUCKB
 * Added s_info to prototype for DOSCompleteBlk().
 *
 *    Rev 1.7   24 Sep 1992 12:00:48   TIMN
 * Deleted references to f(x) FS_GetTotalSizeDBLK()
 *
 *    Rev 1.6   24 Sep 1992 11:58:04   TIMN
 * Updated DOS FileSys to support MTF v4.0 format (stream info structs in data streams)
 *
 *    Rev 1.5   14 May 1992 17:03:24   STEVEN
 * 40 format
 *
 *    Rev 1.4   13 May 1992 16:50:02   STEVEN
 * 40 FORMAT update
 *
 *    Rev 1.3   13 Dec 1991 09:30:44   STEVEN
 * move common functions to tabels
 *
 *    Rev 1.2   10 Jul 1991 13:09:54   STEVEN
 * Added DOS_GetSpecDBLKS().
 *
 *    Rev 1.1   23 May 1991 16:46:12   BARRY
 * Changes for FindFirst/Next to scan for dirs only
 *
 *    Rev 1.0   09 May 1991 13:32:58   HUNTER
 * Initial revision.

**/
/* $end$ include list */

#ifndef _dos_fs_h_
#define _dos_fs_h_

#include "fsys.h"


typedef struct DOS_RESERVED_SH_STRUCT {
   INT16       fhdl ;      /* DOS file handle */
   INT16       active ;    /* is stream being processed */
   STREAM_INFO sh ;        /* DOS reserved stream info */
} DOS_RESERVED_SH, *DOS_RESERVED_SH_PTR ;

   /* sizeof FILE_HAND plus dos reserved struct */
#define FS_SIZEOF_RESERVED_FILE_HAND \
      ( sizeof(FILE_HAND_STRUCT) + sizeof(DOS_RESERVED_SH) )


#define _DEREF_HandObjHandPtr(hand)       ( (DOS_RESERVED_SH_PTR)((hand)->obj_hand.ptr) )

#define _DOS_GetHandObjFileHandle(hand)   ( (_DEREF_HandObjHandPtr(hand)->fhdl ) )
#define _DOS_GetHandObjSize(hand)         ( (_DEREF_HandObjHandPtr(hand)->sh.size ) )

#define _DOS_SetHandObjFileHandle(hand,h) ( (_DEREF_HandObjHandPtr(hand)->fhdl ) = (h) )
#define _DOS_SetHandObjSize(hand,v)       ( (_DEREF_HandObjHandPtr(hand)->sh.size = (v) ) )

#define _DOS_IsStrmBeingProcessed(hand)   ( (_DEREF_HandObjHandPtr(hand)->active ) )
#define _DOS_SetStrmProcessState(hand,v)  ( (_DEREF_HandObjHandPtr(hand)->active ) = (v) )

#define _DOS_WriteStrmInfo(hand)          ( (_DEREF_HandObjHandPtr(hand)->active ) == FALSE )
#define _DOS_ProcessData(hand)            ( (_DEREF_HandObjHandPtr(hand)->active ) == FALSE )
#define _DOS_SetProcessData(hand,v)       ( (_DEREF_HandObjHandPtr(hand)->active ) = !(v)  )


INT16 DOS_AttachToDLE( FSYS_HAND       fsh,      /* I - File system handle */
  GENERIC_DLE_PTR dle,      /*I/O- drive to attach to. list element expanded */
  CHAR_PTR        u_name,   /* I - user name    NOT USED                     */
  CHAR_PTR        pswd);    /* I - passowrd     NOT USED                     */

INT16 DOS_DetachDLE(   FSYS_HAND       fsh );      /* I -  */

INT16 DOS_AllocFileHand( FILE_HAND *file_hand ) ;   /* I/O - */
VOID  DOS_MemsetFileHand( FILE_HAND *file_hand ) ;    /* I/O - */

INT16 DOS_CreateObj(   FSYS_HAND fsh,    /* I - File system to create object one */
  DBLK_PTR  dblk);  /* I - Describes object to create       */

INT16 DOS_OpenObj(     FSYS_HAND fsh,    /* I - file system that the file is opened on */
  FILE_HAND *hand,  /* O - allocated handle                       */
  DBLK_PTR  dblk,   /*I/O- describes the file to be opened        */
  OPEN_MODE mode);  /* I - open mode                              */

INT16 DOS_ReadObj(  FILE_HAND hand, /* I - handle of object to read from                  */
  CHAR_PTR        buf,        /* O - buffer to place data into                      */
  UINT16          *size,      /*I/O- Entry: size of buf; Exit: number of bytes read */
  UINT16          *blk_size,  /* O - Block size needed for next read                */
  STREAM_INFO_PTR s_info ) ;  /*I/O- struct to place stream header info             */


INT16 DOS_WriteObj( FILE_HAND hand, /* I - handle of object to read from                  */
  CHAR_PTR        buf,        /* O - buffer to place data into                      */
  UINT16          *size,      /*I/O- Entry: size of buf; Exit: number of bytes read */
  UINT16          *blk_size,  /* O - Block size need for next read                  */
  STREAM_INFO_PTR s_info ) ;  /*I/O- struct to place stream header info             */

INT16 DOS_VerObj(   FILE_HAND hand, /* I - file handle to verify data with   */
  CHAR_PTR        buf,        /* I - buffer needed to perform verify   */
  CHAR_PTR        data,       /* I - data to verify against            */
  UINT16          *size,      /*I/O- size of buffers / amount verified */
  UINT16          *blk_size,  /* O - minum size of block for next call */
  STREAM_INFO_PTR s_info ) ;  /*I/O- struct to place stream header info             */


INT16 DOS_CloseObj( FILE_HAND hand );     /* I - handle of object to close */

INT16 DOS_DeleteObj( FSYS_HAND fsh,
  DBLK_PTR  dblk );

INT16 DOS_FindFirst( FSYS_HAND fsh,       /* I - file system handle                    */
  DBLK_PTR  dblk,      /* O - pointer to place to put the dblk data */
  CHAR_PTR  sname,     /* I - search name                           */
  UINT16    obj_type); /* I - object type (all objs, dirs, etc.)    */

INT16 DOS_FindNext(  FSYS_HAND fsh,      /* I - File system handle     */
  DBLK_PTR  dblk );   /* O - Discriptor block       */

INT16 DOS_GetObjInfo( FSYS_HAND fsh,      /* I - File system handle                      */
  DBLK_PTR  dblk );   /*I/O- On entry it is minimal on exit Complete */

INT16 DOS_VerObjInfo( FSYS_HAND fsh,     /* I - File system handle                      */
  DBLK_PTR  dblk );  /* I - DBLK to compare OS against */

INT16 DOS_ChangeDir( FSYS_HAND fsh,    /* I - file system to changing directories on  */
  CHAR_PTR  path,   /* I - describes the path of the new directory */
  INT16     psize); /* I - specifies the length of the path        */

INT16 DOS_UpDir(     FSYS_HAND fsh );  /* I - file system to change directories in */

INT16 DOS_GetCurrentPath( FSYS_HAND fsh,    /* I - file system to get current path from */
  CHAR_PTR  path,   /* O - buffer to place this path            */
  INT16     *size); /*I/O- size of buffer on entry & on exit    */

INT16 DOS_SeekObj( FILE_HAND hand,    /* I - Opened object to seek into */
  UINT32  *offset ); /*I/O- Offset to seek; Number of bytes actualy seeked */

INT16 DOS_GetMaxSizeDBLK( FSYS_HAND fsh  /* not used */ );

INT16 DOS_GetBasePath( FSYS_HAND fsh,          /* I - file system to get base path from */
  CHAR_PTR  full_path,    /* O - buffer to place this path         */
  INT16     *size );      /*I/O- size of buffer on entry & on exit */

INT16 DOS_GetCurrentDDB( FSYS_HAND fsh,     /* I - file system to get DDB from */
  DBLK_PTR  dblk );  /* O - place to put the DDB data   */

INT16 DOS_SetObjInfo(  FSYS_HAND fsh,    /* I - file system handle    */
  DBLK_PTR  dblk);  /* I - data to write to disk */

INT16 DOS_ModFnameFDB(  FSYS_HAND fsh,        /* I - File system handle                              */
  BOOLEAN  set_it,    /* I - TRUE if setting file name, FALSE if getting */
  DBLK_PTR dblk,      /* I - Descriptor block to get file name from      */
  CHAR_PTR buf,       /*I/O- file name to read (or to write)             */
  INT16    *size ) ;  /*I/O- size buffer on entry and exit               */

INT16 DOS_ModPathDDB( FSYS_HAND fsh,        /* I - File system handle                              */
  BOOLEAN  set_it ,   /* I - TRUE if setting path, FALSE if getting */
  DBLK_PTR dblk,      /* I - Descriptor block to get path from      */
  CHAR_PTR buf,       /*I/O- path to read (or to write)             */
  INT16    *size );   /*I/O- size of buffer on entry and exit       */

INT16 DOS_GetOSFnameFDB( DBLK_PTR dblk ,     /* I - Descriptor block to get path from      */
  CHAR_PTR buf );     /*I/O- path to read (or to write)             */

INT16 DOS_GetOSPathDDB(
  FSYS_HAND fsh,      /* I - File System handle */
  DBLK_PTR dblk ,     /* I - Descriptor block to get path from      */
  CHAR_PTR buf );     /*I/O- path to read (or to write)             */

INT16 DOS_GetFileVerFDB( DBLK_PTR dblk ,
  UINT32   *version ) ;

INT16 DOS_GetCdateDBLK( DBLK_PTR      dblk ,     /* I - Descriptor block to get creation date           */
  DATE_TIME_PTR buf );     /*I/O- createion date to read (or to write)            */

INT16 DOS_GetMdateDBLK( DBLK_PTR      dblk ,     /* I - Descriptor block to get creation date           */
  DATE_TIME_PTR buf ) ;    /* O - modify date to write                            */

INT16 DOS_ModBdateDBLK( BOOLEAN       set_it ,   /* I - TRUE if setting creation date, FALSE if getting */
  DBLK_PTR      dblk ,     /* I - Descriptor block to get creation date           */
  DATE_TIME_PTR buf ) ;    /*I/O- createion date to read (or to write)            */

INT16 DOS_ModAdateDBLK( BOOLEAN       set_it ,   /* I - TRUE if setting creation date, FALSE if getting */
  DBLK_PTR      dblk ,     /* I - Descriptor block to get creation date           */
  DATE_TIME_PTR buf ) ;    /*I/O- createion date to read (or to write)            */

UINT64 DOS_GetDisplaySizeDBLK( FSYS_HAND fsh,        /* I - File system handle                              */
  DBLK_PTR dblk ) ;     /* I - Descriptor block to get generic data size for   */

INT16 DOS_GetOS_InfoDBLK( DBLK_PTR dblk,         /* I - DBLK to get the info from                       */
  CHAR_PTR os_info,      /* O - Buffer to place data                            */
  INT16    *size );      /*I/O- Buffer size / data length                       */


INT16 DOS_ModAttribDBLK( BOOLEAN  set_it ,
  DBLK_PTR dblk ,
  UINT32_PTR attr );


INT16 DOS_GetObjTypeDBLK( DBLK_PTR    dblk,
  OBJECT_TYPE *type );


INT16 DOS_GetActualSizeDBLK( FSYS_HAND fsh,
  DBLK_PTR  dblk ) ;

INT16 DOS_SizeofFname( FSYS_HAND fsh,        /* I - file system in use     */
  DBLK_PTR  fdb );      /* I - dblk to get fname from */

INT16 DOS_SizeofOSFname( FSYS_HAND fsh,      /* I - file system in use     */
  DBLK_PTR  fdb ) ;   /* I - dblk to get fname from */

INT16 DOS_SizeofPath( FSYS_HAND fsh,         /* I - File system handle         */
  DBLK_PTR ddb ) ;       /* I - DBLK to get path size from */

INT16 DOS_SizeofOSPath( FSYS_HAND fsh,       /* I - File system handle         */
  DBLK_PTR ddb ) ;     /* I - DBLK to get path size from */

INT16 DOS_SizeofOSInfo( FSYS_HAND fsh,      /* I - File system handle              */
  DBLK_PTR  dblk );   /* I - DBLK to get size of OS info for */


INT16 DOS_PushMinDDB( FSYS_HAND fsh,
  DBLK_PTR dblk );

INT16 DOS_PopMinDDB( FSYS_HAND fsh ,
  DBLK_PTR dblk );

INT16 DOS_CreateFDB( FSYS_HAND fsh,
  GEN_FDB_DATA_PTR dat ) ;

INT16 DOS_CreateDDB( FSYS_HAND fsh,
  GEN_DDB_DATA_PTR dat ) ;

INT16 DOS_CreateIDB( FSYS_HAND fsh,
  GEN_IDB_DATA_PTR dat ) ;

VOID DOS_SetOwnerId( FSYS_HAND fsh, DBLK_PTR dblk, UINT32 id ) ;

BOOLEAN DOS_ProcessDDB( FSYS_HAND fsh, DBLK_PTR ddb ) ;

INT16 DOS_ChangeIntoDDB( FSYS_HAND fsh, DBLK_PTR ddb ) ;

VOID DOS_GetRealBasePath( FSYS_HAND fsh, CHAR_PTR path ) ;


INT16 DOS_GetSpecDBLKS(
     FSYS_HAND fsh,
     DBLK_PTR  dblk,
     INT32     *index );

INT16 DOS_FindDrives( DLE_HAND hand, BE_CFG_PTR cfg, UINT32 fsys_mask );

VOID DOS_GetVolName( GENERIC_DLE_PTR dle, CHAR_PTR buffer ) ;

INT16 DOS_SizeofVolName( GENERIC_DLE_PTR dle ) ;

BOOLEAN DOS_IsBlkComplete( FSYS_HAND fsh, DBLK_PTR dblk ) ;
INT16   DOS_CompleteBlk( FSYS_HAND fsh, DBLK_PTR dblk, CHAR_PTR buffer, UINT16 *size, STREAM_INFO_PTR sinfo ) ;
VOID    DOS_ReleaseBlk( FSYS_HAND fsh, DBLK_PTR dblk ) ;
VOID    DOS_InitMakeData( FSYS_HAND fsh, INT16 blk_type, CREATE_DBLK_PTR data ) ;

#endif