diff options
-rw-r--r-- | nbench0.h | 43 | ||||
-rw-r--r-- | sysspec.c | 154 | ||||
-rw-r--r-- | sysspec.h | 38 |
3 files changed, 0 insertions, 235 deletions
@@ -256,43 +256,6 @@ void *global_fstruct[] = (void *)&global_lustruct }; /* -** Following globals added to support command line emulation on -** the Macintosh....which doesn't have command lines. -*/ -#ifdef MAC -int argc; /* Argument count */ -char *argv[20]; /* Argument vectors */ - -unsigned char Uargbuff[129]; /* Buffer holding arguments string */ -unsigned char Udummy[2]; /* Dummy buffer for first arg */ - -#endif - -#ifdef MACTIMEMGR -#include <Types.h> -#include <Timer.h> -/* -** Timer globals for Mac -*/ -struct TMTask myTMTask; -long MacHSTdelay,MacHSTohead; - -#endif - -/* -** Following globals used by Win 31 timing routines. -** NOTE: This requires the includes of the w31timer.asm -** file in your project!! -*/ -#ifdef WIN31TIMER -#include <windows.h> -#include <toolhelp.h> -extern TIMERINFO win31tinfo; -extern HANDLE hThlp; -extern FARPROC lpfn; -#endif - -/* ** PROTOTYPES */ static int parse_arg(char *argptr); @@ -315,12 +278,6 @@ static int calc_confidence(double scores[], static double getscore(int fid); static void show_stats(int bid); -#ifdef MAC -void UCommandLine(void); -void UParse(void); -unsigned char *UField(unsigned char *ptr); -#endif - /* ** EXTERNAL PROTOTYPES */ @@ -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 ** @@ -42,41 +42,6 @@ ** System-specific includes */ -#ifdef DOS16MEM -#include "dos.h" -#endif - -/* #include "time.h" -#include "io.h" -#include "fcntl.h" -#include "sys\stat.h" */ -/* Removed for MSVC++ -#include "alloc.h" -*/ - -/* -** MAC Time Manager routines (from Code Warrior) -*/ -#ifdef MACTIMEMGR -#include <memory.h> -#include <lowmem.h> -#include <Types.h> -#include <Timer.h> -extern struct TMTask myTMTask; -extern long MacHSTdelay,MacHSTohead; -#endif - -/* -** Windows 3.1 timer defines -*/ -#ifdef WIN31TIMER -#include <windows.h> -#include <toolhelp.h> -TIMERINFO win31tinfo; -HANDLE hThlp; -FARPROC lpfn; -#endif - /************** ** EXTERNALS ** **************/ @@ -97,7 +62,6 @@ int RemoveMemArray(unsigned long adj_addr,unsigned long *true_addr); void CreateFile(char *filename, int *errorcode); -#ifdef __linux__ FILE *bmOpenFile(char *fname, int *errorcode); @@ -116,8 +80,6 @@ void writefile(FILE *fhandle, void *buffer, int *errorcode); -#endif - unsigned long StartStopwatch(); unsigned long StopStopwatch(unsigned long startticks); |