1 /* $Id: tape.h 6648 2004-01-25 20:07:11Z rra $
3 ** The public interface to the Tape class.
5 ** Written by James Brister <brister@vix.com>
7 ** The Tape class simulates a mag tape. It only reads or writes Articles. A
8 ** tape is either in an Input or Output state. When an Article is given to a
9 ** Tape it will store the Article in memory until it reaches a highwater mark
10 ** at which point it dumps all it's articles to disk.
12 ** Input tapes generate article objects on request if the underlying tape
13 ** file has info in it. The Tapes take care of cleaning up used-up files as
17 #if ! defined ( tape_h__ )
25 /* If dontRotate is true, then any articles that get written to the tape
26 will never be read back in again. This is for the batch-mode-only case
27 where articles written to tape were done so 'cause the remote
28 temporarily rejected them. */
29 Tape newTape (const char *peerName, bool dontRotate) ;
31 void gPrintTapeInfo (FILE *fp, unsigned int inedntAmt) ;
32 void printTapeInfo (Tape tape, FILE *fp, unsigned int indentAmt) ;
34 /* deletes the tape objects. If it has any articles cached then it dumps
36 void delTape (Tape tape) ;
38 /* give an article to the Tape for storage */
39 void tapeTakeArticle (Tape tape, Article article) ;
41 /* get a new article from an Input tape. */
42 Article getArticle (Tape tape) ;
44 /* close the input and output files and reopen them. */
45 void gFlushTapes (void) ;
46 void tapeFlush (Tape tape) ;
49 /**************************************************/
50 /* CLASS LEVEL FUNCTIONS */
51 /**************************************************/
53 /* get all the active input tapes to checkpoint their current positions */
54 void checkPointTapes (void) ;
56 /* get the name of the directory tapes are being stored in. */
57 const char *getTapeDirectory (void) ;
59 /* set the size limit of the output tapes. Default is zero which is no
61 void setOutputSizeLimit (long limit) ;
63 int tapeConfigLoadCbk (void *data) ;
65 void tapeLogGlobalStatus (FILE *fp) ;
66 void tapeLogStatus (Tape tape, FILE *fp) ;