#undef IN
#include <stdio.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
#include <sys/types.h> /* for mtio.h */
#include <afs/cmd.h>
#include <afs/procmgmt.h>
int fileMark(usd_handle_t hTape);
int fileMarkSize(char *tapeDevice);
static int tt_fileMarkSize(struct cmd_syndesc *as, void *arock);
+afs_int32 rewindTape(usd_handle_t hTape);
+int dataBlock(usd_handle_t, afs_int32);
#define ERROR(evalue) \
{ \
void quitFms(int);
-main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc, char **argv)
{
struct sigaction intaction, oldaction;
struct cmd_syndesc *cptr;
memset((char *)&intaction, 0, sizeof(intaction));
- intaction.sa_handler = (int (*)())quitFms;
+ intaction.sa_handler = quitFms;
sigaction(SIGINT, &intaction, &oldaction);
}
-fileMarkSize(tapeDevice)
- char *tapeDevice;
+int
+fileMarkSize(char *tapeDevice)
{
afs_uint32 nFileMarks, nBlocks, nbfTape;
double tpSize, fmSize;
afs_uint32 countr;
afs_int32 code = 0;
- afs_int32 rewindTape();
-
code =
usd_Open(tapeDevice, (USD_OPEN_RDWR | USD_OPEN_WLOCK), 0777, &hTape);
if (code) {
* entry:
* blocksize - size of block in bytes
*/
-
+int
dataBlock(usd_handle_t hTape, afs_int32 reqSize)
{
static char *dB_buffer = 0;
static afs_int32 dB_buffersize = 0;
static int dB_count = 0;
int *ptr;
- afs_int32 code = 0, xferd;
+ afs_int32 code = 0;
+ afs_uint32 xferd;
/* dbBuffersize is only valid when dB_buffer is non-zero */