#define F_GETFL 3
#define F_SETFL 4
-int tape_open(const char *file, int flags, int mode = 0);
-int tape_read(int fd, void *buffer, unsigned int count);
-int tape_write(int fd, const void *buffer, unsigned int count);
-int tape_ioctl(int fd, unsigned long int request, ...);
-int tape_close(int fd);
+int win32_tape_open(const char *file, int flags, int mode = 0);
+int win32_tape_read(int fd, void *buffer, unsigned int count);
+int win32_tape_write(int fd, const void *buffer, unsigned int count);
+int win32_tape_ioctl(int fd, unsigned long int request, ...);
+int win32_tape_close(int fd);
#define open _open
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2006-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2006-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
#define NUMBER_HANDLE_ENTRIES (sizeof(TapeHandleTable) / sizeof(TapeHandleTable[0]))
-DWORD GetTapePositionInfo(HANDLE hDevice, PTAPE_POSITION_INFO TapePositionInfo);
-DWORD GetDensityBlockSize(HANDLE hDevice, DWORD *pdwDensity, DWORD *pdwBlockSize);
+static DWORD GetTapePositionInfo(HANDLE hDevice, PTAPE_POSITION_INFO TapePositionInfo);
+static DWORD GetDensityBlockSize(HANDLE hDevice, DWORD *pdwDensity, DWORD *pdwBlockSize);
-int tape_get(int fd, struct mtget *mt_get);
-int tape_op(int fd, struct mtop *mt_com);
-int tape_pos(int fd, struct mtpos *mt_pos);
+static int tape_get(int fd, struct mtget *mt_get);
+static int tape_op(int fd, struct mtop *mt_com);
+static int tape_pos(int fd, struct mtpos *mt_pos);
int
-tape_open(const char *file, int flags, int mode)
+win32_tape_open(const char *file, int flags, int mode)
{
HANDLE hDevice = INVALID_HANDLE_VALUE;
char szDeviceName[256] = "\\\\.\\";
}
int
-tape_read(int fd, void *buffer, unsigned int count)
+win32_tape_read(int fd, void *buffer, unsigned int count)
{
if (buffer == NULL) {
errno = EINVAL;
}
int
-tape_write(int fd, const void *buffer, unsigned int count)
+win32_tape_write(int fd, const void *buffer, unsigned int count)
{
if (buffer == NULL) {
errno = EINVAL;
}
int
-tape_close(int fd)
+win32_tape_close(int fd)
{
if (fd < 3 || fd >= (int)(NUMBER_HANDLE_ENTRIES + 3) ||
TapeHandleTable[fd - 3].OSHandle == INVALID_HANDLE_VALUE) {
}
int
-tape_ioctl(int fd, unsigned long int request, ...)
+win32_tape_ioctl(int fd, unsigned long int request, ...)
{
va_list argp;
int result;
return result;
}
-int tape_op(int fd, struct mtop *mt_com)
+static int tape_op(int fd, struct mtop *mt_com)
{
DWORD result = NO_ERROR;
int index;
return result == NO_ERROR ? 0 : -1;
}
-int tape_get(int fd, struct mtget *mt_get)
+static int tape_get(int fd, struct mtget *mt_get)
{
TAPE_POSITION_INFO pos_info;
BOOL result;
SCSI_READ_POSITION_EXTENDED_BUFFER ExtendedBuffer;
} READ_POSITION_RESULT, *PREAD_POSITION_RESULT;
-DWORD GetTapePositionInfo(HANDLE hDevice, PTAPE_POSITION_INFO TapePositionInfo)
+static DWORD GetTapePositionInfo(HANDLE hDevice, PTAPE_POSITION_INFO TapePositionInfo)
{
PSCSI_PASS_THROUGH ScsiPassThrough;
BOOL bResult;
return NO_ERROR;
}
-DWORD GetDensityBlockSize(HANDLE hDevice, DWORD *pdwDensity, DWORD *pdwBlockSize)
+static DWORD GetDensityBlockSize(HANDLE hDevice, DWORD *pdwDensity, DWORD *pdwBlockSize)
{
DWORD dwBufferSize = sizeof(GET_MEDIA_TYPES) + 5 * sizeof(DEVICE_MEDIA_INFO);
GET_MEDIA_TYPES * pGetMediaTypes = (GET_MEDIA_TYPES *)malloc(dwBufferSize);
return ERROR_NO_MEDIA_IN_DRIVE;
}
-int tape_pos(int fd, struct mtpos *mt_pos)
+static int tape_pos(int fd, struct mtpos *mt_pos)
{
DWORD partition;
DWORD offset;