summaryrefslogtreecommitdiffstats
path: root/private/utils/ntbackup/inc/fmteng.h
blob: fc0750da5c92cccfacbc03f19d25ac638801787e (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
/**
Copyright(c) Maynard Electronics, Inc. 1984-89


     Name:          fmteng.h

     Date Updated:  $./FDT$ $./FTM$
                    7/21/1989   14:4:121

     Description:   The functions and structs defined by this guy are used
                    to determine, setup and free environments that are format
                    and operation specific.
                                          

     $Log:   T:/LOGFILES/FMTENG.H_V  $
 * 
 *    Rev 1.24   08 Sep 1993 18:15:46   GREGG
 * Changed proto of init_tape to match f40proto.h r1.31 and mtf10wdb.c r1.27.
 * 
 *    Rev 1.23   17 Jul 1993 17:56:58   GREGG
 * Changed write translator functions to return INT16 TFLE_xxx errors instead
 * of BOOLEAN TRUE/FALSE.  Files changed:
 *      MTF10WDB.C 1.23, TRANSLAT.H 1.22, F40PROTO.H 1.30, FMTENG.H 1.23,
 *      TRANSLAT.C 1.43, TFWRITE.C 1.68, MTF10WT.C 1.18
 * 
 *    Rev 1.22   22 Jun 1993 10:53:28   GREGG
 * Added API to change the catalog directory path.
 * 
 *    Rev 1.21   09 Mar 1993 18:14:38   GREGG
 * Initial changes for new stream and EOM processing.
 * 
 *    Rev 1.20   26 Jan 1993 01:30:54   GREGG
 * Added Fast Append functionality.
 * 
 *    Rev 1.19   23 Nov 1992 10:59:28   HUNTER
 * Changed prototype for EOM parse function.
 * 
 *    Rev 1.18   09 Nov 1992 10:49:00   GREGG
 * Added tape catalog entry points.
 * 
 *    Rev 1.17   03 Nov 1992 09:36:46   HUNTER
 * Changes for stream stuff
 * 
 *    Rev 1.16   22 Oct 1992 10:53:04   HUNTER
 * Changes for new stream headers
 * 
 *    Rev 1.15   22 Sep 1992 09:01:56   GREGG
 * Initial changes to handle physical block sizes greater than 1K.
 * 
 *    Rev 1.14   14 Aug 1992 16:19:56   GREGG
 * Removed size fields in function table.
 * 
 *    Rev 1.13   20 May 1992 18:16:38   GREGG
 * Changes to support OTC read.
 * 
 *    Rev 1.12   29 Apr 1992 12:59:26   GREGG
 * Added parameter to init_tape function entry.
 * 
 *    Rev 1.11   05 Apr 1992 17:55:18   GREGG
 * ROLLER BLADES - Initial OTC integration.
 * 
 *    Rev 1.10   25 Mar 1992 20:46:10   GREGG
 * ROLLER BLADES - Added eom_lba_size.
 * 
 *    Rev 1.9   04 Feb 1992 21:24:38   NED
 * Changes to Buffer Management translator hooks.
 * 
 *    Rev 1.8   16 Jan 1992 18:31:38   ZEIR
 * Latest BufferMan solution no longer requires StartReadHook.
 * 
 * 
 *    Rev 1.7   02 Jan 1992 14:49:26   NED
 * Buffer Manager/UTF translator integration.
 * 
 *    Rev 1.6   05 Dec 1991 14:05:56   GREGG
 * SKATEBOARD - New Buff Mgt - Initial Integration.
 * 
 *    Rev 1.5   18 Nov 1991 19:59:56   GREGG
 * Added BOOLEAN abort parameter to wt_mk_vcb and wt_close_set.
 * 
 *    Rev 1.4   07 Nov 1991 15:24:14   HUNTER
 * VBLK - Added functions for Variable Blocks
 * 
 *    Rev 1.3   16 Sep 1991 20:09:48   GREGG
 * Changed prototype for SetupFormatEnv to return TFLE_xxx.
 * 
 *    Rev 1.2   03 Jun 1991 10:55:48   GREGG
 * Changed protos for deinitializer and move_to_vcb.
 * 
 *    Rev 1.1   10 May 1991 14:26:24   GREGG
 * Ned's new stuff.

   Rev 1.0   10 May 1991 10:17:50   GREGG
Initial revision.

**/

#ifndef _FMT_ENG
#define _FMT_ENG 

#include "buffman.h"
#include "channel.h"
#include "fmtinf.h"
#include "translat.h"
#include "fsys.h"

/* $end$ */
/* private data structure used by access routines in translat.c */

typedef struct {

     /* return TRUE if this format recognizes the given data */
     BOOLEAN        (*determiner)( VOID_PTR ) ;

     /* set up translator-specific environment, allocate memory, etc. */
     INT16          (*initializer)( CHANNEL_PTR ) ;

     /* undo initialization */
     VOID           (*deinitializer)( VOID_PTR * ) ;

     /* see buffman.h for these two */
     BM_TR_GET_VCB_REQ_FUNC_PTR  set_buffer_requirements ;
     BM_TR_GET_PREF_FUNC_PTR     get_preferred_space ;

     /* to be called upon receiving a buffer full during read */
     VOID       (*read_buffer_hook)( CHANNEL_PTR, BUF_PTR ) ;

     /* given a buffer, return block type BT_xxx */
     INT16          (*parser)( CHANNEL_PTR, BUF_PTR, UINT16_PTR ) ;

     UINT16         (*sizeof_tblk)( VOID_PTR ) ;

     /* called when read returns an exception */
     UINT16         (*exception_action)( CHANNEL_PTR, INT16 ) ;

     /* called upon first examining a new tape. This may do special
        per-tape things for the translator.
     */
     INT16         (*new_tape)( CHANNEL_PTR, BUF_PTR, BOOLEAN_PTR ) ;

     /* Initialize OTC temporary files */
     INT16        (*write_init)( CHANNEL_PTR, UINT16, BUF_PTR ) ;

     /* Write a TAPE header block */
     INT16        (*init_tape)( CHANNEL_PTR, BOOLEAN, BUF_PTR ) ;

     /* Move to OTC */
     INT16        (*start_read)( CHANNEL_PTR ) ;

     /* Move to next/prior/current VCB position */
     INT16         (*move_to_vcb)( CHANNEL_PTR, INT16, BOOLEAN_PTR, BOOLEAN ) ;

     /* Move to End of Data (for fast append) */
     INT16         (*seek_eod)( CHANNEL_PTR ) ;

     /* Get the current VCB */ 
     INT16         (*get_current_vcb)( CHANNEL_PTR, BUF_PTR ) ;

     /* Call to check validity of VCB or NULL if no append of other
        formats is possible
     */
     BOOLEAN        (*verify_vcb)( VOID_PTR ) ;

     BOOLEAN        (*rd_cont_tape)( CHANNEL_PTR, BUF_PTR ) ;

     BOOLEAN        (*rd_recall)( CHANNEL_PTR, BUF_PTR ) ;

     /* Read conversion routines: */
     INT16          (*rd_mk_vcb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_ddb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_fdb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_idb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_cfdb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_bsdb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_osudb)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*rd_mk_mdb)( CHANNEL_PTR, BUF_PTR ) ;
	INT16		(*rd_mk_stream) ( CHANNEL_PTR, BUF_PTR ) ;
     
     /* Write conversion routines: */
     INT16          (*wt_mk_vcb)( CHANNEL_PTR, BUF_PTR, BOOLEAN ) ;
     INT16          (*wt_mk_ddb)( CHANNEL_PTR, BUF_PTR, BOOLEAN ) ;
     INT16          (*wt_mk_fdb)( CHANNEL_PTR, BUF_PTR, BOOLEAN ) ;
	INT16          (*wt_mk_stream)( CHANNEL_PTR, BUF_PTR, STREAM_INFO_PTR ) ;
     INT16          (*wt_mk_enddata)( CHANNEL_PTR, BUF_PTR ) ;
     INT16          (*wt_mk_idb)( CHANNEL_PTR, BUF_PTR, BOOLEAN ) ;
     INT16          (*wt_mk_cfdb)( CHANNEL_PTR, BUF_PTR, BOOLEAN ) ;
     INT16          (*wt_cont_vstrm)( CHANNEL_PTR, BUF_PTR ) ;
     VOID           (*wt_end_vstrm)( CHANNEL_PTR, BUF_PTR, UINT16 ) ;
	VOID           (*wt_parse_written)( CHANNEL_PTR, BUF_PTR, UINT16 ) ;
     INT16          (*wt_close_tape)( CHANNEL_PTR ) ;

     INT16          (*wt_cont_set)( CHANNEL_PTR ) ;

     INT16          (*wt_close_set)( CHANNEL_PTR, BOOLEAN ) ;

     VOID           (*wt_eos_pad_blk)( CHANNEL_PTR ) ;

     /* On Tape Catalog Routines: */
     INT            (*load_set_map)( CHANNEL_PTR, BOOLEAN_PTR, BOOLEAN ) ;

     INT            (*load_set_cat)( CHANNEL_PTR ) ;

     INT            (*get_next_sm_entry)( CHANNEL_PTR ) ;

     INT            (*get_next_sc_entry)( CHANNEL_PTR ) ;

     VOID           (*close_catalogs)( VOID_PTR ) ;

} FMT, *FMT_PTR ;

/* The external tape format table (see fmttab.c) */

extern FMT     supported_fmts[] ;

#endif