summaryrefslogtreecommitdiff
path: root/sysspec.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-13 23:00:00 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-13 23:00:00 +0000
commit8c05353f47d25c1a097d3938333ba212f12b3ea2 (patch)
tree29ae7e122cbda9aaf1322a8fd89f1c52c86810af /sysspec.c
parentb59b0af0b26bcca27af0216309c15da663bcd9b7 (diff)
-- Remove Win31, DOS, and Mac cruft
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@20 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'sysspec.c')
-rw-r--r--sysspec.c154
1 files changed, 0 insertions, 154 deletions
diff --git a/sysspec.c b/sysspec.c
index 121eac4..73b74fb 100644
--- a/sysspec.c
+++ b/sysspec.c
@@ -117,30 +117,6 @@ return(-1);
void CreateFile(char *filename,
int *errorcode)
{
-
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-int fhandle; /* File handle used internally */
-
-fhandle=open(filename,O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
-
-if(fhandle==-1)
- *errorcode=ERROR_FILECREATE;
-else
- *errorcode=0;
-
-/*
-** Since all we're doing here is creating the file,
-** go ahead and close it.
-*/
-close(fhandle);
-
-return;
-#endif
-
-#ifdef __linux__
FILE *fhandle; /* File handle used internally */
fhandle=fopen(filename,"w");
@@ -155,9 +131,6 @@ else
** go ahead and close it.
*/
fclose(fhandle);
-
-return;
-#endif
}
/****************************
@@ -166,31 +139,6 @@ return;
** If an error occurs, returns its code in errorcode.
** The file is opened in read-write exclusive mode.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-
-int bmOpenFile(char *fname, /* File name */
- int *errorcode) /* Error code returned */
-{
-
-int fhandle; /* Returned file handle */
-
-fhandle=open(fname,O_BINARY | O_RDWR, S_IREAD | S_IWRITE);
-
-if(fhandle==-1)
- *errorcode=ERROR_FILEOPEN;
-else
- *errorcode=0;
-
-return(fhandle);
-}
-#endif
-
-
-#ifdef __linux__
-
FILE *bmOpenFile(char *fname, /* File name */
int *errorcode) /* Error code returned */
{
@@ -206,7 +154,6 @@ else
return(fhandle);
}
-#endif
/****************************
@@ -214,20 +161,6 @@ return(fhandle);
** Closes the file identified by fhandle.
** A more inocuous routine there never was.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!!
-*/
-void CloseFile(int fhandle, /* File handle */
- int *errorcode) /* Returned error code */
-{
-
-close(fhandle);
-*errorcode=0;
-return;
-}
-#endif
-#ifdef __linux__
void CloseFile(FILE *fhandle, /* File handle */
int *errorcode) /* Returned error code */
{
@@ -235,7 +168,6 @@ fclose(fhandle);
*errorcode=0;
return;
}
-#endif
/****************************
** readfile
@@ -244,46 +176,6 @@ return;
** Note that this routine expects the offset to be from
** the beginning of the file.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-
-void readfile(int fhandle, /* File handle */
- unsigned long offset, /* Offset into file */
- unsigned long nbytes, /* # of bytes to read */
- void *buffer, /* Buffer to read into */
- int *errorcode) /* Returned error code */
-{
-
-long newoffset; /* New offset by lseek */
-int readcode; /* Return code from read */
-
-/*
-** Presume success.
-*/
-*errorcode=0;
-
-/*
-** Seek to the proper offset.
-*/
-newoffset=lseek(fhandle,(long)offset,SEEK_SET);
-if(newoffset==-1L)
-{ *errorcode=ERROR_FILESEEK;
- return;
-}
-
-/*
-** Do the read.
-*/
-readcode=read(fhandle,buffer,(unsigned)(nbytes & 0xFFFF));
-if(readcode==-1)
- *errorcode=ERROR_FILEREAD;
-
-return;
-}
-#endif
-#ifdef __linux__
void readfile(FILE *fhandle, /* File handle */
unsigned long offset, /* Offset into file */
unsigned long nbytes, /* # of bytes to read */
@@ -317,9 +209,7 @@ readcode=fread(buffer,(size_t)1,nelems,fhandle);
if(readcode!=nelems)
*errorcode=ERROR_FILEREAD;
-return;
}
-#endif
/****************************
** writefile
@@ -328,48 +218,6 @@ return;
** Note that this routine expects the offset to be from
** the beinning of the file.
*/
-#ifdef DOS16
-/*
-** DOS VERSION!!
-*/
-
-void writefile(int fhandle, /* File handle */
- unsigned long offset, /* Offset into file */
- unsigned long nbytes, /* # of bytes to read */
- void *buffer, /* Buffer to read into */
- int *errorcode) /* Returned error code */
-{
-
-long newoffset; /* New offset by lseek */
-int writecode; /* Return code from write */
-
-/*
-** Presume success.
-*/
-*errorcode=0;
-
-/*
-** Seek to the proper offset.
-*/
-newoffset=lseek(fhandle,(long)offset,SEEK_SET);
-if(newoffset==-1L)
-{ *errorcode=ERROR_FILESEEK;
- return;
-}
-
-/*
-** Do the write.
-*/
-writecode=write(fhandle,buffer,(unsigned)(nbytes & 0xFFFF));
-if(writecode==-1)
- *errorcode=ERROR_FILEWRITE;
-
-return;
-}
-#endif
-
-#ifdef __linux__
-
void writefile(FILE *fhandle, /* File handle */
unsigned long offset, /* Offset into file */
unsigned long nbytes, /* # of bytes to read */
@@ -403,9 +251,7 @@ writecode=fwrite(buffer,(size_t)1,nelems,fhandle);
if(writecode==nelems)
*errorcode=ERROR_FILEWRITE;
-return;
}
-#endif
/*****************************
** STOPWATCH ROUTINES **