#ifndef JAK_H #define JAK_H /////////////////////////////////////////////////////////////////////////////// // jak.h // // // // Copyright (c) Jan Knepper, 1998. All Rights Reserved. // // Written by Jan Knepper // // // // Redistribution and use in source and binary forms, with or without // // modification, are permitted provided that the following conditions // // are met: // // 1. Redistributions of source code must retain the above copyright // // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // // notice, this list of conditions and the following disclaimer in the // // documentation and/or other materials provided with the distribution. // // 3. The name of the author may not be used to endorse or promote products // // derived from this software without specific prior written permission. // // // // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND // // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE // // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // // THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #include "Target.h" #include "Message.h" #include "Log.h" #include #include #include #if defined(I_WIN_32) # include #else # include #endif #if defined(I_WIN_32) # define far # define _far # define __far #define __CONSOLE__ 1 #if defined(__CONSOLE__) # include "Console.h" #endif #if defined(__BORLANDC__) #define F_OK 0 // For Symantec C++ Compatibility! #define X_OK 1 // taken from io.h. #define W_OK 2 #define R_OK 4 #endif #if defined(__SC__) // For Borland C++ Compatibility! # define _FAR # define _fstrncpy strncpy # define _argc __argc # define _argv __argv # define __FLAT__ # define MAXINT INT_MAX #endif extern void delay ( unsigned long ); extern void nosound ( void ); extern void sound ( unsigned long ); // string.h extern int i_strcmp ( const char *, int, const char *, const char * ); extern char *i_strcpy ( const char *, int, char *, const char * ); extern char *i_strncpy ( const char *, int, char *, const char *, size_t ); extern char *i_strcat ( const char *, int, char *, const char * ); extern void *i_memcpy ( const char *, int, void *, const void *, size_t ); // stdlib.h extern int i_atoi ( const char *, int, const char * ); extern long i_atol ( const char *, int, const char * ); extern double i_atof ( const char *, int, const char * ); // alloc.h extern void *i_malloc ( const char *, int, size_t ); extern void *i_calloc ( const char *, int, size_t, size_t ); extern void *i_realloc ( const char *, int, void *, size_t ); extern void i_free ( const char *, int, void * ); extern char *i_strdup ( const char *, int, const char * ); extern char *i_tempnam ( const char *, int, const char *, const char * ); extern void i_check ( void ); extern void i_close ( void ); char *novell_username ( void ); extern void DoWordPad ( const char * ); #define d_strcmp(x,y) i_strcmp(__FILE__,__LINE__,x,y) #define d_strcpy(x,y) i_strcpy(__FILE__,__LINE__,x,y) #define d_strncpy(x,y,l) i_strncpy(__FILE__,__LINE__,x,y,l) #define d_strcat(x,y) i_strcat(__FILE__,__LINE__,x,y) #define d_memcpy(d,s,l) i_memcpy(__FILE__,__LINE__,d,s,l) #define d_atoi(s) i_atoi(__FILE__,__LINE__,s) #define d_atol(s) i_atol(__FILE__,__LINE__,s) #define d_atof(s) i_atof(__FILE__,__LINE__,s) // Redefined for I_WIN_32 because SCREENS\BHALLOC.H depends on screens.lib. #define BHMALLOC(x) i_malloc(__FILE__,__LINE__,x) #define BHCALLOC(x,y) i_calloc(__FILE__,__LINE__,x,y) #define BHFREE(x) { \ if ( x != NULL ) \ i_free(__FILE__,__LINE__,x); \ x = NULL; \ } #define BHSTRDUP(x) i_strdup(__FILE__,__LINE__,x) #define BHTEMPNAM(x,y) i_tempnam(__FILE__,__LINE__,x,y) #define BHCHECK() i_check() #define BHCLOSE() i_close() #else // I_WIN_32 #define d_strcmp(x,y) strcmp(x,y) #define d_strcpy(x,y) strcpy(x,y) #define d_strncpy(x,y,l) strncpy(x,y,l) #define d_strcat(x,y) strcat(x,y) #define d_memcpy(d,s,l) memcpy(d,s,l) #define d_atoi(s) atoi(s) #define d_atol(s) atol(s) #define d_atof(s) atof(s) typedef int BOOL; #endif // I_WIN_32 enum OS_Type { OS_Type_UNKNOWN = 0, OS_Type_Windows_NT = 100, OS_Type_Windows_95 = 200, OS_Type_Windows_32s = 300, OS_Type_Windows = 400, OS_Type_DOS = 500, }; extern enum OS_Type SystemType ( void ); #endif // JAK_H