diff --git a/programs/develop/open watcom/trunk/clib.wpj b/programs/develop/open watcom/trunk/clib.wpj new file mode 100644 index 000000000..b8aee59b6 --- /dev/null +++ b/programs/develop/open watcom/trunk/clib.wpj @@ -0,0 +1,43 @@ +40 +projectIdent +0 +VpeMain +1 +WRect +-32 +330 +10304 +9950 +2 +MProject +3 +MCommand +0 +4 +MCommand +0 +1 +5 +WFileName +10 +clib_r.tgt +6 +WVList +1 +7 +VComponent +8 +WRect +2760 +200 +5712 +7390 +0 +0 +9 +WFileName +10 +clib_r.tgt +0 +0 +7 diff --git a/programs/develop/open watcom/trunk/clib/h/_comdef.h b/programs/develop/open watcom/trunk/clib/h/_comdef.h new file mode 100644 index 000000000..b0b8d22b9 --- /dev/null +++ b/programs/develop/open watcom/trunk/clib/h/_comdef.h @@ -0,0 +1,171 @@ +/* + * _comdef.h Common Macro Definitions + * + * Open Watcom Project + * + * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. + * + * This file is automatically generated. Do not edit directly. + * + * ========================================================================= + */ +#ifndef _COMDEF_H_INCLUDED +#define _COMDEF_H_INCLUDED +#if !defined(_ENABLE_AUTODEPEND) + #pragma read_only_file; +#endif + + #ifdef _WCDATA + #error The macro _WCDATA is reserved for use by the runtime library. + #endif + #ifdef _WCNEAR + #error The macro _WCNEAR is reserved for use by the runtime library. + #endif + #ifdef _WCFAR + #error The macro _WCFAR is reserved for use by the runtime library. + #endif + #ifdef _WCHUGE + #error The macro _WCHUGE is reserved for use by the runtime library. + #endif + #ifdef _WCI86NEAR + #error The macro _WCI86NEAR is reserved for use by the runtime library. + #endif + #ifdef _WCI86FAR + #error The macro _WCI86FAR is reserved for use by the runtime library. + #endif + #ifdef _WCI86HUGE + #error The macro _WCI86HUGE is reserved for use by the runtime library. + #endif + #ifdef _WCINTERRUPT + #error The macro _WCINTERRUPT is reserved for use by the runtime library. + #endif + #ifdef _WCUNALIGNED + #error The macro _WCUNALIGNED is reserved for use by the runtime library. + #endif + #if __WATCOMC__ > 1240 + #define _WRTLCALL __declspec(__watcall) + #else + #define _WRTLCALL + #endif + #if defined(_M_IX86) + #define _WCNEAR __near + #define _WCFAR __far + #define _WCHUGE __huge + #define _WCINTERRUPT __interrupt + #define _WCUNALIGNED + #if defined(__386__) + #define _WCI86NEAR + #define _WCI86FAR + #define _WCI86HUGE + #else + #define _WCI86NEAR __near + #define _WCI86FAR __far + #define _WCI86HUGE __huge + #endif + #elif defined(__AXP__) + #define _WCNEAR + #define _WCFAR + #define _WCHUGE + #define _WCI86NEAR + #define _WCI86FAR + #define _WCI86HUGE + #define _WCINTERRUPT + #define _WCUNALIGNED __unaligned + #elif defined(__PPC__) + #define _WCNEAR + #define _WCFAR + #define _WCHUGE + #define _WCI86NEAR + #define _WCI86FAR + #define _WCI86HUGE + #define _WCINTERRUPT + #define _WCUNALIGNED __unaligned + #else + #define _WCNEAR + #define _WCFAR + #define _WCHUGE + #define _WCI86NEAR + #define _WCI86FAR + #define _WCI86HUGE + #define _WCINTERRUPT + #define _WCUNALIGNED + #endif + #if defined(M_I86HM) + #define _WCDATA _WCFAR + #elif defined(__SW_ND) || defined(__FUNCTION_DATA_ACCESS) + #define _WCDATA + #else + #define _WCDATA _WCNEAR + #endif + #if defined(__SW_BR) + #if defined(__NT__) + #define _WCRTLINK __declspec(dllimport) _WRTLCALL + #define _WCRTLINKD __declspec(dllimport) + #define _WMRTLINK __declspec(dllimport) _WRTLCALL + #define _WMRTLINKD __declspec(dllimport) + #define _WPRTLINK __declspec(dllimport) _WRTLCALL + #define _WPRTLINKD __declspec(dllimport) + #elif defined(__OS2__) && (defined(__386__) || defined(__PPC__)) + #define _WCRTLINK _WRTLCALL + #define _WCRTLINKD + #define _WMRTLINK _WRTLCALL + #define _WMRTLINKD + #define _WPRTLINK _WRTLCALL + #define _WPRTLINKD + #else + #define _WCRTLINK _WRTLCALL + #define _WCRTLINKD + #define _WMRTLINK _WRTLCALL + #define _WMRTLINKD + #define _WPRTLINK _WRTLCALL + #define _WPRTLINKD + #endif + #else + #ifndef _WCRTLINK + #define _WCRTLINK _WRTLCALL + #endif + #ifndef _WCRTLINKD + #define _WCRTLINKD + #endif + #ifndef _WMRTLINK + #define _WMRTLINK _WRTLCALL + #endif + #ifndef _WMRTLINKD + #define _WMRTLINKD + #endif + #ifndef _WPRTLINK + #define _WPRTLINK _WRTLCALL + #endif + #ifndef _WPRTLINKD + #define _WPRTLINKD + #endif + #endif + /* control import modifier on intrinsic functions */ + #ifndef _WCIRTLINK + #if defined(__INLINE_FUNCTIONS__) + #define _WCIRTLINK _WRTLCALL + #else + #define _WCIRTLINK _WCRTLINK + #endif + #endif + #ifndef _WMIRTLINK + #if defined(__NO_MATH_OPS) || defined(__AXP__) || defined(__PPC__) + #define _WMIRTLINK _WMRTLINK + #else + #define _WMIRTLINK _WRTLCALL + #endif + #endif + #ifndef _WPIRTLINK + #define _WPIRTLINK _WPRTLINK + #endif + /* for MS compatibility */ + #ifndef _CRTAPI1 + #define _CRTAPI1 + #endif + #ifndef _CRTAPI2 + #define _CRTAPI2 + #endif + #ifndef _CRTIMP + #define _CRTIMP _WCRTLINK + #endif +#endif diff --git a/programs/develop/open watcom/trunk/clib/src/qread.c b/programs/develop/open watcom/trunk/clib/handleio/filelen.c similarity index 69% rename from programs/develop/open watcom/trunk/clib/src/qread.c rename to programs/develop/open watcom/trunk/clib/handleio/filelen.c index 51365cac0..77115e7a9 100644 --- a/programs/develop/open watcom/trunk/clib/src/qread.c +++ b/programs/develop/open watcom/trunk/clib/handleio/filelen.c @@ -24,18 +24,19 @@ * * ======================================================================== * -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! +* Description: Implements POSIX filelength() function and Watcom +* _filelength64(). * ****************************************************************************/ #include "variety.h" + +/* most includes should go after this line */ +#include +#include #include "iomode.h" #include "rtcheck.h" -#include "seterrno.h" -#include "qread.h" -#include typedef struct { @@ -43,26 +44,30 @@ typedef struct unsigned int offset; }__file_handle; +typedef struct +{ DWORD attr; + DWORD flags; + DWORD cr_time; + DWORD cr_date; + DWORD acc_time; + DWORD acc_date; + DWORD mod_time; + DWORD mod_date; + DWORD size; + DWORD size_high; +} FILEINFO; -int _stdcall read_file (const char *name,char *buff,unsigned offset, unsigned count,unsigned *reads); +int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo); -int __qread( int handle, void *buffer, unsigned len ) +_WCRTLINK long filelength( int handle ) { __file_handle *fh; - unsigned amount_read=0; - + FILEINFO info; + __handle_check( handle, -1 ); - fh = (__file_handle*) __getOSHandle( handle ); - - if(read_file(fh->name,buffer,fh->offset,len,&amount_read)) - { - if ( amount_read == 0) - return (-1); - - } - fh->offset+=amount_read; - return( amount_read ); -}; - + fh = (__file_handle*) __getOSHandle( handle); + get_fileinfo(fh->name,&info); + return( info.size ); +} diff --git a/programs/develop/open watcom/trunk/clib/handleio/int64.h b/programs/develop/open watcom/trunk/clib/handleio/int64.h new file mode 100644 index 000000000..e758acd31 --- /dev/null +++ b/programs/develop/open watcom/trunk/clib/handleio/int64.h @@ -0,0 +1,94 @@ +/**************************************************************************** +* +* Open Watcom Project +* +* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. +* +* ======================================================================== +* +* This file contains Original Code and/or Modifications of Original +* Code as defined in and that are subject to the Sybase Open Watcom +* Public License version 1.0 (the 'License'). You may not use this file +* except in compliance with the License. BY USING THIS FILE YOU AGREE TO +* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is +* provided with the Original Code and Modifications, and is also +* available at www.sybase.com/developer/opensource. +* +* The Original Code and all software distributed under the License are +* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM +* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR +* NON-INFRINGEMENT. Please see the License for the specific language +* governing rights and limitations under the License. +* +* ======================================================================== +* +* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE +* DESCRIBE IT HERE! +* +****************************************************************************/ + + +#ifndef _INT64_H_INCLUDED +#define _INT64_H_INCLUDED + +#include "variety.h" + +#ifdef __WATCOM_INT64__ + #define USE_INT64 +#endif +#include "clibi64.h" + + +#ifdef __INT64__ + #define INT_TYPE INT64_TYPE + #define UINT_TYPE UINT64_TYPE + #define LONG_TYPE INT64_TYPE + #define ULONG_TYPE UINT64_TYPE + #define __I64NAME(_n1,_n2) _n2 + + #if !defined(USE_INT64) + #define __int64 double + #define REAL_INT_TYPE double + + #define GET_INT64(__d) ( *( (INT_TYPE*)(&(__d)) ) ) + #define GET_UINT64(__d) ( *( (UINT_TYPE*)(&(__d)) ) ) + #define GET_REALINT64(__i) ( *( (double*)(&(__i)) ) ) + #define GET_REALUINT64(__i) ( *( (double*)(&(__i)) ) ) + + #define HIGHWORD(__w,__i) (__w) = (unsigned)(__i).u._32[I64HI32] + #define LOWWORD(__w,__i) (__w) = (unsigned)(__i).u._32[I64LO32] + #define MAKE_INT64(__i,__h,__l) { \ + (__i).u._32[I64HI32] = (__h); \ + (__i).u._32[I64LO32] = (__l); \ + } + + #define RETURN_INT64(__i) return( GET_REALINT64(__i) ) + #else + #define REAL_INT_TYPE __int64 + + #define GET_INT64(__d) ( __d ) + #define GET_UINT64(__d) ( __d ) + #define GET_REALINT64(__i) ( __i ) + #define GET_REALUINT64(__i) ( __i ) + + #define HIGHWORD(__w,__i) (__w) = (unsigned)( (__i) >> 32 ) + #define LOWWORD(__w,__i) (__w) = (unsigned)(__i) + #define MAKE_INT64(__i,__h,__l) (__i) = ( ((INT_TYPE)(__h)) << 32 ) | (__l) + + #define RETURN_INT64(__i) return( __i ) + #endif + +#else + #define INT_TYPE int + #define UINT_TYPE unsigned int + #define LONG_TYPE long + #define ULONG_TYPE unsigned long + #define __I64NAME(_n1,_n2) _n1 +#endif + +#define INTSIZE ( sizeof( INT_TYPE ) ) + + +#endif diff --git a/programs/develop/open watcom/trunk/clib/handleio/write.c b/programs/develop/open watcom/trunk/clib/handleio/write.c new file mode 100644 index 000000000..7c77b48b3 --- /dev/null +++ b/programs/develop/open watcom/trunk/clib/handleio/write.c @@ -0,0 +1,286 @@ +/**************************************************************************** +* +* Open Watcom Project +* +* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. +* +* ======================================================================== +* +* This file contains Original Code and/or Modifications of Original +* Code as defined in and that are subject to the Sybase Open Watcom +* Public License version 1.0 (the 'License'). You may not use this file +* except in compliance with the License. BY USING THIS FILE YOU AGREE TO +* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is +* provided with the Original Code and Modifications, and is also +* available at www.sybase.com/developer/opensource. +* +* The Original Code and all software distributed under the License are +* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM +* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR +* NON-INFRINGEMENT. Please see the License for the specific language +* governing rights and limitations under the License. +* +* ======================================================================== +* +* Description: C Runtime write() and _lwrite() implementation. +* +****************************************************************************/ + + +#include "variety.h" +#include "int64.h" +#include +#include +#include +#include +#include +#include +#include +#include "iomode.h" +#include "fileacc.h" +#include "rtcheck.h" +#include "rtdata.h" +#include "seterrno.h" +#include "lseek.h" + +/* + The _lwrite function writes data to the specified file. + + Note: This function is provided only for compatibility with 16-bit + versions of Windows. Win32-based applications should use the WriteFile + function. + + UINT _lwrite( + HFILE hFile, // handle to file + LPCSTR lpBuffer, // write data buffer + UINT uBytes // number of bytes to write + ); + */ + +extern void __STKOVERFLOW(); + +/* + Win32 Note: + Note that it is not an error to set the file pointer to a position + beyond the end of the file. The size of the file does not increase + until you call the SetEndOfFile, WriteFile, or WriteFileEx function. A + write operation increases the size of the file to the file pointer + position plus the size of the buffer written, leaving the intervening + bytes uninitialized. Hence, the reason for zero-padding the file + to achieve POSIX conformance. +*/ + +/* + POSIX Note: + When writing to a file that does not support seek operations (pipe, + device, etc.), the O_APPEND flag is effectively ignored. POSIX does + not explicitly state this, but it is implied. Also, ESPIPE (illegal + seek error) is not listed for write(), only pwrite(). Hence we must + either not attempt to seek on such devices, or ignore the failures. +*/ + +#define PAD_SIZE 512 + +typedef union { + unsigned __int64 _64; + long _32[2]; +} __i64; + +static int zero_pad( int handle ) /* 09-jan-95 */ +/*******************************/ +{ + int rc; + long curPos, eodPos; + long bytesToWrite; + unsigned writeAmt; + char zeroBuf[PAD_SIZE]; + + // Pad with zeros due to lseek() past EOF (POSIX) + curPos = __lseek( handle, 0L, SEEK_CUR ); /* current offset */ + if( curPos == -1 ) + return( -1 ); + eodPos = __lseek( handle, 0L, SEEK_END ); /* end of data offset */ + if( eodPos == -1 ) + return( -1 ); + + if( curPos > eodPos ) { + bytesToWrite = curPos - eodPos; /* amount to pad by */ + + if( bytesToWrite > 0 ) { /* only write if needed */ + memset( zeroBuf, 0x00, PAD_SIZE ); /* zero out a buffer */ + do { /* loop until done */ + if( bytesToWrite > PAD_SIZE ) + writeAmt = 512; + else + writeAmt = (unsigned)bytesToWrite; + rc = write( handle, zeroBuf, writeAmt ); + if( rc < 0 ) + return( rc ); + bytesToWrite -= writeAmt; /* more bytes written */ + } while( bytesToWrite != 0 ); + } + } else { + curPos = __lseek( handle, curPos, SEEK_SET ); + if( curPos == -1 ) { + return( -1 ); + } + } + + return( 0 ); /* return success code */ +} + +/* + The os_write function returns 0 meaning no error, -1 meaning error, or + ENOSPC meaning no space left on device. +*/ + +typedef struct +{ + char *name; + unsigned int offset; +}__file_handle; + +int _stdcall write_file (const char *name,const void* buff,unsigned offset, unsigned count,unsigned *reads); + +static int os_write( int handle, const void *buffer, unsigned len, unsigned *amt ) +/********************************************************************************/ +{ + __file_handle *fh; + int rc; + + rc = 0; + + fh = (__file_handle*) __getOSHandle( handle ); + + if(write_file(fh->name,buffer,fh->offset,len,amt)) + { + rc = __set_errno_nt(); + }; + + + if( *amt != len ) + { + rc = ENOSPC; + __set_errno( rc ); + } + return( rc ); +} + + _WCRTLINK int write( int handle, const void *buffer, unsigned len ) +/**********************************************************************/ +{ + unsigned iomode_flags; + char *buf; + unsigned buf_size; + unsigned len_written, i, j; + int rc2; + + __file_handle *fh; + + __handle_check( handle, -1 ); + iomode_flags = __GetIOMode( handle ); + if( iomode_flags == 0 ) + { + __set_errno( EBADF ); + return( -1 ); + } + + if( !(iomode_flags & _WRITE) ) { + __set_errno( EACCES ); /* changed from EBADF to EACCES 23-feb-89 */ + return( -1 ); + } + + fh = (__file_handle*) __getOSHandle( handle ); + + // put a semaphore around our writes + + _AccessFileH( handle ); + if( (iomode_flags & _APPEND) && !(iomode_flags & _ISTTY) ) + { + fh->offset = __lseek( handle, 0L, SEEK_END ); /* end of data offset */ + } + + len_written = 0; + rc2 = 0; + + // Pad the file with zeros if necessary + if( iomode_flags & _FILEEXT ) { + // turn off file extended flag + __SetIOMode_nogrow( handle, iomode_flags&(~_FILEEXT) ); + + // It is not required to pad a file with zeroes on an NTFS file system; + // unfortunately it is required on FAT (and probably FAT32). (JBS) + rc2 = zero_pad( handle ); + } + + if( rc2 == 0 ) { + if( iomode_flags & _BINARY ) { /* if binary mode */ + rc2 = os_write( handle, buffer, len, &len_written ); + /* end of binary mode part */ + } else { /* text mode */ + i = stackavail(); + if( i < 0x00b0 ) { + __STKOVERFLOW(); /* not enough stack space */ + } + buf_size = 512; + if( i < (512 + 48) ) { + buf_size = 128; + } + + buf = __alloca( buf_size ); + + j = 0; + for( i = 0; i < len; ) + { + if( ((const char*)buffer)[i] == '\n' ) + { + buf[j] = '\r'; + ++j; + if( j == buf_size ) + { + rc2 = os_write( handle, buf, buf_size, &j ); + if( rc2 == -1 ) + break; + len_written += j; + if( rc2 == ENOSPC ) + break; + len_written = i; + j = 0; + } + } + buf[j] = ((const char*)buffer)[i]; + ++i; + ++j; + if( j == buf_size ) { + rc2 = os_write( handle, buf, buf_size, &j ); + if( rc2 == -1 ) + break; + len_written += j; + if( rc2 == ENOSPC ) + break; + len_written = i; + j = 0; + } + } + if( j ) { + rc2 = os_write( handle, buf, j, &i ); + if( rc2 == ENOSPC ) { + len_written += i; + } else { + len_written = len; + } + } + /* end of text mode part */ + } + } + _ReleaseFileH( handle ); + if( rc2 == -1 ) { + return( rc2 ); + } else { + return( len_written ); + } +} + + diff --git a/programs/develop/open watcom/trunk/clib/src/87state.h b/programs/develop/open watcom/trunk/clib/src/87state.h deleted file mode 100644 index b164a5e69..000000000 --- a/programs/develop/open watcom/trunk/clib/src/87state.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: prototype for 8087 save/restore state functions and data -* -****************************************************************************/ - - -#if defined(_M_IX86) - -typedef struct _87state { /* 80x87 save area */ -#if defined( __386__ ) - char data[108]; /* 32-bit save area size */ -#else - char data[94]; /* 16-bit save area size */ -#endif -} _87state; - -extern void (*__Save8087)(_87state *); -extern void (*__Rest8087)(_87state *); - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/_clsewnt.c b/programs/develop/open watcom/trunk/clib/src/_clsewnt.c deleted file mode 100644 index 104dce640..000000000 --- a/programs/develop/open watcom/trunk/clib/src/_clsewnt.c +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include "fileacc.h" -//#include -#include "rtcheck.h" -#include "rtdata.h" -#include "iomode.h" -#include "seterrno.h" -//#include "defwin.h" -#include "close.h" - -int __close( int hid ) -{ - int is_closed; - int rc; - HANDLE h; - - __handle_check( hid, -1 ); - - is_closed = 0; - rc = 0; -// h = __getOSHandle( hid ); - -// if( !is_closed && !CloseHandle( h ) ) -// { -// rc = __set_errno_nt(); -// } -// __freePOSIXHandle( hid ); -// __SetIOMode_nogrow( hid, 0 ); - return( rc ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/allocfp.c b/programs/develop/open watcom/trunk/clib/src/allocfp.c deleted file mode 100644 index 14fa1cc2d..000000000 --- a/programs/develop/open watcom/trunk/clib/src/allocfp.c +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent __allocfp() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "liballoc.h" -#include "fileacc.h" -#include "rtdata.h" -#include "seterrno.h" -#include "streamio.h" - - -#define KEEP_FLAGS (_READ | _WRITE | _DYNAMIC) - -FILE *__allocfp( int handle ) -{ - FILE *end; - FILE *fp; - __stream_link *link; - unsigned flags; - - handle = handle; - _AccessIOB(); - /* Try and take one off the recently closed list */ - link = _RWD_cstream; - if( link != NULL ) { - _RWD_cstream = link->next; - fp = link->stream; - flags = (fp->_flag & KEEP_FLAGS) | (_READ | _WRITE); - goto got_one; - } - /* See if there is a static FILE structure available. */ - end = &_RWD_iob[_NFILES]; - for( fp = _RWD_iob; fp < end; ++fp ) { - if( (fp->_flag & (_READ | _WRITE)) == 0 ) { - link = lib_malloc( sizeof( __stream_link ) ); - if( link == NULL ) - goto no_mem; - flags = _READ | _WRITE; - goto got_one; - } - } - /* Allocate a new dynamic structure */ - flags = _DYNAMIC | _READ | _WRITE; - link = lib_malloc( sizeof( __stream_link ) + sizeof( FILE ) ); - if( link == NULL ) - goto no_mem; - fp = (FILE *)(link + 1); -got_one: - memset( fp, 0, sizeof( *fp ) ); - fp->_flag = flags; - link->stream = fp; - link->stream->_link = link; /* point back to link structure */ - link->next = _RWD_ostream; - _RWD_ostream = link; - _ReleaseIOB(); - return( fp ); -no_mem: - __set_errno( ENOMEM ); - _ReleaseIOB(); - return( NULL ); /* no free slots */ -} diff --git a/programs/develop/open watcom/trunk/clib/src/chktty.c b/programs/develop/open watcom/trunk/clib/src/chktty.c deleted file mode 100644 index bc0f41d62..000000000 --- a/programs/develop/open watcom/trunk/clib/src/chktty.c +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of chktty() - check if stream is teletype. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "rtdata.h" -#include "fileacc.h" -#include "streamio.h" - - -void __chktty( FILE *fp ) -{ - /* if we have not determined that we've got a tty then check for one */ - if( !(fp->_flag & _ISTTY) ) { - if( isatty( fileno( fp ) ) ) { - fp->_flag |= _ISTTY; - if( ( fp->_flag & (_IONBF | _IOLBF | _IOFBF) ) == 0 ) { - fp->_flag |= _IOLBF; - } - } - } -} diff --git a/programs/develop/open watcom/trunk/clib/src/clibi64.h b/programs/develop/open watcom/trunk/clib/src/clibi64.h deleted file mode 100644 index c9fb8c7ea..000000000 --- a/programs/develop/open watcom/trunk/clib/src/clibi64.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototypes and pragmas for handling __int64 values. -* -****************************************************************************/ - - -#ifndef _I64_H_INCLUDED -#define _I64_H_INCLUDED - -#include "variety.h" -#include "widechar.h" -#include "watcom.h" - - #define INT64_TYPE __int64 - #define UINT64_TYPE unsigned __int64 - - #define _clib_I64Negative( a ) (((__int64)a) < 0) - #define _clib_I64Positive( a ) (((__int64)a) > 0) - #define _clib_I32ToI64( a, b ) b = (__int64)a - #define _clib_U32ToU64( a, b ) b = (unsigned __int64)(unsigned_32)a - #define _clib_I64ToInt( a, b ) b = (signed)a - #define _clib_U64ToUInt( a, b ) b = (unsigned)a - #define _clib_I64ToLong( a, b ) b = (signed long)a - #define _clib_U64ToULong( a, b ) b = (unsigned long)a - #define _clib_I64Neg( a, b ) b = -a - #define _clib_U64Neg( a, b ) _clib_I64Neg( a, b ) - #define _clib_U64Zero( a ) (a == 0) - #define _clib_U64Cmp( a, b ) (a > b ? +1 : a < b ? -1 : 0) - - #define _clib_U64Mul( a, b, c ) c = a * b - #define _clib_U64Div( a, b, c, d ) (d = a % b, c = a / b) - #define _clib_U64Add( a, b, c ) c = a + b - -// conversion functions - use standard ulltoa()/atoll() - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/close.h b/programs/develop/open watcom/trunk/clib/src/close.h deleted file mode 100644 index 2494fca9e..000000000 --- a/programs/develop/open watcom/trunk/clib/src/close.h +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: prototype for __close clib internal function -* -****************************************************************************/ - - -extern int __close( int handle ); diff --git a/programs/develop/open watcom/trunk/clib/src/commode.h b/programs/develop/open watcom/trunk/clib/src/commode.h deleted file mode 100644 index 76af4ba5d..000000000 --- a/programs/develop/open watcom/trunk/clib/src/commode.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: declaration for set commit mode function -* -****************************************************************************/ - - -/* see note in commode.c */ -_WCRTLINK extern void _WCI86FAR __set_commode( void ); -#pragma aux __set_commode "*_"; diff --git a/programs/develop/open watcom/trunk/clib/src/comtflag.c b/programs/develop/open watcom/trunk/clib/src/comtflag.c deleted file mode 100644 index d32fc2853..000000000 --- a/programs/develop/open watcom/trunk/clib/src/comtflag.c +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Commit mode state variable and accessor. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "commode.h" - - -int _commode = 0; - - -/* - * Before changing any of this, check startup/c/commode.c! - */ - -_WCRTLINK void _WCI86FAR __set_commode( void ) -{ - _commode = _COMMIT; -} diff --git a/programs/develop/open watcom/trunk/clib/src/errorno.h b/programs/develop/open watcom/trunk/clib/src/errorno.h deleted file mode 100644 index f256c6cb4..000000000 --- a/programs/develop/open watcom/trunk/clib/src/errorno.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#define _ERRNO errno - - diff --git a/programs/develop/open watcom/trunk/clib/src/exitwmsg.h b/programs/develop/open watcom/trunk/clib/src/exitwmsg.h deleted file mode 100644 index 38e47c36a..000000000 --- a/programs/develop/open watcom/trunk/clib/src/exitwmsg.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Fatal runtime error handlers. -* -****************************************************************************/ - - -#ifndef _EXITWMSG_H_INCLUDED -#define _EXITWMSG_H_INCLUDED - -#include "variety.h" - -#ifdef __cplusplus - extern "C" { -#endif - -#undef _EWM_PARM1 -#undef _EWM_PARM2 -#if defined(__386__) - #define _EWM_PARM1 eax - #define _EWM_PARM2 edx -#elif defined(M_I86) - #define _EWM_PARM1 ax dx - #define _EWM_PARM2 bx -#else - #define _EWM_PARM1 - #define _EWM_PARM2 -#endif - -// C interface -// - tracks normal calling convention -// - this is the funtion that is called from ASM and from C, C++ -// - note there is no #pragma aborts so that debugger can trace out -_WCRTLINK extern void __exit_with_msg( char _WCI86FAR *, unsigned ); -_WCRTLINK extern void __fatal_runtime_error( char _WCI86FAR *, unsigned ); - -// ASM interface -// - always uses register calling convention -// - this function is only called from the C implementation -// of __exit_with_msg -extern void __do_exit_with_msg( char _WCI86FAR *, unsigned ); -#ifdef _M_IX86 - #pragma aux __do_exit_with_msg "*__" \ - parm caller [_EWM_PARM1] [_EWM_PARM2]; -#endif - -#undef _EWM_PARM1 -#undef _EWM_PARM2 - -_WCRTLINKD extern char volatile __WD_Present; - -// WVIDEO interface -// this function should be called before __exit_with_msg() -// to allow Watcom Debugger (nee WVIDEO) to trap runtime errors. -// this really needs to be far!!! -_WCRTLINK extern int __EnterWVIDEO( char _WCFAR *string ); - -#ifdef __cplusplus - }; -#endif -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/exitwmsg.inc b/programs/develop/open watcom/trunk/clib/src/exitwmsg.inc deleted file mode 100644 index e849921e9..000000000 --- a/programs/develop/open watcom/trunk/clib/src/exitwmsg.inc +++ /dev/null @@ -1,53 +0,0 @@ -;***************************************************************************** -;* -;* Open Watcom Project -;* -;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -;* -;* ======================================================================== -;* -;* This file contains Original Code and/or Modifications of Original -;* Code as defined in and that are subject to the Sybase Open Watcom -;* Public License version 1.0 (the 'License'). You may not use this file -;* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -;* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -;* provided with the Original Code and Modifications, and is also -;* available at www.sybase.com/developer/opensource. -;* -;* The Original Code and all software distributed under the License are -;* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -;* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -;* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -;* NON-INFRINGEMENT. Please see the License for the specific language -;* governing rights and limitations under the License. -;* -;* ======================================================================== -;* -;* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -;* DESCRIBE IT HERE! -;* -;***************************************************************************** - - -ifdef __WASM__ - ifdef __386__ - extrn "C",__fatal_runtime_error : near - else - ifdef __SMALL__ - extrn "C",__fatal_runtime_error : near - endif - ifdef __COMPACT__ - extrn "C",__fatal_runtime_error : near - endif - ifdef __MEDIUM__ - extrn "C",__fatal_runtime_error : far - endif - ifdef __LARGE__ - extrn "C",__fatal_runtime_error : far - endif - ifdef __HUGE__ - extrn "C",__fatal_runtime_error : far - endif - endif -endif diff --git a/programs/develop/open watcom/trunk/clib/src/extfunc.h b/programs/develop/open watcom/trunk/clib/src/extfunc.h deleted file mode 100644 index a7e11fd93..000000000 --- a/programs/develop/open watcom/trunk/clib/src/extfunc.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Special interface for calls to non-Watcom routines from -* inside clib (x86 specific). -* -****************************************************************************/ - - -#ifndef EXTFUNC_H_INCLUDED -#define EXTFUNC_H_INCLUDED - -#include "variety.h" - -#if defined(_M_IX86) - #if !defined(__WINDOWS__) - #if defined(__BIG_DATA__) - #define __DS ds - #endif - #endif - - #if !defined(__FLAT__) - #define __ES es - #endif - - #if defined(__386__) - #if defined(__WINDOWS__) || !defined(__FLAT__) - #define __FS fs - #endif - - #define __GS gs - #if defined(__SW_3S) - #define __AX eax - #define __BX ebx - #define __CX ecx - #define __DX edx - #endif - #endif - - #ifndef __AX - #define __AX - #endif - #ifndef __BX - #define __BX - #endif - #ifndef __CX - #define __CX - #endif - #ifndef __DX - #define __DX - #endif - #ifndef __DS - #define __DS - #endif - #ifndef __ES - #define __ES - #endif - #ifndef __FS - #define __FS - #endif - #ifndef __GS - #define __GS - #endif - - #pragma aux __outside_CLIB modify [__AX __BX __CX __DX __DS __ES __FS __GS]; - /* - use as follows: - - typedef void vfv( void ); - #pragma aux (__outside_CLIB) __vfv; - */ - - #undef __AX - #undef __BX - #undef __CX - #undef __DX - #undef __DS - #undef __ES - #undef __FS - #undef __GS -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/farfunc.h b/programs/develop/open watcom/trunk/clib/src/farfunc.h deleted file mode 100644 index 63c876c9f..000000000 --- a/programs/develop/open watcom/trunk/clib/src/farfunc.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Macros for switching between far and near function version -* -****************************************************************************/ - - -#ifndef _FARFUNC_H_INCLUDED -#define _FARFUNC_H_INCLUDED - -#ifdef __FARFUNC__ - #define _FFAR _WCFAR - #define _NEARFAR(n1,n2) n2 -#else - #define _FFAR - #define _NEARFAR(n1,n2) n1 -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/farsupp.h b/programs/develop/open watcom/trunk/clib/src/farsupp.h deleted file mode 100644 index ab9c4973d..000000000 --- a/programs/develop/open watcom/trunk/clib/src/farsupp.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Far pointer support typedefs. -* -****************************************************************************/ - - -#ifndef _FARSUPP_H_INCLUDED -#define _FARSUPP_H_INCLUDED - -#include "variety.h" -#include "widechar.h" -#ifdef __LONG_LONG_SUPPORT__ - #include "clibi64.h" -#endif - -/* Only support near/far pointers on 16-bit targets, extended DOS - * and Win386. Ideally we might want to test for non-flat memory model. - */ -#if defined( _M_I86 ) || defined( __DOS__ ) || defined( __WINDOWS__ ) - #define __FAR_SUPPORT__ - typedef CHAR_TYPE _WCFAR *FAR_STRING; - typedef char _WCFAR *FAR_ASCII_STRING; - typedef wchar_t _WCFAR *FAR_UNI_STRING; - typedef int _WCFAR *FAR_INT; - typedef signed char _WCFAR *FAR_CHAR; - typedef short _WCFAR *FAR_SHORT; - typedef long _WCFAR *FAR_LONG; - typedef float _WCFAR *FAR_FLOAT; - typedef double _WCFAR *FAR_DOUBLE; - #ifdef __LONG_LONG_SUPPORT__ - typedef UINT64_TYPE _WCFAR *FAR_INT64; - #endif -#else - #undef __FAR_SUPPORT__ - typedef CHAR_TYPE *FAR_STRING; - typedef char *FAR_ASCII_STRING; - typedef wchar_t *FAR_UNI_STRING; - typedef int *FAR_INT; - typedef signed char *FAR_CHAR; - typedef short *FAR_SHORT; - typedef long *FAR_LONG; - typedef float *FAR_FLOAT; - typedef double *FAR_DOUBLE; - #ifdef __LONG_LONG_SUPPORT__ - typedef UINT64_TYPE *FAR_INT64; - #endif -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/fclose.c b/programs/develop/open watcom/trunk/clib/src/fclose.c deleted file mode 100644 index 473fabc94..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fclose.c +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent fclose() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "liballoc.h" -#include "mf.h" -#include -#include "fileacc.h" -#include "tmpfname.h" -#include "rtdata.h" -#include "lseek.h" -#include "streamio.h" -#include "close.h" -#include "flush.h" - - -#ifndef __UNIX__ -void (*__RmTmpFileFn)( FILE *fp ); -#endif - - -int __doclose( FILE *fp, int close_handle ) -{ - int ret; - - if( fp->_flag == 0 ) { - return( -1 ); /* file already closed */ - } - ret = 0; - if( fp->_flag & _DIRTY ) { - ret = __flush( fp ); - } - _AccessFile( fp ); -/* - * 02-nov-92 G.Turcotte Syncronize buffer pointer with the file pointer - * IEEE Std 1003.1-1988 B.8.2.3.2 - * 03-nov-03 B.Oldeman Inlined ftell; we already know the buffer isn't - * dirty (because of the flush), so only a "get" applies - */ - if( fp->_cnt != 0 ) { /* if something in buffer */ - __lseek( fileno( fp ), -fp->_cnt, SEEK_CUR ); - } - - if( close_handle ) { -#if defined( __UNIX__ ) || defined( __NETWARE__ ) - // we don't get to implement the close function on these systems - ret |= close( fileno( fp ) ); -#else - ret |= __close( fileno( fp ) ); -#endif - } - if( fp->_flag & _BIGBUF ) { /* if we allocated the buffer */ - lib_free( _FP_BASE(fp) ); - _FP_BASE(fp) = NULL; - } -#ifndef __UNIX__ - /* this never happens under UNIX */ - if( fp->_flag & _TMPFIL ) { /* if this is a temporary file */ - __RmTmpFileFn( fp ); - } -#endif - _ReleaseFile( fp ); - return( ret ); -} - -int __shutdown_stream( FILE *fp, int close_handle ) -{ - int ret; - - ret = __doclose( fp, close_handle ); - __freefp( fp ); - return( ret ); -} - -_WCRTLINK int fclose( FILE *fp ) -{ - __stream_link *link; - - _AccessIOB(); - link = _RWD_ostream; - for( ;; ) { - if( link == NULL ) { - _ReleaseIOB(); - return( -1 ); /* file not open */ - } - if( link->stream == fp ) break; - link = link->next; - } - _ReleaseIOB(); - return( __shutdown_stream( fp, 1 ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/fflush.c b/programs/develop/open watcom/trunk/clib/src/fflush.c deleted file mode 100644 index 5aa82d30b..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fflush.c +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of fflush() - flush streams. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "rtdata.h" -#include "fileacc.h" -#include "flush.h" - -_WCRTLINK int fflush( FILE *fp ) -{ - if( fp == NULL ) { - flushall(); - return( 0 ); - } - _ValidFile( fp, EOF ); - return( __flush( fp ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/fgetc.c b/programs/develop/open watcom/trunk/clib/src/fgetc.c deleted file mode 100644 index 0c0c86aaa..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fgetc.c +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent fgetc() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#ifndef __UNIX__ - #include -#endif -#include "fileacc.h" -#include -#include "rtdata.h" -#include "seterrno.h" -#ifdef __WIDECHAR__ - #include - #include -#endif -#include "qread.h" -#include "orient.h" -#include "flush.h" -#include "streamio.h" - - -#define DOS_EOF_CHAR 0x1a - -#ifdef __WIDECHAR__ - #define CHARMASK 0xffff -#else - #define CHARMASK 0xff -#endif - -int __F_NAME(__fill_buffer,__wfill_buffer)( FILE *fp ) -{ - if( _FP_BASE(fp) == NULL ) { - __ioalloc( fp ); - } - if( fp->_flag & _ISTTY ) { /* 20-aug-90 */ - if( fp->_flag & (_IONBF | _IOLBF) ) { - __flushall( _ISTTY ); /* flush all TTY output */ - } - } - fp->_flag &= ~_UNGET; /* 10-mar-90 */ - fp->_ptr = _FP_BASE(fp); -#ifdef __UNIX__ - fp->_cnt = __qread( fileno( fp ), fp->_ptr, - (fp->_flag & _IONBF) ? CHARSIZE : fp->_bufsize ); -#else - if(( fp->_flag & (_IONBF | _ISTTY)) == (_IONBF | _ISTTY) && - ( fileno( fp ) == STDIN_FILENO )) - { - int c; /* JBS 31-may-91 */ - - fp->_cnt = 0; - // c = getche(); - if( c != EOF ) { - *(CHAR_TYPE *)fp->_ptr = c; - fp->_cnt = CHARSIZE; - } - } else { - fp->_cnt = __qread( fileno( fp ), fp->_ptr, - (fp->_flag & _IONBF) ? CHARSIZE : fp->_bufsize ); - } -#endif - if( fp->_cnt <= 0 ) { - if( fp->_cnt == 0 ) { - fp->_flag |= _EOF; - } else { - fp->_flag |= _SFERR; - fp->_cnt = 0; - } - } - return( fp->_cnt ); -} - -int __F_NAME(__filbuf,__wfilbuf)( FILE *fp ) -{ - if( __F_NAME(__fill_buffer,__wfill_buffer)( fp ) == 0 ) { - return( EOF ); - } - else { - fp->_cnt -= CHARSIZE; - fp->_ptr += CHARSIZE; - return( *(CHAR_TYPE *)(fp->_ptr - CHARSIZE) & CHARMASK ); - } -} - - -#ifndef __WIDECHAR__ - -_WCRTLINK int fgetc( FILE *fp ) -{ - int c; - - _ValidFile( fp, EOF ); - _AccessFile( fp ); - - /*** Deal with stream orientation ***/ - ORIENT_STREAM(fp,EOF); - - if( (fp->_flag & _READ) == 0 ) { - __set_errno( EBADF ); - fp->_flag |= _SFERR; - c = EOF; - } else { - fp->_cnt--; - // it is important that this remain a relative comparison - // to ensure that the getc() macro works properly - if( fp->_cnt < 0 ) { - c = __F_NAME(__filbuf,__wfilbuf)( fp ); - } else { - c = *(char *)fp->_ptr; - fp->_ptr++; - } - } -#ifndef __UNIX__ - if( !(fp->_flag & _BINARY) ) { - if( c == '\r' ) { - fp->_cnt--; - // it is important that this remain a relative comparison - // to ensure that the getc() macro works properly - if( fp->_cnt < 0 ) { - c = __F_NAME(__filbuf,__wfilbuf)( fp ); - } else { - c = *(CHAR_TYPE*)fp->_ptr & CHARMASK; - fp->_ptr += CHARSIZE; - } - } - if( c == DOS_EOF_CHAR ) { - fp->_flag |= _EOF; - c = EOF; - } - } -#endif - _ReleaseFile( fp ); - return( c ); -} - -#else - -static int __read_wide_char( FILE *fp, wchar_t *wc ) -/**************************************************/ -{ - if( fp->_flag & _BINARY ) { - /*** Read a wide character ***/ - return( fread( wc, sizeof( wchar_t ), 1, fp ) ); - } else { - char mbc[MB_CUR_MAX]; - wchar_t wcTemp; - int rc; - - /*** Read the multibyte character ***/ - if( !fread( &mbc[0], 1, 1, fp ) ) - return( 0 ); - - if( _ismbblead( mbc[0] ) ) { - if( !fread( &mbc[1], 1, 1, fp ) ) - return( 0 ); - } - - /*** Convert it to wide form ***/ - rc = mbtowc( &wcTemp, mbc, MB_CUR_MAX ); - if( rc >= 0 ) { - *wc = wcTemp; - return( 1 ); - } else { - __set_errno( EILSEQ ); - return( 0 ); - } - } -} - -_WCRTLINK wint_t fgetwc( FILE *fp ) -{ - wchar_t c; - - _ValidFile( fp, WEOF ); - _AccessFile( fp ); - - /*** Deal with stream orientation ***/ - ORIENT_STREAM(fp,WEOF); - - /*** Read the character ***/ - if( !__read_wide_char( fp, &c ) ) { - _ReleaseFile( fp ); - return( WEOF ); - } - if( !(fp->_flag & _BINARY) && (c == L'\r') ) { - if( !__read_wide_char( fp, &c ) ) { - _ReleaseFile( fp ); - return( WEOF ); - } - } - - _ReleaseFile( fp ); - return( (wint_t)c ); -} - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/fileacc.h b/programs/develop/open watcom/trunk/clib/src/fileacc.h deleted file mode 100644 index 386be424c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fileacc.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#define _ValidFile( fp, retval ) /* make sure fp is a valid pointer */ -#define SetupTGCSandNCS( x ) /* initialization for Netware/386 */ - -#if defined(__SW_BM) - - #define _AccessFile( fp ) _AccessFileH( (fp)->_handle ) - #define _ReleaseFile( fp ) _ReleaseFileH( (fp)->_handle ) - - #if defined(__386__) || defined(__AXP__) || defined(__PPC__) - extern void (*_AccessFileH)( int ); - extern void (*_ReleaseFileH)( int ); - extern void (*_AccessIOB)( void ); - extern void (*_ReleaseIOB)( void ); - #else - // 16bit OS/2 multi-thread is different - extern void __AccessFileH( int ); - extern void __ReleaseFileH( int ); - extern void __AccessIOB( void ); - extern void __ReleaseIOB( void ); - - // define macros to call the access routines directly for OS/2 1.x - #define _AccessFileH( hdl ) __AccessFileH( hdl ) - #define _ReleaseFileH( hdl ) __ReleaseFileH( hdl ) - #define _AccessIOB() __AccessIOB() - #define _ReleaseIOB() __ReleaseIOB() - #endif - #if defined(__NT__) - extern void (*_AccessFList)( void ); - extern void (*_ReleaseFList)( void ); - #endif - -#else - /* these are for multi thread support */ - /* they are not required if not building multi-thread library */ - /* note: 32 bit NETWARE, OS/2, NT, QNX libraries are always multi-thread */ - #define _AccessFile( fp ) /* gain access to the FILE* pointer */ - #define _ReleaseFile( fp ) /* release access */ - - #define _AccessFileH( hdl ) /* gain access to the file handle */ - #define _ReleaseFileH( hdl ) /* release access */ - - #define _AccessIOB() /* gain access to array of __iob's */ - #define _ReleaseIOB() /* release access */ - - #if defined(__NT__) - #define _AccessFList() - #define _ReleaseFList() - #endif -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/fixpoint.h b/programs/develop/open watcom/trunk/clib/src/fixpoint.h deleted file mode 100644 index a09cb3ab0..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fixpoint.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Fixed-point data type. -* -****************************************************************************/ - - -typedef union t32 { - unsigned long uWhole; - signed long sWhole; - struct { unsigned short int lo, hi; } wd; - struct { unsigned char b1, b2, b3, b4; } bite; -} T32; diff --git a/programs/develop/open watcom/trunk/clib/src/flush.c b/programs/develop/open watcom/trunk/clib/src/flush.c deleted file mode 100644 index 541eba709..000000000 --- a/programs/develop/open watcom/trunk/clib/src/flush.c +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of fflush() helper routine. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include -#include "fileacc.h" -#include "rtdata.h" -#include "seterrno.h" -#include "qwrite.h" -#include "lseek.h" -#include "flush.h" - -#if defined( __NETWARE__ ) && defined( _THIN_LIB ) - -/* Take flush from LibC */ -_WCRTLINK int __flush( FILE *fp ) -{ - return( fflush( fp ) ); -} - -#else - -_WCRTLINK int __flush( FILE *fp ) -{ - int len; - long offset; - int ret; - char *ptr; - unsigned amount; - - ret = 0; - _AccessFile( fp ); - if( fp->_flag & _DIRTY ) { - fp->_flag &= ~_DIRTY; - if( (fp->_flag & _WRITE) && (_FP_BASE(fp) != NULL) ) { - ptr = _FP_BASE(fp); - amount = fp->_cnt; - while( amount != 0 && ret == 0 ) { - len = __qwrite( fileno( fp ), ptr, amount ); /* 02-aug-90 */ - if( len == -1 ) { - fp->_flag |= _SFERR; - ret = EOF; - } -#ifndef __UNIX__ - else if( len == 0 ) { - __set_errno( ENOSPC ); /* 12-nov-88 */ - fp->_flag |= _SFERR; - ret = EOF; - } -#endif - ptr += len; - amount -= len; - } - } - } else if( _FP_BASE(fp) != NULL ) { /* not dirty */ - /* fseek( fp, ftell(fp), SEEK_SET ); */ - fp->_flag &= ~_EOF; - if( !(fp->_flag & _ISTTY) ) { - offset = fp->_cnt; - if( offset != 0 ) { /* 10-aug-89 JD */ - offset = __lseek( fileno( fp ), -offset, SEEK_CUR ); - } - if( offset == -1 ) { - fp->_flag |= _SFERR; - ret = EOF; - } - } - } - fp->_ptr = _FP_BASE(fp); /* reset ptr to start of buffer */ - fp->_cnt = 0; -#if !defined( __NETWARE__ ) && !defined( __OSI__ ) - if( ret == 0 && (_FP_EXTFLAGS(fp) & _COMMIT) ) { - if( fsync( fileno( fp ) ) == -1 ) { - ret = EOF; - } - } -#endif - _ReleaseFile( fp ); - return( ret ); -} - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/flush.h b/programs/develop/open watcom/trunk/clib/src/flush.h deleted file mode 100644 index 484457d08..000000000 --- a/programs/develop/open watcom/trunk/clib/src/flush.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototype for __flush and __flushall internal routines. -* -****************************************************************************/ - -/* __flush is used by C++ run-time library */ -_WCRTLINK extern int __flush( FILE * ); - -extern int __flushall( int ); diff --git a/programs/develop/open watcom/trunk/clib/src/flushall.c b/programs/develop/open watcom/trunk/clib/src/flushall.c deleted file mode 100644 index 8fffa7c17..000000000 --- a/programs/develop/open watcom/trunk/clib/src/flushall.c +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of flushall() - flush all streams. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "rtdata.h" -#include "fileacc.h" -#include "flush.h" - - -/* __fill_buffer calls this routine with _ISTTY mask */ - -int __flushall( int mask ) -{ - __stream_link *link; - FILE *fp; - int number_of_open_files; - - _AccessIOB(); - number_of_open_files = 0; - for( link = _RWD_ostream; link != NULL; link = link->next ) { - fp = link->stream; - if( fp->_flag & mask ) { /* if file is a candidate */ - ++number_of_open_files; - if( fp->_flag & _DIRTY ) { - __flush( fp ); - } - } - } - _ReleaseIOB(); - return( number_of_open_files ); -} - -_WCRTLINK int flushall( void ) -{ - return( __flushall( ~0 ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/fmode.h b/programs/develop/open watcom/trunk/clib/src/fmode.h deleted file mode 100644 index 386ac1af3..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fmode.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -/* define _fmode to be _fmode */ diff --git a/programs/develop/open watcom/trunk/clib/src/fopen.c b/programs/develop/open watcom/trunk/clib/src/fopen.c deleted file mode 100644 index e91ce17b2..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fopen.c +++ /dev/null @@ -1,359 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent fopen() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#ifdef __WIDECHAR__ - #include -#endif -#include -#include -#include -#include "fileacc.h" -#include "fmode.h" -#include "openmode.h" -#include "rtdata.h" -#include "seterrno.h" -//#include "defwin.h" -#include "streamio.h" - -#ifdef __UNIX__ - #define PMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) -#else - #define PMODE (S_IREAD | S_IWRITE) -#endif - - -int __F_NAME(__open_flags,__wopen_flags)( const CHAR_TYPE *modestr, int *extflags ) -{ - int flags; - int alive = 1; - int gotplus = 0; - int gottextbin = 0; -#ifndef __NETWARE__ - int gotcommit = 0; -#endif - - flags = 0; - if( extflags != NULL ) { -#ifdef __NETWARE__ - *extflags = 0; -#else - if( _commode == _COMMIT ) { - *extflags = _COMMIT; - } else { - *extflags = 0; - } -#endif - } - - /* - * The first character in modestr must be 'r', 'w', or 'a'. - */ - switch( *modestr ) { - case 'r': - flags |= _READ; - break; - case 'w': - flags |= _WRITE; - break; - case 'a': - flags |= _WRITE | _APPEND; - break; - default: - __set_errno( EINVAL ); - return( 0 ); - } - modestr++; - - /* - * Next we might have, in any order, some additional mode modifier - * characters: - * 1. A '+' character. - * 2. Either a 't' or a 'b'. - * 3. Either a 'c' or a 'n'. (Not available for Netware.) - * For MS compatability, scanning stops when any of the three groups - * is encountered twice; e.g., "wct+b$&!" is valid and will result in - * a text, not binary, stream. Also for MS compatability, scanning - * stops at any unrecognized character, without causing failure. - */ - while( (*modestr != NULLCHAR) && alive ) { - switch( *modestr ) { - case '+': - if( gotplus ) { - alive = 0; - } else { - flags |= _READ | _WRITE; - gotplus = 1; - } - break; - case 't': - if( gottextbin ) { - alive = 0; - } else { - gottextbin = 1; - } - break; - case 'b': - if( gottextbin ) { - alive = 0; - } else { -#ifndef __UNIX__ - flags |= _BINARY; -#endif - gottextbin = 1; - } - break; -#ifndef __NETWARE__ - case 'c': - if( gotcommit ) { - alive = 0; - } else { - *extflags |= _COMMIT; - gotcommit = 1; - } - break; - case 'n': - if( gotcommit ) { - alive = 0; - } else { - *extflags &= ~_COMMIT; - gotcommit = 1; - } - break; -#endif - default: - break; - } - modestr++; - } - - /* - * Handle defaults for any unspecified options. - */ -#ifndef __UNIX__ - if( !gottextbin ) { - if( _RWD_fmode == O_BINARY ) flags |= _BINARY; - } -#endif - - return( flags ); -} - - -static FILE *__F_NAME(__doopen,__wdoopen)( const CHAR_TYPE *name, - CHAR_TYPE mode, - int file_flags, - int extflags, - int shflag, /* sharing flag */ - FILE * fp ) -{ - int open_mode; - int p_mode; - - SetupTGCSandNCS( RETURN_ARG( FILE *, 0 ) ); /* for NW386 */ - fp->_flag &= ~(_READ | _WRITE); - fp->_flag |= file_flags; - - /* we need the mode character to indicate if the original */ - /* intention is to open for read or for write */ - mode = __F_NAME(tolower,towlower)( mode ); - if( mode == 'r' ) { - open_mode = O_RDONLY; - if( file_flags & _WRITE ) { /* if "r+" mode */ - open_mode = O_RDWR; - } -#if defined( __NETWARE__ ) - open_mode |= O_BINARY; -#elif defined( __UNIX__ ) -#else - if( file_flags & _BINARY ) { - open_mode |= O_BINARY; - } else { - open_mode |= O_TEXT; - } -#endif - p_mode = 0; - } else { /* mode == 'w' || mode == 'a' */ - if( file_flags & _READ ) { /* if "a+" or "w+" mode */ - open_mode = O_RDWR | O_CREAT; - } else { - open_mode = O_WRONLY | O_CREAT; - } - if( file_flags & _APPEND ) { - open_mode |= O_APPEND; - } else { /* mode == 'w' */ - open_mode |= O_TRUNC; - } -#if defined( __NETWARE__ ) - open_mode |= O_BINARY; -#elif defined( __UNIX__ ) -#else - if( file_flags & _BINARY ) { - open_mode |= O_BINARY; - } else { - open_mode |= O_TEXT; - } -#endif - p_mode = PMODE; - } - fp->_handle = __F_NAME(sopen,_wsopen)( name, open_mode, shflag, p_mode ); - if( fp->_handle == -1 ) { - // since we couldn't open the file, release the FILE struct - __freefp( fp ); - return( NULL ); - } - fp->_cnt = 0; - fp->_bufsize = 0; /* was BUFSIZ JBS 31-may-91 */ -#ifndef __NETWARE__ - _FP_ORIENTATION(fp) = _NOT_ORIENTED; /* initial orientation */ - _FP_EXTFLAGS(fp) = extflags; -#endif -#if defined( __NT__ ) || defined( __OS2__ ) - _FP_PIPEDATA(fp).isPipe = 0; /* not a pipe */ -#endif - _FP_BASE(fp) = NULL; - if( file_flags & _APPEND ) { - fseek( fp, 0L, SEEK_END ); - } - __chktty( fp ); /* JBS 28-aug-90 */ - return( fp ); -} - - -_WCRTLINK FILE *__F_NAME(_fsopen,_wfsopen)( const CHAR_TYPE *name, - const CHAR_TYPE *access_mode, int shflag ) -{ - FILE * fp; - int file_flags; - int extflags; - - /* validate access_mode */ - file_flags = __F_NAME(__open_flags,__wopen_flags)( access_mode, &extflags ); - if( file_flags == 0 ) { - return( NULL ); - } - - /* specify dummy handle 0 */ - fp = __allocfp( 0 ); /* JBS 30-aug-91 */ - if( fp != NULL ) { - fp = __F_NAME(__doopen,__wdoopen)( name, *access_mode, - file_flags, extflags, - shflag, fp ); - } - return( fp ); -} - - -_WCRTLINK FILE *__F_NAME(fopen,_wfopen)( const CHAR_TYPE *name, const CHAR_TYPE *access_mode ) -{ - return( __F_NAME(_fsopen,_wfsopen)( name, access_mode, OPENMODE_DENY_COMPAT ) ); -} - -static FILE *close_file( FILE *fp ) -{ - __stream_link * link; - __stream_link **owner; - - _AccessIOB(); - /* See if the file pointer is a currently open file. */ - link = _RWD_ostream; - for( ;; ) { - if( link == NULL ) break; - if( link->stream == fp ) { - if( fp->_flag & (_READ|_WRITE) ) { - __doclose( fp, 1 ); - } - _ReleaseIOB(); - return( fp ); - } - link = link->next; - } - /* - It's not on the list of open files, so check the list of - recently closed ones. - */ - owner = &_RWD_cstream; - for( ;; ) { - link = *owner; - if( link == NULL ) break; - if( link->stream == fp ) { - /* remove from closed list and put on open */ - *owner = link->next; - link->next = _RWD_ostream; - _RWD_ostream = link; - _ReleaseIOB(); - return( fp ); - } - owner = &link->next; - } - /* We ain't seen that file pointer ever. Leave things be. */ - __set_errno( EBADF ); - _ReleaseIOB(); - return( NULL ); -} - - -_WCRTLINK FILE *__F_NAME(freopen,_wfreopen)( const CHAR_TYPE *name, - const CHAR_TYPE *access_mode, FILE *fp ) -{ - int hdl; - int file_flags; - int extflags; - - _ValidFile( fp, 0 ); - - /* validate access_mode */ - file_flags = __F_NAME(__open_flags,__wopen_flags)( access_mode, &extflags ); - if( file_flags == 0 ) { - return( NULL ); - } - - hdl = fileno( fp ); - _AccessFileH( hdl ); - -#ifdef DEFAULT_WINDOWING - if( _WindowsRemoveWindowedHandle != 0 ) { - _WindowsRemoveWindowedHandle( hdl ); - } -#endif - fp = close_file( fp ); - if( fp != NULL ) { - fp->_flag &= _DYNAMIC; /* 24-jul-92 */ - fp = __F_NAME(__doopen,__wdoopen)( name, *access_mode, - file_flags, extflags, - 0, fp ); - } - _ReleaseFileH( hdl ); - return( fp ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/fprtf.h b/programs/develop/open watcom/trunk/clib/src/fprtf.h deleted file mode 100644 index 7a9f51021..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fprtf.h +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototype for __fprtf() internal routine. -* -****************************************************************************/ - - -extern int __F_NAME(__fprtf,__fwprtf)( FILE *fp, const CHAR_TYPE *format, va_list arg ); diff --git a/programs/develop/open watcom/trunk/clib/src/fputc.c b/programs/develop/open watcom/trunk/clib/src/fputc.c deleted file mode 100644 index 48bc65209..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fputc.c +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent fputc() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#include "fileacc.h" -#include "rtdata.h" -#include "seterrno.h" -#include "orient.h" -#ifdef __WIDECHAR__ - #include - #include -#endif -#include "flush.h" -#include "streamio.h" - - -#ifndef __WIDECHAR__ - -_WCRTLINK int fputc( int c, FILE *fp ) -{ - int flags; - - _ValidFile( fp, EOF ); - _AccessFile( fp ); - - /*** Deal with stream orientation ***/ - ORIENT_STREAM(fp,EOF); - - if( !(fp->_flag & _WRITE) ) { - __set_errno( EBADF ); - fp->_flag |= _SFERR; - _ReleaseFile( fp ); - return( EOF ); - } - if( _FP_BASE(fp) == NULL ) { - __ioalloc( fp ); - } - flags = _IONBF; - if( c == '\n' ) { - flags = _IONBF | _IOLBF; -#ifndef __UNIX__ - if( !(fp->_flag & _BINARY) ) { - fp->_flag |= _DIRTY; - *(char*)fp->_ptr = '\r'; /* '\n' -> '\r''\n' */ - fp->_ptr++; - fp->_cnt++; - if( fp->_cnt == fp->_bufsize ) { - if( __flush( fp ) ) { - _ReleaseFile( fp ); - return( EOF ); - } - } - } -#endif - } - fp->_flag |= _DIRTY; - *(char *)fp->_ptr = c; - fp->_ptr++; - fp->_cnt++; - if( (fp->_flag & flags) || (fp->_cnt == fp->_bufsize) ) { - if( __flush( fp ) ) { - _ReleaseFile( fp ); - return( EOF ); - } - } - _ReleaseFile( fp ); - return( (UCHAR_TYPE)c ); -} - - -#else - - -static int __write_wide_char( FILE *fp, wchar_t wc ) -/**************************************************/ -{ - if( fp->_flag & _BINARY ) { - /*** Dump the wide character ***/ - return( fwrite( &wc, sizeof( wchar_t ), 1, fp ) ); - } else { - char mbc[MB_CUR_MAX]; - int rc; - - /*** Convert the wide character to multibyte form and write it ***/ - rc = wctomb( mbc, wc ); - if( rc > 0 ) { - return( fwrite( mbc, rc, 1, fp ) ); - } else { - __set_errno( EILSEQ ); - return( 0 ); - } - } -} - - -_WCRTLINK wint_t fputwc( wint_t c, FILE *fp ) -{ - _ValidFile( fp, WEOF ); - _AccessFile( fp ); - - /*** Deal with stream orientation ***/ - ORIENT_STREAM(fp,WEOF); - - /*** Write the character ***/ - if( !__write_wide_char( fp, c ) ) { - _ReleaseFile( fp ); - return( WEOF ); - } else { - _ReleaseFile( fp ); - return( c ); - } -} - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/fputs.c b/programs/develop/open watcom/trunk/clib/src/fputs.c deleted file mode 100644 index 1279a7868..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fputs.c +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of fputs() - put string to stream. -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include "fileacc.h" -#include "rtdata.h" -#include "flush.h" -#include "streamio.h" - - -_WCRTLINK int __F_NAME(fputs,fputws)( const CHAR_TYPE *s, FILE *fp ) -{ - const CHAR_TYPE *start; - int c; - int not_buffered; - int rc; - - _ValidFile( fp, __F_NAME(EOF,WEOF) ); - _AccessFile( fp ); - - if( _FP_BASE(fp) == NULL ) { - __ioalloc( fp ); /* allocate buffer */ - } - not_buffered = 0; - if( fp->_flag & _IONBF ) { - not_buffered = 1; - fp->_flag &= ~_IONBF; - fp->_flag |= _IOLBF; - } - rc = 0; - start = s; - while( c = *s ) { - s++; -#ifndef __WIDECHAR__ - if( (fputc)( c, fp ) == EOF ) { /* 23-oct-91 */ - rc = EOF; - break; - } -#else - if( (fputwc)( c, fp ) == WEOF ) { /* 23-oct-91 */ - rc = -1; - break; - } -#endif - } - if( not_buffered ) { - fp->_flag &= ~_IOLBF; - fp->_flag |= _IONBF; - if( rc == 0 ) { - rc = __flush( fp ); /* 23-oct-91 */ - } - } - if( rc == 0 ) { - /* return the number of items written */ - /* this is ok by ANSI which says that success is */ - /* indicated by a non-negative return value */ - rc = s - start; - } - _ReleaseFile( fp ); - return( rc ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/fread.c b/programs/develop/open watcom/trunk/clib/src/fread.c deleted file mode 100644 index 657366d42..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fread.c +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of fread() - read data from stream. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include "fileacc.h" -#include -#include -#include "rtdata.h" -#include "seterrno.h" -#include "qread.h" -#include "streamio.h" - - -#define DOS_EOF_CHAR 0x1a - -extern int __fill_buffer( FILE * ); /* located in fgetc */ - - -_WCRTLINK size_t fread( void *_buf, size_t size, size_t n, FILE *fp ) -{ - char *buf = _buf; - size_t len_read; - - _ValidFile( fp, 0 ); - _AccessFile( fp ); - if( (fp->_flag & _READ) == 0 ) { - __set_errno( EBADF ); - fp->_flag |= _SFERR; - _ReleaseFile( fp ); - return( 0 ); - } - -#if 0 - /*** If the buffer is _DIRTY, resync it before reading ***/ - if( fp->_flag & (_WRITE | _UNGET) ) { - if( fp->_flag & _DIRTY ) { - fseek( fp, 0, SEEK_CUR ); - } - } -#endif - - n *= size; - if( n == 0 ) { - _ReleaseFile( fp ); - return( n ); - } - if( _FP_BASE(fp) == NULL ) { - __ioalloc( fp ); /* allocate buffer */ - } - len_read = 0; -#if !defined( __UNIX__ ) - if( fp->_flag & _BINARY ) -#endif - { - size_t bytes_left = n, bytes; - for( ;; ) { - if( fp->_cnt != 0 ) { - bytes = fp->_cnt; - if( bytes > bytes_left ) { - bytes = bytes_left; - } - memcpy( buf, fp->_ptr, bytes ); - fp->_ptr += bytes; - buf += bytes; - fp->_cnt -= bytes; - bytes_left -= bytes; - len_read += bytes; - } - if( bytes_left == 0 ) break; - - /* if user's buffer is larger than our buffer, OR - _IONBF is set, then read directly into user's buffer. */ - - if( (bytes_left >= fp->_bufsize) || (fp->_flag & _IONBF) ) { - bytes = bytes_left; - fp->_ptr = _FP_BASE(fp); - fp->_cnt = 0; - if( !(fp->_flag & _IONBF) ) { - /* if more than a sector, set to multiple of sector size*/ - if( bytes > 512 ) { - bytes &= -512; - } - } - n = __qread( fileno(fp), buf, bytes ); - if( n == -1 ) { - fp->_flag |= _SFERR; - break; - } else if( n == 0 ) { - fp->_flag |= _EOF; - break; - } - buf += n; - bytes_left -= n; - len_read += n; - } else { - if( __fill_buffer( fp ) == 0 ) break; - } - } /* end for */ -#if !defined(__UNIX__) - } else { - for( ;; ) { - int c; - - // ensure non-empty buffer - if( fp->_cnt == 0 ) { - if( __fill_buffer( fp ) == 0 ) break; - } - // get character - --fp->_cnt; - c = *fp->_ptr++ & 0xff; - // perform new-line translation - if( c == '\r' ) { - // ensure non-empty buffer - if( fp->_cnt == 0 ) { - if( __fill_buffer( fp ) == 0 ) break; - } - // get character - --fp->_cnt; - c = *fp->_ptr++ & 0xff; - } - // check for DOS end of file marker - if( c == DOS_EOF_CHAR ) { - fp->_flag |= _EOF; - break; - } - // store chracter - buf[len_read] = (char)c; - ++len_read; - if( len_read == n ) break; - } -#endif - } - _ReleaseFile( fp ); - return( len_read / size ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/freefp.c b/programs/develop/open watcom/trunk/clib/src/freefp.c deleted file mode 100644 index 550c58602..000000000 --- a/programs/develop/open watcom/trunk/clib/src/freefp.c +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent __allocfp() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "liballoc.h" -#include "fileacc.h" -#include "rtdata.h" -#include "streamio.h" - -#ifdef DLHEAP - -void _cdecl dlfree(void*); -void _cdecl mf_init(); - -#define malloc dlmalloc -#define free dlfree -#define realloc dlrealloc - -#define lib_free dlfree -#endif - -/* - NOTE: This routine does not actually free the link/FILE structures. - That is because code assumes that it can fclose the file and then - freopen is a short time later. The __purgefp routine can be called - to actually release the storage. -*/ - -void __freefp( FILE * fp ) -{ - __stream_link **owner; - __stream_link *link; - - _AccessIOB(); - owner = &_RWD_ostream; - for( ;; ) { - link = *owner; - if( link == NULL ) - return; - if( link->stream == fp ) - break; - owner = &link->next; - } - fp->_flag |= _READ | _WRITE; - (*owner) = link->next; - link->next = _RWD_cstream; - _RWD_cstream = link; - _ReleaseIOB(); -} - - -void __purgefp( void ) -{ - __stream_link *next; - - _AccessIOB(); - while( _RWD_cstream != NULL ) { - next = _RWD_cstream->next; - lib_free( _RWD_cstream ); - _RWD_cstream = next; - } - _ReleaseIOB(); -} diff --git a/programs/develop/open watcom/trunk/clib/src/fseek.c b/programs/develop/open watcom/trunk/clib/src/fseek.c deleted file mode 100644 index 96e9dfe29..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fseek.c +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of fseek - set stream position. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "fileacc.h" -#include "rtdata.h" -#include "seterrno.h" -#include "flush.h" - - -static int __update_buffer( long diff, FILE *fp ) -{ - /* - diff is relative to fp->_ptr - if diff is within the buffer update the pointers and return 0 - otherwise update the pointers and return 1 - */ - if( diff <= fp->_cnt && diff >= (_FP_BASE(fp) - fp->_ptr) ) { - fp->_flag &= ~(_EOF); - fp->_ptr += diff; - fp->_cnt -= diff; - return( 0 ); - } - return( 1 ); -} - - -/* - * This used to be in __update_buffer(), but we don't want to do this until - * AFTER we've made certain that lseek() will be a successful one. - */ -static void __reset_buffer( FILE *fp ) -{ - fp->_flag &= ~(_EOF); - fp->_ptr = _FP_BASE(fp); - fp->_cnt = 0; -} - - -_WCRTLINK int fseek( FILE *fp, long offset, int origin ) -{ - _ValidFile( fp, -1 ); - _AccessFile( fp ); - /* - if the file is open for any sort of writing we must ensure that - the buffer is flushed when dirty so that the integrity of the - data is preserved. - if there is an ungotten character in the buffer then the data must - be discarded to ensure the integrity of the data - */ - if( fp->_flag & (_WRITE | _UNGET) ) { - if( fp->_flag & _DIRTY ) { - /* - the __flush routine aligns the DOS file pointer with the - start of the resulting cleared buffer, as such, the SEEK_CUR - code used for the non-_DIRTY buffer case is not required - */ - if( __flush( fp ) ) { - // assume __flush set the errno value - // if erroneous input, override errno value - if( origin == SEEK_SET && offset < 0 ) { - __set_errno( EINVAL ); - } - _ReleaseFile( fp ); - return( -1 ); - } - } else { - if( origin == SEEK_CUR ) { - offset -= fp->_cnt; - } - fp->_ptr = _FP_BASE(fp); - fp->_cnt = 0; - } - fp->_flag &= ~(_EOF|_UNGET); - if( lseek( fileno( fp ), offset, origin ) == -1 ) { - _ReleaseFile( fp ); - return( -1 ); - } - } else { - // file is open for read only, - // no characters have been ungotten - // the OS file pointer is at fp->_ptr + fp->_cnt relative to the - // FILE* buffer - switch( origin ) { - case SEEK_CUR: - { long ptr_delta = fp->_cnt; - - if( __update_buffer( offset, fp ) ) { - offset -= ptr_delta; - if( lseek( fileno( fp ), offset, origin ) == -1 ) { - _ReleaseFile( fp ); - return( -1 ); - } - __reset_buffer(fp); - } - } break; - case SEEK_SET: - { long file_ptr = tell( fileno( fp ) ); - - file_ptr -= fp->_cnt; - if( __update_buffer( offset - file_ptr, fp ) ) { - if( lseek( fileno( fp ), offset, origin ) == -1 ) { - _ReleaseFile( fp ); - return( -1 ); - } - __reset_buffer(fp); - } - } break; - case SEEK_END: - fp->_flag &= ~(_EOF); - fp->_ptr = _FP_BASE(fp); - fp->_cnt = 0; - if( lseek( fileno( fp ), offset, origin ) == -1 ) { - _ReleaseFile( fp ); - return( -1 ); - } - break; - default: - __set_errno( EINVAL ); - _ReleaseFile( fp ); - return( -1 ); - } - } - _ReleaseFile( fp ); - return( 0 ); /* indicate success */ -} diff --git a/programs/develop/open watcom/trunk/clib/src/fstatus.inc b/programs/develop/open watcom/trunk/clib/src/fstatus.inc deleted file mode 100644 index e7ff411ff..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fstatus.inc +++ /dev/null @@ -1,47 +0,0 @@ -;***************************************************************************** -;* -;* Open Watcom Project -;* -;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -;* -;* ======================================================================== -;* -;* This file contains Original Code and/or Modifications of Original -;* Code as defined in and that are subject to the Sybase Open Watcom -;* Public License version 1.0 (the 'License'). You may not use this file -;* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -;* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -;* provided with the Original Code and Modifications, and is also -;* available at www.sybase.com/developer/opensource. -;* -;* The Original Code and all software distributed under the License are -;* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -;* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -;* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -;* NON-INFRINGEMENT. Please see the License for the specific language -;* governing rights and limitations under the License. -;* -;* ======================================================================== -;* -;* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -;* DESCRIBE IT HERE! -;* -;***************************************************************************** - - -FPE_OK equ 0 -FPE_INVALID equ 81h -FPE_DENORMAL equ 82h -FPE_ZERODIVIDE equ 83h -FPE_OVERFLOW equ 84h -FPE_UNDERFLOW equ 85h -FPE_INEXACT equ 86h -FPE_UNEMULATED equ 87h -FPE_SQRTNEG equ 88h -FPE_STACKOVERFLOW equ 8ah -FPE_STACKUNDERFLOW equ 8bh -FPE_EXPLICITGEN equ 8ch -FPE_IOVERFLOW equ 8dh -FPE_LOGERR equ 8eh -FPE_MODERR equ 8fh diff --git a/programs/develop/open watcom/trunk/clib/src/fsync.c b/programs/develop/open watcom/trunk/clib/src/fsync.c deleted file mode 100644 index 4c7b859ac..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fsync.c +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#if defined(__DOS__) || defined(__WINDOWS__) -#elif defined(__NT__) -#elif defined(__OS2__) -#elif defined(__NETWARE__) -#endif - -#include -#include "iomode.h" -#include "rtcheck.h" -#include "seterrno.h" - -/* -// take fsync from LIBC import file -*/ -#if !defined (_NETWARE_LIBC) - -_WCRTLINK int fsync( int handle ) -/*******************************/ -{ - int ret = 0; - - __handle_check( handle, -1 ); - - #if defined(__DOS__) || defined(__WINDOWS__) - #elif defined(__NT__) -// if( !FlushFileBuffers( __getOSHandle( handle ) ) ) -// { -// __set_errno_nt(); -// ret = -1; -// } - #elif defined(__OS2__) - #elif defined(__NETWARE__) - #else - #error Unknown target system - #endif - - return( ret ); -} - -#endif /* !defined (_NETWARE_LIBC) */ diff --git a/programs/develop/open watcom/trunk/clib/src/ftell.c b/programs/develop/open watcom/trunk/clib/src/ftell.c deleted file mode 100644 index ca2c5a77e..000000000 --- a/programs/develop/open watcom/trunk/clib/src/ftell.c +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent ftell() implementaiton. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "fileacc.h" - - -_WCRTLINK long ftell( FILE *fp ) -{ - long pos; - - _ValidFile( fp, -1 ); - if( fp->_flag & _APPEND && fp->_flag & _DIRTY ) { - fflush( fp ); /* if data written in append mode, OS must know */ - } - pos = tell( fileno( fp ) ); - if( pos == -1 ) { - return( -1L ); - } - _AccessFile( fp ); - if( fp->_cnt != 0 ) { /* if something in buffer */ - if( fp->_flag & _DIRTY ) { /* last operation was a put */ - pos += fp->_cnt; - } else { /* last operation was a get */ - pos -= fp->_cnt; - } - } - _ReleaseFile( fp ); - return( pos ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/ftos.h b/programs/develop/open watcom/trunk/clib/src/ftos.h deleted file mode 100644 index 7d07bf359..000000000 --- a/programs/develop/open watcom/trunk/clib/src/ftos.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototypes for floating-point formatting routines. -* -****************************************************************************/ - - -#ifndef _FTOS_H_INCLUDED -#define _FTOS_H_INCLUDED - -#include "variety.h" -#include "farsupp.h" - -_WCRTLINK extern FAR_STRING (*__EFG_printf)(); -_WCRTLINK extern void (*__EFG_scanf)(); -extern FAR_STRING _EFG_Format(); -extern void __cnvs2d(); -_WMRTLINK extern FAR_STRING (*__get_EFG_Format())(); -_WMRTLINK extern void (*__get__cnvs2d())(); - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/fwrite.c b/programs/develop/open watcom/trunk/clib/src/fwrite.c deleted file mode 100644 index eff6f9ec3..000000000 --- a/programs/develop/open watcom/trunk/clib/src/fwrite.c +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent fwrite() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include -#include "fileacc.h" -#include "rtdata.h" -#include "seterrno.h" -#include "qwrite.h" -#include "flush.h" -#include "streamio.h" - - -_WCRTLINK size_t fwrite( const void *buf, size_t size, size_t n, FILE *fp ) -{ - size_t count; - unsigned oflag; - - _ValidFile( fp, 0 ); - _AccessFile( fp ); - if( (fp->_flag & _WRITE) == 0 ) { - __set_errno( EBADF ); - fp->_flag |= _SFERR; - _ReleaseFile( fp ); - return( 0 ); /* POSIX says return 0 */ - } - n *= size; - if( n == 0 ) { - _ReleaseFile( fp ); - return( n ); - } - if( _FP_BASE(fp) == NULL ) { - __ioalloc( fp ); /* allocate buffer */ - } - oflag = fp->_flag & (_SFERR | _EOF); /* JBS 27-jan-92 */ - fp->_flag &= ~(_SFERR | _EOF); /* JBS 27-jan-92 */ - count = 0; -#if !defined( __UNIX__ ) - if( fp->_flag & _BINARY ) { /* binary I/O */ -#else - { -#endif - size_t bytes_left = n, bytes; - - do { - /* if our buffer is empty, and user's buffer is larger, - then write directly from user's buffer. 28-apr-90 */ - - if( fp->_cnt == 0 && bytes_left >= fp->_bufsize ) { - bytes = bytes_left & -512; /* multiple of 512 */ - if( bytes == 0 ) { - bytes = bytes_left; /* bufsize < 512 */ - } - n = __qwrite( fileno( fp ), buf, bytes ); - if( n == -1 ) { - fp->_flag |= _SFERR; - } -#if !defined( __UNIX__ ) - else if( n == 0 ) { - _RWD_errno = ENOSPC; - fp->_flag |= _SFERR; - } -#endif - bytes = n; - } else { - bytes = fp->_bufsize - fp->_cnt; - if( bytes > bytes_left ) { - bytes = bytes_left; - } - memcpy( fp->_ptr, buf, bytes ); - fp->_ptr += bytes; - fp->_cnt += bytes; - fp->_flag |= _DIRTY; - if( (fp->_cnt == fp->_bufsize) || (fp->_flag & _IONBF) ) { - __flush(fp); - } - } - buf = ((const char *)buf) + bytes; - count += bytes; - bytes_left -= bytes; - } while( bytes_left && !ferror( fp ) ); -#if !defined( __UNIX__ ) - } else { /* text I/O */ - const char *bufptr; - int not_buffered; - #ifndef __NETWARE__ - int old_orientation; - #endif - /* temporarily enable buffering saving the previous setting */ - not_buffered = 0; - if( fp->_flag & _IONBF ) { - not_buffered = 1; - fp->_flag &= ~_IONBF; - fp->_flag |= _IOFBF; - } - - /*** Use fputc, and make it think the stream is byte-oriented ***/ - #ifndef __NETWARE__ - old_orientation = _FP_ORIENTATION(fp); - _FP_ORIENTATION(fp) = _BYTE_ORIENTED; - #endif - bufptr = (const char *)buf; - do { - fputc( *(bufptr++), fp ); - if( fp->_flag & (_EOF | _SFERR) ) break; - ++count; - } while( count != n ); - #ifndef __NETWARE__ - _FP_ORIENTATION(fp) = old_orientation; - #endif - - if( not_buffered ) { /* if wasn't buffered, then reset */ - fp->_flag &= ~_IOFBF; - fp->_flag |= _IONBF; - __flush( fp ); - } -#endif - } - if( fp->_flag & _SFERR ) { - /* - * Quantum 11-17-92 Temporary buffering confuses the return - * value if the call is interrupted. - * kludge: return 0 on error - */ - count = 0; - } - fp->_flag |= oflag; /* JBS 27-jan-92 */ - _ReleaseFile( fp ); - return( count / size ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/gtchewnt.c b/programs/develop/open watcom/trunk/clib/src/gtchewnt.c deleted file mode 100644 index 802b98aef..000000000 --- a/programs/develop/open watcom/trunk/clib/src/gtchewnt.c +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include "rtdata.h" - -_WCRTLINK int getche() - { - unsigned c; - unsigned stashed; - - stashed = _RWD_cbyte; - - c = getch(); - if( c != EOF && stashed == 0 ) { - putch( c ); - } - return( c ); - } diff --git a/programs/develop/open watcom/trunk/clib/src/handleio.h b/programs/develop/open watcom/trunk/clib/src/handleio.h deleted file mode 100644 index 0a549e4fd..000000000 --- a/programs/develop/open watcom/trunk/clib/src/handleio.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: prototypes for handleio internal functions -* -****************************************************************************/ - - -/* __plusplus_fstat and __plusplus_open are used by C++ run-time library */ -_WCRTLINK extern int __plusplus_fstat( int handle, int *pios_mode ); -_WCRTLINK extern int __plusplus_open( const char *name, int *pios_mode, int prot ); - -extern unsigned __IOMode( int handle ); -extern void __set_handles( int num ); -extern void __grow_iomode( int num ); -extern void __shrink_iomode( void ); - -extern unsigned *__io_mode; diff --git a/programs/develop/open watcom/trunk/clib/src/hdlman.c b/programs/develop/open watcom/trunk/clib/src/hdlman.c deleted file mode 100644 index da9b11d32..000000000 --- a/programs/develop/open watcom/trunk/clib/src/hdlman.c +++ /dev/null @@ -1,257 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Handle manager routines. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include "liballoc.h" -#include -#ifdef _M_IX86 - #include -#endif -#include -#include -#if defined(__OS2__) -#elif defined(__WINDOWS__) || defined(__NT__) -#endif -#include "iomode.h" -#include "fileacc.h" -#include "rtinit.h" -#include "seterrno.h" -#include "handleio.h" - -#undef __getOSHandle - -extern unsigned __NFiles; // the size of the iomode array -extern void __grow_iomode( int num ); - unsigned __NHandles = 0; - -#if defined(__NT__) - -HANDLE *__OSHandles = NULL; - -unsigned __growPOSIXHandles( unsigned num ) -{ - HANDLE *new2; - unsigned i; - - if( num > __NHandles ) - { - _AccessFList(); - if( __OSHandles == NULL ) - { - new2 = lib_malloc( num * sizeof( int ) ); - } - else - { - new2 = lib_realloc( __OSHandles, num * sizeof( int ) ); - } - if( new2 == NULL ) - { - __set_errno( ENOMEM ); - num = __NHandles; - } - else - { - for( i = __NHandles; i < num; i++ ) - { - new2[ i ] = NULL_HANDLE; - } - __OSHandles = new2; - __NHandles = num; - } - _ReleaseFList(); - } - return( __NHandles ); -} - -int __allocPOSIXHandle( HANDLE hdl ) -{ - int i; - - _AccessFList(); - for( i = 0; i < __NHandles; i++ ) - { - if( __OSHandles[i] == NULL_HANDLE ) break; - } - if( i >= __NHandles ) - { - // 20 -> (20+10+1) -> 31 - // 31 -> (31+15+1) -> 47 - // 47 -> (47+23+1) -> 71 - __growPOSIXHandles( i + (i >> 1) + 1 ); - // keep iomode array in sync - if( __NHandles > __NFiles ) __grow_iomode( __NHandles ); - for( ; i < __NHandles; i++ ) - { - if( __OSHandles[i] == NULL_HANDLE ) break; - } - } - if( i >= __NHandles ) - { - i = -1; - } else { - __OSHandles[i] = hdl; - } - _ReleaseFList(); - return( i ); -} - -void __freePOSIXHandle( int hid ) -{ - __OSHandles[ hid ] = NULL_HANDLE; -} - - -HANDLE __getOSHandle( int hid ) -{ - return( __OSHandles[ hid ] ); -} - - -int __setOSHandle( unsigned hid, HANDLE hdl ) -{ - // call the Win32 API for a standard file handle - switch( hid ) { - case STDIN_FILENO: -// SetStdHandle( STD_INPUT_HANDLE, hdl ); - break; - case STDOUT_FILENO: -// SetStdHandle( STD_OUTPUT_HANDLE, hdl ); - break; - case STDERR_FILENO: -// SetStdHandle( STD_ERROR_HANDLE, hdl ); - break; - } - if( hid < __NHandles ) - { - __OSHandles[ hid ] = hdl; - } - else - { - hid = (unsigned)-1; // this should never happen - } - return( hid ); -} - -HANDLE *__FakeHandles = 0; -static int __topFakeHandle = 0; - -HANDLE __NTGetFakeHandle( void ) -{ - HANDLE os_handle; - static DWORD fakeHandle = 0x80000000L; - _AccessFList(); - - fakeHandle++; - os_handle = (HANDLE)fakeHandle; - _ReleaseFList(); - return( os_handle ); -} - -// called from library startup code - -void __initPOSIXHandles( void ) -{ - HANDLE h; - - // __OSHandles = NULL; - // __NHandles = 0; - - __growPOSIXHandles( __NFiles ); - h = 0; //GetStdHandle( STD_INPUT_HANDLE ); - if( h == 0 || h == INVALID_HANDLE_VALUE ) { - h = (HANDLE)__NTGetFakeHandle(); - } - __allocPOSIXHandle( h ); // should return 0==STDIN_FILENO - h = 0; //GetStdHandle( STD_OUTPUT_HANDLE ); - if( h == 0 || h == INVALID_HANDLE_VALUE ) { - h = (HANDLE)__NTGetFakeHandle(); - } - __allocPOSIXHandle( h ); // should return 1==STDOUT_FILENO - h = 0; //GetStdHandle( STD_ERROR_HANDLE ); - if( h == 0 || h == INVALID_HANDLE_VALUE ) { - h = (HANDLE)__NTGetFakeHandle(); - } - __allocPOSIXHandle( h ); // should return 3==STDERR_FILENO -} - -static void __finiPOSIXHandles( void ) -{ - if( __OSHandles != NULL ) { - lib_free( __OSHandles ); - __OSHandles = NULL; - } - if( __FakeHandles != NULL ) - { - int i; - for( i = 0 ; i < __topFakeHandle ; i++ ) - { - // CloseHandle( __FakeHandles[i] ); - } - lib_free( __FakeHandles ); - __FakeHandles = 0; - } -} - -AYI( __finiPOSIXHandles, INIT_PRIORITY_LIBRARY-1 ) - -#endif - - -void __set_handles( int num ) -{ - __NHandles = num; -} - -_WCRTLINK int _grow_handles( int num ) -{ - if( num > __NHandles ) - { - #if defined(MSDOS) - #elif defined( __OS2_286__ ) - #elif defined( __WARP__ ) - #elif defined(__WINDOWS__) - #elif defined(__NT__) - { - num = __growPOSIXHandles( num ); - } - #elif defined(__NETWARE__) - #elif defined(__UNIX__) - #endif - - if( num > __NFiles ) { - __grow_iomode( num ); // sets new __NFiles if successful - } - __NHandles = num; - } - return( __NHandles ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/hugeval.c b/programs/develop/open watcom/trunk/clib/src/hugeval.c deleted file mode 100644 index b25488482..000000000 --- a/programs/develop/open watcom/trunk/clib/src/hugeval.c +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -_WCRTLINKD unsigned short const _HUGEDATA _HugeValue[] = { 0x0000, 0x0000, 0x0000, 0x7ff0 }; diff --git a/programs/develop/open watcom/trunk/clib/src/initfile.c b/programs/develop/open watcom/trunk/clib/src/initfile.c deleted file mode 100644 index 9cb706ca7..000000000 --- a/programs/develop/open watcom/trunk/clib/src/initfile.c +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Stream I/O initializer. -* -****************************************************************************/ - - -//#include "dll.h" // needs to be first -#include "variety.h" -#include -#include -#include "liballoc.h" -#include "mf.h" -#include "rtdata.h" -#include "exitwmsg.h" - -#ifdef DLHEAP - -void* _cdecl dlmalloc(size_t); -void _cdecl dlfree(void*); -void _cdecl mf_init(); - -#define malloc dlmalloc -#define free dlfree -#define realloc dlrealloc - -#define lib_malloc dlmalloc -#define lib_free dlfree -#define lib_realloc dlrealloc - -#endif - -void __InitFiles( void ) -{ - __stream_link *link; - FILE *fp; - - fp = _RWD_iob; - - stderr->_flag &= ~(_IONBF | _IOLBF | _IOFBF); - stderr->_flag |= _IONBF; - for( fp = _RWD_iob; fp->_flag != 0; ++fp ) - { - link = lib_malloc( sizeof( __stream_link ) ); - if( link == NULL ) - { - __fatal_runtime_error( - "Not enough memory to allocate file structures\r\n", 1 ); - } - link->stream = fp; - link->next = _RWD_ostream; - _RWD_ostream = link; - fp->_link = link; - fp->_link->_base = NULL; - fp->_link->_tmpfchar = 0; - fp->_link->_orientation = _NOT_ORIENTED; - } - _RWD_cstream = NULL; -} diff --git a/programs/develop/open watcom/trunk/clib/src/ioalloc.c b/programs/develop/open watcom/trunk/clib/src/ioalloc.c deleted file mode 100644 index ebba1213c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/ioalloc.c +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent __ioalloc() implementation. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "liballoc.h" -#include -#include "rtdata.h" -#include "streamio.h" - - -void __ioalloc( FILE *fp ) -{ - __chktty( fp ); /* JBS 28-aug-90 */ - if( fp->_bufsize == 0 ) { - if( fp->_flag & _IOLBF ) { - fp->_bufsize = 134; - } else if( fp->_flag & _IONBF ) { - /* Use small but reasonably sized buffer; otherwise we will end - * up calling into the OS for every character, completely killing - * performance on unbuffered stream output through printf() etc., - * especially in extended DOS because of mode switches. - */ - fp->_bufsize = 64; - } else { - fp->_bufsize = BUFSIZ; - } - } - _FP_BASE(fp) = lib_malloc( fp->_bufsize ); - if( _FP_BASE(fp) == NULL ) { - fp->_flag &= ~(_IONBF | _IOLBF | _IOFBF); - fp->_flag |= _IONBF; /* can't get big buffer */ - _FP_BASE(fp) = (char *)&(fp->_ungotten); - fp->_bufsize = 1; - } else { - fp->_flag |= _BIGBUF; /* got big buffer */ - } - fp->_ptr = _FP_BASE(fp); - fp->_cnt = 0; -} diff --git a/programs/develop/open watcom/trunk/clib/src/iob.c b/programs/develop/open watcom/trunk/clib/src/iob.c deleted file mode 100644 index 9454e345c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/iob.c +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Definition of __iob array. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include "rtdata.h" -#include "rtinit.h" -#include "tmpfname.h" - - -_WCRTLINKD FILE _WCNEAR __iob[_NFILES] = { - { NULL, 0, NULL, _READ, 0, 0, 0 } /* stdin */ - ,{ NULL, 0, NULL, _WRITE, 1, 0, 0 } /* stdout */ - ,{ NULL, 0, NULL, _WRITE, 2, 0, 0 } /* stderr */ -#if defined( __DOS__ ) || defined( __WINDOWS__ ) || defined( __OSI__ ) - ,{ NULL, 0, NULL, _READ|_WRITE, 3, 0, 0 } /* stdaux */ - ,{ NULL, 0, NULL, _WRITE, 4, 0, 0 } /* stdprn */ -#endif -}; - -__stream_link *__ClosedStreams; -__stream_link *__OpenStreams; - -#if !defined( __UNIX__ ) -_WCRTLINKD int _WCNEAR _fmode = O_TEXT; /* default file translation mode */ -#endif - -extern void __InitFiles(); -extern void __full_io_exit(); - -AXI(__InitFiles,INIT_PRIORITY_LIBRARY); -AYI(__full_io_exit,INIT_PRIORITY_LIBRARY); diff --git a/programs/develop/open watcom/trunk/clib/src/iobaddr.c b/programs/develop/open watcom/trunk/clib/src/iobaddr.c deleted file mode 100644 index e3e0de0f1..000000000 --- a/programs/develop/open watcom/trunk/clib/src/iobaddr.c +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Standard stream/file accessor routines. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "rtdata.h" - - -#if !defined( __NETWARE__ ) && !defined( _THIN_LIB ) - -_WCRTLINK FILE *__get_std_stream( unsigned handle ) -{ - if( handle > NUM_STD_STREAMS ) { - return( NULL ); - } else { - return( &_RWD_iob[handle] ); - } -} - -_WCRTLINK FILE *__get_std_file( unsigned handle ) -{ - return( __get_std_stream( handle ) ); -} - -#else - -#include - -#if defined( _NETWARE_LIBC ) - extern FILE **___stdin ( void ); - extern FILE **___stdout( void ); - extern FILE **___stderr( void ); - extern FILE **___cin ( void ); - extern FILE **___cout ( void ); - - _WCRTLINK FILE *__get_std_stream( unsigned handle ) - { - FILE *pFile = NULL; - - switch( handle ) { - case STDIN_FILENO: - pFile = *___stdin(); - break; - case STDOUT_FILENO: - pFile = *___stdout(); - break; - case STDERR_FILENO: - pFile = *___stderr(); - break; - default: - break; - } - return( pFile ); - } -#elif defined( _NETWARE_CLIB ) - extern FILE **__get_stdin ( void ); - extern FILE **__get_stdout( void ); - extern FILE **__get_stderr( void ); - - _WCRTLINK FILE *__get_std_stream( unsigned handle ) - { - FILE *pFile = NULL; - - switch( handle ) { - case STDIN_FILENO: - pFile = *__get_stdin(); - break; - case STDOUT_FILENO: - pFile = *__get_stdout(); - break; - case STDERR_FILENO: - pFile = *__get_stderr(); - break; - default: - break; - } - return( pFile ); - } -#endif - -#endif - - -#if defined( __NETWARE__ ) && !defined( _THIN_LIB ) - -#include - -FILE **__get_stdin( void ) -{ - static FILE *stdin_ptr; - - stdin_ptr = __get_std_stream( STDIN_FILENO ); - return( &stdin_ptr ); -} - -FILE **__get_stdout( void ) -{ - static FILE *stdout_ptr; - - stdout_ptr = __get_std_stream( STDOUT_FILENO ); - return( &stdout_ptr ); -} - -FILE **__get_stderr( void ) -{ - static FILE *stderr_ptr; - - stderr_ptr = __get_std_stream( STDERR_FILENO ); - return( &stderr_ptr ); -} - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/ioexit.c b/programs/develop/open watcom/trunk/clib/src/ioexit.c deleted file mode 100644 index b9542cf8c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/ioexit.c +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: I/O streams shutdown. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "rtdata.h" - -extern void __purgefp(void); -extern int __shutdown_stream( FILE *fp, int ); - -static int docloseall( unsigned dont_close ) -{ - FILE *fp; - int number_of_files_closed; - __stream_link *link; - __stream_link *next; - FILE *bottom; - FILE *standards; - int close_handle; - - bottom = &_RWD_iob[dont_close]; - standards = &_RWD_iob[NUM_STD_STREAMS]; - number_of_files_closed = 0; - for( link = _RWD_ostream; link != NULL; link = next ) { - next = link->next; - fp = link->stream; - close_handle = 1; - if ((fp->_flag & _DYNAMIC) || (fp->_flag & _TMPFIL)) - { - __shutdown_stream( fp, close_handle ); - ++number_of_files_closed; - } - else if( fp >= bottom ) { -#ifndef __NETWARE__ - /* close the file, but leave the handle open */ - if( fp < standards ) { - close_handle = 0; - } -#endif - __shutdown_stream( fp, close_handle ); - ++number_of_files_closed; - } - } - return( number_of_files_closed ); -} - -_WCRTLINK int fcloseall( void ) -{ - return( docloseall( NUM_STD_STREAMS ) ); -} - -void __full_io_exit( void ) -{ - docloseall( 0 ); - __purgefp(); -} diff --git a/programs/develop/open watcom/trunk/clib/src/iomode.c b/programs/develop/open watcom/trunk/clib/src/iomode.c deleted file mode 100644 index 73bbd88a3..000000000 --- a/programs/develop/open watcom/trunk/clib/src/iomode.c +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: io_mode handle information array manipulation -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include -#include "rtdata.h" -//#include "liballoc.h" -#include "fileacc.h" -#include "rtinit.h" -#include "seterrno.h" -#include "iomode.h" - -unsigned __NFiles = _NFILES; /* maximum # of files we can open */ - -#if defined(__NETWARE__) -#error NO IO MODE MANAGER UNDER NETWARE -#endif - -#if !defined(__UNIX__) - -unsigned _HUGEDATA __init_mode[_NFILES] = { /* file mode information (flags) */ - _READ, /* stdin */ - _WRITE, /* stdout */ - _WRITE, /* stderr */ - _READ|_WRITE, /* stdaux */ - _WRITE /* stdprn */ -}; - -unsigned *__io_mode = __init_mode; /* initially points to static array */ - -unsigned __GetIOMode( int handle ) -{ - if( handle >= __NFiles ) - { - return( 0 ); - } - return( __io_mode[handle] ); -} - -void __SetIOMode_nogrow( int handle, unsigned value ) -{ - if( handle < __NFiles ) - { - __io_mode[handle] = value; /* we're closing it; smite _INITIALIZED */ - } -} - -#endif - diff --git a/programs/develop/open watcom/trunk/clib/src/iomode.h b/programs/develop/open watcom/trunk/clib/src/iomode.h deleted file mode 100644 index 1e54d3867..000000000 --- a/programs/develop/open watcom/trunk/clib/src/iomode.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: prototypes and definitions for iomode array manipulation -* -****************************************************************************/ - - -#ifndef _IOMODE_H_INCLUDED -#define _IOMODE_H_INCLUDED - -#if defined(__NT__) - -#include - -#define NULL_HANDLE (HANDLE)-1 -#define DUMMY_HANDLE (HANDLE)-2 - -extern unsigned __NHandles; - -extern void __initPOSIXHandles( void ); -extern unsigned __growPOSIXHandles( unsigned num ); -extern int __allocPOSIXHandle( HANDLE hdl ); -extern void __freePOSIXHandle( int hid ); -extern HANDLE __getOSHandle( int hid ); -extern int __setOSHandle( unsigned hid, HANDLE hdl ); -extern HANDLE __NTGetFakeHandle( void ); - -extern HANDLE *__OSHandles; - -#define __getOSHandle( hid ) __OSHandles[ hid ] -#define NT_STDIN_FILENO (__getOSHandle( STDIN_FILENO )) -#define NT_STDOUT_FILENO (__getOSHandle( STDOUT_FILENO )) -#define NT_STDERR_FILENO (__getOSHandle( STDERR_FILENO )) - -#endif - -#if !defined(__NETWARE__) - -extern unsigned __GetIOMode( int __handle ); -extern int __SetIOMode( int __handle, unsigned __value ); -extern void __SetIOMode_nogrow( int __handle, unsigned __value ); -extern void __ChkTTYIOMode( int __handle ); - -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/iomodtty.c b/programs/develop/open watcom/trunk/clib/src/iomodtty.c deleted file mode 100644 index 9543f778d..000000000 --- a/programs/develop/open watcom/trunk/clib/src/iomodtty.c +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: check tty for standard handles in the iomode array -* -****************************************************************************/ - -#include "variety.h" -#include -#include "rtdata.h" -//#include "liballoc.h" -#include "fileacc.h" -#include "handleio.h" -#include "iomode.h" - -#define _INITIALIZED _DYNAMIC - -void __ChkTTYIOMode( int handle ) -{ - if( handle < NUM_STD_STREAMS && !(__io_mode[handle] & _INITIALIZED) ) - { - __io_mode[handle] |= _INITIALIZED; - if( isatty( handle ) ) - { - __io_mode[handle] |= _ISTTY; - } - } -} - -// For F77 to call - -unsigned __IOMode( int handle ) -{ - __ChkTTYIOMode( handle ); - return( __GetIOMode( handle ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/isattwnt.c b/programs/develop/open watcom/trunk/clib/src/isattwnt.c deleted file mode 100644 index fb757bee8..000000000 --- a/programs/develop/open watcom/trunk/clib/src/isattwnt.c +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of isatty() for Win32. -* -****************************************************************************/ - - -#include "variety.h" -#include -//#include -//#include "defwin.h" -#include "iomode.h" -#include "fileacc.h" - -/* - DWORD GetFileType( - HANDLE hFile // handle to file - ); - Return value can be: - FILE_TYPE_CHAR The specified file is a character file, - typically an LPT device or a console - */ - -_WCRTLINK int isatty( int hid ) -{ -// if( GetFileType( __getOSHandle( hid ) ) == FILE_TYPE_CHAR ) { -// return( 1 ); -// } - return( 0 ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/istable.c b/programs/develop/open watcom/trunk/clib/src/istable.c deleted file mode 100644 index ecceb54ef..000000000 --- a/programs/develop/open watcom/trunk/clib/src/istable.c +++ /dev/null @@ -1,295 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Character classification table. -* -****************************************************************************/ - - -#include "variety.h" -#include - -_WCRTLINKD const char _HUGEDATA _IsTable[257] = { - -#define ___0__ 0 - -/* -1,EOF */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 00,NUL */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 01,SOH */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 02,STX */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 03,ETX */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 04,EOT */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 05,ENQ */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 06,NAK */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 07,BEL */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 08,BS */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 09,TAB */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL, -/* 0A,LF */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL, -/* 0B,VT */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL, -/* 0C,FF */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL, -/* 0D,CR */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL, -/* 0E,SI */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 0F,SO */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 10, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 11, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 12, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 13, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 14, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 15, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 16, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 17, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 18, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 19, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 1A, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 1B, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 1C, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 1D, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 1E, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 1F, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 20, */ ___0__|___0__|___0__|___0__|_PRINT|___0__|_SPACE|___0__, -/* 21, ! */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 22, " */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 23, # */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 24, $ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 25, % */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 26, & */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 27, ' */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 28, ( */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 29, ) */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 2A, * */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 2B, + */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 2C, , */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 2D, - */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 2E, . */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 2F, / */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 30, 0 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 31, 1 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 32, 2 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 33, 3 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 34, 4 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 35, 5 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 36, 6 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 37, 7 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 38, 8 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 39, 9 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 3A, : */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 3B, ; */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 3C, < */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 3D, = */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 3E, > */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 3F, ? */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 40, @ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 41, A */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 42, B */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 43, C */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 44, D */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 45, E */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 46, F */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 47, G */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 48, H */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 49, I */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 4A, J */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 4B, K */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 4C, L */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 4D, M */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 4E, N */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 4F, O */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 50, P */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 51, Q */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 52, R */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 53, S */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 54, T */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 55, U */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 56, V */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 57, W */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 58, X */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 59, Y */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 5A, Z */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 5B, [ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 5C, \ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 5D, ] */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 5E, ^ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 5F, _ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 60, ` */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 61, a */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 62, b */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 63, c */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 64, d */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 65, e */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 66, f */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__, -/* 67, g */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 68, h */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 69, i */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 6A, j */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 6B, k */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 6C, l */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 6D, m */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 6E, n */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 6F, o */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 70, p */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 71, q */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 72, r */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 73, s */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 74, t */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 75, u */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 76, v */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 77, w */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 78, x */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 79, y */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 7A, z */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__, -/* 7B, { */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 7C, | */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 7D, } */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 7E, ~ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__, -/* 7F,DEL */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL, -/* 80, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 81, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 82, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 83, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 84, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 85, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 86, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 87, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 88, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 89, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 8A, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 8B, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 8C, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 8D, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 8E, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 8F, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 90, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 91, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 92, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 93, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 94, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 95, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 96, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 97, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 98, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 99, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 9A, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 9B, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 9C, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 9D, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 9E, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* 9F, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* A9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* AA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* AB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* AC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* AD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* AE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* AF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* B9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* BA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* BB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* BC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* BD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* BE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* BF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* C9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* CA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* CB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* CC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* CD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* CE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* CF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* D9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* DA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* DB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* DC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* DD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* DE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* DF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* E9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* EA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* EB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* EC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* ED, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* EE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* EF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* F9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* FA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* FB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* FC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* FD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* FE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__, -/* FF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__ }; diff --git a/programs/develop/open watcom/trunk/clib/src/kolibri.h b/programs/develop/open watcom/trunk/clib/src/kolibri.h deleted file mode 100644 index d888282c2..000000000 --- a/programs/develop/open watcom/trunk/clib/src/kolibri.h +++ /dev/null @@ -1,105 +0,0 @@ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -#define FONT0 0x00000000 -#define FONT1 0x10000000 - -#define BT_NORMAL 0x00000000 -#define BT_NOFRAME 0x20000000 -#define BT_HIDE 0x40000000 -#define BT_DEL 0x80000000 - -#define EV_REDRAW 1 -#define EV_KEY 2 -#define EV_BUTTON 3 - -#define REL_SCREEN 0 -#define REL_WINDOW 1 - -#define FILE_NOT_FOUND 5 -#define FILE_EOF 6 - - -typedef unsigned int DWORD; -typedef unsigned short int WORD; - -typedef struct -{ DWORD pci_cmd; - DWORD irq; - DWORD glob_cntrl; - DWORD glob_sta; - DWORD codec_io_base; - DWORD ctrl_io_base; - DWORD codec_mem_base; - DWORD ctrl_mem_base; - DWORD codec_id; -} CTRL_INFO; - -typedef struct -{ DWORD cmd; - DWORD offset; - DWORD r1; - DWORD count; - DWORD buff; - char r2; - char *name; -} FILEIO; - -typedef struct -{ DWORD attr; - DWORD flags; - DWORD cr_time; - DWORD cr_date; - DWORD acc_time; - DWORD acc_date; - DWORD mod_time; - DWORD mod_date; - DWORD size; - DWORD size_high; -} FILEINFO; - -void _stdcall InitHeap(int heap_size); -void* _stdcall UserAlloc(int size); -int _stdcall UserFree(void* p); - -void _stdcall GetNotify(void *event); - -void _stdcall CreateThread(void *fn, char *p_stack); - -DWORD _stdcall GetMousePos(DWORD rel_type); - -void _stdcall debug_out_hex(DWORD val); -void debug_out_str(char* str); - -int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo); -int _stdcall read_file (const char *name,char*buff,DWORD offset, DWORD count,DWORD *reads); -int _stdcall write_file(const char *name,char*buff,int offset,int count,int *writes); - -//void exit(); -int _stdcall get_key(int *key); -int _stdcall remap_key(int key); - -int _cdecl get_button_id(); - -void delay(int val); -int wait_for_event(int time); -int wait_for_event_infinite(); -void BeginDraw(void); -void EndDraw(void); - -void _stdcall GetScreenSize(int *x, int*y); -void _stdcall DrawWindow(int x,int y, int sx, int sy,int workcolor,int style, - int captioncolor,int windowtype,int bordercolor); -void _stdcall debug_out(int ch); -void _stdcall make_button(int x, int y, int xsize, int ysize, int id, int color); -void _stdcall draw_bar(int x, int y, int xsize, int ysize, int color); -void _stdcall write_text(int x,int y,int color,char* text,int len); - -#ifdef __cplusplus -extern "C" -} -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/langenv.h b/programs/develop/open watcom/trunk/clib/src/langenv.h deleted file mode 100644 index fb4a7a7bf..000000000 --- a/programs/develop/open watcom/trunk/clib/src/langenv.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Establish common stuff for a target environment for -* language-related processors. -* -****************************************************************************/ - - -#ifndef __LANGENV_H__ -#define __LANGENV_H__ - -// This file uses __TGT_SYS to figure out the required target. -// -// langenvd.h contains the possible values. -// -// __TGT_SYS_X86 is the default -// - -#include "langenvd.h" - -#ifndef __TGT_SYS - #define __TGT_SYS __TGT_SYS_X86 -#endif - -#if __TGT_SYS == __TGT_SYS_X86 - - #define TS_SEG_CODE "_TEXT" - #define TS_SEG_CONST "CONST" - #define TS_SEG_CONST2 "CONST2" - #define TS_SEG_DATA "_DATA" - #define TS_SEG_TIB "TIB" - #define TS_SEG_TI "TI" - #define TS_SEG_TIE "TIE" - #define TS_SEG_XIB "XIB" - #define TS_SEG_XI "XI" - #define TS_SEG_XIE "XIE" - #define TS_SEG_YIB "YIB" - #define TS_SEG_YI "YI" - #define TS_SEG_YIE "YIE" - #define TS_SEG_YC "YC" - #define TS_SEG_BSS "_BSS" - #define TS_SEG_STACK "STACK" - #define TS_SEG_DEPENDS "not used" - #define TS_SEG_TLSB ".tls" - #define TS_SEG_TLS ".tls$" - #define TS_SEG_TLSE ".tls$ZZZ" - #define TS_SEG_TLS_CLASS "TLS" - - #define TS_MAX_OBJNAME 256 - #define TS_DATA_MANGLE "_*" - #define TS_CODE_MANGLE "*_" - -#elif __TGT_SYS == __TGT_SYS_AXP_NT || __TGT_SYS == __TGT_SYS_PPC_NT || __TGT_SYS == __TGT_SYS_MIPS - - #define TS_SEG_CODE ".text" - #define TS_SEG_CONST ".const" - #define TS_SEG_CONST2 ".const2" - #define TS_SEG_DATA ".data" - #define TS_SEG_TIB ".rtl$tib" - #define TS_SEG_TI ".rtl$tid" - #define TS_SEG_TIE ".rtl$tie" - #define TS_SEG_XIB ".rtl$xib" - #define TS_SEG_XI ".rtl$xid" - #define TS_SEG_XIE ".rtl$xie" - #define TS_SEG_YIB ".rtl$yib" - #define TS_SEG_YI ".rtl$yid" - #define TS_SEG_YIE ".rtl$yie" - #define TS_SEG_YC ".rtl$yc" - #define TS_SEG_BSS ".bss" - #define TS_SEG_STACK ".stack" - #define TS_SEG_DEPENDS ".depend" - #define TS_SEG_TLSB ".tls" - #define TS_SEG_TLS ".tls$" - #define TS_SEG_TLSE ".tls$ZZZ" - #define TS_SEG_TLS_CLASS NULL - - #define TS_MAX_OBJNAME 1024 - #define TS_DATA_MANGLE "*" - #define TS_CODE_MANGLE "*" - -#else - - #error Invalid target system - -#endif - -#undef __TGT_SYS - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/langenvd.h b/programs/develop/open watcom/trunk/clib/src/langenvd.h deleted file mode 100644 index b9d2ebcea..000000000 --- a/programs/develop/open watcom/trunk/clib/src/langenvd.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Define values for language targets. -* -****************************************************************************/ - - -#ifndef __LANGENVD_H__ -#define __LANGENVD_H__ - -#define __TGT_SYS_X86 0 // All x86 systems to date -#define __TGT_SYS_AXP_NT 1 // Win32 on DEC Alpha AXP -#define __TGT_SYS_PPC_NT 2 // Win32 on IBM/Motorola PowerPC -#define __TGT_SYS_MIPS 3 // MIPS RISC Architecture - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/liballoc.h b/programs/develop/open watcom/trunk/clib/src/liballoc.h deleted file mode 100644 index ed192ec39..000000000 --- a/programs/develop/open watcom/trunk/clib/src/liballoc.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: These are macros that define the 'real' functions that -* the library memory allocators use. -* -****************************************************************************/ - - -#ifndef _LIBALLOC_H_INCLUDED -#define _LIBALLOC_H_INCLUDED -#include "variety.h" -#include - -#ifdef __NETWARE__ - - /* - // NetWare uses Alloc and Free because the heap will not have - // been initialised at _Prelude time... - */ - - #define lib_malloc( x ) _NW_malloc( x ) - #define lib_free( x ) _NW_free( x ) - #if defined (_NETWARE_CLIB) - #define lib_realloc( x, y, z) _NW_realloc( x, y, z ) - #else - #define lib_realloc( x, y) _NW_realloc( x, y) - #endif - #define lib_calloc( x, y ) _NW_calloc( x, y ) - - extern void *_NW_calloc( size_t __n,size_t __size ); - extern void *_NW_malloc( size_t ); - #if defined (_NETWARE_CLIB) - extern void *_NW_realloc( void *ptr,size_t size,size_t old); - #else - extern void *_NW_realloc( void *ptr,size_t size); - #endif - extern void _NW_free( void *ptr ); -#else - #define lib_malloc( x ) malloc( x ) - #define lib_free( x ) free( x ) - #define lib_realloc( x, y ) realloc( x, y ) - - #define lib_nmalloc( x ) _nmalloc( x ) - #define lib_nfree( x ) _nfree( x ) - #define lib_nrealloc( x, y ) _nrealloc( x, y ) - - #define lib_fmalloc( x ) _fmalloc( x ) - #define lib_ffree( x ) _ffree( x ) - #define lib_frealloc( x, y ) _frealloc( x, y ) - - #define lib_calloc( x, y ) calloc( x, y ) -#endif - -// these are used by the C++ library -// they are real routines so that the C++ library -// remains platform independent. -#ifdef __cplusplus -extern "C" { -#endif -_WCRTLINK extern void _plib_free( void *ptr ); -_WCRTLINK extern void *_plib_malloc( size_t size ); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/lseek.c b/programs/develop/open watcom/trunk/clib/src/lseek.c deleted file mode 100644 index 3f0813d73..000000000 --- a/programs/develop/open watcom/trunk/clib/src/lseek.c +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: lseek wrapper with positive -> extend file check -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#ifdef __NT__ -#include -#endif -#include "iomode.h" -#include "rtcheck.h" -#include "seterrno.h" -#include "lseek.h" - -_WCRTLINK long lseek( int handle, long offset, int origin ) -{ - unsigned iomode_flags; - - __handle_check( handle, -1 ); - - /*** Set the _FILEEXT iomode_flags bit if positive offset ***/ - iomode_flags = __GetIOMode( handle ); - - if( offset > 0 && !(iomode_flags & _APPEND) ) - __SetIOMode( handle, iomode_flags | _FILEEXT ); - return( __lseek( handle, offset, origin ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/lseek.h b/programs/develop/open watcom/trunk/clib/src/lseek.h deleted file mode 100644 index b7f53b7f0..000000000 --- a/programs/develop/open watcom/trunk/clib/src/lseek.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: basic __lseek (without file extend) definition/prototype -* -****************************************************************************/ - - -#ifndef _LSEEK_H_INCLUDED -#define _LSEEK_H_INCLUDED - -#if defined(__DOS__) || defined(__OS2__) || defined(__NT__) || defined(__WINDOWS__) -_WCRTLINK extern long __lseek( int handle, long offset, int origin ); -#else -#define __lseek lseek -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/lseekwnt.c b/programs/develop/open watcom/trunk/clib/src/lseekwnt.c deleted file mode 100644 index 0d27479be..000000000 --- a/programs/develop/open watcom/trunk/clib/src/lseekwnt.c +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License.* -* ======================================================================== -* -* Description: low level lseek without file extend for Windows NT -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include "iomode.h" -#include "rtcheck.h" -#include "seterrno.h" -#include "lseek.h" -#include "handleio.h" - -/* - DWORD SetFilePointer( - HANDLE hFile, // handle to file - LONG lDistanceToMove, // bytes to move pointer - PLONG lpDistanceToMoveHigh, // bytes to move pointer - DWORD dwMoveMethod // starting point - ); - */ - -#ifndef INVALID_SET_FILE_POINTER -#define INVALID_SET_FILE_POINTER 0xFFFFFFFF -#endif - -typedef struct -{ - char *name; - unsigned int offset; -}__file_handle; - -typedef struct -{ DWORD attr; - DWORD flags; - DWORD cr_time; - DWORD cr_date; - DWORD acc_time; - DWORD acc_date; - DWORD mod_time; - DWORD mod_date; - DWORD size; - DWORD size_high; -} FILEINFO; - -int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo); - -_WCRTLINK long __lseek( int hid, long offset, int origin ) -{ - __file_handle *fh; - long rc; - - __handle_check( hid, -1 ); - fh = (__file_handle*) __getOSHandle( hid ); - - switch(origin) - { - case SEEK_SET: - rc = offset; - break; - case SEEK_CUR: - rc = fh->offset + offset; - break; - case SEEK_END: - { - FILEINFO info; - get_fileinfo(fh->name,&info); - rc = offset + info.size; - break; - } - default: - return -1; - }; - - fh->offset = rc; - - return( rc ); -} - diff --git a/programs/develop/open watcom/trunk/clib/src/mbchar.h b/programs/develop/open watcom/trunk/clib/src/mbchar.h deleted file mode 100644 index 403db7f28..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mbchar.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#if !defined(MBCHARdotH) -#define MBCHARdotH - - -/* Prototype for initialization function */ -extern int __mbinit( int codepage ); - -#define _MBINIT_CP_ANSI (-1) -#define _MBINIT_CP_OEM (-2) -#define _MBINIT_CP_SBCS (-3) -#define _MBINIT_CP_932 (-4) - - -/* Current code page */ -#if !defined(__UNIX__) - extern unsigned int __MBCodePage; - #define _MB_CODE_PAGE_DEFINED -#endif - - -/* See if a packed DBCS char has no lead byte, i.e. is a skinny char */ -#define SINGLE_BYTE_CHAR(__c) ( !( (__c)&0xFF00 ) ) - - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/mbinit.c b/programs/develop/open watcom/trunk/clib/src/mbinit.c deleted file mode 100644 index 62363989f..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mbinit.c +++ /dev/null @@ -1,306 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" - -#include -#include -#include "mbchar.h" - - -unsigned int __MBCodePage = 0; /* default code page */ - -static void set_dbcs_table( int low, int high ) -{ - memset( __MBCSIsTable + low + 1, _MB_LEAD, high - low + 1 ); -} - -static void clear_dbcs_table( void ) -{ - __IsDBCS = 0; /* SBCS for now */ - __MBCodePage = 0; - memset( __MBCSIsTable, 0, 257 ); -} - -/**** -***** Initialize a multi-byte character set. Returns 0 on success. -****/ - -int __mbinit( int codepage ) -{ - - /*** Handle values from _setmbcp ***/ - if( codepage == _MBINIT_CP_ANSI ) - { - codepage = 0; - } - else - if( codepage == _MBINIT_CP_OEM ) - { - codepage = 0; - } - else - if( codepage == _MBINIT_CP_SBCS ) - { - clear_dbcs_table(); - return( 0 ); - } - else - if( codepage == _MBINIT_CP_932 ) - { - clear_dbcs_table(); - set_dbcs_table( 0x81, 0x9F ); - set_dbcs_table( 0xE0, 0xFC ); - __IsDBCS = 1; - __MBCodePage = 932; - return( 0 ); - } - return( 0 ); /* return success code */ -} - - - -/**** -***** Query DOS to find the valid lead byte ranges. -****/ - -#if defined(__DOS__) && !defined(__OSI__) -#ifndef __386__ - -// for some unknown reason NT DPMI returns for DOS service 6300h -// Carry=0, odd SI value and DS stay unchanged -// this case is also tested as wrong int 21h result -#if 1 -#pragma aux dos_get_dbcs_lead_table = \ - "push ds" \ - "xor ax,ax" \ - "mov ds,ax" \ - "mov ah,63h" /* get DBCS vector table */ \ - "int 21h" \ - "mov di,ds" \ - "jnc label1" \ - "xor di,di" \ - "label1:" \ - "test di,di" \ - "jnz exit1" \ - "mov si,di" \ - "exit1:" \ - "pop ds" \ - value [di si] \ - modify [ax bx cx dx si di es]; -#else -unsigned short _WCFAR *dos_get_dbcs_lead_table( void ) -/****************************************************/ -{ - union REGS regs; - struct SREGS sregs; - - regs.w.ax = 0x6300; /* get lead byte table code */ - sregs.ds = 0; - sregs.es = 0; - intdosx( ®s, ®s, &sregs ); /* call DOS */ - if( regs.w.cflag || ( sregs.ds == 0 )) /* ensure function succeeded */ - return( NULL ); - return( MK_FP( sregs.ds, regs.w.si ) ); /* return pointer to table */ -} -#endif - -#if 0 -unsigned short dos_get_code_page( void ) -/**************************************/ -{ - union REGS regs; - struct SREGS sregs; - unsigned char buf[7]; - - regs.w.ax = 0x6501; /* get international info */ - regs.w.bx = 0xFFFF; /* global code page */ - regs.w.cx = 7; /* buffer size */ - regs.w.dx = 0xFFFF; /* current country */ - regs.w.di = FP_OFF( (void __far*)buf ); /* buffer offset */ - sregs.es = FP_SEG( (void __far*)buf ); /* buffer segment */ - sregs.ds = 0; /* in protected mode (dos16m) DS must be initialized */ - intdosx( ®s, ®s, &sregs ); /* call DOS */ - if( regs.w.cflag ) return( 0 ); /* ensure function succeeded */ - return( * (unsigned short*)(buf+5) ); /* return code page */ -} -#else -#pragma aux dos_get_code_page = \ - "push ds" \ - "push bp" \ - "mov bp,sp" \ - "sub sp,8" \ - "xor ax,ax" \ - "mov ds,ax" \ - "mov ax,6501h" /* get international info */ \ - "mov bx,0ffffh" /* global code page */ \ - "mov cx,0007h" /* buffer size */ \ - "mov dx,0ffffh" /* current country */ \ - "lea di,[bp-8]" /* buffer offset */ \ - "push ss" \ - "pop es" /* buffer segment */ \ - "int 21h" /* call DOS */ \ - "mov ax,[bp-8+5]" /* code page */ \ - "jnc NoError" \ - "xor ax,ax" \ - "NoError:" \ - "mov sp,bp" \ - "pop bp" \ - "pop ds" \ - value [ax] \ - modify [ax bx cx dx di es]; -#endif - -#else - - -#pragma pack(__push,1); -typedef struct { - unsigned short int_num; - unsigned short real_ds; - unsigned short real_es; - unsigned short real_fs; - unsigned short real_gs; - unsigned long real_eax; - unsigned long real_edx; -} PHARLAP_block; -#pragma pack(__pop); - -unsigned short _WCFAR *dos_get_dbcs_lead_table( void ) -/****************************************************/ -{ - union REGPACK regs; - - if( _IsPharLap() ) { - PHARLAP_block pblock; - - memset( &pblock, 0, sizeof( pblock ) ); - memset( ®s, 0, sizeof( regs ) ); - pblock.real_eax = 0x6300; /* get DBCS vector table */ - pblock.int_num = 0x21; /* DOS call */ - regs.x.eax = 0x2511; /* issue real-mode interrupt */ - regs.x.edx = FP_OFF( &pblock ); /* DS:EDX -> parameter block */ - regs.w.ds = FP_SEG( &pblock ); - intr( 0x21, ®s ); - if( pblock.real_ds != 0xFFFF ) { /* weird OS/2 value */ - return( MK_FP( _ExtenderRealModeSelector, - (((unsigned)pblock.real_ds)<<4) + regs.w.si ) ); - } - } else if( _IsRational() ) { - rm_call_struct dblock; - - memset( &dblock, 0, sizeof( dblock ) ); - dblock.eax = 0x6300; /* get DBCS vector table */ - DPMISimulateRealModeInterrupt( 0x21, 0, 0, &dblock ); - if( (dblock.flags & 1) == 0 ) { - return( MK_FP( _ExtenderRealModeSelector, - (((unsigned)dblock.ds)<<4) + dblock.esi ) ); - } - } - return( NULL ); -} - -unsigned short dos_get_code_page( void ) -/**************************************/ -{ - union REGPACK regs; - unsigned short __far * temp; - unsigned short real_seg; - unsigned short codepage = 0; - - - /*** Get the code page ***/ - if( _IsPharLap() ) { - union REGS r; - PHARLAP_block pblock; - - /*** Alloc DOS Memory under Phar Lap ***/ - memset( &r, 0, sizeof( r ) ); - r.x.ebx = 1; - r.x.eax = 0x25c0; - intdos( &r, &r ); - real_seg = r.w.ax; - - memset( &pblock, 0, sizeof( pblock ) ); - memset( ®s, 0, sizeof( regs ) ); - pblock.real_eax = 0x6501; /* get international info */ - pblock.real_edx = 0xFFFF; /* current country */ - pblock.real_es = real_seg; /* buffer segment */ - regs.x.ebx = 0xFFFF; /* global code page */ - regs.x.ecx = 7; /* buffer size */ - regs.x.edi = 0; /* buffer offset */ - pblock.int_num = 0x21; /* DOS call */ - regs.x.eax = 0x2511; /* issue real-mode interrupt */ - regs.x.edx = FP_OFF( &pblock ); /* DS:EDX -> parameter block */ - regs.w.ds = FP_SEG( &pblock ); - intr( 0x21, ®s ); - if( pblock.real_ds != 0xFFFF ) { /* weird OS/2 value */ - temp = MK_FP( _ExtenderRealModeSelector, (real_seg<<4) + 5 ); - codepage = *temp; - } - - /*** Free DOS Memory under Phar Lap ***/ - r.x.ecx = real_seg; - r.x.eax = 0x25c1; - intdos( &r, &r ); - } else if( _IsRational() ) { - unsigned long dpmi_rc; - unsigned short selector; - rm_call_struct dblock; - - /*** Allocate some DOS memory with DPMI ***/ - dpmi_rc = DPMIAllocateDOSMemoryBlock( 1 ); /* one paragraph is enough */ - real_seg = (unsigned short) dpmi_rc; - selector = (unsigned short) (dpmi_rc>>16); - - memset( &dblock, 0, sizeof( dblock ) ); - dblock.eax = 0x6501; /* get international info */ - dblock.ebx = 0xFFFF; /* global code page */ - dblock.ecx = 7; /* buffer size */ - dblock.edx = 0xFFFF; /* current country */ - dblock.edi = 0; /* buffer offset */ - dblock.es = real_seg; /* buffer segment */ - DPMISimulateRealModeInterrupt( 0x21, 0, 0, &dblock ); - if( (dblock.flags & 1) == 0 ) { - temp = MK_FP( _ExtenderRealModeSelector, (real_seg<<4) + 5 ); - codepage = *temp; - } - /*** Free DOS memory with DPMI ***/ - DPMIFreeDOSMemoryBlock( selector ); - } - - return( codepage ); -} - - -#endif -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/mbisdbcs.c b/programs/develop/open watcom/trunk/clib/src/mbisdbcs.c deleted file mode 100644 index a452dc4af..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mbisdbcs.c +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "rtinit.h" - -_WCRTLINKD int __IsDBCS; diff --git a/programs/develop/open watcom/trunk/clib/src/mbislead.c b/programs/develop/open watcom/trunk/clib/src/mbislead.c deleted file mode 100644 index dd6e62963..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mbislead.c +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "mbchar.h" -#include "rtinit.h" - -_WCRTLINKD unsigned char __MBCSIsTable[257]; - -/** - * Determine whether or not the specified byte is a lead byte. - */ - -_WCRTLINK int (_ismbblead)( const unsigned int ch ) -{ - return( __MBCSIsTable[ch+1] & _MB_LEAD ); -} - -/** - * If this module is linked in, the startup code will call this function, - * which will initialize the default multibyte code page. - */ - -static void __mbInitOnStartup( void ) -{ - __mbinit( 0 ); -} - -AXI( __mbInitOnStartup, INIT_PRIORITY_LIBRARY ) diff --git a/programs/develop/open watcom/trunk/clib/src/mbtowc.c b/programs/develop/open watcom/trunk/clib/src/mbtowc.c deleted file mode 100644 index 8b097d327..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mbtowc.c +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "farfunc.h" - - - -/**** -***** Convert a multibyte character to a wide character. -****/ - -_WCRTLINK int _NEARFAR(mbtowc,_fmbtowc)( wchar_t _FFAR *pwc, const char _FFAR *ch, size_t n ) -{ - - /*** Catch special cases ***/ - if( ch == NULL ) return( 0 ); - if( n == 0 ) return( -1 ); - if( *ch == '\0' ) { - if( pwc != NULL ) *pwc = L'\0'; - return( 0 ); - } - if( _ismbblead( ch[0] ) && ch[1] == '\0' ) return( -1 ); /* invalid */ - - /*** Convert the character ***/ - if( _ismbblead(*ch) && n>=2 ) { /* lead byte present? */ - if( pwc != NULL ) { - *pwc = (((wchar_t)ch[0])<<8) | /* convert to lead:trail */ - (wchar_t)ch[1]; - } - return( 2 ); /* return char size */ - } else if( !_ismbblead(*ch) ) { - if( pwc != NULL ) { - *pwc = (wchar_t)ch[0]; /* convert to 00:byte */ - } - return( 1 ); /* return char size */ - } else { - return( -1 ); /* n==1, but char 2 bytes */ - } -} diff --git a/programs/develop/open watcom/trunk/clib/src/mdef.inc b/programs/develop/open watcom/trunk/clib/src/mdef.inc deleted file mode 100644 index ddd5ecf64..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mdef.inc +++ /dev/null @@ -1,358 +0,0 @@ -;***************************************************************************** -;* -;* Open Watcom Project -;* -;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -;* -;* ======================================================================== -;* -;* This file contains Original Code and/or Modifications of Original -;* Code as defined in and that are subject to the Sybase Open Watcom -;* Public License version 1.0 (the 'License'). You may not use this file -;* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -;* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -;* provided with the Original Code and Modifications, and is also -;* available at www.sybase.com/developer/opensource. -;* -;* The Original Code and all software distributed under the License are -;* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -;* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -;* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -;* NON-INFRINGEMENT. Please see the License for the specific language -;* governing rights and limitations under the License. -;* -;* ======================================================================== -;* -;* Description: Memory model setup for interfacing with C code. -;* -;***************************************************************************** - - -_SMALL_CODE = 00h -_BIG_CODE = 01h -_SMALL_DATA = 00h -_BIG_DATA = 02h -_HUGE_DATA = 04h -_LONG_INTS = 08h - -_USE_32_SEGS = 10h -_386 = 10h ; from old clib - -_DS_PEGGED = 20h ; from old clib (used for Windows) -_TINY = 40h ; from old clib (formerly 10h) - -_FLAT = ( _SMALL_CODE or _SMALL_DATA or _USE_32_SEGS ) -_SMALL = ( _SMALL_CODE or _SMALL_DATA ) -_COMPACT = ( _SMALL_CODE or _BIG_DATA ) -_MEDIUM = ( _BIG_CODE or _SMALL_DATA ) -_LARGE = ( _BIG_CODE or _BIG_DATA ) -_HUGE = ( _BIG_CODE or _HUGE_DATA ) - -_EMULATION = 00h -_8087 = 01h - -ifdef __WASM__ - ifdef __FLAT__ - _MODEL = _FLAT - endif - ifdef __SMALL__ - _MODEL = _SMALL - endif - ifdef __COMPACT__ - _MODEL = _COMPACT - endif - ifdef __MEDIUM__ - _MODEL = _MEDIUM - endif - ifdef __LARGE__ - _MODEL = _LARGE - endif - ifdef __HUGE__ - _MODEL = _HUGE - endif - ifdef __386__ - _MODEL = ( _MODEL or _USE_32_SEGS ) - endif - ifdef __WINDOWS__ - if _MODEL and (_BIG_DATA or _HUGE_DATA) - _MODEL = ( _MODEL or _DS_PEGGED ) - endif - endif - ifdef __FPC__ - _MATH = _EMULATION - endif - ifdef __FPI__ - _MATH = _8087 - endif - ifdef __FPI87__ - _MATH = _8087 - endif -else -include .\model.inc ; defines _MODEL, _MATH symbols -endif - -if _MODEL and _BIG_CODE - -modstart macro modname,alignment -ifdef NDEBUG - name modname -endif - ifb -_TEXT segment word public 'CODE' - else -_TEXT segment alignment public 'CODE' - endif - assume cs:_TEXT - endm - -calli macro regname - call dword ptr [regname] - endm - -codeptr macro p1,p2 - ifb - extrn p1 : dword - else - extrn "&p1",p2 : dword - endif - endm - -docall macro dest - call far ptr dest - endm - -dojmp macro dest - jmp far ptr dest - endm - -defp macro dsym,exp - dsym proc far exp - endm - -defpe macro dsym - ifdef _EXPORT - dsym proc far export - else - dsym proc far - endif - endm - -defn macro dsym - dsym proc near - endm - -endproc macro dsym - dsym endp - endm - -epilog macro - if _MODEL and _USE_32_SEGS - pop EBP - dec EBP - mov ESP,EBP - else - pop BP - dec BP - endif - endm - -prolog macro - if _MODEL and _USE_32_SEGS - inc EBP - push EBP - mov EBP,ESP - else - inc BP - push BP - mov BP,SP - endif - endm - -xdefp macro p1,p2 - ifb - public p1 - else - public "&p1",p2 - endif - endm - -xref macro p1,p2 - ifb - extrn `p1` : far - else - extrn "&p1",`p2` : far - endif - endm - -lcall macro dest - push cs - call near ptr dest - endm - -else - -modstart macro modname,alignment -ifdef NDEBUG - name modname -endif - if _MODEL and _USE_32_SEGS -_TEXT segment use32 alignment public 'CODE' - else -_TEXT segment alignment public 'CODE' - endif - assume cs:_TEXT - endm - -calli macro regname - call regname - endm - -codeptr macro p1,p2 - if _MODEL and _USE_32_SEGS - ifb - extrn p1 : dword - else - extrn "&p1",p2 : dword - endif - else - ifb - extrn p1 : word - else - extrn "&p1",p2 : word - endif - endif - endm - -defn macro dsym - dsym proc near - endm - -defp macro dsym,exp - dsym proc near exp - endm - -defpe macro dsym - ifdef _EXPORT - dsym proc near export - else - dsym proc near - endif - endm - -docall macro dest - call dest - endm - -dojmp macro dest - jmp dest - endm - -endproc macro dsym - dsym endp - endm - -epilog macro - if _MODEL and _USE_32_SEGS - pop EBP - else - pop BP - endif - endm - -prolog macro - if _MODEL and _USE_32_SEGS - push EBP - mov EBP,ESP - else - push BP - mov BP,SP - endif - endm - -xdefp macro p1,p2 - ifb - public p1 - else - public "&p1",p2 - endif - endm - -xref macro p1,p2 - ifb - extrn `p1` : near - else - extrn "&p1",`p2` : near - endif - endm - -lcall macro dest - call dest - endm - -endif - -endmod macro -_TEXT ends - endm - -dataseg macro -DGROUP group _DATA -assume ds:DGROUP,ss:DGROUP - if _MODEL and _USE_32_SEGS -_DATA segment use32 dword public 'DATA' - else -_DATA segment word public 'DATA' - endif - endm -datasegment macro - dataseg ; should be phased out - endm - -enddata macro -_DATA ends - endm - -bss_segment macro - if _MODEL and _USE_32_SEGS -_BSS segment use32 dword public 'BSS' - else -_BSS segment word public 'BSS' - endif -DGROUP group _BSS - assume ds:DGROUP - endm - -endbss macro -_BSS ends - endm - -alias_function macro alias, function - ifb - xref "C",_&alias - else - xref "C",function - endif - .code - public "C",`alias` - ifdef _EXPORT - `alias` proc export - else - `alias` proc - endif - ifb - jmp _&alias - else - jmp `function` - endif - `alias` endp - endm - -xred macro p1,p2,p3 - ifb - extrn p1 : p2 - else - extrn "&p1",p2 : p3 - endif - endm - diff --git a/programs/develop/open watcom/trunk/clib/src/mf.h b/programs/develop/open watcom/trunk/clib/src/mf.h deleted file mode 100644 index 34ff9ae20..000000000 --- a/programs/develop/open watcom/trunk/clib/src/mf.h +++ /dev/null @@ -1,100 +0,0 @@ - - -//#include "kolibc.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef unsigned int dword; -typedef unsigned int size_t; - - -#define PINUSE_BIT 1 -#define CINUSE_BIT 2 -#define INUSE_BITS 3 - - -struct m_seg -{ - char* base; /* base address */ - dword size; /* allocated size */ - struct m_seg* next; /* ptr to next segment */ - dword flags; /* mmap and extern flag */ -}; - -struct m_chunk -{ - dword prev_foot; /* Size of previous chunk (if free). */ - dword head; /* Size and inuse bits. */ - struct m_chunk* fd; /* double links -- used only if free. */ - struct m_chunk* bk; -}; - -typedef struct m_chunk* mchunkptr; - -struct t_chunk -{ - /* The first four fields must be compatible with malloc_chunk */ - dword prev_foot; - dword head; - - struct t_chunk* fd; - struct t_chunk* bk; - - struct t_chunk* child[2]; - - struct t_chunk* parent; - dword index; -}; - -typedef struct t_chunk* tchunkptr; -typedef struct t_chunk* tbinptr; - -typedef struct m_state -{ - dword smallmap; - dword treemap; -// DWORD dvsize; - dword topsize; - char* least_addr; -// mchunkptr dv; - mchunkptr top; - dword magic; - struct m_chunk smallbins[32]; - tbinptr treebins[32]; -}; - - -void _cdecl init_malloc(void* p); -void* _cdecl dlmalloc(size_t); -void _cdecl dlfree(void*); -void* _cdecl dlrealloc(void *,size_t); - - -dword compute_tree_index(size_t s); - -static void insert_chunk(mchunkptr P, size_t S); -static void insert_large_chunk(tchunkptr X, size_t S); - -static void unlink_large_chunk(tchunkptr X); - -//void replace_dv(mchunkptr P, size_t S); -static void* malloc_small(size_t nb); -static void* malloc_large(size_t nb); - -#define leftshift_for_tree_index(i) \ - ((i == 31)? 0 : (31 - (i >> 1) + 8 - 2)) - -#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) -#define chunk2mem(p) (void*)((char*)p + 8) -#define mem2chunk(mem) (mchunkptr)((char*)mem - 8) -#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - - diff --git a/programs/develop/open watcom/trunk/clib/src/myvalist.h b/programs/develop/open watcom/trunk/clib/src/myvalist.h deleted file mode 100644 index 036d3cb39..000000000 --- a/programs/develop/open watcom/trunk/clib/src/myvalist.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Mask differences between platforms where va_list is an -* array and platforms where it's not. -* -****************************************************************************/ - - -#ifndef _MYVALIST_H_INCLUDED - -#include "variety.h" -#include - -typedef struct my_va_list { - va_list v; -} my_va_list; - -#if defined(__AXP__) || defined(__PPC__) || defined(__MIPS__) - #define MY_VA_LIST( a ) (*(my_va_list *)&(a)) -#else - #define MY_VA_LIST( a ) (*(my_va_list *)(a)) -#endif - -#define _MYVALIST_H_INCLUDED -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/openklbr.c b/programs/develop/open watcom/trunk/clib/src/openklbr.c deleted file mode 100644 index b8474d803..000000000 --- a/programs/develop/open watcom/trunk/clib/src/openklbr.c +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Win32 implementation of open() and sopen(). -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "liballoc.h" -#include "iomode.h" -#include "fileacc.h" -#include "openmode.h" -#include "rtdata.h" -#include "seterrno.h" - -extern unsigned __NFiles; -extern char *__appcwd; -extern int __appcwdlen; - -#if (defined(__WINDOWS__) || defined(__NT__)) - -typedef struct -{ DWORD attr; - DWORD flags; - DWORD cr_time; - DWORD cr_date; - DWORD acc_time; - DWORD acc_date; - DWORD mod_time; - DWORD mod_date; - DWORD size; - DWORD size_high; -} FILEINFO; - -int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo); -int _stdcall create_file(const char *name); - - -typedef struct -{ - char *name; - unsigned int offset; -}__file_handle; - - -char* getfullpath(const char* path) -{ - int prev_is_slash=0; - int len=0, depth=0, i; - char* buff; - char c; - - if(*path == '/') - { - buff = (char*)lib_malloc(strlen(path)+1); - buff[0] = '\0'; - len=0; - } - else - { - len= __appcwdlen; - buff = (char*)lib_malloc(len+strlen(path)+1); - strncpy(buff, __appcwd, __appcwdlen); - - prev_is_slash = 1; - buff[len] = 0; - for(i=0; buff[i]; i++) - if(buff[i] == '/' && i < len-1) depth++; - } - - while(c=*path++) - { - switch (c) - { - - case '.': - if((*path == '.')&& - (*path+1)== '/') - { if(!depth) - { free(buff); - return 0; - }; - buff[len-1] = 0; - len = strrchr(buff, '/') + 1 - buff; - buff[len] = 0; - depth--; - path +=2; - prev_is_slash = 1; - continue; - } - if(*path == '/') - { - path++; - prev_is_slash = 1; - continue; - } - buff[len++] = c; - continue; - - case '/': - prev_is_slash = 1; - buff[len++] = c; - continue; - - default: - prev_is_slash = 0; - buff[len++] = c; - continue; - }; - }; - buff[len]= '\0'; - return buff; -}; - - -size_t FileSize(FILE *fp) -{ - int hdl; - __file_handle *fh; - FILEINFO info; - - hdl = fileno( fp ); - // __handle_check( hdl, -1 ); - - fh = (__file_handle*) __getOSHandle(hdl); - - - get_fileinfo(fh->name,&info); - - return info.size; - -} - -int access(const char *path, int mode) -{ size_t retval; - FILEINFO info; - char *p; - - p = getfullpath(path); - retval=get_fileinfo(p,&info); - free(p); - - return retval; - -} - -static HANDLE __openFileHandle(const CHAR_TYPE *name, int mode) -{ - FILEINFO info; - __file_handle *handle; - char *path; - int err; - - path = getfullpath(name); - - if(err=get_fileinfo(path,&info)) - { -// printf("failed getfileinfo %s\n\r", path); - - if(mode & O_CREAT) - err=create_file(path); - - if(err) - { - lib_free(path); - return (HANDLE)-1; - }; - }; - - if ( !(handle=(__file_handle*)lib_malloc(sizeof( __file_handle) ))) - { lib_free(path); - return (HANDLE)-1; - }; - - handle->name = path; - handle->offset = 0; - - return (HANDLE)handle; -}; - - -static int __F_NAME(_sopen,__wsopen)( const CHAR_TYPE *name, int mode, int share, va_list args ) -{ - HANDLE handle; - int hid, rwmode; - unsigned iomode_flags; - - // First try to get the required slot. - // No point in creating a file only to not use it. JBS 99/10/26 - hid = __allocPOSIXHandle( DUMMY_HANDLE ); - if( hid == -1 ) - { - return( -1 ); - } - - rwmode = mode; - - - /*** Open the file ***/ - - handle = __openFileHandle( name, mode); - - if( handle==(HANDLE)-1 ) - { - __freePOSIXHandle( hid ); - return( -1 ); //error - } - -// Now use the slot we got. - __setOSHandle( hid, handle ); // JBS 99/11/01 - - iomode_flags = 0; - - - if( rwmode == O_RDWR ) iomode_flags |= _READ | _WRITE; - else if( rwmode == O_RDONLY) iomode_flags |= _READ; - else if( rwmode == O_WRONLY) iomode_flags |= _WRITE; - if( mode & O_APPEND ) iomode_flags |= _APPEND; - if( mode & (O_BINARY|O_TEXT) ) { - if( mode & O_BINARY ) iomode_flags |= _BINARY; - } else { - if( _RWD_fmode == O_BINARY ) iomode_flags |= _BINARY; - } - __SetIOMode( hid, iomode_flags ); - return( hid ); -} - -#elif -static int __F_NAME(_sopen,__wsopen)( const CHAR_TYPE *name, int mode, int share, va_list args ) -{ - DWORD create_disp, exists_disp; - DWORD perm, fileattr; - DWORD desired_access, share_mode; - SECURITY_ATTRIBUTES security; - HANDLE handle; - int hid, rwmode; - unsigned iomode_flags; - - // First try to get the required slot. - // No point in creating a file only to not use it. JBS 99/10/26 - hid = __allocPOSIXHandle( DUMMY_HANDLE ); - if( hid == -1 ) { - return( -1 ); - } - - rwmode = mode & OPENMODE_ACCESS_MASK; - __GetNTAccessAttr( rwmode, &desired_access, &perm ); - __GetNTShareAttr( share|rwmode, &share_mode ); - fileattr = FILE_ATTRIBUTE_NORMAL; - - security.nLength = sizeof( SECURITY_ATTRIBUTES ); - security.lpSecurityDescriptor = NULL; - security.bInheritHandle = mode&O_NOINHERIT ? FALSE : TRUE; - -#ifdef DEFAULT_WINDOWING -#ifdef __WIDECHAR__ - if( _WindowsNewWindow != 0 && !_wcsicmp( name, L"con" ) ) -#else - if( _WindowsNewWindow != 0 && !stricmp( name, "con" ) ) -#endif - { - handle = (HANDLE) __NTGetFakeHandle(); - - // Now use the slot we got. - __setOSHandle( hid, handle ); // JBS 99/11/01 - _WindowsNewWindow( NULL, hid, -1 ); - - iomode_flags = _ISTTY; - } else { -#endif - if( mode & O_CREAT ) { - perm = va_arg( args, int ); - va_end( args ); - perm &= ~_RWD_umaskval; /* 05-jan-95 */ - if( ( perm & S_IREAD ) && !( perm & S_IWRITE ) ) { - fileattr = FILE_ATTRIBUTE_READONLY; - } - if( mode & O_EXCL ) { - create_disp = CREATE_NEW; - exists_disp = CREATE_NEW; - } else if( mode & O_TRUNC ) { - create_disp = CREATE_ALWAYS; - exists_disp = CREATE_NEW; - } else { - create_disp = OPEN_ALWAYS; - exists_disp = OPEN_EXISTING; - } - } else if( mode & O_TRUNC ) { - exists_disp = TRUNCATE_EXISTING; - } else { - exists_disp = OPEN_EXISTING; - } - - /*** Open the file ***/ - #ifdef __WIDECHAR__ - handle = __lib_CreateFileW( name, desired_access, share_mode, - &security, exists_disp, fileattr, - NULL ); - #else - handle = CreateFileA( name, desired_access, share_mode, - &security, exists_disp, fileattr, NULL ); - #endif - if( handle==(HANDLE)-1 ) { - if( mode&O_CREAT ) { - #ifdef __WIDECHAR__ - handle = __lib_CreateFileW( name, desired_access, - share_mode, NULL, create_disp, - fileattr, NULL ); - #else - handle = CreateFileA( name, desired_access, - share_mode, NULL, create_disp, - fileattr, NULL ); - #endif - } - if( handle == (HANDLE)-1 ) { - __freePOSIXHandle( hid ); - return( __set_errno_nt() ); - } - } - - // Now use the slot we got. - __setOSHandle( hid, handle ); // JBS 99/11/01 - - iomode_flags = 0; - - if( isatty(hid) ) { - iomode_flags = _ISTTY; - } -#ifdef DEFAULT_WINDOWING - } -#endif - - if( rwmode == O_RDWR ) iomode_flags |= _READ | _WRITE; - else if( rwmode == O_RDONLY) iomode_flags |= _READ; - else if( rwmode == O_WRONLY) iomode_flags |= _WRITE; - if( mode & O_APPEND ) iomode_flags |= _APPEND; - if( mode & (O_BINARY|O_TEXT) ) { - if( mode & O_BINARY ) iomode_flags |= _BINARY; - } else { - if( _RWD_fmode == O_BINARY ) iomode_flags |= _BINARY; - } - __SetIOMode( hid, iomode_flags ); - return( hid ); -} -#endif - -_WCRTLINK int __F_NAME(open,_wopen)( const CHAR_TYPE *name, int mode, ... ) -{ - int permission; - va_list args; - - va_start( args, mode ); - permission = va_arg( args, int ); - va_end( args ); - return( __F_NAME(sopen,_wsopen)( name, mode, SH_COMPAT, permission ) ); -} - - -_WCRTLINK int __F_NAME(sopen,_wsopen)( const CHAR_TYPE *name, int mode, int shflag, ... ) -{ - va_list args; - - va_start( args, shflag ); - return( __F_NAME(_sopen,__wsopen)( name, mode, shflag, args ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/openmode.h b/programs/develop/open watcom/trunk/clib/src/openmode.h deleted file mode 100644 index 4e29d357c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/openmode.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#ifndef _OPENMODE_H_INCLUDED -#define _OPENMODE_H_INCLUDED -enum { - FILEATTR_MASK = 0x003f, - FILEATTR_NORMAL = 0x0000, - FILEATTR_READONLY = 0x0001, - FILEATTR_HIDDEN = 0x0002, - FILEATTR_SYSTEM = 0x0004, - FILEATTR_DIRECTORY = 0x0010, - FILEATTR_ARCHIVED = 0x0020 -}; - -enum { - OPENFLAG_FAIL_IF_EXISTS = 0x0000, - OPENFLAG_OPEN_IF_EXISTS = 0x0001, - OPENFLAG_REPLACE_IF_EXISTS = 0x0002, - OPENFLAG_FAIL_IF_NOT_EXISTS = 0x0000, - OPENFLAG_CREATE_IF_NOT_EXISTS = 0x0010 -}; - -enum { - OPENMODE_DASD = 0x8000, - OPENMODE_WRITE_THROUGH = 0x4000, - OPENMODE_FAIL_ERRORS = 0x2000, - OPENMODE_NO_CACHE = 0x1000, - OPENMODE_LOCALITY_MASK = 0x0700, - OPENMODE_LOCALITY_RANDSEQ = 0x0300, - OPENMODE_LOCALITY_RANDOM = 0x0200, - OPENMODE_LOCALITY_SEQUENTIAL = 0x0100, - OPENMODE_LOCALITY_NONE = 0x0000, - OPENMODE_INHERITANCE = 0x0080, - OPENMODE_SHARE_MASK = 0x0070, - OPENMODE_DENY_COMPAT = 0x0000, - OPENMODE_DENY_ALL = 0x0010, - OPENMODE_DENY_WRITE = 0x0020, - OPENMODE_DENY_READ = 0x0030, - OPENMODE_DENY_NONE = 0x0040, - OPENMODE_ACCESS_MASK = 0x0007, - OPENMODE_ACCESS_RDONLY = 0x0000, - OPENMODE_ACCESS_WRONLY = 0x0001, - OPENMODE_ACCESS_RDWR = 0x0002 -}; -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/orient.h b/programs/develop/open watcom/trunk/clib/src/orient.h deleted file mode 100644 index ab097f6bd..000000000 --- a/programs/develop/open watcom/trunk/clib/src/orient.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Macro to deal with stream orientation. -* -****************************************************************************/ - - -#ifdef __NETWARE__ - /* One less thing to worry about */ - #define ORIENT_STREAM(stream,error_return) -#else - #ifdef __WIDECHAR__ - #define ORIENT_STREAM(stream,error_return) \ - if( _FP_ORIENTATION(stream) != _WIDE_ORIENTED ) { \ - if( _FP_ORIENTATION(stream) == _NOT_ORIENTED ) { \ - _FP_ORIENTATION(stream) = _WIDE_ORIENTED; \ - } else { \ - _ReleaseFile( stream ); \ - return( error_return ); \ - } \ - } - #else - #define ORIENT_STREAM(stream,error_return) \ - if( _FP_ORIENTATION(stream) != _BYTE_ORIENTED ) { \ - if( _FP_ORIENTATION(stream) == _NOT_ORIENTED ) { \ - _FP_ORIENTATION(stream) = _BYTE_ORIENTED; \ - } else { \ - _ReleaseFile( stream ); \ - return( error_return ); \ - } \ - } - #endif -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/printf.c b/programs/develop/open watcom/trunk/clib/src/printf.c deleted file mode 100644 index 3bf34cdd6..000000000 --- a/programs/develop/open watcom/trunk/clib/src/printf.c +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of printf() - formatted output. -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#include "farsupp.h" -#include "printf.h" -#include "fprtf.h" - -void debug_out_str(const char* str); -void _stdcall debug_out(int ch); - -static char _dest[512]; - -_WCRTLINK int __F_NAME(printf,wprintf)( const CHAR_TYPE *format, ... ) -{ - int retval; - auto va_list args; - - va_start( args, format ); -// return( __F_NAME(__fprtf,__fwprtf)( stdout, format, args ) ); - - va_start( args, format ); - #ifdef __WIDECHAR__ - retval = _vswprintf( _dest, format, args ); - #else - retval = vsprintf( _dest, format, args ); - #endif - debug_out_str(_dest); - return retval; -} - -void debug_out_str(const char* str) -{ - while (*str != 0) - { - debug_out(*str); - str++; - } -} - - - diff --git a/programs/develop/open watcom/trunk/clib/src/printf.h b/programs/develop/open watcom/trunk/clib/src/printf.h deleted file mode 100644 index 2c6187e3b..000000000 --- a/programs/develop/open watcom/trunk/clib/src/printf.h +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Definitions needed by callers to internal string formatter -* __prtf() for printf() style handling. -* -****************************************************************************/ - - -#ifndef _PRINTF_H_INCLUDED -#define _PRINTF_H_INCLUDED - -#include "variety.h" -#include "widechar.h" - -#if defined(__QNX__) - #if defined(__386__) - #define __SLIB_CALLBACK _WCFAR - #define __SLIB - #pragma aux slib_callback_t __far parm [eax] [edx] modify [eax edx]; - #elif defined( __SMALL_DATA__ ) - #define __SLIB_CALLBACK _WCFAR __loadds - #define __SLIB _WCFAR - #else - #define __SLIB_CALLBACK _WCFAR - #define __SLIB _WCFAR - #endif -#else - #if defined( __HUGE__ ) - #define __SLIB _WCFAR - #define __SLIB_CALLBACK - #else - #define __SLIB - #define __SLIB_CALLBACK - #endif -#endif - -#define SPECS_VERSION 200 - -/* - * This is the __prtf specs structure. NB - should be naturally aligned. - * - * There are both wide and MBCS versions explicitly because part of __wprtf - * needs to access both kinds of structure. - */ - -typedef struct -{ - char __SLIB *_dest; - short _flags; // flags (see below) - short _version; // structure version # (2.0 --> 200) - int _fld_width; // field width - int _prec; // precision - int _output_count; // # of characters outputted for %n - int _n0; // number of chars to deliver first - int _nz0; // number of zeros to deliver next - int _n1; // number of chars to deliver next - int _nz1; // number of zeros to deliver next - int _n2; // number of chars to deliver next - int _nz2; // number of zeros to deliver next - char _character; // format character - char _pad_char; - char _padding[2]; // to keep struct aligned -} _mbcs_SPECS; - -typedef struct -{ - wchar_t __SLIB *_dest; - short _flags; // flags (see below) - short _version; // structure version # (2.0 --> 200) - int _fld_width; // field width - int _prec; // precision - int _output_count; // # of characters outputted for %n - int _n0; // number of chars to deliver first - int _nz0; // number of zeros to deliver next - int _n1; // number of chars to deliver next - int _nz1; // number of zeros to deliver next - int _n2; // number of chars to deliver next - int _nz2; // number of zeros to deliver next - wchar_t _character; // format character - wchar_t _pad_char; -} _wide_SPECS; - -#ifdef __WIDECHAR__ - #define SPECS _wide_SPECS -#else - #define SPECS _mbcs_SPECS -#endif - - -typedef void (__SLIB_CALLBACK slib_callback_t)( SPECS __SLIB *, int ); - -/* specification flags... (values for _flags field above) */ - -#define SPF_ALT 0x0001 -#define SPF_BLANK 0x0002 -#define SPF_FORCE_SIGN 0x0004 -#define SPF_LEFT_ADJUST 0x0008 -#define SPF_CHAR 0x0010 -#define SPF_SHORT 0x0020 -#define SPF_LONG 0x0040 -#define SPF_LONG_LONG 0x0080 -#define SPF_LONG_DOUBLE 0x0100 // may be also used for __int64 -#define SPF_NEAR 0x0200 -#define SPF_FAR 0x0400 -#define SPF_CVT 0x0800 // __cvt function - -#ifdef __QNX__ -#define SPF_ZERO_PAD 0x8000 -#endif // __QNX__ - -#if defined( __STDC_WANT_LIB_EXT1__ ) && __STDC_WANT_LIB_EXT1__ == 1 - -#if !defined( __WIDECHAR__ ) -int __prtf_s( void __SLIB *dest, /* parm for use by out_putc */ - const char * __restrict format, /* pointer to format string */ - va_list args, /* pointer to pointer to args*/ - const char **errmsg, /* constraint violation msg */ - slib_callback_t *out_putc ); /* character output routine */ - -#else -int __wprtf_s( void __SLIB *dest, /* parm for use by out_putc */ - const CHAR_TYPE * __restrict format,/* pointer to format string */ - va_list args, /* pointer to pointer to args*/ - const char **errmsg, /* constraint violation msg */ - slib_callback_t *out_putc ); /* character output routine */ -#endif - -#else - -#if !defined(__WIDECHAR__) -int __prtf( void __SLIB *dest, /* parm for use by out_putc */ - const char *format, /* pointer to format string */ - va_list args, /* pointer to pointer to args*/ - slib_callback_t *out_putc ); /* character output routine */ - -#else -int __wprtf( void __SLIB *dest, /* parm for use by out_putc */ - const CHAR_TYPE *format, /* pointer to format string */ - va_list args, /* pointer to pointer to args*/ - slib_callback_t *out_putc ); /* character output routine */ -#endif - -#ifdef __QNX__ -int __prtf_slib( void __SLIB *dest, /* parm for use by out_putc */ - const char * format, /* pointer to format string */ - char **args, /* pointer to pointer to args*/ - slib_callback_t *out_putc, /* character output routine */ - int ptr_size ); - - #if !defined(IN_SLIB) && !defined(__386__) - extern int ( _WCFAR * ( _WCFAR *__f)) (); - #define __prtf(a,b,c,d) __prtf_slib(a,b,c,d,sizeof(void *)) - #define __prtf_slib(a,b,c,d,e) ((int(_WCFAR *) (void _WCFAR *,const char _WCFAR *,char * _WCFAR *args,void (_WCFAR *__out)(SPECS _WCFAR *,int),int)) __f[24])(a,b,c,d,e) - #endif -#endif - -#endif /* Safer C */ - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/prtf.c b/programs/develop/open watcom/trunk/clib/src/prtf.c deleted file mode 100644 index 2df55a021..000000000 --- a/programs/develop/open watcom/trunk/clib/src/prtf.c +++ /dev/null @@ -1,1100 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: __prtf() - low level string formatter. -* -****************************************************************************/ - - -#define __LONG_LONG_SUPPORT__ - -#if !defined( __NETWARE__ ) && !defined( __UNIX__ ) - #define USE_MBCS_TRANSLATION -#endif - -#include "variety.h" -#ifdef SAFE_PRINTF - #include "saferlib.h" -#endif -#include "widechar.h" -#include -#include -#include -#include -#include -#if defined( __WIDECHAR__ ) || defined( USE_MBCS_TRANSLATION ) - #include -#endif -#include "ftos.h" -#include "farsupp.h" -#include "printf.h" -#include "prtscncf.h" -#include "fixpoint.h" -#include "myvalist.h" - -#define BUF_SIZE 72 /* 64-bit ints formatted as binary can get big */ -#define TRUE 1 -#define FALSE 0 - -#define PASCAL_STRING 'S' /* for Novell */ -#define WIDE_CHAR_STRING 'S' - -#if defined( __QNX_386__ ) - /* for use in QNX 32-bit shared library */ - #pragma aux __prtf "_sl_*" far; -#endif - - -#if defined( __QNX__ ) - #define EFG_PRINTF __EFG_Format -#else - #define EFG_PRINTF (*__EFG_printf) -#endif - -extern FAR_STRING EFG_PRINTF( char *buffer, my_va_list *args, _mbcs_SPECS __SLIB *specs ); - - -#if defined( __WIDECHAR__ ) - #define _FAR_OTHER_STRING FAR_ASCII_STRING -#else - #define _FAR_OTHER_STRING FAR_UNI_STRING -#endif - - -#if defined( __WINDOWS_386__ ) - #ifdef __SW_3S - #pragma aux slib_callback_t modify [eax edx ecx fs gs]; - #else - #pragma aux slib_callback_t modify [fs gs]; - #endif -#endif - - -/* forward references */ -static const CHAR_TYPE *evalflags( const CHAR_TYPE *, SPECS __SLIB * ); -static FAR_STRING formstring( CHAR_TYPE *, my_va_list *, SPECS __SLIB *, CHAR_TYPE * ); -static const CHAR_TYPE * getprintspecs( const CHAR_TYPE *, my_va_list *, SPECS __SLIB * ); -#ifdef USE_MBCS_TRANSLATION -static void write_wide_string( FAR_UNI_STRING str, SPECS *specs, - slib_callback_t *out_putc ); -static void write_skinny_string( FAR_ASCII_STRING str, SPECS *specs, - slib_callback_t *out_putc ); -#endif - -#ifdef SAFE_PRINTF - int __F_NAME(__prtf_s,__wprtf_s) -#else - int __F_NAME(__prtf,__wprtf) -#endif - ( void __SLIB *dest, /* parm for use by out_putc */ - const CHAR_TYPE *format, /* pointer to format string */ - va_list args, /* pointer to pointer to args*/ -#ifdef SAFE_PRINTF - const char **msg, /* rt-constraint message */ -#endif - slib_callback_t *out_putc ) /* char output routine */ -{ - CHAR_TYPE buffer[ BUF_SIZE ]; - CHAR_TYPE null_char = '\0'; - CHAR_TYPE *a; - FAR_STRING arg; - const CHAR_TYPE *ctl; - SPECS specs; - - specs._dest = dest; - specs._flags = 0; - specs._version = SPECS_VERSION; - specs._output_count = 0; - ctl = format; - while( *ctl != NULLCHAR ) { - if( *ctl != '%' ) { - (out_putc)( &specs, *ctl++ ); - } else { - ++ctl; - { - my_va_list pargs; - pargs = MY_VA_LIST( args ); - ctl = getprintspecs( ctl, &pargs, &specs ); - MY_VA_LIST( args ) = pargs; - } - - specs._character = *ctl++; - if( specs._character == NULLCHAR ) - break; /* 05-jan-89 */ - - if( specs._character == 'n' ) { -#ifdef SAFE_PRINTF - /* The %n specifier is not allowed - too dangerous. */ - *msg = "%n"; - break; -#else - FAR_INT iptr; - -#if defined( __FAR_SUPPORT__ ) - if( specs._flags & SPF_FAR ) { - iptr = va_arg( args, int _WCFAR * ); - } else if( specs._flags & SPF_NEAR ) { - iptr = va_arg( args, int _WCNEAR * ); - } else { - iptr = va_arg( args, int * ); - } -#else - iptr = va_arg( args, int * ); -#endif - if( specs._flags & SPF_CHAR ) { - *((FAR_CHAR)iptr) = specs._output_count; - } else if( specs._flags & SPF_SHORT ) { - *((FAR_SHORT)iptr) = specs._output_count; - } else if( specs._flags & SPF_LONG ) { - *((FAR_LONG)iptr) = specs._output_count; -#if defined( __LONG_LONG_SUPPORT__ ) - } else if( specs._flags & SPF_LONG_LONG ) { - *((FAR_INT64)iptr) = specs._output_count; -#endif - } else { - *iptr = specs._output_count; - } -#endif /* SAFE_PRINTF */ - } else { -#ifdef SAFE_PRINTF - if( specs._character == 's' || specs._character == 'S' ) { - FAR_STRING str; - va_list args_copy; - - /* Make sure %s argument is not NULL. Note that near pointers - * in segmented models need special handling because only - * offset will be NULL, not segment. - */ - va_copy( args_copy, args ); -#if defined( __FAR_SUPPORT__ ) - if( specs._flags & SPF_FAR ) { - str = va_arg( args_copy, CHAR_TYPE _WCFAR * ); - } else if( specs._flags & SPF_NEAR ) { - CHAR_TYPE _WCNEAR *ptr; - - ptr = va_arg( args_copy, CHAR_TYPE _WCNEAR * ); - if( ptr == NULL ) { - str = NULL; - } else { - str = ptr; - } - } else { - CHAR_TYPE *ptr; - - ptr = va_arg( args_copy, CHAR_TYPE * ); - if( ptr == NULL ) { - str = NULL; - } else { - str = ptr; - } - } -#else - str = va_arg( args_copy, CHAR_TYPE * ); -#endif - va_end( args_copy ); - if( str == NULL ) { - *msg = "%s -> NULL"; - break; /* bail out */ - } - } -#endif /* SAFE_PRINTF */ - - { - my_va_list pargs; - pargs = MY_VA_LIST( args ); - arg = formstring( buffer, &pargs, &specs, &null_char ); - MY_VA_LIST( args ) = pargs; - } - specs._fld_width -= specs._n0 + - specs._nz0 + - specs._n1 + - specs._nz1 + - specs._n2 + - specs._nz2; - if( !(specs._flags & SPF_LEFT_ADJUST) ) { - if( specs._pad_char == ' ' ) { - while( specs._fld_width > 0 ) { - (out_putc)( &specs, ' ' ); - --specs._fld_width; - } - } - } - a = buffer; - while( specs._n0 > 0 ) { - (out_putc)( &specs, *a ); - ++a; - --specs._n0; - } - while( specs._nz0 > 0 ) { - (out_putc)( &specs, '0' ); - --specs._nz0; - } - if( specs._character == 's' ) { -#if defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - if( specs._flags & SPF_SHORT ) { - write_skinny_string( (FAR_ASCII_STRING)arg, &specs, out_putc ); - } else -#elif !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - if( specs._flags & SPF_LONG ) { - write_wide_string( (FAR_UNI_STRING)arg, &specs, out_putc ); - } else -#endif - { - while( specs._n1 > 0 ) { - (out_putc)( &specs, *arg++ ); - --specs._n1; - } - } - } -#if !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - else if( specs._character == WIDE_CHAR_STRING ) { - write_wide_string( (FAR_UNI_STRING)arg, &specs, out_putc ); - } else -#elif !defined( __WIDECHAR__ ) && defined( __NETWARE__ ) - else if( specs._character == WIDE_CHAR_STRING ) { - } else -#endif - { - while( specs._n1 > 0 ) { - (out_putc)( &specs, *arg++ ); - --specs._n1; - } - } - while( specs._nz1 > 0 ) { - (out_putc)( &specs, '0' ); - --specs._nz1; - } - while( specs._n2 > 0 ) { - (out_putc)( &specs, *arg ); - ++arg; - --specs._n2; - } - while( specs._nz2 > 0 ) { - (out_putc)( &specs, '0' ); - --specs._nz2; - } - if( specs._flags & SPF_LEFT_ADJUST ) { - while( specs._fld_width > 0 ) { - (out_putc)( &specs, ' ' ); - --specs._fld_width; - } - } - } - } - } - return( specs._output_count ); -} - -static const CHAR_TYPE * getprintspecs( const CHAR_TYPE *ctl, - my_va_list *pargs, - SPECS __SLIB *specs ) -{ - specs->_pad_char = ' '; - ctl = evalflags( ctl, specs ); - specs->_fld_width = 0; - if( *ctl == '*' ) { - specs->_fld_width = va_arg( pargs->v, int ); - if( specs->_fld_width < 0 ) { - specs->_fld_width = - specs->_fld_width; - specs->_flags |= SPF_LEFT_ADJUST; - } - ctl++; - } else { - while(( *ctl >= '0' ) && ( *ctl <= '9' )) { - specs->_fld_width = specs->_fld_width * 10 + ( *ctl++ - '0' ); - } - } - specs->_prec = -1; - if( *ctl == '.' ) { - specs->_prec = 0; - ctl++; - if( *ctl == '*' ) { - specs->_prec = va_arg( pargs->v, int ); - if( specs->_prec < 0 ) - specs->_prec = -1; /* 19-jul-90 */ - ctl++; - } else { - while(( *ctl >= '0' ) && ( *ctl <= '9' )) { - specs->_prec = specs->_prec * 10 + ( *ctl++ - '0' ); - } - } - /* - "For b, d, i, o, u, x, X, e, E, f, g and G conversions, leading - zeros (following any indication of sign or base) are used to - pad the field width; no space padding is performed. If the 0 - or - flags both appear, the 0 flag is ignored. For b, d, i, o, - u, x or X conversions, if a precision is specified, the 0 flag - is ignored. For other conversions, the behaviour is undefined." - */ -// if( specs->_prec != -1 ) specs->_pad_char = ' '; /* 30-jul-95 *//*removed by JBS*/ - } - switch( *ctl ) { - case 'l': -#if defined( __LONG_LONG_SUPPORT__ ) - if( ctl[1] == 'l' ) { - specs->_flags |= SPF_LONG_LONG; - ctl += 2; - break; - } -#endif - /* fall through */ - ZSPEC_CASE_LONG - TSPEC_CASE_LONG - case 'w': - specs->_flags |= SPF_LONG; - ctl++; - break; - case 'h': - if( ctl[1] == 'h' ) { - specs->_flags |= SPF_CHAR; - ctl += 2; - break; - } - specs->_flags |= SPF_SHORT; - ctl++; - break; -#if defined( __LONG_LONG_SUPPORT__ ) - case 'I': - if(( ctl[1] == '6' ) && ( ctl[2] == '4' )) { - specs->_flags |= SPF_LONG_LONG; - ctl += 3; - } - break; - JSPEC_CASE_LLONG - /* fall through */ -#endif - case 'L': - specs->_flags |= SPF_LONG_DOUBLE | SPF_LONG_LONG; - ctl++; - break; -#if defined( __FAR_SUPPORT__ ) - case 'F': /* conflicts with ISO-defined 'F' conversion */ - /* fall through */ -#endif - case 'W': /* 8086 specific flag for FAR pointer */ - specs->_flags |= SPF_FAR; - ctl++; - break; - case 'N': /* 8086 specific flag for NEAR pointer */ - specs->_flags |= SPF_NEAR; - ctl++; - break; -#if defined( TSPEC_IS_INT ) || defined( ZSPEC_IS_INT ) - TSPEC_CASE_INT /* If either 't' or 'z' spec corresponds to 'int', */ - ZSPEC_CASE_INT /* we need to parse and ignore the spec. */ - ctl++; - break; -#endif - } - return( ctl ); -} - - -static const CHAR_TYPE *evalflags( const CHAR_TYPE *ctl, SPECS __SLIB *specs ) -{ - specs->_flags = 0; - for( ; ; ctl++ ) { - if( *ctl == '-' ) { - specs->_flags |= SPF_LEFT_ADJUST; - } else if( *ctl == '#' ) { - specs->_flags |= SPF_ALT; - } else if( *ctl == '+' ) { - specs->_flags |= SPF_FORCE_SIGN; - specs->_flags &= ~SPF_BLANK; - } else if( *ctl == ' ' ) { - if( ( specs->_flags & SPF_FORCE_SIGN ) == 0 ) { - specs->_flags |= SPF_BLANK; - } - } else if( *ctl == '0' ) { - specs->_pad_char = '0'; -#ifdef __QNX__ - specs->_flags |= SPF_ZERO_PAD; -#endif - } else { - break; - } - } - return( ctl ); -} - - -static int far_strlen( FAR_STRING s, int precision ) -{ - int len; - - len = 0; - while(( len != precision ) && ( *s++ != NULLCHAR )) - ++len; - - return( len ); -} - -/* - * far_other_strlen - calculates the length of an ascii string - * for the unicode version - * - calculates the length of a unicode string for - * the standard version - */ - -static int far_other_strlen( FAR_STRING s, int precision ) -{ - int len = 0; - _FAR_OTHER_STRING ptr = (_FAR_OTHER_STRING)s; - -#if !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - char mbBuf[MB_CUR_MAX]; - int chBytes; - - if( precision == -1 ) { - while( *ptr ) { - chBytes = wctomb( mbBuf, *ptr++ ); - if( chBytes != -1 ) { - len += chBytes; - } - } - return( len ); - } - while( *ptr && ( len <= precision )) { - chBytes = wctomb( mbBuf, *ptr++ ); - if( chBytes != -1 ) { - len += chBytes; - } - } - return(( len <= precision ) ? len : precision ); - -#else - - while( *ptr++ && ( len != precision )) - ++len; - - return( len ); -#endif -} - -static void fmt4hex( unsigned value, CHAR_TYPE *buf, int maxlen ) -{ - int i, len; - - __F_NAME(itoa,_itow)( value, buf, 16 ); - len = __F_NAME(strlen,wcslen)( buf ); - for( i = maxlen - 1; len; --i ) { - --len; - buf[i] = buf[len]; - } - while( i >= 0 ) { - buf[i] = '0'; - --i; - } - buf[maxlen] = NULLCHAR; -} - - -static void FixedPoint_Format( CHAR_TYPE *buf, long value, SPECS __SLIB *specs ) -{ - T32 at; - int i; - CHAR_TYPE *bufp; - - at.sWhole = value; - if( at.sWhole < 0 ) { - at.sWhole = - at.sWhole; - *buf++ = '-'; - } - if( specs->_prec == -1 ) - specs->_prec = 4; - - __F_NAME(itoa,_itow)( at.wd.hi, buf, 10 ); - bufp = buf; /* remember start address of buffer */ - while( *buf ) - ++buf; - - if( specs->_prec != 0 ) { - *buf++ = '.'; - for( i = 0; i < specs->_prec; i++ ) { - at.wd.hi = 0; - at.uWhole *= 10; - *buf++ = at.bite.b3 + '0'; - } - *buf = NULLCHAR; - } - if( at.wd.lo & 0x8000 ) { /* fraction >= .5, need to round */ - for(;;) { /* 22-dec-91 */ - if( buf == bufp ) { - *buf++ = '1'; - while( *buf == '0' ) - ++buf; - - if( *buf == '.' ) { - *buf++ = '0'; - *buf++ = '.'; - while( *buf == '0' ) { - ++buf; - } - } - *buf++ = '0'; - *buf = NULLCHAR; - break; - } - --buf; - if( *buf == '.' ) - --buf; - - if( *buf != '9' ) { - ++ *buf; - break; - } - *buf = '0'; - } - } -} - -static void float_format( CHAR_TYPE *buffer, my_va_list *pargs, SPECS __SLIB *specs ) -{ -#ifdef __WIDECHAR__ - char mbBuffer[BUF_SIZE*MB_CUR_MAX]; - _mbcs_SPECS mbSpecs; - int count; - size_t rc; - char *p; -#endif // __WIDECHAR__ - -#ifdef __WIDECHAR__ - /* - * EFG_PRINTF can only handle MBCS buffers and the MBCS version of the - * SPECS structure. So, make a _mbcs_SPECS structure equivalent to the - * _wide_SPECS one, and use that instead. Note that we can't use - * memcpy() because some field sizes are different. - */ - mbSpecs._dest = NULL; /* this field isn't actually used */ - mbSpecs._flags = specs->_flags; - mbSpecs._version = specs->_version; - mbSpecs._fld_width = specs->_fld_width; - mbSpecs._prec = specs->_prec; - mbSpecs._output_count = specs->_output_count; - mbSpecs._n0 = specs->_n0; - mbSpecs._nz0 = specs->_nz0; - mbSpecs._n1 = specs->_n1; - mbSpecs._nz1 = specs->_nz1; - mbSpecs._n2 = specs->_n2; - mbSpecs._nz2 = specs->_nz2; - mbSpecs._character = (char)specs->_character; - mbSpecs._pad_char = (char)specs->_pad_char; -#endif - -#ifdef __WIDECHAR__ - EFG_PRINTF( mbBuffer, pargs, &mbSpecs ); -#else - EFG_PRINTF( buffer, pargs, specs ); -#endif - -#ifdef __WIDECHAR__ - /* - * Now convert the returned information back into our _wide_SPECS - * structure. We can't just use mbstowcs because it's an array of - * characters, not a string. - */ - p = mbBuffer; - for( count = 0; count < BUF_SIZE; count++ ) { - rc = mbtowc( &(buffer[count]), p, MB_CUR_MAX ); - if( rc == -1 ) { - buffer[count] = L'?'; - } - p = _mbsinc( p ); - } - specs->_flags = mbSpecs._flags; - specs->_version = mbSpecs._version; - specs->_fld_width = mbSpecs._fld_width; - specs->_prec = mbSpecs._prec; - specs->_output_count = mbSpecs._output_count; - specs->_n0 = mbSpecs._n0; - specs->_nz0 = mbSpecs._nz0; - specs->_n1 = mbSpecs._n1; - specs->_nz1 = mbSpecs._nz1; - specs->_n2 = mbSpecs._n2; - specs->_nz2 = mbSpecs._nz2; - specs->_character = (wchar_t) mbSpecs._character; - specs->_pad_char = (wchar_t) mbSpecs._pad_char; -#endif -} - -static void SetZeroPad( SPECS __SLIB *specs ) -{ - int n; - - if( !(specs->_flags & SPF_LEFT_ADJUST) ) { - if( specs->_pad_char == '0' ) { - n = specs->_fld_width - specs->_n0 - specs->_nz0 - - specs->_n1 - specs->_nz1 - specs->_n2 - specs->_nz2; - if( n > 0 ) { - specs->_nz0 += n; - } - } - } -} - - -#if !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) -static void write_wide_string( FAR_UNI_STRING str, SPECS *specs, - slib_callback_t *out_putc ) -{ - int bytes; - char mbBuf[MB_CUR_MAX]; - char *mbBufPtr; - - while( specs->_n1 > 0 ) { - bytes = wctomb( mbBuf, *str++ ); - if( bytes != -1 ) { - if( bytes <= specs->_n1 ) { - mbBufPtr = mbBuf; - while( bytes-- ) { - (out_putc)( specs, *mbBufPtr++ ); - --specs->_n1; - } - } else { - specs->_n1 = 0; - } - } - } -} -#endif - - -#if defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) -static void write_skinny_string( FAR_ASCII_STRING str, SPECS *specs, - slib_callback_t *out_putc ) -{ - int bytes; - wchar_t wc; - FAR_ASCII_STRING mbPtr = str; - char mbBuf[MB_CUR_MAX]; - - while( specs->_n1 > 0 ) { - mbBuf[0] = *mbPtr++; - if( _ismbblead( mbBuf[0] ) ) - mbBuf[1] = *mbPtr++; - - bytes = mbtowc( &wc, mbBuf, MB_CUR_MAX ); - if( bytes <= specs->_n1 ) { - if( bytes != -1 ) { - (out_putc)( specs, wc ); - specs->_n1 -= bytes; - } - } else { - specs->_n1 = 0; - } - } -} -#endif - - -static FAR_STRING formstring( CHAR_TYPE *buffer, my_va_list *pargs, - SPECS __SLIB *specs, CHAR_TYPE *null_string ) -{ - FAR_STRING arg; - int length; - int radix; -#if defined( __LONG_LONG_SUPPORT__ ) - unsigned long long long_long_value; -#endif - unsigned long long_value; - unsigned int int_value; -#if defined( __FAR_SUPPORT__ ) - unsigned int seg_value; -#endif -#if !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - int bytes; -#endif - - arg = buffer; - - specs->_n0 = specs->_nz0 = - specs->_n1 = specs->_nz1 = - specs->_n2 = specs->_nz2 = 0; - - if( ( specs->_character == 'b' ) || - ( specs->_character == 'o' ) || - ( specs->_character == 'u' ) || - ( specs->_character == 'x' ) || - ( specs->_character == 'X' ) ) { -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->_flags & SPF_LONG_LONG ) { - long_long_value = va_arg( pargs->v, unsigned long long ); - } else -#endif - if( specs->_flags & SPF_LONG ) { - long_value = va_arg( pargs->v, unsigned long ); - } else { - long_value = va_arg( pargs->v, unsigned ); - if( specs->_flags & SPF_SHORT ) { /* JBS 92/02/12 */ - long_value = (unsigned short) long_value; - } else if( specs->_flags & SPF_CHAR ) { - long_value = (unsigned char)long_value; - } - } - } else - - if( ( specs->_character == 'd' ) || - ( specs->_character == 'i' ) ) { - -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->_flags & SPF_LONG_LONG ) { - long_long_value = va_arg( pargs->v, long long ); - } else -#endif - if( specs->_flags & SPF_LONG ) { - long_value = va_arg( pargs->v, long ); - } else { - long_value = va_arg( pargs->v, int ); - if( specs->_flags & SPF_SHORT ) { /* JBS 92/02/12 */ - long_value = (short) long_value; - } else if( specs->_flags & SPF_CHAR ) { - long_value = (signed char)long_value; - } - } - { - int negative = FALSE; - -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->_flags & SPF_LONG_LONG ) { - if( (long long)long_long_value < 0 ) { - negative = TRUE; - } - } else -#endif - if( (long)long_value < 0 ) { - negative = TRUE; - } - if( negative ) { - buffer[specs->_n0++] = '-'; - -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->_flags & SPF_LONG_LONG ) { - long_long_value = -long_long_value; - } else -#endif - long_value = - long_value; - } else if( specs->_flags & SPF_FORCE_SIGN ) { - buffer[specs->_n0++] = '+'; - } else if( specs->_flags & SPF_BLANK ) { - buffer[specs->_n0++] = ' '; - } - } - } - - radix = 10; /* base 10 for 'd', 'i' and 'u' */ - switch( specs->_character ) { - case 'f': - case 'F': - if( specs->_flags & SPF_SHORT ) { /* "%hf" 13-jun-91 */ - long_value = va_arg( pargs->v, long ); - FixedPoint_Format( buffer, long_value, specs ); - specs->_n1 = far_strlen( buffer, -1 ); - break; - } - /* types f & F fall through */ - - case 'g': - case 'G': - case 'e': - case 'E': - float_format( buffer, pargs, specs ); - SetZeroPad( specs ); - arg++; // = &buffer[1]; - break; - - case 's': -#ifndef __NETWARE__ - case WIDE_CHAR_STRING: -#else - case PASCAL_STRING: -#endif - // arg has been initialized to point to buffer - // set buffer[0] to a null character assuming pointer will be NULL - // If pointer is not null, then arg will be assigned the pointer - buffer[0] = '\0'; // assume null pointer -#if defined( __FAR_SUPPORT__ ) - if( specs->_flags & SPF_FAR ) { - CHAR_TYPE _WCFAR *temp = va_arg( pargs->v, CHAR_TYPE _WCFAR * ); - - if( temp ) { - arg = temp; - } - } else if( specs->_flags & SPF_NEAR ) { - CHAR_TYPE _WCNEAR *temp = va_arg( pargs->v, CHAR_TYPE _WCNEAR * ); - - if( temp ) { - arg = (void *)temp; - } - } else { - CHAR_TYPE *temp = va_arg( pargs->v, CHAR_TYPE * ); - - if( temp ) { - arg = temp; - } - } -#else - { - CHAR_TYPE *temp = va_arg( pargs->v, CHAR_TYPE * ); - - if( temp ) { - arg = temp; - } - } -#endif - -#ifdef __NETWARE__ - if( specs->_character == PASCAL_STRING ) { -#ifdef __WIDECHAR__ - if( specs->_flags & SPF_SHORT ) -#else - if( specs->_flags & SPF_LONG ) -#endif - { - length = *( (_FAR_OTHER_STRING)arg ); - arg = (FAR_STRING)( (_FAR_OTHER_STRING)arg + 1 ); - } else { - length = *arg++; - } - } else -#elif !defined( __NETWARE__ ) && !defined( __WIDECHAR__ ) - if( specs->_character == WIDE_CHAR_STRING ) { - if( specs->_flags & SPF_SHORT ) { - length = far_strlen( arg, specs->_prec ); - } else { - length = far_other_strlen( arg, specs->_prec ); - } - } else -#endif - -#ifdef __WIDECHAR__ - if( specs->_flags & SPF_SHORT ) { -#else - if( specs->_flags & SPF_LONG ) { -#endif - length = far_other_strlen( arg, specs->_prec ); - } else { - length = far_strlen( arg, specs->_prec ); - } - - specs->_n1 = length; - if(( specs->_prec >= 0 ) && ( specs->_prec < length )) { - specs->_n1 = specs->_prec; - } - break; - - case 'x': - case 'X': - if( specs->_flags & SPF_ALT ) { -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->_flags & SPF_LONG_LONG ) { - if( long_long_value != 0 ) { - buffer[specs->_n0++] = '0'; - buffer[specs->_n0++] = specs->_character; - } - } else -#endif - if( long_value != 0 ) { - buffer[specs->_n0++] = '0'; - buffer[specs->_n0++] = specs->_character; - } - } - radix = 16; /* base 16 */ - goto processNumericTypes; - - case 'b': /* CDH 2003 Apr 23 *//* Add binary mode */ - radix = 2; /* base 2 */ - goto processNumericTypes; - - case 'o': - radix = 8; /* base 8 */ - /* 'o' conversion falls through */ - - case 'd': - case 'i': - case 'u': -// 'x' and 'X' jumps here - -processNumericTypes: - if( specs->_prec != -1 ) - specs->_pad_char = ' '; /* 30-jul-95, 11-may-99 */ - - /* radix contains the base; 8 for 'o', 10 for 'd' and 'i' and 'u', - 16 for 'x' and 'X', and 2 for 'b' */ - - arg = &buffer[ specs->_n0 ]; - -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->_flags & SPF_LONG_LONG ) { - if(( specs->_prec == 0 ) && ( long_long_value == 0 )) { - *arg = '\0'; - length = 0; - } else { - __F_NAME(ulltoa,_ulltow)( long_long_value, &buffer[specs->_n0], radix ); - if( specs->_character == 'X' ) { - __F_NAME(strupr,_wcsupr)( buffer ); - } - length = far_strlen( arg, -1 ); - } - } else -#endif - if(( specs->_prec == 0 ) && ( long_value == 0 )) { - *arg = '\0'; - length = 0; - } else { - __F_NAME(ultoa,_ultow)( long_value, &buffer[specs->_n0], radix ); - if( specs->_character == 'X' ) { - __F_NAME(strupr,_wcsupr)( buffer ); - } - length = far_strlen( arg, -1 ); - } - specs->_n1 = length; - if( specs->_n1 < specs->_prec ) { - specs->_nz0 = specs->_prec - specs->_n1; - } else if( specs->_flags & SPF_ALT && radix < 10 - && (!length || (arg[0] != '0')) ) { - /* For 'b' and 'o' conversions, alternate format forces the number to - * start with a zero (effectively increases precision by one), but - * only if it doesn't start with a zero already. - */ - ++specs->_nz0; - } - if( specs->_prec == -1 ) { - SetZeroPad( specs ); - } - break; - - case 'p': - case 'P': -#if defined( __FAR_SUPPORT__ ) - #if defined( __BIG_DATA__ ) - if( !( specs->_flags & (SPF_NEAR|SPF_FAR) ) ) { - specs->_flags |= SPF_FAR; - } - if( specs->_fld_width == 0 ) { - if( specs->_flags & SPF_NEAR ) { - specs->_fld_width = sizeof( unsigned ) * 2; - } else { - specs->_fld_width = sizeof( CHAR_TYPE _WCFAR * ) * 2 + 1; - } - } - #else - if( specs->_fld_width == 0 ) { - if( specs->_flags & SPF_FAR ) { - specs->_fld_width = sizeof( CHAR_TYPE _WCFAR * ) * 2 + 1; - } else { - specs->_fld_width = sizeof( unsigned ) * 2; - } - } - #endif -#else - if( specs->_fld_width == 0 ) { - specs->_fld_width = sizeof( unsigned ) * 2; - } -#endif - specs->_flags &= ~( SPF_BLANK | SPF_FORCE_SIGN ); - int_value = va_arg( pargs->v, unsigned ); /* offset */ -#if defined( __FAR_SUPPORT__ ) - if( specs->_flags & SPF_FAR ) { - seg_value = va_arg( pargs->v, unsigned ) & 0xFFFF; /* segment */ - /* use "unsigned short" for 386 instead of "unsigned" 21-jul-89 */ - fmt4hex( seg_value, buffer, sizeof( unsigned short ) * 2 ); - buffer[sizeof(unsigned short)*2] = ':'; - fmt4hex( int_value, buffer + sizeof( unsigned short ) * 2 + 1, - sizeof( unsigned ) * 2 ); - } else { - fmt4hex( int_value, buffer, sizeof( unsigned ) * 2 ); - } -#else - fmt4hex( int_value, buffer, sizeof( unsigned ) * 2 ); -#endif - if( specs->_character == 'P' ) { - __F_NAME(strupr,_wcsupr)( buffer ); - } - specs->_n0 = far_strlen( arg, -1 ); - break; - - case 'c': -#if defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - if( specs->_flags & SPF_SHORT ) { - char * mbPtr; - char mbBuf[MB_CUR_MAX]; - wchar_t wc; - - mbPtr = va_arg( pargs->v, char* ); - mbBuf[0] = mbPtr[0]; - if( _ismbblead( mbBuf[0] ) ) - mbBuf[1] = mbPtr[1]; - - if( mbtowc( &wc, mbBuf, MB_CUR_MAX ) != -1 ) { - buffer[0] = wc; - } - } else { - buffer[0] = va_arg( pargs->v, int ); - } - specs->_n0 = 1; -#elif !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - specs->_n0 = 1; - if( specs->_flags & SPF_LONG ) { - char mbBuf[MB_CUR_MAX]; - wchar_t wc; - - wc = va_arg( pargs->v, int ); - if( wctomb( mbBuf, wc ) != -1 ) { - buffer[0] = mbBuf[0]; - if( _ismbblead( mbBuf[0] ) ) { - buffer[1] = mbBuf[1]; - specs->_n0++; - } - } - } else { - buffer[0] = va_arg( pargs->v, int ); - } -#else - specs->_n0 = 1; - buffer[0] = va_arg( pargs->v, int ); -#endif - break; - -#if !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - case 'C': - bytes = wctomb( buffer, va_arg( pargs->v, int ) ); -// if( bytes != -1 && bytes <= specs->_prec ) { - if( bytes != -1 ) { /* Normative Addendum 4.5.3.3.1: no precision */ - specs->_n0 = bytes; - } else { - specs->_n0 = 0; - } - break; -#endif - - default: - specs->_fld_width = 0; - buffer[ 0 ] = specs->_character; - specs->_n0 = 1; - break; - } - return( arg ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/prtscncf.h b/programs/develop/open watcom/trunk/clib/src/prtscncf.h deleted file mode 100644 index fc410783a..000000000 --- a/programs/develop/open watcom/trunk/clib/src/prtscncf.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Configure 'j', 'z', and 't' modifiers for __scnf and __prtf. -* -****************************************************************************/ - - -#ifndef PTRSCNF_H_INCLUDED -#define PTRSCNF_H_INCLUDED - -#include -#include - -/* Currently size_t is always 'unsigned int', but won't be on LP64 systems */ - -#if SIZE_MAX == UINT_MAX - #define ZSPEC_IS_INT -#elif SIZE_MAX == ULONG_MAX - #define ZSPEC_IS_LONG -#else - #error Could not configure zspec -#endif - -/* Currently intmax_t is always 'long long int' but might be something - * else, in theory at least - */ -#if INTMAX_MAX == LLONG_MAX - #define JSPEC_IS_LLONG - #define JSPEC_CASE_LLONG case 'j': -#else - #error Could not configure jspec -#endif - -/* Currently ptrdiff_t can be either 'long int' or 'int' */ -#if PTRDIFF_MAX == INT_MAX - #define TSPEC_IS_INT -#elif PTRDIFF_MAX == LONG_MAX - #define TSPEC_IS_LONG -#else - #error Could not configure tspec -#endif - -#ifdef ZSPEC_IS_INT - #define ZSPEC_CASE_INT case 'z': -#else - #define ZSPEC_CASE_INT -#endif - -#ifdef ZSPEC_IS_LONG - #define ZSPEC_CASE_LONG case 'z': -#else - #define ZSPEC_CASE_LONG -#endif - -#ifdef TSPEC_IS_INT - #define TSPEC_CASE_INT case 't': -#else - #define TSPEC_CASE_INT -#endif - -#ifdef TSPEC_IS_LONG - #define TSPEC_CASE_LONG case 't': -#else - #define TSPEC_CASE_LONG -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/qread.h b/programs/develop/open watcom/trunk/clib/src/qread.h deleted file mode 100644 index ff1b3e239..000000000 --- a/programs/develop/open watcom/trunk/clib/src/qread.h +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototype for __qread() internal helper. -* -****************************************************************************/ - - -#ifdef __NETWARE__ - #define __qread( h, b, l ) read( h, b, l ) -#else - extern int __qread( int handle, void *buffer, unsigned len ); -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/qwrit.c b/programs/develop/open watcom/trunk/clib/src/qwrit.c deleted file mode 100644 index 1d7f0ac8b..000000000 --- a/programs/develop/open watcom/trunk/clib/src/qwrit.c +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include - -#include "iomode.h" -#include "fileacc.h" -#include "rtcheck.h" -#include "rtdata.h" -#include "seterrno.h" -#include "qwrite.h" -#include "liballoc.h" - - -/* - Use caution when setting the file pointer in a multithreaded - application. You must synchronize access to shared resources. For - example, an application whose threads share a file handle, update the - file pointer, and read from the file must protect this sequence by - using a critical section object or a mutex object. - */ - -typedef struct -{ DWORD attr; - DWORD flags; - DWORD cr_time; - DWORD cr_date; - DWORD acc_time; - DWORD acc_date; - DWORD mod_time; - DWORD mod_date; - DWORD size; - DWORD size_high; -} FILEINFO; - -typedef struct -{ - char *name; - unsigned int offset; -}__file_handle; - -int _stdcall get_fileinfo(const char *name,FILEINFO* pinfo); -int _stdcall write_file(const char *name,const void *buff,unsigned offset,unsigned count,unsigned *writes); -char* getfullpath(const char* path); - -int __qwrite( int handle, const void *buffer, unsigned len ) -{ - int atomic; - __file_handle *fh; - unsigned len_written; - - - __handle_check( handle, -1 ); - - fh = (__file_handle*) __getOSHandle( handle ); - - atomic = 0; - if( __GetIOMode( handle ) & _APPEND ) - { - FILEINFO info; - - _AccessFileH( handle ); - atomic = 1; - get_fileinfo(fh->name,&info); - fh->offset = info.size; - }; - - if(write_file(fh->name,buffer,fh->offset,len,&len_written)) - { - if ( len_written == 0) - { - if( atomic == 1 ) - _ReleaseFileH( handle ); - - return (-1); - }; - }; - - fh->offset+=len_written; - - - if( atomic == 1 ) - { - _ReleaseFileH( handle ); - } - return( len_written ); -} - -int write_once(const char *name, void *buffer, unsigned len) -{ char *path; - unsigned count; - - path= getfullpath(name); - write_file(path,buffer,0,len,&count); - lib_free(path); - return count; - -} diff --git a/programs/develop/open watcom/trunk/clib/src/qwrite.h b/programs/develop/open watcom/trunk/clib/src/qwrite.h deleted file mode 100644 index c9eb3b867..000000000 --- a/programs/develop/open watcom/trunk/clib/src/qwrite.h +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototype for __qwrite() internal helper. -* -****************************************************************************/ - - -#ifdef __NETWARE__ - #define __qwrite( h, b, l ) write( h, (void *)b, l ) -#else - extern int __qwrite( int, const void *, unsigned ); -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/rewind.c b/programs/develop/open watcom/trunk/clib/src/rewind.c deleted file mode 100644 index 23749ef76..000000000 --- a/programs/develop/open watcom/trunk/clib/src/rewind.c +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent implementation of rewind(). -* -****************************************************************************/ - - -#include "variety.h" -#include - - -_WCRTLINK void rewind( FILE *fp ) -{ - __stream_check( fp, 0 ); - clearerr( fp ); - fseek( fp, 0, SEEK_SET ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/riscstr.h b/programs/develop/open watcom/trunk/clib/src/riscstr.h deleted file mode 100644 index 4008e6529..000000000 --- a/programs/develop/open watcom/trunk/clib/src/riscstr.h +++ /dev/null @@ -1,359 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: RISC oriented string functions designed to access memory -* as aligned 32- or 64-bit words whenever possible. -* -****************************************************************************/ - - -#ifndef _RISCSTR_H_INCLUDED -#define _RISCSTR_H_INCLUDED - - -/* - * Determine if we're building RISC versions of string/memory routines. - */ - -#if defined(__AXP__) || defined(__PPC__) - #define __RISCSTR__ -#endif - -#ifdef __RISCSTR__ /* do nothing if not RISC target */ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#include "watcom.h" - - -/* - * Choose between 32- and 64-bit words. - */ - -#define USE_INT64 0 /* no 64-bit stuff for now */ - -#ifndef USE_INT64 - #ifdef __AXP__ - #define USE_INT64 1 - #else - #define USE_INT64 0 - #endif -#endif - -#if USE_INT64 - #define INT __int64 - #define UINT unsigned __int64 -#else - #define INT int - #define UINT uint_32 -#endif - -#define BYTES_PER_WORD ( sizeof( UINT ) ) -#define INT_SIZE ( BYTES_PER_WORD * 8 ) -#define CHARS_PER_WORD ( BYTES_PER_WORD / CHARSIZE ) - -#define MOD_BYTES_PER_WORD(__n) ( (__n) & (BYTES_PER_WORD-1) ) - - - -/* - * Macros to mask off a single character. - */ - -#if USE_INT64 - #define BYTE1 ( _riscdata->byteMasks[0].val ) - #define BYTE2 ( _riscdata->byteMasks[1].val ) - #define BYTE3 ( _riscdata->byteMasks[2].val ) - #define BYTE4 ( _riscdata->byteMasks[3].val ) - #define BYTE5 ( _riscdata->byteMasks[4].val ) - #define BYTE6 ( _riscdata->byteMasks[5].val ) - #define BYTE7 ( _riscdata->byteMasks[6].val ) - #define BYTE8 ( _riscdata->byteMasks[7].val ) -#else - #define BYTE1 ( 0x000000FF ) - #define BYTE2 ( 0x0000FF00 ) - #define BYTE3 ( 0x00FF0000 ) - #define BYTE4 ( 0xFF000000 ) -#endif - -#ifdef __WIDECHAR__ - #define CHR1MASK ( BYTE1 | BYTE2 ) - #define CHR2MASK ( BYTE3 | BYTE4 ) -#else - #define CHR1MASK ( BYTE1 ) - #define CHR2MASK ( BYTE2 ) - #define CHR3MASK ( BYTE3 ) - #define CHR4MASK ( BYTE4 ) -#endif - - -#ifdef __WIDECHAR__ - #define CHR1(__w) ( (__w) & CHR1MASK ) - #define CHR2(__w) ( (__w) & CHR2MASK ) -#else - #define CHR1(__w) ( (__w) & BYTE1 ) - #define CHR2(__w) ( (__w) & BYTE2 ) - #define CHR3(__w) ( (__w) & BYTE3 ) - #define CHR4(__w) ( (__w) & BYTE4 ) - #if USE_INT64 - #define CHR5(__w) ( (__w) & BYTE5 ) - #define CHR6(__w) ( (__w) & BYTE6 ) - #define CHR7(__w) ( (__w) & BYTE7 ) - #define CHR8(__w) ( (__w) & BYTE8 ) - #endif -#endif - - - -/* - * Macros for extracting the first characters in a word. - */ - -#if USE_INT64 - #define FRONT_BYTES(__n) ( _riscdata->frontCharsMasks[(__n)].val ) - #define FRONT_CHRS(__w,__o) ( (__w) & FRONT_BYTES_riscdata[(__o)].val ) -#else -// extern UINT __FRONT_BYTES[]; -// #define FRONT_BYTES __FRONT_BYTES - #define FRONT_BYTES ( _riscdata->frontCharsMasks ) - #define FRONT_CHRS(__w,__o) ( (__w) & FRONT_BYTES[(__o)] ) -#endif - - - -/* - * Macros for ignoring the first characters in a word. - */ - -#if USE_INT64 - #define SKIP_CHRS_MASKS(__n) ( _riscdata->skipCharsMasks[(__n)].val ) - #define SKIP_CHRS(__w,__o) ( (__w) & SKIP_CHRS_MASKS(__o) ) -#else -// extern UINT __SKIP_CHRS_MASKS[]; -// #define SKIP_CHRS_MASKS __SKIP_CHRS_MASKS - #define SKIP_CHRS_MASKS(__n) ( _riscdata->skipCharsMasks[(__n)] ) - #define SKIP_CHRS(__w,__o) ( (__w) & SKIP_CHRS_MASKS(__o) ) -#endif - - - -/* - * Macros for checking if a word contains a null byte. - */ - -#if USE_INT64 - #define SUB_M ( _riscdata->_01Mask.val ) - #define NIL_M ( _riscdata->_80Mask.val ) - #define SUB_MASK(__n) ( _riscdata->subMasks[(__n)].val ) -#else - #ifdef __WIDECHAR__ - #define SUB_M ( 0x00010001 ) - #define NIL_M ( 0x80008000 ) - #else - #define SUB_M ( 0x01010101 ) - #define NIL_M ( 0x80808080 ) - #endif -// extern UINT __SubMask[]; -// #define SUB_MASK __SubMask - #define SUB_MASK(__n) ( _riscdata->subMasks[(__n)] ) -#endif - -#define GOT_NIL(__w) ( ( (~(__w)) & ((__w) - SUB_M) ) & NIL_M ) - -#ifdef __WIDECHAR__ - #define OFFSET_GOT_NIL(__w,__o) ( ( (~(__w)) & ((__w) - SUB_MASK((__o)/CHARSIZE)) ) & NIL_M ) -#else - #define OFFSET_GOT_NIL(__w,__o) ( ( (~(__w)) & ((__w) - SUB_MASK(__o)) ) & NIL_M ) -#endif - - - -/* - * Some handy pointer manipulation macros. - */ - -#define ROUND(__p) ( (UINT*) ( (UINT)(__p) & (-sizeof(UINT)) ) ) - -#define OFFSET(__p) ( ((unsigned int)(__p)) & (sizeof(UINT)-1) ) - - - -/* - * Macros for uppercase and lowercase stuff. - */ - -#ifdef __WIDECHAR__ - #define CHR1_A ( 0x00000041 ) - #define CHR2_A ( 0x00410000 ) - - #define CHR1_Z ( 0x0000005A ) - #define CHR2_Z ( 0x005A0000 ) - - #define CHR1_A2a(s) ( s | 0x00000020 ) - #define CHR2_A2a(s) ( s | 0x00200000 ) -#else - #define CHR1_A ( 0x00000041 ) - #define CHR2_A ( 0x00004100 ) - #define CHR3_A ( 0x00410000 ) - #define CHR4_A ( 0x41000000 ) - - #define CHR1_Z ( 0x0000005A ) - #define CHR2_Z ( 0x00005A00 ) - #define CHR3_Z ( 0x005A0000 ) - #define CHR4_Z ( 0x5A000000 ) - - #define CHR1_A2a(s) ( s | 0x00000020 ) - #define CHR2_A2a(s) ( s | 0x00002000 ) - #define CHR3_A2a(s) ( s | 0x00200000 ) - #define CHR4_A2a(s) ( s | 0x20000000 ) -#endif - -#ifdef __WIDECHAR__ - #define TO_LOW_CHR1(s) ( ( (s>=CHR1_A) && (s<=CHR1_Z) ) ? CHR1_A2a(s) : s ) - #define TO_LOW_CHR2(s) ( ( (s>=CHR2_A) && (s<=CHR2_Z) ) ? CHR2_A2a(s) : s ) -#else - #define TO_LOW_CHR1(s) ( ( (s>=CHR1_A) && (s<=CHR1_Z) ) ? CHR1_A2a(s) : s ) - #define TO_LOW_CHR2(s) ( ( (s>=CHR2_A) && (s<=CHR2_Z) ) ? CHR2_A2a(s) : s ) - #define TO_LOW_CHR3(s) ( ( (s>=CHR3_A) && (s<=CHR3_Z) ) ? CHR3_A2a(s) : s ) - #define TO_LOW_CHR4(s) ( ( (s>=CHR4_A) && (s<=CHR4_Z) ) ? CHR4_A2a(s) : s ) -#endif - - -#ifdef __WIDECHAR__ - #define CHR1_a ( 0x00000061 ) - #define CHR2_a ( 0x00610000 ) - - #define CHR1_z ( 0x0000007A ) - #define CHR2_z ( 0x007A0000 ) - - #define CHR1_a2A(s) ( s & 0x000000DF ) - #define CHR2_a2A(s) ( s & 0x00DF0000 ) -#else - #define CHR1_a ( 0x00000061 ) - #define CHR2_a ( 0x00006100 ) - #define CHR3_a ( 0x00610000 ) - #define CHR4_a ( 0x61000000 ) - - #define CHR1_z ( 0x0000007A ) - #define CHR2_z ( 0x00007A00 ) - #define CHR3_z ( 0x007A0000 ) - #define CHR4_z ( 0x7A000000 ) - - #define CHR1_a2A(s) ( s & 0x000000DF ) - #define CHR2_a2A(s) ( s & 0x0000DF00 ) - #define CHR3_a2A(s) ( s & 0x00DF0000 ) - #define CHR4_a2A(s) ( s & 0xDF000000 ) -#endif - -#ifdef __WIDECHAR__ - #define TO_UPR_CHR1(s) ( ( (s>=CHR1_a) && (s<=CHR1_z) ) ? CHR1_a2A(s) : s ) - #define TO_UPR_CHR2(s) ( ( (s>=CHR2_a) && (s<=CHR2_z) ) ? CHR2_a2A(s) : s ) -#else - #define TO_UPR_CHR1(s) ( ( (s>=CHR1_a) && (s<=CHR1_z) ) ? CHR1_a2A(s) : s ) - #define TO_UPR_CHR2(s) ( ( (s>=CHR2_a) && (s<=CHR2_z) ) ? CHR2_a2A(s) : s ) - #define TO_UPR_CHR3(s) ( ( (s>=CHR3_a) && (s<=CHR3_z) ) ? CHR3_a2A(s) : s ) - #define TO_UPR_CHR4(s) ( ( (s>=CHR4_a) && (s<=CHR4_z) ) ? CHR4_a2A(s) : s ) -#endif - - - -/* - * Tweak characters within a word. - */ - -#ifdef __WIDECHAR__ - #define REVERSE_CHARS(__w) ( (CHR1(__w)<<16) | (CHR2(__w)>>16) ) -#else - #define REVERSE_CHARS(__w) ( (CHR1(__w)<<24) | (CHR2(__w)<<8) | \ - (CHR3(__w)>>8) | (CHR4(__w)>>24) ) -#endif - -#define SWAP_BYTES(__w) ( (((__w)&BYTE1)<<8) | (((__w)&BYTE2)>>8) | \ - (((__w)&BYTE3)<<8) | (((__w)&BYTE4)>>8) ) - - - -/* - * Data used by the RISC string functions. - */ - -struct __F_NAME(__RISC_StrData,__wRISC_StrData) { -#if USE_INT64 - unsigned_64 byteMasks[8]; - unsigned_64 frontCharsMasks[8]; - unsigned_64 skipCharsMasks[8]; - unsigned_64 _01Mask; - unsigned_64 _80Mask; - unsigned_64 subMasks[8]; -#else - #ifdef __WIDECHAR__ - uint_32 frontCharsMasks[2]; - uint_32 skipCharsMasks[2]; - uint_32 subMasks[2]; - #else - uint_32 frontCharsMasks[4]; - uint_32 skipCharsMasks[4]; - uint_32 subMasks[4]; - #endif -#endif -}; - - -#ifdef __WIDECHAR__ - extern struct __wRISC_StrData __wRISC_StringData; - #define RISC_DATA_LOCALREF struct __wRISC_StrData *_riscdata = &__wRISC_StringData -#else - extern struct __RISC_StrData __RISC_StringData; - #define RISC_DATA_LOCALREF struct __RISC_StrData *_riscdata = &__RISC_StringData -#endif - - - -/* - * Prototype functions called by the RISC-oriented string functions. - */ - -_WCRTLINK extern wchar_t * __simple_wcschr( const wchar_t *str, wint_t ch ); -_WCRTLINK extern int __simple_wcscmp( const wchar_t *s1, const wchar_t *s2 ); -_WCRTLINK extern wchar_t * __simple_wcscpy( wchar_t *dest, const wchar_t *src ); -_WCRTLINK extern int __simple__wcsicmp( const wchar_t *s1, const wchar_t *s2 ); -_WCRTLINK extern size_t __simple_wcslen( const wchar_t *str ); -_WCRTLINK extern wchar_t * __simple__wcslwr( wchar_t *str ); -_WCRTLINK extern int __simple_wcsncmp( const wchar_t *s1, const wchar_t *s2, size_t n ); -_WCRTLINK extern wchar_t * __simple_wcsncpy( wchar_t *dest, const wchar_t *src, size_t n ); -_WCRTLINK extern int __simple__wcsnicmp( const wchar_t *s1, const wchar_t *s2, size_t n ); -_WCRTLINK extern wchar_t * __simple__wcsnset( wchar_t *str, int ch, size_t n ); -_WCRTLINK extern wchar_t * __simple_wcsrchr( const wchar_t *str, wint_t ch ); -_WCRTLINK extern wchar_t * __simple__wcsset( wchar_t *str, wchar_t ch ); -_WCRTLINK extern wchar_t * __simple__wcsupr( wchar_t *str ); - - -#endif /* #ifdef __RISCSTR__ */ - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/rtcheck.h b/programs/develop/open watcom/trunk/clib/src/rtcheck.h deleted file mode 100644 index 1a7d874c9..000000000 --- a/programs/develop/open watcom/trunk/clib/src/rtcheck.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Perform runtime file handle checks. -* -****************************************************************************/ - - -#ifndef _RTCHECK_H_INCLUDED -#define _RTCHECK_H_INCLUDED - -#include "variety.h" -#include -#include "seterrno.h" - -/*********** -#if ( defined(__NT__) || defined(__RUNTIME_HANDLE_CHECKS__) ) \ - && ( !defined(__NETWARE__) && !defined(__UNIX__) \ - && !defined(__OSI__) ) - - extern unsigned __NFiles; - - #define __handle_check( __h, __r ) \ - if( (__h) < 0 || (__h) > __NFiles ) { \ - __set_errno( EBADF ); \ - return( __r ); \ - } - -#else - - #define __handle_check( __h, __r ) - -#endif -**************/ - -#define __handle_check( __h, __r ) - - -#endif - diff --git a/programs/develop/open watcom/trunk/clib/src/rtdata.h b/programs/develop/open watcom/trunk/clib/src/rtdata.h deleted file mode 100644 index f218987f4..000000000 --- a/programs/develop/open watcom/trunk/clib/src/rtdata.h +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Internal CLIB structures and variables. -* -****************************************************************************/ - - -#ifndef _RTDATA_H_INCLUDED -#define _RTDATA_H_INCLUDED - -#include "variety.h" - -#include -#include "errorno.h" - -/* DOS based platforms have stdaux/stdprn in addition to stdin/out/err */ -#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OSI__) - #define NUM_STD_STREAMS 5 -#else - #define NUM_STD_STREAMS 3 -#endif - -#if defined(__NT__) || defined(__OS2__) - struct __pipe_info { - int isPipe; /* non-zero if it's a pipe */ - int pid; /* PID of spawned process */ - }; -#endif - -typedef struct __stream_link { - struct __stream_link * next; - struct __iobuf * stream; - unsigned char * _base; /* location of buffer */ - int _orientation; /* wide/byte/not oriented */ - int _extflags; /* extended flags */ - unsigned char _tmpfchar; /* tmpfile number */ - unsigned char _filler[sizeof(int)-1];/* explicit padding */ -#if defined(__NT__) || defined(__OS2__) - struct __pipe_info pipeInfo; /* pipe-related fields */ -#endif -} __stream_link; - -typedef void _WCI86FAR FPEhandler( int ); - -#define _FP_BASE(__fp) ((__fp)->_link->_base) -#ifndef __NETWARE__ - #define _FP_ORIENTATION(__fp) ((__fp)->_link->_orientation) - #define _FP_EXTFLAGS(__fp) ((__fp)->_link->_extflags) -#endif - #define _FP_TMPFCHAR(__fp) ((__fp)->_link->_tmpfchar) -#ifndef __NETWARE__ - #define _FP_PIPEDATA(__fp) ((__fp)->_link->pipeInfo) -#endif - -extern __stream_link *__OpenStreams; -extern __stream_link *__ClosedStreams; -extern char * _WCNEAR __env_mask; /* ptr to char array of flags */ -extern FPEhandler *__FPE_handler; -extern void (*__FPE_handler_exit)( void ); -#if !defined(__NETWARE__) - extern int _cbyte; - extern int _cbyte2; - extern int _child; - extern int __umaskval; - extern unsigned _curbrk; - extern int _commode; -#endif -#if !defined (_NETWARE_LIBC) -extern unsigned _STACKTOP; -#endif -#if !defined(__QNX__) && !defined(__LINUX__) - extern void (*__Save8087)();/* Ptr to FP state save rtn (spawn) */ - extern void (*__Rest8087)();/* Ptr to FP state restore rtn (spawn) */ -#endif -extern unsigned short _8087cw; /* control word initializer */ -extern unsigned char _no87; /* NO87 environment var defined */ -extern unsigned char _8087; /* type of 8087/emulator present */ -extern unsigned char _real87; /* 8087 coprocessor hardware present */ -#if defined(_M_IX86) - #pragma aux _8087cw "_*"; - #pragma aux _no87 "_*"; - #pragma aux _8087 "_*"; - #pragma aux _real87 "_*"; -#endif -#if !defined(__SW_BM) - extern unsigned _STACKLOW; -#endif - -#define _RWD_ostream __OpenStreams -#define _RWD_cstream __ClosedStreams -#define _RWD_iob __iob -#if !defined(__NETWARE__) - #define _RWD_threadid _threadid -#endif -#define _RWD_environ environ -#define _RWD_wenviron _wenviron -#define _RWD_env_mask __env_mask -#define _RWD_abort __abort -#define _RWD_sigtab __SIGNALTABLE -#define _RWD_FPE_handler_exit __FPE_handler_exit -#define _RWD_FPE_handler __FPE_handler -#define _RWD_fmode _fmode -#if !defined(__NETWARE__) - #define _RWD_umaskval __umaskval - #define _RWD_cbyte _cbyte - #define _RWD_cbyte2 _cbyte2 - #define _RWD_child _child - #define _RWD_amblksiz _amblksiz - #define _RWD_curbrk _curbrk - #define _RWD_dynend _dynend - #define _RWD_psp _psp -#endif -#if !defined (_NETWARE_LIBC) -#define _RWD_stacktop _STACKTOP -#endif -#if !defined(__QNX__) && !defined(__LINUX__) - #define _RWD_Save8087 __Save8087 - #define _RWD_Rest8087 __Rest8087 -#endif -#define _RWD_8087cw _8087cw -#define _RWD_no87 _no87 -#define _RWD_8087 _8087 -#define _RWD_real87 _real87 -#if !defined(__NETWARE__) - #define _RWD_HShift _HShift - #define _RWD_osmajor _osmajor - #define _RWD_osminor _osminor - #define _RWD_osmode _osmode - #if defined(__NT__) - #define _RWD_osbuild _osbuild - #define _RWD_osver _osver - #define _RWD_winmajor _winmajor - #define _RWD_winminor _winminor - #define _RWD_winver _winver - #endif - #define _RWD_doserrno _DOSERRNO -#endif -#define _RWD_tmpfnext __tmpfnext -#if !defined(_RWD_errno) - #define _RWD_errno _ERRNO -#endif -#define _RWD_nexttok _NEXTTOK -#define _RWD_nextftok _NEXTFTOK -#define _RWD_nextmbtok _NEXTMBTOK -#define _RWD_nextmbftok _NEXTMBFTOK -#define _RWD_nextwtok _NEXTWTOK -#define _RWD_tzname tzname -#define _RWD_timezone timezone -#define _RWD_daylight daylight -#define _RWD_dst_adjust __dst_adjust -#define _RWD_start_dst __start_dst -#define _RWD_end_dst __end_dst -#define _RWD_asctime _RESULT -#ifdef __SW_BM - #define _RWD_cvtbuf __THREADDATAPTR->__cvt_buffer -#else - #define _RWD_cvtbuf cvt_buffer -#endif -#if defined(__NETWARE__) - #define _RWD_ioexit __ioexit - #define _RWD_tmpnambuf (__THREADDATAPTR->__tmpnambuf) - #define _RWD_randnextinit (__THREADDATAPTR->__randnextinit) -#else - #define _RWD_tmpnambuf _tmpname - #define _RWD_randnextinit THREAD_PTR.__randnextinit -#endif -#define _RWD_stacklow _STACKLOW -#define _RWD_randnext _RANDNEXT -#define _RWD_ThreadData _ThreadData -#define _RWD_StaticInitSema _StaticInitSema -#define _RWD_PureErrorFlag _PureErrorFlag -#define _RWD_UndefVfunFlag _UndefVfunFlag -#define _RWD_ModuleInit _ModuleInit - -/* - For the sake of efficiency, tell the compiler - that the __exit... routines never return. -*/ -_WCRTLINK extern void __exit( unsigned ); -#if defined(_M_IX86) - #pragma aux __exit aborts; -#endif - -extern void (*__abort)( void ); // Defined in abort.c -extern void __terminate( void ); // Defined in abort.c - -#endif // _RTDATA_H_INCLUDED diff --git a/programs/develop/open watcom/trunk/clib/src/rtinit.h b/programs/develop/open watcom/trunk/clib/src/rtinit.h deleted file mode 100644 index 73d2f4864..000000000 --- a/programs/develop/open watcom/trunk/clib/src/rtinit.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Structures for run-time initialization/finalization. -* -****************************************************************************/ - - -#ifndef __RTINIT_H__ -#define __RTINIT_H__ - -#include "langenvd.h" -#if defined( __PPC__ ) - #define __TGT_SYS __TGT_SYS_AXP_PPC - typedef unsigned __type_rtp; - typedef unsigned __type_pad; - typedef void( *__type_rtn ) ( void ); -#elif defined( __AXP__ ) - #define __TGT_SYS __TGT_SYS_AXP_NT - typedef unsigned __type_rtp; - typedef unsigned __type_pad; - typedef void( *__type_rtn ) ( void ); -#elif defined( __MIPS__ ) - #define __TGT_SYS __TGT_SYS_MIPS - typedef unsigned __type_rtp; - typedef unsigned __type_pad; - typedef void( *__type_rtn ) ( void ); -#else - #define __TGT_SYS __TGT_SYS_X86 - typedef unsigned char __type_rtp; - typedef unsigned short __type_pad; - #if defined( __386__ ) - typedef void __near( *__type_rtn ) ( void ); - #else - typedef void( *__type_rtn ) ( void ); - #endif -#endif -#include "langenv.h" - -#if defined( __MEDIUM__ ) || defined( __LARGE__ ) || defined( __HUGE__ ) - #define __LARGE_CODE__ -#endif - -// initialization progresses from highest priority to lowest -// finalization progresses from lowest to highest -#pragma pack( 1 ) -struct rt_init // structure placed in XI/YI segment -{ - __type_rtp rtn_type; // - near=0/far=1 routine indication - // also used when walking table to flag - // completed entries - __type_rtp priority; // - priority (0-highest 255-lowest) - __type_rtn rtn; // - routine -#if !( defined( __LARGE_CODE__ ) || defined( __386__ ) ) || defined( COMP_CFG_COFF ) - __type_pad padding; // - padding, when small code ptr - // or when risc cpu -#endif -}; -#pragma pack() - -#if defined( M_I86 ) - #if defined( __LARGE_CODE__ ) /* segmented large code models */ - #define YIXI( seg, label, routine, priority ) \ - struct rt_init __based( __segname( seg ) ) label = \ - { 1, priority, routine }; - #else /* other segmented models */ - #define YIXI( seg, label, routine, priority ) \ - struct rt_init __based( __segname( seg ) ) label = \ - { 0, priority, routine, 0 }; - #endif -#else /* non-segmented architectures */ - #define YIXI( seg, label, routine, priority ) \ - struct rt_init __based( __segname( seg ) ) label = \ - { 0, priority, routine }; -#endif - -/* - Use these when you want a global label for the XI/YI structure -*/ -#define XI( label, routine, priority ) YIXI( TS_SEG_XI, label, routine, priority ) -#define YI( label, routine, priority ) YIXI( TS_SEG_YI, label, routine, priority ) - -/* - Use these when you don't care about the label on the XI/YI structure -*/ -#define __ANON( x ) __anon ## x -#define ANON( x ) __ANON( x ) -#define AXI( routine, priority ) static XI( ANON( __LINE__ ), routine, priority ) -#define AYI( routine, priority ) static YI( ANON( __LINE__ ), routine, priority ) - -enum { - INIT_PRIORITY_THREAD = 1, // priority for thread data init - INIT_PRIORITY_FPU = 2, // priority for FPU/EMU init - INIT_PRIORITY_RUNTIME = 10, // priority for run/time initialization - INIT_PRIORITY_IOSTREAM = 20, // priority for IOSTREAM - INIT_PRIORITY_LIBRARY = 32, // default library-initialization priority - INIT_PRIORITY_PROGRAM = 64, // default program-initialization priority - FINI_PRIORITY_DTOR = 40, // priority for module DTOR - DTOR_PRIORITY = 40, // priority for module DTOR - FINI_PRIORITY_EXIT = 16 // when exit() is called, functions between - // 255 and this are called, the rest of the - // fini routines are called from __exit(). -}; - -/* have to turn off, or we get unref'd warnings for AXI & AYI stuff */ -#pragma off( unreferenced ) - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/saferlib.h b/programs/develop/open watcom/trunk/clib/src/saferlib.h deleted file mode 100644 index 77a1907fe..000000000 --- a/programs/develop/open watcom/trunk/clib/src/saferlib.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Internal data and routines for "Safer C", or bounds-checking -* library extension. -* -****************************************************************************/ - - -#ifndef _SAFERLIB_H_INCLUDED -#define _SAFERLIB_H_INCLUDED - -#define __STDC_WANT_LIB_EXT1__ 1 -#include -#include - -// Maximum length of runtime-constraint error message -#define RTCT_MSG_MAX 128 - -#define _RWD_rtcthandler __runtime_constraint_handler - -extern constraint_handler_t __runtime_constraint_handler; - -extern void __rtct_fail( const char *fn, const char *reason, void *reserved ); - -// Runtime-constraint validation macros. Call the handler and return zero if check -// failed, return non-zero value if check succeeded. - -#define __check_constraint_nullptr( arg ) \ - ((arg == NULL) ? __rtct_fail( __func__, #arg " == NULL", NULL ), 0 : 1) - -#define __check_constraint_maxsize( arg ) \ - ((arg > RSIZE_MAX) ? __rtct_fail( __func__, #arg " > RSIZE_MAX", NULL ), 0 : 1) - -#define __check_constraint_zero( arg ) \ - ((arg == 0) ? __rtct_fail( __func__, #arg " == 0", NULL ), 0 : 1) - -#define __check_constraint_toosmall( name, left ) \ - ((left == 0) ? __rtct_fail( __func__, #name " is too small to hold data", NULL ), 0 : 1) - - -// Runtime-constraint validation macros. Construct the message and return -// zero if check failed, return non-zero value if check succeeded. -// __rtct_fail has to be explicitly called later. - -#define __check_constraint_nullptr_msg( msg, arg ) \ - ((arg == NULL) ? ( msg = #arg " == NULL" ), 0 : 1) - -#define __check_constraint_maxsize_msg( msg, arg ) \ - ((arg > RSIZE_MAX) ? ( msg = #arg " > RSIZE_MAX" ), 0 : 1) - -#define __check_constraint_zero_msg( msg, arg ) \ - ((arg == 0) ? ( msg = #arg " == 0" ), 0 : 1) - -#define __check_constraint_toosmall_msg( msg, name, left ) \ - ((left == 0) ? ( msg = #name " is too small to hold data" ), 0 : 1) - -#define __check_constraint_a_gt_b_msg( msg, a, b ) \ - ((a > b) ? ( msg = #a " > " #b ), 0 : 1) - -#define __check_constraint_overlap_msg( msg, p1, len1, p2, len2 ) \ - (((p1 == p2) || ( (p1 > p2) && ( p1 < (CHAR_TYPE *)p2 + len2 * sizeof( CHAR_TYPE ))) \ - || ( (p2 > p1) && ( p2 < (CHAR_TYPE *)p1 + len1 * sizeof( CHAR_TYPE )))) \ - ? ( msg = #p1 " overlap " #p2 ), 0 : 1) - - -// For 16-bit targets, the RSIZE_MAX check is effectively no-op. Object sizes -// up to SIZE_MAX are legal and not uncommon. -#if RSIZE_MAX == SIZE_MAX - #undef __check_constraint_maxsize - #define __check_constraint_maxsize( arg ) 1 - #undef __check_constraint_maxsize_msg - #define __check_constraint_maxsize_msg( msg, arg ) 1 - - #define __lte_rsizmax( arg ) 1 -#else - #define __lte_rsizmax( arg ) (arg <= RSIZE_MAX) -#endif - -#endif // _SAFERLIB_H_INCLUDED diff --git a/programs/develop/open watcom/trunk/clib/src/scanf.h b/programs/develop/open watcom/trunk/clib/src/scanf.h deleted file mode 100644 index 1dbb53e5b..000000000 --- a/programs/develop/open watcom/trunk/clib/src/scanf.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Format specification descriptor for scanf family. -* -****************************************************************************/ - - -#ifndef _SCANF_H_INCLUDED -#define _SCANF_H_INCLUDED - -#include "variety.h" -#include "widechar.h" -#include - -typedef struct { - int (*cget_rtn)(); /* character get rtn */ - void (*uncget_rtn)(); /* unget a character rtn */ - CHAR_TYPE *ptr; /* file or string pointer */ - int width; /* conversion field width */ - unsigned assign : 1; /* assignment flag for current argument */ - unsigned eoinp : 1; /* end of input reached */ - unsigned far_ptr : 1; /* F - far pointer */ - unsigned near_ptr : 1; /* N - near pointer */ - unsigned char_var : 1; /* hh - char variable */ - unsigned short_var : 1; /* h - short variable */ - unsigned long_var : 1; /* l - long variable */ - unsigned long_long_var : 1; /* ll - long long variable */ - unsigned long_double_var: 1; /* L - long double variable */ - unsigned p_format : 1; /* %p (pointer conversion) */ -} SCNF_SPECS; - -#if defined(__HUGE__) - #define PTR_SCNF_SPECS SCNF_SPECS _WCFAR * -#else - #define PTR_SCNF_SPECS SCNF_SPECS * -#endif - -#if defined( __STDC_WANT_LIB_EXT1__ ) && __STDC_WANT_LIB_EXT1__ == 1 - #if defined(__WIDECHAR__) - extern int __wscnf_s( PTR_SCNF_SPECS, const CHAR_TYPE *, const char **msg, va_list ); - #else - extern int __scnf_s( PTR_SCNF_SPECS, const CHAR_TYPE *, const char **msg, va_list ); - #endif -#else - #if defined(__WIDECHAR__) - extern int __wscnf( PTR_SCNF_SPECS, const CHAR_TYPE *, va_list ); - #else - extern int __scnf( PTR_SCNF_SPECS, const CHAR_TYPE *, va_list ); - #endif -#endif - -//#pragma off(unreferenced); -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/scnf.c b/programs/develop/open watcom/trunk/clib/src/scnf.c deleted file mode 100644 index 378debae2..000000000 --- a/programs/develop/open watcom/trunk/clib/src/scnf.c +++ /dev/null @@ -1,1116 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Platform independent worker routines for scanf(). -* -****************************************************************************/ - - -#define __LONG_LONG_SUPPORT__ - -#if !defined( __NETWARE__ ) && !defined( __UNIX__ ) - #define USE_MBCS_TRANSLATION -#endif - -#include "variety.h" -#ifdef SAFE_SCANF - #include "saferlib.h" -#endif -#include "widechar.h" -#include -#include -#include -#ifdef __WIDECHAR__ - #include -#else - #include -#endif -#include -#include "scanf.h" -#include "prtscncf.h" -#include "fixpoint.h" -#include "ftos.h" -#include "farsupp.h" -#include "myvalist.h" -#if defined( __WIDECHAR__ ) || defined( USE_MBCS_TRANSLATION ) - #include -#endif - -#define TRUE 1 -#define FALSE 0 - -#define STOP_CHR 0xFFFFFFFF - -#define EFG_SCANF (*__EFG_scanf) - -/* internal file/string get, unget routines */ -#ifdef __WINDOWS_386__ - #ifdef __SW_3S - #pragma aux cget modify [eax edx ecx fs gs] - #pragma aux uncget modify [eax edx ecx fs gs] - #else - #pragma aux cget modify [fs gs] - #pragma aux uncget modify [fs gs] - #endif -#endif - -#if defined(__HUGE__) - #define SCNF_FAR _WCFAR -#else - #define SCNF_FAR -#endif - - -/* Macros to reduce the already large number of ifdefs in the code */ -#ifdef SAFE_SCANF - - #define GET_MAXELEM(x) x = va_arg( arg->v, size_t ) - #define DEFINE_VARS(x,y) size_t x, y = 0 - #define CHECK_ELEMS(x,y,z) if( x < ++y ) return( z ) -#else - - #define GET_MAXELEM(x) - #define DEFINE_VARS(x,y) - #define CHECK_ELEMS(x,y,z) - -#endif - -static int cget( PTR_SCNF_SPECS specs ) -{ - return( (*((specs)->cget_rtn))( specs ) ); -} - - -static void uncget( int c, PTR_SCNF_SPECS specs ) -{ - ((*((specs)->uncget_rtn))( c, specs )); -} - - -/* - * get_opt -- get option string for current conversion directive - * and fills in the SCNF_SPECS structure. - * returns advanced format string pointer. - */ -static const CHAR_TYPE *get_opt( const CHAR_TYPE *opt_str, PTR_SCNF_SPECS specs ) -{ - int c, width; - - specs->assign = TRUE; - specs->far_ptr = 0; - specs->near_ptr = 0; - specs->char_var = 0; - specs->short_var = 0; - specs->long_var = 0; - specs->long_long_var = 0; - specs->long_double_var = 0; - specs->p_format = 0; /* 21-nov-89 */ - specs->width = -1; - if( *opt_str == '*' ) { - specs->assign = FALSE; - ++opt_str; - } - c = *opt_str; - if( __F_NAME(isdigit,iswdigit)( c ) ) { - width = 0; - do { - width *= 10; - width += ( c - '0' ); - c = *++opt_str; - } while( __F_NAME(isdigit,iswdigit)( c ) ); - specs->width = width; - } - switch( *opt_str ) { - case 'N': - specs->near_ptr = 1; - ++opt_str; - break; -#if defined( __FAR_SUPPORT__ ) - case 'F': /* conflicts with ISO-defined 'F' conversion */ - /* fall through */ -#endif - case 'W': - specs->far_ptr = 1; - ++opt_str; - break; - } - switch( *opt_str ) { - case 'h': - if( opt_str[1] == 'h' ) { - specs->char_var = 1; - opt_str += 2; - break; - } - specs->short_var = 1; - ++opt_str; - break; - case 'l': -#if defined( __LONG_LONG_SUPPORT__ ) - if( opt_str[1] == 'l' ) { - specs->long_long_var = 1; - opt_str += 2; - break; - } -#endif - /* fall through */ - ZSPEC_CASE_LONG - TSPEC_CASE_LONG - case 'w': - specs->long_var = 1; - ++opt_str; - break; -#if defined( __LONG_LONG_SUPPORT__ ) - JSPEC_CASE_LLONG - /* fall through */ -#endif - case 'L': - specs->long_double_var = 1; - specs->long_long_var = 1; - ++opt_str; - break; -#if defined( __LONG_LONG_SUPPORT__ ) - case 'I': - if( opt_str[1] == '6' && opt_str[2] == '4' ) { - specs->long_long_var = 1; - opt_str += 3; - } - break; -#endif -#if defined( TSPEC_IS_INT ) || defined( ZSPEC_IS_INT ) - TSPEC_CASE_INT /* If either 't' or 'z' spec corresponds to 'int', */ - ZSPEC_CASE_INT /* we need to parse and ignore the spec. */ - ++opt_str; - break; -#endif - } - return( opt_str ); -} - - -/* - * scan_white -- scan white space from input stream - */ -static int scan_white( PTR_SCNF_SPECS specs ) -{ - int c, len; - - len = 0; - for( ;; ) { - c = cget( specs ); - if( !__F_NAME(isspace,iswspace)( c ) ) - break; - ++len; - } - if( !specs->eoinp ) - uncget( c, specs ); - return( len ); -} - -/* - * scan_char -- handles %c and %C - */ -static int scan_char( PTR_SCNF_SPECS specs, my_va_list *arg ) -{ - int len; - int width; - FAR_STRING str; - int c; - DEFINE_VARS( maxelem, nelem ); - - if( specs->assign ) { -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - str = va_arg( arg->v, CHAR_TYPE _WCFAR * ); - } else if( specs->near_ptr ) { - str = va_arg( arg->v, CHAR_TYPE _WCNEAR * ); - } else { - str = va_arg( arg->v, CHAR_TYPE * ); - } -#else - str = va_arg( arg->v, CHAR_TYPE * ); -#endif - GET_MAXELEM( maxelem ); - } - len = 0; - if( (width = specs->width) == -1 ) - width = 1; - while( width > 0 ) { - c = cget( specs ); - if( specs->eoinp ) - break; - ++len; - --width; - if( specs->assign ) { - CHECK_ELEMS( maxelem, nelem, -1 ); -#if defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - if( specs->short_var ) { - char mbBuf[MB_CUR_MAX]; - - if( wctomb( mbBuf, c ) != -1 ) { - *(FAR_ASCII_STRING)str = mbBuf[0]; - str = (FAR_STRING) ( (FAR_ASCII_STRING)str + 1 ); - if( _ismbblead( mbBuf[0] ) ) { - CHECK_ELEMS( maxelem, nelem, -1 ); - *(FAR_ASCII_STRING)str = mbBuf[1]; - str = (FAR_STRING) ( (FAR_ASCII_STRING)str + 1 ); - } - } else { - return( 0 ); - } - } else { - *str++ = c; - } -#elif defined( USE_MBCS_TRANSLATION ) - if( specs->long_var ) { - wchar_t wc; - char mbBuf[MB_CUR_MAX]; - - mbBuf[0] = c; - if( _ismbblead( mbBuf[0] ) ) - mbBuf[1] = cget( specs ); - if( mbtowc( &wc, mbBuf, MB_CUR_MAX ) != -1 ) { - *(FAR_UNI_STRING)str = wc; - str = (FAR_STRING) ( (FAR_UNI_STRING)str + 1 ); - } else { - return( 0 ); - } - } else { - *str++ = c; - } -#else - *str++ = c; -#endif - } - } - return( len ); -} - - -/* - * cgetw -- cget which keeps track of field width. - * returns STOP_CHR on end of field or end of file. - */ -static long cgetw( PTR_SCNF_SPECS specs ) -{ - int c; - - if( specs->width-- == 0 ) - return( STOP_CHR ); - c = cget( specs ); - return( !( specs->eoinp ) ? c : STOP_CHR ); -} - - -/* - * scan_string -- handles %s and %S - */ -static int scan_string( PTR_SCNF_SPECS specs, my_va_list *arg ) -{ - int c; - int len; - FAR_ASCII_STRING str; - char chsize; - DEFINE_VARS( maxelem, nelem ); - - if( specs->long_var ) { /* %ls or %ws */ - chsize = sizeof( wchar_t ); - } else if( specs->short_var ) { /* %hs */ - chsize = 1; - } else { /* %s */ - chsize = CHARSIZE; - } - if( specs->assign ) { -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - str = va_arg( arg->v, char _WCFAR * ); - } else if( specs->near_ptr ) { - str = va_arg( arg->v, char _WCNEAR * ); - } else { - str = va_arg( arg->v, char * ); - } -#else - str = va_arg( arg->v, char * ); -#endif - GET_MAXELEM( maxelem ); - } - len = 0; - for( ;; ) { - c = cget( specs ); - if( !__F_NAME(isspace,iswspace)( c ) ) - break; - ++len; - } - if( specs->eoinp ) { - len = 0; /* since this is eof, no input done */ - goto done; - } - if( specs->width-- == 0 ) - goto ugdone; - do { - ++len; - if( specs->assign ) { - CHECK_ELEMS( maxelem, nelem, -1 ); - if( chsize == 1 ) { -#if defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - char mbBuf[MB_CUR_MAX]; - - if( wctomb( mbBuf, c ) != -1 ) { - *(FAR_ASCII_STRING)str = mbBuf[0]; - if( _ismbblead( mbBuf[0] ) ) { - CHECK_ELEMS( maxelem, nelem, -1 ); - str++; - *(FAR_ASCII_STRING)str = mbBuf[1]; - } - } else { - return( 0 ); - } -#else - *str = c; -#endif - } else { -#if !defined( __WIDECHAR__ ) && defined( USE_MBCS_TRANSLATION ) - wchar_t wc; - char mbBuf[MB_CUR_MAX]; - - mbBuf[0] = c; - if( _ismbblead( mbBuf[0] ) ) - mbBuf[1] = cget( specs ); - if( mbtowc( &wc, mbBuf, MB_CUR_MAX ) != -1 ) { - *(FAR_UNI_STRING)str = wc; - } else { - return( 0 ); - } -#else - *(FAR_UNI_STRING)str = c; -#endif - } - str += chsize; - } - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } while( !__F_NAME(isspace,iswspace)( c ) ); -ugdone: - uncget( c, specs ); -done: - if( specs->assign && len > 0 ) { - CHECK_ELEMS( maxelem, nelem, -1 ); - if( chsize == 1 ) { - *str = '\0'; - } else { - *(FAR_UNI_STRING)str = 0; - } - } - return( len ); -} - - -/* - * report_scan -- handles %n - */ -static void report_scan( PTR_SCNF_SPECS specs, my_va_list *arg, int match ) -{ - FAR_INT iptr; - - if( specs->assign ) { -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - iptr = va_arg( arg->v, int _WCFAR * ); - } else if( specs->near_ptr ) { - iptr = va_arg( arg->v, int _WCNEAR * ); - } else { - iptr = va_arg( arg->v, int * ); - } -#else - iptr = va_arg( arg->v, int * ); -#endif - if( specs->char_var ) { - *((FAR_CHAR)iptr) = match; - } else if( specs->short_var ) { - *((FAR_SHORT)iptr) = match; - } else if( specs->long_var ) { - *((FAR_LONG)iptr) = match; -#if defined( __LONG_LONG_SUPPORT__ ) - } else if( specs->long_long_var ) { - *((FAR_INT64)iptr) = match; -#endif - } else { - *iptr = match; - } - } -} - -#if !defined( __WIDECHAR__ ) -#define SCANSET_LENGTH (256 / 8) - -static const char lst_mask[8] = { - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 -}; - -/* - * makelist -- create scanset for %[ directive. - * scanset is stored as 256 bit flags in a 32 byte array. - */ -static const char *makelist( const char *format, char *scanset ) -{ - int lst_chr; - - memset( scanset, 0, SCANSET_LENGTH ); - if( (lst_chr = *format++) == '\0' ) - return( format ); - do { - scanset[lst_chr >> 3] |= lst_mask[lst_chr & 0x07]; - if( (lst_chr = *format) == '\0' ) - break; - ++format; - } while( lst_chr != ']' ); - return( format ); -} -#endif - - -/* - * scan_arb -- handles %[ - */ -static int scan_arb( PTR_SCNF_SPECS specs, my_va_list *arg, const CHAR_TYPE **format ) -{ - unsigned width; - FAR_STRING str; - int len, c, not_flag; -#if defined( __WIDECHAR__ ) - const CHAR_TYPE *list; - CHAR_TYPE ch; - char in_list; -#else - char scanset[SCANSET_LENGTH]; -#endif - DEFINE_VARS( maxelem, nelem ); - - if( not_flag = (**format == '^') ) { - ++(*format); - } -#if !defined( __WIDECHAR__ ) - *format = makelist( *format, scanset ); -#endif - if( specs->assign ) { -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - str = va_arg( arg->v, CHAR_TYPE _WCFAR * ); - } else if( specs->near_ptr ) { - str = va_arg( arg->v, CHAR_TYPE _WCNEAR * ); - } else { - str = va_arg( arg->v, CHAR_TYPE * ); - } -#else - str = va_arg( arg->v, CHAR_TYPE * ); -#endif - GET_MAXELEM( maxelem ); - } - len = 0; - width = specs->width; - while( width > 0 ) { - c = cget( specs ); - if( specs->eoinp ) - break; -#if defined( __WIDECHAR__ ) - list = *format; - ch = *list; - in_list = TRUE; - while( c != ch ) { - list++; - ch = *list; - if( ch == ']' ) { - in_list = FALSE; - break; - } - } - if( in_list == not_flag ) { - uncget( c, specs ); - break; - } -#else - if( ((scanset[c >> 3] & lst_mask[c & 0x07]) == 0) != not_flag ) { - uncget( c, specs ); - break; - } -#endif - ++len; - --width; - if( specs->assign ) { - CHECK_ELEMS( maxelem, nelem, -1 ); - *str++ = c; - } - } - if( specs->assign && len > 0 ) { - CHECK_ELEMS( maxelem, nelem, -1 ); - *str = '\0'; - } -#if defined( __WIDECHAR__ ) - while( *(*format)++ != ']' ) /* skip past format specifier */ - ; -#endif - return( len ); -} - - -/* - * scan_float -- handles floating point numerical conversion - * *** should implement buffer overflow protection *** - */ -static int scan_float( PTR_SCNF_SPECS specs, my_va_list *arg ) -{ - double value; - char *num_str, buf[80]; - int len; - int pref_len; - long c; - int digit_found; - FAR_FLOAT fptr; - char *p; - T32 at; - T32 ft; - - num_str = buf; - pref_len = len = 0; - for( ;; ) { - c = cget( specs ); - if( !__F_NAME(isspace,iswspace)( c ) ) - break; - ++pref_len; - } - if( specs->eoinp ) - goto done; - if( specs->width-- == 0 ) - goto ugdone; - if( c == '+' || c == '-' ) { - *num_str++ = c; - ++pref_len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } - if( !__F_NAME(isdigit,iswdigit)( c ) && c != '.' ) - goto ugdone; - at.uWhole = 0; - digit_found = FALSE; - if( __F_NAME(isdigit,iswdigit)( c ) ) { - digit_found = TRUE; - do { - *num_str++ = c; - if( specs->short_var ) - at.wd.hi = at.wd.hi * 10 + c - '0'; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } while( __F_NAME(isdigit,iswdigit)( c ) ); - } - if( c == '.' ) { - *num_str++ = c; - ++len; /* account for the '.' */ - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - if( !digit_found && !__F_NAME(isdigit,iswdigit)(c) ) - goto ugdone; - while( __F_NAME(isdigit,iswdigit)( c ) ) { - *num_str++ = c; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) { - break; - } - } - if( specs->short_var ) { /* %hf fixed-point format 05-feb-92 */ - ft.uWhole = 0; - p = num_str; - for( ;; ) { - --p; - if( *p == '.' ) - break; - ft.bite.b3 = *p - '0'; - ft.uWhole = ft.uWhole / 10; - } - at.wd.lo = ft.wd.lo; - } - if( c == STOP_CHR ) { - goto done; - } - } - if( specs->short_var == 0 && (c == 'e' || c == 'E') ) { - *num_str++ = c; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - if( c == '+' || c == '-' ) { - *num_str++ = c; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } - if( !__F_NAME(isdigit,iswdigit)( c ) ) { - len = 0; /* fast way to flag error */ - } else { - do { - *num_str++ = c; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } while( __F_NAME(isdigit,iswdigit)( c ) ); - } - } -ugdone: - uncget( (int)c, specs ); -done: - if( len > 0 ) { - len += pref_len; - if( specs->assign ) { - *num_str = NULLCHAR; - if( specs->short_var ) { - if( buf[0] == '-' ) { - at.sWhole = - at.sWhole; - } - } else { - EFG_SCANF( buf, (void *)&value ); /* 27-mar-90 */ - } -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - fptr = va_arg( arg->v, float _WCFAR * ); - } else if( specs->near_ptr ) { - fptr = va_arg( arg->v, float _WCNEAR * ); - } else { - fptr = va_arg( arg->v, float * ); - } -#else - fptr = va_arg( arg->v, float * ); -#endif - if( specs->short_var ) { /* 05-feb-92 */ - *((FAR_LONG) fptr) = at.uWhole; - } else if( specs->long_var || specs->long_double_var ) { - *((FAR_DOUBLE) fptr) = value; - } else { - *fptr = value; - } - } - } - return( len ); -} - - -static int radix_value( int c ) -{ - if( c >= '0' && c <= '9' ) - return( c - '0' ); - c = __F_NAME(tolower,towlower)( c ); - if( c >= 'a' && c <= 'f' ) - return( c - 'a' + 10 ); - return( 16 ); -} - - -/* - * scan_int -- handles integer numeric conversion - */ -static int scan_int( PTR_SCNF_SPECS specs, my_va_list *arg, int base, int sign_flag ) -{ - long value; - int len; - int pref_len; - int c; - int sign; - int digit; - FAR_INT iptr; -#if defined( __LONG_LONG_SUPPORT__ ) - unsigned long long long_value; - FAR_INT64 llptr; - - long_value = 0; -#endif - - value = 0; - pref_len = len = 0; - for( ;; ) { - c = cget( specs ); - if( !__F_NAME(isspace,iswspace)( c ) ) - break; - ++pref_len; - } - if( specs->eoinp ) - goto done; - if( specs->width-- == 0 ) - goto ugdone; - sign = '+'; - if( sign_flag && (c == '+' || c == '-') ) { - sign = c; - ++pref_len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } - if( base == 0 ) { - if( c == '0' ) { - len = 1; - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - if( c == 'x' || c == 'X' ) { - len = 0; - ++pref_len; /* for the '0' */ - ++pref_len; /* for the 'x' */ - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - base = 16; - } else { - base = 8; - } - } else { - base = 10; - } - } else if( base == 16 ) { - if( c == '0' ) { - len = 1; - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - if( c == 'x' || c == 'X' ) { - len = 0; - ++pref_len; /* for the '0' */ - ++pref_len; /* for the 'x' */ - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } - } - } -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->long_long_var ) { - for( ;; ) { - digit = radix_value( c ); - if( digit >= base ) - break; - long_value = long_value * base + digit; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } - if( c == ':' && specs->p_format ) { - for( ;; ) { - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - digit = radix_value( c ); - if( digit >= base ) - break; - long_value = long_value * base + digit; - } - } - } else -#endif - { - for( ;; ) { - digit = radix_value( c ); - if( digit >= base ) - break; - value = value * base + digit; - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) { - goto done; - } - } - if( c == ':' && specs->p_format ) { - for( ;; ) { - ++len; - if( (c = cgetw( specs )) == STOP_CHR ) - goto done; - digit = radix_value( c ); - if( digit >= base ) - break; - value = value * base + digit; - } - } - } -ugdone: - uncget( c, specs ); -done: -#if defined( __LONG_LONG_SUPPORT__ ) - if( specs->long_long_var ) { - if( sign == '-' ) { - long_value =- long_value; - } - if( len > 0 ) { - len += pref_len; - if( specs->assign ) { -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - llptr = va_arg( arg->v, unsigned long long _WCFAR * ); - } else if( specs->near_ptr ) { - llptr = va_arg( arg->v, unsigned long long _WCNEAR * ); - } else { - llptr = va_arg( arg->v, unsigned long long * ); - } -#else - llptr = va_arg( arg->v, unsigned long long * ); -#endif - *llptr = long_value; - } - } - } else -#endif - { - if( sign == '-' ) { - value = -value; - } - if( len > 0 ) { - len += pref_len; - if( specs->assign ) { -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - iptr = va_arg( arg->v, int _WCFAR * ); - } else if( specs->near_ptr ) { - iptr = va_arg( arg->v, int _WCNEAR * ); - } else { - iptr = va_arg( arg->v, int * ); - } -#else - iptr = va_arg( arg->v, int * ); -#endif - if( specs->char_var ) { - *((FAR_CHAR)iptr) = value; - } else if( specs->short_var ) { - *((FAR_SHORT)iptr) = value; - } else if( specs->long_var ) { - *((FAR_LONG)iptr) = value; - } else { - *iptr = value; - } - } - } - } - return( len ); -} - - -#ifdef SAFE_SCANF - -/* - * null_arg -- check for a null pointer passed in arguments - */ -static int null_arg( PTR_SCNF_SPECS specs, my_va_list *arg ) -{ - FAR_STRING str = NULL; - va_list args_copy; - - va_copy( args_copy, arg->v ); -#if defined( __FAR_SUPPORT__ ) - if( specs->far_ptr ) { - str = va_arg( args_copy, CHAR_TYPE _WCFAR * ); - } else if( specs->near_ptr ) { - CHAR_TYPE _WCNEAR *ptr; - - ptr = va_arg( args_copy, CHAR_TYPE _WCNEAR * ); - /* The following should work: - * - * str = (ptr == NULL) ? (void _WCFAR *)NULL : ptr; - * - * but doesn't due to a bug in C compiler introduced in - * 11.0 and fixe in OW 1.4. Ternary operator may be used - * when building with OW 1.5. See also similar code in prtf.c. - */ - if( ptr == NULL ) { - str = NULL; - } else { - str = ptr; - } - } else { - CHAR_TYPE *ptr; - - ptr = va_arg( args_copy, CHAR_TYPE * ); - if( ptr == NULL ) { - str = NULL; - } else { - str = ptr; - } - } -#else - str = va_arg( args_copy, CHAR_TYPE * ); -#endif - va_end( args_copy ); - return( str == NULL ? 1 : 0 ); -} - -#endif - - -#ifdef SAFE_SCANF -int __F_NAME(__scnf_s,__wscnf_s)( PTR_SCNF_SPECS specs, const CHAR_TYPE *format, const char **msg, va_list args ) -#else -int __F_NAME(__scnf,__wscnf)( PTR_SCNF_SPECS specs, const CHAR_TYPE *format, va_list args ) -#endif -{ - int char_match; - int items_converted; - int items_assigned; - int match_len; - int c; - int fmt_chr; - my_va_list margs; - - margs = MY_VA_LIST( args ); - - char_match = items_assigned = items_converted = 0; - specs->eoinp = 0; - - while( (fmt_chr = *format++) != NULLCHAR ) { - if( __F_NAME(isspace,iswspace)( fmt_chr ) ) { - char_match += scan_white( specs ); - } else if( fmt_chr != '%' ) { - if( (c = cget( specs )) != fmt_chr ) { - if( !specs->eoinp ) - uncget( c, specs ); - break; - } - ++char_match; /* 27-oct-88 */ - } else { /* fmt_chr == '%' */ - format = get_opt( format, specs ); - if( (fmt_chr = *format) != NULLCHAR ) - ++format; -#ifdef SAFE_SCANF - if( fmt_chr != '%' ) { - /* The '%' specifier is the only one not expecting pointer arg */ - if( specs->assign && null_arg( specs, &margs ) ) { - *msg = "%ptr -> NULL"; - return( __F_NAME(EOF,WEOF) ); - } - } -#endif - switch( fmt_chr ) { - case 'd': - match_len = scan_int( specs, &margs, 10, TRUE ); - goto check_match; - case 'i': - match_len = scan_int( specs, &margs, 0, TRUE ); - goto check_match; - case 'o': - match_len = scan_int( specs, &margs, 8, TRUE ); - goto check_match; - case 'u': - match_len = scan_int( specs, &margs, 10, TRUE ); - goto check_match; - case 'p': -#if defined( __BIG_DATA__ ) - specs->long_var = 1; /* indicate far pointer */ - specs->p_format = 1; /* ... */ -#endif - // fall through - case 'x': - case 'X': - match_len = scan_int( specs, &margs, 16, TRUE ); - goto check_match; - case 'e': - case 'E': - case 'f': - case 'F': - case 'g': - case 'G': - match_len = scan_float( specs, &margs ); - goto check_match; -#if !defined(__WIDECHAR__) && !defined(__NETWARE__) - case 'S': - specs->long_var = 1; - /* fall through to %s handler */ -#endif - case 's': - match_len = scan_string( specs, &margs ); - goto check_match; - case '[': - match_len = scan_arb( specs, &margs, &format ); - goto check_match; -#if !defined(__WIDECHAR__) && !defined(__NETWARE__) - case 'C': - specs->long_var = 1; - /* fall through to %c handler */ -#endif - case 'c': - match_len = scan_char( specs, &margs ); -check_match: - if( match_len > 0 ) { - char_match += match_len; - ++items_converted; - if( specs->assign ) { - ++items_assigned; - } - } else { -#ifdef SAFE_SCANF - if( match_len < 0 ) { - /* Matching failure caused by insufficient space in output - * is not input failure, hence we won't return EOF regardless - * of specs->eoinp state. - */ - ++items_converted; - } -#endif - goto fail; - } - break; - case 'n': - report_scan( specs, &margs, char_match ); - break; - case '%': - if( (c = cget( specs )) != '%' ) { - if( !specs->eoinp ) - uncget( c, specs ); - goto fail; - } else { - char_match += 1; - } - break; - } - } - if( specs->eoinp ) { - while( *format == '%' ) { - ++format; - format = get_opt( format, specs ); - if( *format == 'n' ) { - ++format; -#ifdef SAFE_SCANF - if( specs->assign && null_arg( specs, &margs ) ) { - *msg = "%ptr -> NULL"; - return( __F_NAME(EOF,WEOF) ); - } -#endif - report_scan( specs, &margs, char_match ); - } else { - break; - } - } - break; - } - } - -fail: - if( items_converted == 0 && specs->eoinp ) - return( __F_NAME(EOF,WEOF) ); - return( items_assigned ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/setefg.c b/programs/develop/open watcom/trunk/clib/src/setefg.c deleted file mode 100644 index 3788fffcb..000000000 --- a/programs/develop/open watcom/trunk/clib/src/setefg.c +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Routine to bring in real floating-point formatting code. -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "ftos.h" -#include "farsupp.h" - -/* This routine will be called by cstart if "_fltused" is referenced. */ - -void __setEFGfmt( void ) -{ -#ifdef __SW_BR - __EFG_printf = __get_EFG_Format(); - __EFG_scanf = __get__cnvs2d(); /* 27-mar-90 */ -#else - __EFG_printf = _EFG_Format; - __EFG_scanf = __cnvs2d; /* 27-mar-90 */ -#endif -} diff --git a/programs/develop/open watcom/trunk/clib/src/seterrno.c b/programs/develop/open watcom/trunk/clib/src/seterrno.c deleted file mode 100644 index 75ed7e31c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/seterrno.c +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Implementation of __set_errno(). -* -****************************************************************************/ - - -#ifdef __WATCOMC__ - -#include "variety.h" -#include -#include -#include "rtdata.h" -#include "seterrno.h" - -_WCRTLINK void __set_errno( unsigned int err ) -{ - _RWD_errno = err; -} - -_WCRTLINK void __set_EDOM() -{ - __set_errno( EDOM ); -} - -_WCRTLINK void __set_ERANGE() -{ - __set_errno( ERANGE ); -} - -_WCRTLINK int __set_EINVAL() -{ - __set_errno( EINVAL ); - return( -1 ); -} - -//#if !defined(__UNIX__) && !defined(__NETWARE__) -//_WCRTLINK void __set_doserrno( unsigned int err ) -//{ -// _RWD_doserrno = err; -//} -//#endif - -#else - -#include -void __set_errno( unsigned int err ) -{ - errno = err; -} - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/seterrno.h b/programs/develop/open watcom/trunk/clib/src/seterrno.h deleted file mode 100644 index e31320666..000000000 --- a/programs/develop/open watcom/trunk/clib/src/seterrno.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: errno related CLIB internal declarations. -* -****************************************************************************/ - -#ifndef _SETERNO_H_INCLUDED -#define _SETERNO_H_INCLUDED - -#include "variety.h" - -// defined in _dos\c\dosret.c -_WCRTLINK extern int __set_errno_dos( unsigned int ); -#if defined(__NT__) - _WCRTLINK extern int __set_errno_nt( void ); -#endif - -// defined in startup\c\seterrno.c -_WCRTLINK extern void __set_errno( unsigned int ); -_WCRTLINK extern int __set_EINVAL( void ); -_WCRTLINK extern void __set_EDOM( void ); -_WCRTLINK extern void __set_ERANGE( void ); -#if !defined(__UNIX__) - _WCRTLINK extern void __set_doserrno( unsigned int ); -#endif - -#endif - diff --git a/programs/develop/open watcom/trunk/clib/src/stiomode.c b/programs/develop/open watcom/trunk/clib/src/stiomode.c deleted file mode 100644 index 32f4391a9..000000000 --- a/programs/develop/open watcom/trunk/clib/src/stiomode.c +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include -#include -#include "rtdata.h" -#include "liballoc.h" -#include "fileacc.h" -#include "rtinit.h" -#include "seterrno.h" -#include "iomode.h" -#include "handleio.h" - -#ifdef DLHEAP - -void* _cdecl dlmalloc(size_t); -void _cdecl dlfree(void*); -void _cdecl mf_init(); - -#define malloc dlmalloc -#define free dlfree -#define realloc dlrealloc - -#define lib_malloc dlmalloc -#define lib_free dlfree -#define lib_realloc dlrealloc - -#endif - -#if defined(__NETWARE__) -#error NO IO MODE MANAGER UNDER NETWARE -#endif - -extern unsigned _HUGEDATA __init_mode[_NFILES]; -extern unsigned __NFiles; /* maximum # of files we can open */ - -static unsigned _init_NFiles; // original __NFiles value; - -void __grow_iomode( int num ) -{ - unsigned *new; - - _AccessIOB(); - if( __io_mode == __init_mode ) - { - _init_NFiles = __NFiles; - new = (unsigned *) lib_malloc( num * sizeof( unsigned ) ); - if( new != NULL ) { - memcpy( new, __init_mode, __NFiles * sizeof(unsigned) ); - } - } - else - { - #if defined(__NETWARE__) - #else - new = (unsigned *) lib_realloc( __io_mode, num * sizeof( unsigned ) ); - #endif - } - if( new == NULL ) - { - __set_errno( ENOMEM ); - } - else - { - memset( &new[__NFiles], 0, (num-__NFiles)*sizeof(unsigned) ); - __io_mode = new; - __NFiles = num; - } - _ReleaseIOB(); -} - -void __shrink_iomode( void ) -{ - _AccessIOB(); - // free any malloc'd iomode array - if( __io_mode != __init_mode ) - { - lib_free( __io_mode ); - __io_mode = __init_mode; - __NFiles = _init_NFiles; - } - _ReleaseIOB(); -} - -AYI(__shrink_iomode,INIT_PRIORITY_IOSTREAM); - - -#if defined(__WARP__) - -extern unsigned __NHandles; - -static void __preinit_iomode_os2(void) -{ - LONG req_count; - ULONG curr_max_fh; - APIRET rc; - - // Ensure that the clib and OS file handle limits match - req_count = 0; - rc = DosSetRelMaxFH( &req_count, &curr_max_fh ); - if( rc == 0 ) { - __grow_iomode( curr_max_fh ); - __NHandles = curr_max_fh; // same as __set_handles - } - -} - -AXI( __preinit_iomode_os2, INIT_PRIORITY_RUNTIME ); - -#endif - -#define _INITIALIZED _DYNAMIC - -signed __SetIOMode( int handle, unsigned value ) -{ - int i; - - if( handle >= __NFiles ) - { - i = __NFiles; // 20 -> (20+10+1) -> 31 - // 31 -> (31+15+1) -> 47 - // 47 -> (47+23+1) -> 71 - __grow_iomode( i + (i > 1) + 1 ); - } - if( handle >= __NFiles ) - { - // return an error indication (errno should be set to ENOMEM) - return( -1 ); - } - else - { - if( value != 0 ) - { - __ChkTTYIOMode( handle ); - __io_mode[handle] = value | _INITIALIZED; - } - else - { - __io_mode[handle] = value; /* we're closing it; smite _INITIALIZED */ - } - return( handle ); - } -} diff --git a/programs/develop/open watcom/trunk/clib/src/strcmp.c b/programs/develop/open watcom/trunk/clib/src/strcmp.c deleted file mode 100644 index 6d1d86a68..000000000 --- a/programs/develop/open watcom/trunk/clib/src/strcmp.c +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include "riscstr.h" -#include "xstring.h" - -#undef strcmp - - -/* return <0 if s0 if s>t */ - -#if defined(__RISCSTR__) && defined(__WIDECHAR__) - _WCRTLINK int __simple_wcscmp( const CHAR_TYPE *s, const CHAR_TYPE *t ) -#else - _WCRTLINK int __F_NAME(strcmp,wcscmp)( const CHAR_TYPE *s, const CHAR_TYPE *t ) -#endif - { -#if defined(__INLINE_FUNCTIONS__) && !defined(__WIDECHAR__) && defined(_M_IX86) - return( _inline_strcmp( s, t ) ); -#else - for( ; *s == *t; s++, t++ ) - if( *s == NULLCHAR ) - return( 0 ); - return( *s - *t ); -#endif - } diff --git a/programs/develop/open watcom/trunk/clib/src/strdup.h b/programs/develop/open watcom/trunk/clib/src/strdup.h deleted file mode 100644 index 81164eb09..000000000 --- a/programs/develop/open watcom/trunk/clib/src/strdup.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#ifndef __STRDUP_H_INCLUDED -#define __STRDUP_H_INCLUDED - -#include "variety.h" -#include "widechar.h" - -_WCRTLINK extern char *__clib_strdup( const char *str ); -_WCRTLINK extern wchar_t *__clib_wcsdup( const wchar_t *str ); -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/streamio.h b/programs/develop/open watcom/trunk/clib/src/streamio.h deleted file mode 100644 index 3b61c1398..000000000 --- a/programs/develop/open watcom/trunk/clib/src/streamio.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototypes for various streamio internal routines. -* -****************************************************************************/ - - -extern FILE *__allocfp( int handle ); -extern void __freefp( FILE * ); -extern void __chktty( FILE *fp ); -extern void __ioalloc( FILE * ); -extern int __doclose( FILE *fp, int close_handle ); -extern int __shutdown_stream( FILE *fp, int close_handle ); diff --git a/programs/develop/open watcom/trunk/clib/src/struct.inc b/programs/develop/open watcom/trunk/clib/src/struct.inc deleted file mode 100644 index 2d88e461e..000000000 --- a/programs/develop/open watcom/trunk/clib/src/struct.inc +++ /dev/null @@ -1,220 +0,0 @@ -;***************************************************************************** -;* -;* Open Watcom Project -;* -;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -;* -;* ======================================================================== -;* -;* This file contains Original Code and/or Modifications of Original -;* Code as defined in and that are subject to the Sybase Open Watcom -;* Public License version 1.0 (the 'License'). You may not use this file -;* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -;* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -;* provided with the Original Code and Modifications, and is also -;* available at www.sybase.com/developer/opensource. -;* -;* The Original Code and all software distributed under the License are -;* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -;* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -;* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -;* NON-INFRINGEMENT. Please see the License for the specific language -;* governing rights and limitations under the License. -;* -;* ======================================================================== -;* -;* Description: Structured macros for MASM/WASM. -;* -;***************************************************************************** - - - __label = 0 - __depth = 0 - __inner_loop = 0 - -_guess macro name - __depth = __depth + 1 - __label = __label + 1 - _set __astk,%__depth,__label,<> - __label = __label + 1 - _set __estk,%__depth,__label,<> - ifnb - name = __label - endif - endm - -_quif macro cc,name - ifnb - _set __elbl,,name,<> - _j cc,_l,%__elbl - else - _set __albl,,__astk,%__depth - _j cc,_l,%__albl - endif - endm - -_quit macro name - _quif ,name - endm - -_admit macro - _set __albl,,__astk,%__depth - __label = __label + 1 - _set __astk,%__depth,__label,<> - _set __elbl,,__estk,%__depth - _j ,_l,%__elbl - _label _l,%__albl - endm - -_endguess macro - _set __albl,,__astk,%__depth - _label _l,%__albl - _set __elbl,,__estk,%__depth - _label _l,%__elbl - __depth = __depth - 1 - endm - -_loop macro name - _guess name - _set __albl,,__astk,%__depth - _label _m,%__albl - _set __elbl,,__estk,%__depth - _label _m,%__elbl - _set __llbl,%__depth,%__inner_loop,<> - _set __inner_loop,,%__depth,<> - endm - -_loopif macro cc,name - ifnb - _set __elbl,,name,<> - _j cc,_m,%__elbl - else - _set __albl,,__astk,%__inner_loop - _j cc,_m,%__albl - endif - endm - -_until macro cc - _set __albl,,__astk,%__depth - _jn cc,_m,%__albl - _set __inner_loop,,__llbl,%__depth - _endguess - endm - -_endloop macro - _set __albl,,__astk,%__depth - _j ,_m,%__albl - _set __inner_loop,,__llbl,%__depth - _endguess - endm - -_if macro cc - _guess - _set __albl,,__astk,%__depth - _jn cc,_l,%__albl - endm - -_else macro - _admit - endm - -_endif macro - _endguess - endm - -_set macro base1,ext1,base2,ext2 - base1&ext1 = base2&ext2 - endm - -_label macro base,ext -base&ext: - endm - -_j macro cc,base,ext - j&cc base&ext - endm - -_jn macro cc,base,ext - jn&cc base&ext - endm - -jnna macro label - ja label - endm - -jnnae macro label - jae label - endm - -jnnb macro label - jb label - endm - -jnnbe macro label - jbe label - endm - -jnnc macro label - jc label - endm - -jnne macro label - je label - endm - -jnng macro label - jg label - endm - -jnnge macro label - jge label - endm - -jnnl macro label - jl label - endm - -jnnle macro label - jle label - endm - -jnno macro label - jo label - endm - -jnnp macro label - jp label - endm - -jnns macro label - js label - endm - -jnnz macro label - jz label - endm - -jnpe macro label - jpo label - endm - -jnpo macro label - jpe label - endm - -j macro label - jmp label - endm - -jn macro label - nop - endm - -_shl macro reg,count - add reg,reg - endm - -_rcl macro reg,count - adc reg,reg - endm diff --git a/programs/develop/open watcom/trunk/clib/src/tell.c b/programs/develop/open watcom/trunk/clib/src/tell.c deleted file mode 100644 index d79648338..000000000 --- a/programs/develop/open watcom/trunk/clib/src/tell.c +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include -#include "lseek.h" - -_WCRTLINK long int tell( int handle ) -{ - return( __lseek( handle, 0L, SEEK_CUR ) ); -} diff --git a/programs/develop/open watcom/trunk/clib/src/tmpfname.h b/programs/develop/open watcom/trunk/clib/src/tmpfname.h deleted file mode 100644 index 6aabdd376..000000000 --- a/programs/develop/open watcom/trunk/clib/src/tmpfname.h +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Temporary file filename related definitions. -* -****************************************************************************/ - - -#define _TMPFNAME_LENGTH 13 -#define _TMP_INIT_CHAR 32 diff --git a/programs/develop/open watcom/trunk/clib/src/ulltoa.c b/programs/develop/open watcom/trunk/clib/src/ulltoa.c deleted file mode 100644 index fe245badd..000000000 --- a/programs/develop/open watcom/trunk/clib/src/ulltoa.c +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -// this file should remain an indirected file -// it is done this way to support the reuse of the source file -#define __WIDECHAR__ -#undef __INLINE_FUNCTIONS__ -#include "lltoa.c" diff --git a/programs/develop/open watcom/trunk/clib/src/ultoa.c b/programs/develop/open watcom/trunk/clib/src/ultoa.c deleted file mode 100644 index 20dbf23cc..000000000 --- a/programs/develop/open watcom/trunk/clib/src/ultoa.c +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -// this file should remain an indirected file -// it is done this way to support the reuse of the source file -#define __WIDECHAR__ -#undef __INLINE_FUNCTIONS__ -#include "ltoa.c" diff --git a/programs/develop/open watcom/trunk/clib/src/variety.h b/programs/develop/open watcom/trunk/clib/src/variety.h deleted file mode 100644 index fecec0e16..000000000 --- a/programs/develop/open watcom/trunk/clib/src/variety.h +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Configuration for clib builds. -* -****************************************************************************/ - - -#ifndef _VARIETY_H_INCLUDED -#define _VARIETY_H_INCLUDED - -// -// Note: for the DLL versions of the runtime libraries, this file must be -// included before any of the runtime header files. -// - -#ifndef _COMDEF_H_INCLUDED - #include <_comdef.h> -#endif - -// specialized data reference macro -#define _HUGEDATA _WCDATA - -// memory model macros -#if defined(__SMALL__) - #define __SMALL_DATA__ - #define __SMALL_CODE__ -#elif defined(__FLAT__) - #define __SMALL_DATA__ - #define __SMALL_CODE__ -#elif defined(__MEDIUM__) - #define __SMALL_DATA__ - #define __BIG_CODE__ -#elif defined(__COMPACT__) - #define __BIG_DATA__ - #define __SMALL_CODE__ -#elif defined(__LARGE__) - #define __BIG_DATA__ - #define __BIG_CODE__ -#elif defined(__HUGE__) - #define __BIG_DATA__ - #define __BIG_CODE__ -#elif defined(__AXP__) || defined(__PPC__) || defined(__MIPS__) - // these effectively use near data references - #define __SMALL_DATA__ - #define __SMALL_CODE__ -#else - #error unable to configure memory model -#endif - -// operating system and processor macros -#if defined(__GENERIC__) - #if defined(__386__) - #define __PROTECT_MODE__ - #define __GENERIC_386__ - #elif defined(M_I86) - #define __REAL_MODE__ - #define __GENERIC_086__ - #else - #error unrecognized processor for GENERIC - #endif -#elif defined(__OS2__) - #if defined(M_I86) - #define __REAL_MODE__ - #define __OS2_286__ - #elif defined(__386__) - #define __PROTECT_MODE__ - #define __OS2_386__ - #define __WARP__ - #elif defined(__PPC__) - #define __PROTECT_MODE__ - #define __OS2_PPC__ - #define __WARP__ - #else - #error unrecognized processor for OS2 - #endif -#elif defined(__NT__) - #if !defined(WIN32_LEAN_AND_MEAN) && !defined(WIN32_NICE_AND_FAT) - #define WIN32_LEAN_AND_MEAN - #endif - #define __PROTECT_MODE__ - #if defined(__386__) - #define __NT_386__ - #elif defined(__AXP__) - #define __NT_AXP__ - #elif defined(__PPC__) - #define __NT_PPC__ - #else - #error unrecognized processor for NT - #endif -#elif defined(__WINDOWS__) || defined(__WINDOWS_386__) - #define __PROTECT_MODE__ - #if defined(__386__) - #define __WINDOWS__ - #elif defined(M_I86) - #define __WINDOWS_286__ - #else - #error unrecognized processor for WINDOWS - #endif -#elif defined(__DOS__) - #if defined(__386__) - #define __PROTECT_MODE__ - #define __DOS_386__ - #elif defined(M_I86) - #define __REAL_MODE__ - #define __DOS_086__ - #else - #error unrecognized processor for DOS - #endif -#elif defined(__OSI__) - #if defined(__386__) - #define __PROTECT_MODE__ - #define __OSI_386__ - #else - #error unrecognized processor for OSI - #endif -#elif defined(__QNX__) - #define __PROTECT_MODE__ - #define __UNIX__ - #if defined(__386__) - #define __QNX_386__ - #elif defined(M_I86) - #define __QNX_286__ - #else - #error unrecognized processor for QNX - #endif -#elif defined(__LINUX__) - #define __PROTECT_MODE__ - #define __UNIX__ - #if defined(__386__) - #define __LINUX_386__ - #elif defined(__PPC__) - #define __LINUX_PPC__ - #elif defined(__MIPS__) - #define __LINUX_MIPS__ - #else - #error unrecognized processor for Linux - #endif -#elif defined(__NETWARE__) - #define __PROTECT_MODE__ - #if defined(__386__) - #define __NETWARE_386__ - #else - #error unrecognized processor for NETWARE - #endif -#else - #error unable to configure operating system and processor -#endif - -// handle building dll's with appropriate linkage -#if !defined(__SW_BR) && (defined(__WARP__) || defined(__NT__)) - #if defined(__MAKE_DLL_CLIB) - #undef _WCRTLINK - #undef _WCIRTLINK - #undef _WCRTLINKD - #undef _WMRTLINK - #undef _WMIRTLINK - #undef _WMRTLINKD - #undef _WPRTLINK - #undef _WPIRTLINK - #undef _WPRTLINKD - #if defined(__NT__) - #define _WCRTLINK __declspec(dllexport) _WRTLCALL - #define _WCIRTLINK __declspec(dllexport) _WRTLCALL - #define _WCRTLINKD __declspec(dllexport) - #define _WMRTLINK __declspec(dllimport) _WRTLCALL - #define _WMIRTLINK __declspec(dllimport) _WRTLCALL - #define _WMRTLINKD __declspec(dllimport) - #define _WPRTLINK __declspec(dllimport) _WRTLCALL - #define _WPIRTLINK __declspec(dllimport) _WRTLCALL - #define _WPRTLINKD __declspec(dllimport) - #elif defined(__WARP__) - #define _WCRTLINK __declspec(dllexport) _WRTLCALL - #define _WCIRTLINK __declspec(dllexport) _WRTLCALL - #define _WCRTLINKD __declspec(dllexport) - #define _WMRTLINK _WRTLCALL - #define _WMIRTLINK _WRTLCALL - #define _WMRTLINKD - #define _WPRTLINK _WRTLCALL - #define _WPIRTLINK _WRTLCALL - #define _WPRTLINKD - #endif - #elif defined(__MAKE_DLL_MATHLIB) - #define _RTDLL - #undef _WCRTLINK - #undef _WCIRTLINK - #undef _WCRTLINKD - #undef _WMRTLINK - #undef _WMIRTLINK - #undef _WMRTLINKD - #undef _WPRTLINK - #undef _WPIRTLINK - #undef _WPRTLINKD - #if defined(__NT__) - #define _WCRTLINK __declspec(dllimport) _WRTLCALL - #define _WCIRTLINK __declspec(dllimport) _WRTLCALL - #define _WCRTLINKD __declspec(dllimport) - #define _WMRTLINK __declspec(dllexport) _WRTLCALL - #define _WMIRTLINK __declspec(dllexport) _WRTLCALL - #define _WMRTLINKD __declspec(dllexport) - #define _WPRTLINK __declspec(dllimport) _WRTLCALL - #define _WPIRTLINK __declspec(dllimport) _WRTLCALL - #define _WPRTLINKD __declspec(dllimport) - #elif defined(__WARP__) - #define _WCRTLINK _WRTLCALL - #define _WCIRTLINK _WRTLCALL - #define _WCRTLINKD - #define _WMRTLINK __declspec(dllexport) _WRTLCALL - #define _WMIRTLINK __declspec(dllexport) _WRTLCALL - #define _WMRTLINKD __declspec(dllexport) - #define _WPRTLINK _WRTLCALL - #define _WPIRTLINK _WRTLCALL - #define _WPRTLINKD - #endif - #elif defined(__MAKE_DLL_CPPLIB) - #define _RTDLL - #undef _WCRTLINK - #undef _WCIRTLINK - #undef _WCRTLINKD - #undef _WMRTLINK - #undef _WMIRTLINK - #undef _WMRTLINKD - #undef _WPRTLINK - #undef _WPIRTLINK - #undef _WPRTLINKD - #if defined(__NT__) - #define _WCRTLINK __declspec(dllimport) _WRTLCALL - #define _WCIRTLINK __declspec(dllimport) _WRTLCALL - #define _WCRTLINKD __declspec(dllimport) - #define _WMRTLINK __declspec(dllimport) _WRTLCALL - #define _WMIRTLINK __declspec(dllimport) _WRTLCALL - #define _WMRTLINKD __declspec(dllimport) - #define _WPRTLINK __declspec(dllexport) _WRTLCALL - #define _WPIRTLINK __declspec(dllexport) _WRTLCALL - #define _WPRTLINKD __declspec(dllexport) - #elif defined(__WARP__) - #define _WCRTLINK _WRTLCALL - #define _WCIRTLINK _WRTLCALL - #define _WCRTLINKD - #define _WMRTLINK _WRTLCALL - #define _WMIRTLINK _WRTLCALL - #define _WMRTLINKD - #define _WPRTLINK __declspec(dllexport) _WRTLCALL - #define _WPIRTLINK __declspec(dllexport) _WRTLCALL - #define _WPRTLINKD __declspec(dllexport) - #endif - #endif -#endif - -#define __ptr_check( p, a ) -#define __null_check( p, a ) -#define __stream_check( s, a ) - -#define __ROUND_UP_SIZE( __x, __amt ) (((__x)+((__amt)-1))&(~((__amt)-1))) -/// -/// This doesn't work for far pointer's -/// -///#define __ROUND_UP_PTR( __x, __amt ) ((void *)__ROUND_UP_SIZE((unsigned)(__x),__amt)) -#if defined(M_I86) - #define __ALIGN_SIZE( __x ) __ROUND_UP_SIZE( __x, 2 ) -// #define __ALIGN_PTR( __x ) __ROUND_UP_PTR( __x, 2 ) -#elif defined(__386__) - #define __ALIGN_SIZE( __x ) __ROUND_UP_SIZE( __x, 4 ) -/// #define __ALIGN_PTR( __x ) __ROUND_UP_PTR( __x, 4 ) -#else - #define __ALIGN_SIZE( __x ) __ROUND_UP_SIZE( __x, 8 ) -// #define __ALIGN_PTR( __x ) __ROUND_UP_PTR( __x, 8 ) -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/vsprintf.c b/programs/develop/open watcom/trunk/clib/src/vsprintf.c deleted file mode 100644 index 482ad2cbd..000000000 --- a/programs/develop/open watcom/trunk/clib/src/vsprintf.c +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include "widechar.h" -#include -#include -#include -#include "printf.h" - - -/* - * mem_putc -- append a character to a string in memory - */ -#ifdef __WIDECHAR__ - -struct vswprtf_buf { - CHAR_TYPE *bufptr; - int chars_output; - int max_chars; -}; - -static slib_callback_t mem_putc; // setup calling convention -static void __SLIB_CALLBACK mem_putc( SPECS __SLIB *specs, int op_char ) -{ - struct vswprtf_buf *info; - - info = (struct vswprtf_buf*) specs->_dest; - if( info->chars_output + 1 <= info->max_chars ) { - *( info->bufptr++ ) = op_char; - specs->_output_count++; - info->chars_output++; - } -} - -#else - -static slib_callback_t mem_putc; // setup calling convention -static void __SLIB_CALLBACK mem_putc( SPECS __SLIB *specs, int op_char ) -{ - *( specs->_dest++ ) = op_char; - specs->_output_count++; -} - -#endif - - -#ifdef __WIDECHAR__ -_WCRTLINK int vswprintf( CHAR_TYPE *dest, size_t n, const CHAR_TYPE *format, va_list arg ) -{ - slib_callback_t *tmp; - auto struct vswprtf_buf info; - - #if defined( __386__ ) && defined( __QNX__ ) - /* avoid some segment relocations for 32-bit QNX */ - tmp = (void (*)())mem_putc; - #else - tmp = mem_putc; - #endif - if( n != 0 ) { - info.bufptr = dest; - info.chars_output = 0; - info.max_chars = n - 1; - __wprtf( &info, format, arg, tmp ); - dest[info.chars_output] = NULLCHAR; - } - return( info.chars_output ); -} -#endif - -_WCRTLINK int __F_NAME(vsprintf,_vswprintf) ( CHAR_TYPE *dest, const CHAR_TYPE *format, va_list arg ) -{ - slib_callback_t *tmp; -#ifndef __WIDECHAR__ - register int len; -#else - auto struct vswprtf_buf info; -#endif - -#if defined( __386__ ) && defined( __QNX__ ) - /* avoid some segment relocations for 32-bit QNX */ - tmp = (void (*)())mem_putc; -#else - tmp = mem_putc; -#endif -#ifdef __WIDECHAR__ - info.bufptr = dest; - info.chars_output = 0; - info.max_chars = INT_MAX; - __wprtf( &info, format, arg, tmp ); - dest[info.chars_output] = NULLCHAR; - return( info.chars_output ); -#else - len = __prtf( dest, format, arg, tmp ); - dest[len] = NULLCHAR; - return( len ); -#endif -} diff --git a/programs/develop/open watcom/trunk/clib/src/watcom.h b/programs/develop/open watcom/trunk/clib/src/watcom.h deleted file mode 100644 index 362dc5aba..000000000 --- a/programs/develop/open watcom/trunk/clib/src/watcom.h +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Common type definitions and macros widely used by Open -* Watcom tools. -* -****************************************************************************/ - - -#ifndef _WATCOM_H_INCLUDED_ -#define _WATCOM_H_INCLUDED_ - -#include -#ifndef __WATCOMC__ -#include "clibext.h" -#endif - -#if !defined(__sun__) && !defined(sun) && !defined(__sgi) && !defined(__hppa) && !defined(_AIX) && !defined(__alpha) && !defined(_TYPES_H_) && !defined(_SYS_TYPES_H) - typedef unsigned uint; -#endif - -typedef unsigned char uint_8; -typedef unsigned short uint_16; -#if defined (LONG_IS_64BITS) -typedef unsigned int uint_32; -#else -typedef unsigned long uint_32; -#endif -typedef unsigned char unsigned_8; -typedef unsigned short unsigned_16; -#if defined (LONG_IS_64BITS) -typedef unsigned int unsigned_32; -#else -typedef unsigned long unsigned_32; -#endif - -typedef signed char int_8; -typedef signed short int_16; -#if defined (LONG_IS_64BITS) -typedef signed int int_32; -#else -typedef signed long int_32; -#endif -typedef signed char signed_8; -typedef signed short signed_16; -#if defined (LONG_IS_64BITS) -typedef signed int signed_32; -#else -typedef signed long signed_32; -#endif - -typedef struct { - union { - unsigned_32 _32[2]; - unsigned_16 _16[4]; - unsigned_8 _8[8]; - struct { -#if defined( __BIG_ENDIAN__ ) - unsigned v : 1; - unsigned : 15; - unsigned : 16; - unsigned : 16; - unsigned : 16; -#else - unsigned : 16; - unsigned : 16; - unsigned : 16; - unsigned : 15; - unsigned v : 1; -#endif - } sign; -#if defined(__WATCOM_INT64__) || defined(__GNUC__) - unsigned long long _64[1]; -#endif - } u; -} unsigned_64; -typedef unsigned_64 signed_64; - -/* Macros for low/high end access on little and big endian machines */ - -#if defined( __BIG_ENDIAN__ ) - #define I64LO32 1 - #define I64HI32 0 - #define I64LO16 3 - #define I64HI16 0 - #define I64LO8 7 - #define I64HI8 0 -#else - #define I64LO32 0 - #define I64HI32 1 - #define I64LO16 0 - #define I64HI16 3 - #define I64LO8 0 - #define I64HI8 7 -#endif - -/* Define _crtn for prototypes for external C routines called from C++. - * Eg. extern _crtn void Foo(); - */ -#if !defined( _crtn ) - #if defined( __cplusplus ) - #define _crtn "C" - #else - #define _crtn - #endif -#endif - -/* Macros for little/big endian conversion; These exist to simplify writing - * code that handles both little and big endian data on either little or big - * endian host platforms. Some of these macros could be implemented as inline - * assembler where instructions to byte swap data in registers or read/write - * memory access with byte swapping is available. - * - * NOTE: The SWAP_XX macros will swap data in place. If you only want to take a - * a copy of the data and leave the original intact, then use the SWAPNC_XX - * macros. - */ -#define SWAPNC_16(w) (\ - (((w) & 0x000000FFUL) << 8) |\ - (((w) & 0x0000FF00UL) >> 8)\ - ) -#define SWAPNC_32(w) (\ - (((w) & 0x000000FFUL) << 24) |\ - (((w) & 0x0000FF00UL) << 8) |\ - (((w) & 0x00FF0000UL) >> 8) |\ - (((w) & 0xFF000000UL) >> 24)\ - ) -#define SWAPNC_64(w) (\ - (((w) & 0x00000000000000FFULL) << 56) |\ - (((w) & 0x000000000000FF00ULL) << 40) |\ - (((w) & 0x0000000000FF0000ULL) << 24) |\ - (((w) & 0x00000000FF000000ULL) << 8) |\ - (((w) & 0x000000FF00000000ULL) >> 8) |\ - (((w) & 0x0000FF0000000000ULL) >> 24) |\ - (((w) & 0x00FF000000000000ULL) >> 40) |\ - (((w) & 0xFF00000000000000ULL) >> 56)\ - ) - -#if defined( __BIG_ENDIAN__ ) - /* Macros to get little endian data */ - #define GET_LE_16(w) SWAPNC_16(w) - #define GET_LE_32(w) SWAPNC_32(w) - #define GET_LE_64(w) SWAPNC_64(w) - /* Macros to get big endian data */ - #define GET_BE_16(w) (w) - #define GET_BE_32(w) (w) - #define GET_BE_64(w) (w) - /* Macros to convert little endian data in place */ - #define CONV_LE_16(w) (w) = SWAPNC_16(w) - #define CONV_LE_32(w) (w) = SWAPNC_32(w) - #define CONV_LE_64(w) (w) = SWAPNC_64(w) - /* Macros to convert big endian data in place */ - #define CONV_BE_16(w) - #define CONV_BE_32(w) - #define CONV_BE_64(w) - /* Macros to swap byte order */ - #define SWAP_16 CONV_LE_16 - #define SWAP_32 CONV_LE_32 - #define SWAP_64 CONV_LE_64 -#else - /* Macros to get little endian data */ - #define GET_LE_16(w) (w) - #define GET_LE_32(w) (w) - #define GET_LE_64(w) (w) - /* Macros to get big endian data */ - #define GET_BE_16(w) SWAPNC_16(w) - #define GET_BE_32(w) SWAPNC_32(w) - #define GET_BE_64(w) SWAPNC_64(w) - /* Macros to convert little endian data in place */ - #define CONV_LE_16(w) - #define CONV_LE_32(w) - #define CONV_LE_64(w) - /* Macros to convert big endian data in place */ - #define CONV_BE_16(w) (w) = SWAPNC_16(w) - #define CONV_BE_32(w) (w) = SWAPNC_32(w) - #define CONV_BE_64(w) (w) = SWAPNC_64(w) - /* Macros to swap byte order */ - #define SWAP_16 CONV_BE_16 - #define SWAP_32 CONV_BE_32 - #define SWAP_64 CONV_BE_64 -#endif - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/wctomb.c b/programs/develop/open watcom/trunk/clib/src/wctomb.c deleted file mode 100644 index 7c98e18f3..000000000 --- a/programs/develop/open watcom/trunk/clib/src/wctomb.c +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE -* DESCRIBE IT HERE! -* -****************************************************************************/ - - -#include "variety.h" -#include -#include "farfunc.h" - - - -/**** -***** Convert a wide character to a multibyte character. -****/ - -_WCRTLINK int _NEARFAR(wctomb,_fwctomb)( char _FFAR *ch, wchar_t wchar ) -{ - - /*** Catch special cases ***/ - if( ch == 0 ) return( 0 ); - - /*** Convert the character ***/ - if( wchar & 0xFF00 ) - { - ch[0] = (wchar&0xFF00) >> 8; /* store lead byte */ - ch[1] = wchar & 0x00FF; /* store trail byte */ - return( 2 ); /* return size in bytes */ - } - else - { - ch[0] = wchar & 0x00FF; /* store char byte */ - return( 1 ); /* return size in bytes */ - } -} diff --git a/programs/develop/open watcom/trunk/clib/src/widechar.h b/programs/develop/open watcom/trunk/clib/src/widechar.h deleted file mode 100644 index 7e99f9c3c..000000000 --- a/programs/develop/open watcom/trunk/clib/src/widechar.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Macros for single source wide/narrow character code. -* -****************************************************************************/ - - -#ifndef _WIDECHAR_H_INCLUDED -#define _WIDECHAR_H_INCLUDED - -#include "variety.h" -#include /* for wchar_t and _atouni */ - -/*** Define some handy macros ***/ -#ifdef __WIDECHAR__ - #define DIR_TYPE struct _wdirent - #define CHAR_TYPE wchar_t - #define UCHAR_TYPE wchar_t - #define INTCHAR_TYPE wint_t - #define INT_WC_TYPE wchar_t - #define VOID_WC_TYPE wchar_t - #define NULLCHAR 0 - #define STRING(a) L##a - #define _AToUni(p1,p2) _atouni(p1,p2) - #define IS_ASCII(c) ( (c & 0xff00) == 0 ) - #define TO_ASCII(c) ( c ) - #define __F_NAME(n1,n2) n2 - #define UNICODE - #define _UNICODE - #define __UNICODE__ -#else - #define DIR_TYPE struct dirent - #define CHAR_TYPE char - #define UCHAR_TYPE unsigned char - #define INTCHAR_TYPE int - #define INT_WC_TYPE int - #define VOID_WC_TYPE void - #define NULLCHAR '\0' - #define STRING(a) a - #define _AToUni(p1,p2) (p2) - #define IS_ASCII(c) ( 1 ) - #define TO_ASCII(c) ( (unsigned char)c ) - #define __F_NAME(n1,n2) n1 -#endif -#define CHARSIZE (sizeof( CHAR_TYPE )) - -/* must be the larger of char and wchar_t */ -#define MAX_CHAR_TYPE wchar_t - -#endif diff --git a/programs/develop/open watcom/trunk/clib/src/xstring.h b/programs/develop/open watcom/trunk/clib/src/xstring.h deleted file mode 100644 index 7dc834a91..000000000 --- a/programs/develop/open watcom/trunk/clib/src/xstring.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -* -* Open Watcom Project -* -* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. -* -* ======================================================================== -* -* This file contains Original Code and/or Modifications of Original -* Code as defined in and that are subject to the Sybase Open Watcom -* Public License version 1.0 (the 'License'). You may not use this file -* except in compliance with the License. BY USING THIS FILE YOU AGREE TO -* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is -* provided with the Original Code and Modifications, and is also -* available at www.sybase.com/developer/opensource. -* -* The Original Code and all software distributed under the License are -* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM -* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR -* NON-INFRINGEMENT. Please see the License for the specific language -* governing rights and limitations under the License. -* -* ======================================================================== -* -* Description: Prototypes for direct 'calls' to inline functions. -* -****************************************************************************/ - - -#ifndef _XSTRING_H_INCLUDED -#include "variety.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __INLINE_FUNCTIONS__ - void *_inline_memchr( const void *__s, int __c, size_t __n ); - int _inline_memcmp( const void *__s1, const void *__s2, size_t __n ); - void *_inline_memcpy( void *__s1, const void *__s2, size_t __n ); - void *_inline_memmove( void *__s1, const void *__s2, size_t __n ); - void *_inline_memset( void *__s, int __c, size_t __n ); - char *_inline_strcat( char *__s1, const char *__s2 ); - char *_inline_strchr( const char *__s, int __c ); - int _inline_strcmp( const char *__s1, const char *__s2 ); - char *_inline_strcpy( char *__s1, const char *__s2 ); - size_t _inline_strlen( const char *__s ); - void _WCFAR *_inline__fmemchr( const void _WCFAR *__s, int __c, size_t __n ); - void _WCFAR *_inline__fmemcpy( void _WCFAR *__s1, const void _WCFAR *__s2, size_t __n ); - void _WCFAR *_inline__fmemset( void _WCFAR *__s, int __c, size_t __n ); - int _inline__fmemcmp( const void _WCFAR *__s1, const void _WCFAR *__s2, size_t __n ); - char _WCFAR *_inline__fstrcat( char _WCFAR *__s1, const char _WCFAR *__s2 ); - char _WCFAR *_inline__fstrchr( const char _WCFAR *__s, int __c ); - int _inline__fstrcmp( const char _WCFAR *__s1, const char _WCFAR *__s2 ); - char _WCFAR *_inline__fstrcpy( char _WCFAR *__s1, const char _WCFAR *__s2 ); - size_t _inline__fstrlen( const char _WCFAR *__s ); - void _inline_movedata( unsigned __srcseg, unsigned __srcoff, - unsigned __tgtseg, unsigned __tgtoff, unsigned __len ); -#endif /* __INLINE_FUNCTIONS__ */ - -#define _XSTRING_H_INCLUDED -#ifdef __cplusplus -}; -#endif -#endif diff --git a/programs/develop/open watcom/trunk/clib_r.tgt b/programs/develop/open watcom/trunk/clib_r.tgt new file mode 100644 index 000000000..16a353c75 --- /dev/null +++ b/programs/develop/open watcom/trunk/clib_r.tgt @@ -0,0 +1,5955 @@ +40 +targetIdent +0 +MProject +1 +MComponent +0 +2 +WString +3 +LIB +3 +WString +5 +n_2sn +1 +0 +1 +4 +MCommand +0 +5 +MCommand +0 +6 +MItem +10 +clib_r.lib +7 +WString +3 +LIB +8 +WVList +1 +9 +MVState +10 +WString +4 +WLIB +11 +WString +16 +???s?Page bound: +1 +12 +WString +3 +128 +0 +13 +WVList +0 +-1 +1 +1 +0 +14 +WPickList +319 +15 +MItem +5 +*.asm +16 +WString +6 +ASMOBJ +17 +WVList +5 +18 +MVState +19 +WString +4 +WASM +20 +WString +25 +n????Include directories: +1 +21 +WString +54 +$(%watcom)\h;$(%watcom)\h\nt;d:\myprojects\kdoom2\clib +0 +22 +MRState +23 +WString +4 +WASM +24 +WString +21 +?????Compiler default +1 +0 +25 +MRState +26 +WString +4 +WASM +27 +WString +33 +?????In-line Pentium instructions +1 +1 +28 +MRState +29 +WString +4 +WASM +30 +WString +29 +?????No debugging information +1 +1 +31 +MRState +32 +WString +4 +WASM +33 +WString +28 +?????Line number information +1 +0 +34 +WVList +0 +-1 +1 +0 +0 +35 +MItem +23 +CLIB\CGSUPP\7fu8386.asm +36 +WString +6 +ASMOBJ +37 +WVList +0 +38 +WVList +0 +15 +1 +1 +0 +39 +MItem +23 +CLIB\CGSUPP\7u8f386.asm +40 +WString +6 +ASMOBJ +41 +WVList +0 +42 +WVList +0 +15 +1 +1 +0 +43 +MItem +22 +CLIB\CGSUPP\__copy.asm +44 +WString +6 +ASMOBJ +45 +WVList +0 +46 +WVList +0 +15 +1 +1 +0 +47 +MItem +22 +CLIB\CGSUPP\__stos.asm +48 +WString +6 +ASMOBJ +49 +WVList +0 +50 +WVList +0 +15 +1 +1 +0 +51 +MItem +24 +CLIB\CGSUPP\amodf386.asm +52 +WString +6 +ASMOBJ +53 +WVList +0 +54 +WVList +0 +15 +1 +1 +0 +55 +MItem +24 +CLIB\CGSUPP\bufld386.asm +56 +WString +6 +ASMOBJ +57 +WVList +0 +58 +WVList +0 +15 +1 +1 +0 +59 +MItem +22 +CLIB\CGSUPP\div386.asm +60 +WString +6 +ASMOBJ +61 +WVList +0 +62 +WVList +0 +15 +1 +1 +0 +63 +MItem +22 +CLIB\CGSUPP\fdc386.asm +64 +WString +6 +ASMOBJ +65 +WVList +0 +66 +WVList +0 +15 +1 +1 +0 +67 +MItem +23 +CLIB\CGSUPP\fdfs386.asm +68 +WString +6 +ASMOBJ +69 +WVList +0 +70 +WVList +0 +15 +1 +1 +0 +71 +MItem +23 +CLIB\CGSUPP\fdi4386.asm +72 +WString +6 +ASMOBJ +73 +WVList +0 +74 +WVList +0 +15 +1 +1 +0 +75 +MItem +23 +CLIB\CGSUPP\fdi8386.asm +76 +WString +6 +ASMOBJ +77 +WVList +0 +78 +WVList +0 +15 +1 +1 +0 +79 +MItem +22 +CLIB\CGSUPP\fdmath.asm +80 +WString +6 +ASMOBJ +81 +WVList +0 +82 +WVList +0 +15 +1 +1 +0 +83 +MItem +24 +CLIB\CGSUPP\fdmth386.asm +84 +WString +6 +ASMOBJ +85 +WVList +0 +86 +WVList +0 +15 +1 +1 +0 +87 +MItem +22 +CLIB\CGSUPP\fdn386.asm +88 +WString +6 +ASMOBJ +89 +WVList +0 +90 +WVList +0 +15 +1 +1 +0 +91 +MItem +24 +CLIB\CGSUPP\fprem386.asm +92 +WString +6 +ASMOBJ +93 +WVList +0 +94 +WVList +0 +15 +1 +1 +0 +95 +MItem +22 +CLIB\CGSUPP\fsc386.asm +96 +WString +6 +ASMOBJ +97 +WVList +0 +98 +WVList +0 +15 +1 +1 +0 +99 +MItem +23 +CLIB\CGSUPP\fsfd386.asm +100 +WString +6 +ASMOBJ +101 +WVList +0 +102 +WVList +0 +15 +1 +1 +0 +103 +MItem +23 +CLIB\CGSUPP\fsi4386.asm +104 +WString +6 +ASMOBJ +105 +WVList +0 +106 +WVList +0 +15 +1 +1 +0 +107 +MItem +23 +CLIB\CGSUPP\fsi8386.asm +108 +WString +6 +ASMOBJ +109 +WVList +0 +110 +WVList +0 +15 +1 +1 +0 +111 +MItem +24 +CLIB\CGSUPP\fsmth386.asm +112 +WString +6 +ASMOBJ +113 +WVList +0 +114 +WVList +0 +15 +1 +1 +0 +115 +MItem +22 +CLIB\CGSUPP\fsn386.asm +116 +WString +6 +ASMOBJ +117 +WVList +0 +118 +WVList +0 +15 +1 +1 +0 +119 +MItem +24 +CLIB\CGSUPP\fstat386.asm +120 +WString +6 +ASMOBJ +121 +WVList +0 +122 +WVList +0 +15 +1 +1 +0 +123 +MItem +23 +CLIB\CGSUPP\i4fd386.asm +124 +WString +6 +ASMOBJ +125 +WVList +0 +126 +WVList +0 +15 +1 +1 +0 +127 +MItem +23 +CLIB\CGSUPP\i4fs386.asm +128 +WString +6 +ASMOBJ +129 +WVList +0 +130 +WVList +0 +15 +1 +1 +0 +131 +MItem +19 +CLIB\CGSUPP\i8d.asm +132 +WString +6 +ASMOBJ +133 +WVList +0 +134 +WVList +0 +15 +1 +1 +0 +135 +MItem +23 +CLIB\CGSUPP\i8fd386.asm +136 +WString +6 +ASMOBJ +137 +WVList +0 +138 +WVList +0 +15 +1 +1 +0 +139 +MItem +23 +CLIB\CGSUPP\i8fs386.asm +140 +WString +6 +ASMOBJ +141 +WVList +0 +142 +WVList +0 +15 +1 +1 +0 +143 +MItem +22 +CLIB\CGSUPP\i8m386.asm +144 +WString +6 +ASMOBJ +145 +WVList +0 +146 +WVList +0 +15 +1 +1 +0 +147 +MItem +23 +CLIB\CGSUPP\i8rs386.asm +148 +WString +6 +ASMOBJ +149 +WVList +0 +150 +WVList +0 +15 +1 +1 +0 +151 +MItem +23 +CLIB\CGSUPP\ldiv386.asm +152 +WString +6 +ASMOBJ +153 +WVList +0 +154 +WVList +0 +15 +1 +1 +0 +155 +MItem +24 +CLIB\CGSUPP\lldiv386.asm +156 +WString +6 +ASMOBJ +157 +WVList +0 +158 +WVList +0 +15 +1 +1 +0 +159 +MItem +24 +CLIB\CONVERT\fdmd386.asm +160 +WString +6 +ASMOBJ +161 +WVList +0 +162 +WVList +0 +15 +1 +1 +0 +163 +MItem +24 +CLIB\CONVERT\fsms386.asm +164 +WString +6 +ASMOBJ +165 +WVList +0 +166 +WVList +0 +15 +1 +1 +0 +167 +MItem +24 +CLIB\CONVERT\mdfd386.asm +168 +WString +6 +ASMOBJ +169 +WVList +0 +170 +WVList +0 +15 +1 +1 +0 +171 +MItem +24 +CLIB\CONVERT\msfs386.asm +172 +WString +6 +ASMOBJ +173 +WVList +0 +174 +WVList +0 +15 +1 +1 +0 +175 +MItem +20 +CLIB\FPU\chipa32.asm +176 +WString +6 +ASMOBJ +177 +WVList +0 +178 +WVList +0 +15 +1 +1 +0 +179 +MItem +20 +CLIB\FPU\chipd32.asm +180 +WString +6 +ASMOBJ +181 +WVList +0 +182 +WVList +0 +15 +1 +1 +0 +183 +MItem +20 +CLIB\FPU\chipr32.asm +184 +WString +6 +ASMOBJ +185 +WVList +0 +186 +WVList +0 +15 +1 +1 +0 +187 +MItem +20 +CLIB\FPU\chipt32.asm +188 +WString +6 +ASMOBJ +189 +WVList +0 +190 +WVList +0 +15 +1 +1 +0 +191 +MItem +21 +CLIB\FPU\ini87386.asm +192 +WString +6 +ASMOBJ +193 +WVList +0 +194 +WVList +0 +15 +1 +1 +0 +195 +MItem +22 +CLIB\INTEL\chipvar.asm +196 +WString +6 +ASMOBJ +197 +WVList +0 +198 +WVList +0 +15 +1 +1 +0 +199 +MItem +23 +CLIB\INTEL\i64ts386.asm +200 +WString +6 +ASMOBJ +201 +WVList +0 +202 +WVList +0 +15 +1 +1 +0 +203 +MItem +22 +CLIB\STRING\cmp386.asm +204 +WString +6 +ASMOBJ +205 +WVList +0 +206 +WVList +0 +15 +1 +1 +0 +207 +MItem +3 +*.c +208 +WString +4 +COBJ +209 +WVList +7 +210 +MVState +211 +WString +3 +WCC +212 +WString +25 +n????Include directories: +1 +213 +WString +54 +$(%watcom)\h;$(%watcom)\h\nt;d:\myprojects\kdoom2\clib +0 +214 +MRState +215 +WString +3 +WCC +216 +WString +29 +?????No debugging information +1 +1 +217 +MRState +218 +WString +3 +WCC +219 +WString +24 +?????Full debugging info +1 +0 +220 +MRState +221 +WString +3 +WCC +222 +WString +21 +?????Compiler default +1 +0 +223 +MRState +224 +WString +3 +WCC +225 +WString +33 +?????In-line Pentium instructions +1 +1 +226 +MRState +227 +WString +3 +WCC +228 +WString +21 +?????Compiler default +1 +0 +229 +MRState +230 +WString +3 +WCC +231 +WString +29 +?????In-line with coprocessor +1 +1 +232 +WVList +0 +-1 +1 +1 +0 +233 +MItem +20 +CLIB\CHAR\chartest.c +234 +WString +4 +COBJ +235 +WVList +0 +236 +WVList +0 +207 +1 +1 +0 +237 +MItem +19 +CLIB\CHAR\isalnum.c +238 +WString +4 +COBJ +239 +WVList +0 +240 +WVList +0 +207 +1 +1 +0 +241 +MItem +19 +CLIB\CHAR\isalpha.c +242 +WString +4 +COBJ +243 +WVList +0 +244 +WVList +0 +207 +1 +1 +0 +245 +MItem +19 +CLIB\CHAR\isascii.c +246 +WString +4 +COBJ +247 +WVList +0 +248 +WVList +0 +207 +1 +1 +0 +249 +MItem +19 +CLIB\CHAR\isblank.c +250 +WString +4 +COBJ +251 +WVList +0 +252 +WVList +0 +207 +1 +1 +0 +253 +MItem +19 +CLIB\CHAR\iscntrl.c +254 +WString +4 +COBJ +255 +WVList +0 +256 +WVList +0 +207 +1 +1 +0 +257 +MItem +18 +CLIB\CHAR\iscsym.c +258 +WString +4 +COBJ +259 +WVList +0 +260 +WVList +0 +207 +1 +1 +0 +261 +MItem +19 +CLIB\CHAR\iscsymf.c +262 +WString +4 +COBJ +263 +WVList +0 +264 +WVList +0 +207 +1 +1 +0 +265 +MItem +19 +CLIB\CHAR\isdigit.c +266 +WString +4 +COBJ +267 +WVList +0 +268 +WVList +0 +207 +1 +1 +0 +269 +MItem +19 +CLIB\CHAR\isgraph.c +270 +WString +4 +COBJ +271 +WVList +0 +272 +WVList +0 +207 +1 +1 +0 +273 +MItem +19 +CLIB\CHAR\islower.c +274 +WString +4 +COBJ +275 +WVList +0 +276 +WVList +0 +207 +1 +1 +0 +277 +MItem +19 +CLIB\CHAR\isprint.c +278 +WString +4 +COBJ +279 +WVList +0 +280 +WVList +0 +207 +1 +1 +0 +281 +MItem +19 +CLIB\CHAR\ispunct.c +282 +WString +4 +COBJ +283 +WVList +0 +284 +WVList +0 +207 +1 +1 +0 +285 +MItem +19 +CLIB\CHAR\isspace.c +286 +WString +4 +COBJ +287 +WVList +0 +288 +WVList +0 +207 +1 +1 +0 +289 +MItem +19 +CLIB\CHAR\istable.c +290 +WString +4 +COBJ +291 +WVList +0 +292 +WVList +0 +207 +1 +1 +0 +293 +MItem +19 +CLIB\CHAR\isupper.c +294 +WString +4 +COBJ +295 +WVList +0 +296 +WVList +0 +207 +1 +1 +0 +297 +MItem +20 +CLIB\CHAR\iswctype.c +298 +WString +4 +COBJ +299 +WVList +0 +300 +WVList +0 +207 +1 +1 +0 +301 +MItem +20 +CLIB\CHAR\isxdigit.c +302 +WString +4 +COBJ +303 +WVList +0 +304 +WVList +0 +207 +1 +1 +0 +305 +MItem +19 +CLIB\CHAR\tolower.c +306 +WString +4 +COBJ +307 +WVList +0 +308 +WVList +0 +207 +1 +1 +0 +309 +MItem +19 +CLIB\CHAR\toupper.c +310 +WString +4 +COBJ +311 +WVList +0 +312 +WVList +0 +207 +1 +1 +0 +313 +MItem +20 +CLIB\CHAR\towctrns.c +314 +WString +4 +COBJ +315 +WVList +0 +316 +WVList +0 +207 +1 +1 +0 +317 +MItem +23 +CLIB\CONVERT\alphabet.c +318 +WString +4 +COBJ +319 +WVList +0 +320 +WVList +0 +207 +1 +1 +0 +321 +MItem +19 +CLIB\CONVERT\atoi.c +322 +WString +4 +COBJ +323 +WVList +0 +324 +WVList +0 +207 +1 +1 +0 +325 +MItem +19 +CLIB\CONVERT\atol.c +326 +WString +4 +COBJ +327 +WVList +0 +328 +WVList +0 +207 +1 +1 +0 +329 +MItem +20 +CLIB\CONVERT\atoll.c +330 +WString +4 +COBJ +331 +WVList +0 +332 +WVList +0 +207 +1 +1 +0 +333 +MItem +19 +CLIB\CONVERT\itoa.c +334 +WString +4 +COBJ +335 +WVList +0 +336 +WVList +0 +207 +1 +1 +0 +337 +MItem +20 +CLIB\CONVERT\lltoa.c +338 +WString +4 +COBJ +339 +WVList +0 +340 +WVList +0 +207 +1 +1 +0 +341 +MItem +19 +CLIB\CONVERT\ltoa.c +342 +WString +4 +COBJ +343 +WVList +0 +344 +WVList +0 +207 +1 +1 +0 +345 +MItem +21 +CLIB\CONVERT\strtol.c +346 +WString +4 +COBJ +347 +WVList +0 +348 +WVList +0 +207 +1 +1 +0 +349 +MItem +22 +CLIB\CONVERT\strtoll.c +350 +WString +4 +COBJ +351 +WVList +0 +352 +WVList +0 +207 +1 +1 +0 +353 +MItem +22 +CLIB\DIRECT\gtcwdwnt.c +354 +WString +4 +COBJ +355 +WVList +0 +356 +WVList +0 +207 +1 +1 +0 +357 +MItem +23 +CLIB\ENVIRON\clearenv.c +358 +WString +4 +COBJ +359 +WVList +0 +360 +WVList +0 +207 +1 +1 +0 +361 +MItem +22 +CLIB\ENVIRON\environ.c +362 +WString +4 +COBJ +363 +WVList +0 +364 +WVList +0 +207 +1 +1 +0 +365 +MItem +21 +CLIB\ENVIRON\getenv.c +366 +WString +4 +COBJ +367 +WVList +0 +368 +WVList +0 +207 +1 +1 +0 +369 +MItem +20 +CLIB\ENVIRON\gtcmd.c +370 +WString +4 +COBJ +371 +WVList +0 +372 +WVList +0 +207 +1 +1 +0 +373 +MItem +23 +CLIB\ENVIRON\searchen.c +374 +WString +4 +COBJ +375 +WVList +0 +376 +WVList +0 +207 +1 +1 +0 +377 +MItem +22 +CLIB\ENVIRON\setenvp.c +378 +WString +4 +COBJ +379 +WVList +0 +380 +WVList +0 +207 +1 +1 +0 +381 +MItem +18 +CLIB\FILE\remove.c +382 +WString +4 +COBJ +383 +WVList +0 +384 +WVList +0 +207 +1 +1 +0 +385 +MItem +18 +CLIB\FPU\cntrl87.c +386 +WString +4 +COBJ +387 +WVList +0 +388 +WVList +0 +207 +1 +1 +0 +389 +MItem +18 +CLIB\FPU\cntrlfp.c +390 +WString +4 +COBJ +391 +WVList +0 +392 +WVList +0 +207 +1 +1 +0 +393 +MItem +19 +CLIB\FPU\fclex387.c +394 +WString +4 +COBJ +395 +WVList +0 +396 +WVList +0 +207 +1 +1 +0 +397 +MItem +24 +CLIB\HANDLEIO\_clsewnt.c +398 +WString +4 +COBJ +399 +WVList +0 +400 +WVList +0 +207 +1 +1 +0 +401 +MItem +21 +CLIB\HANDLEIO\close.c +402 +WString +4 +COBJ +403 +WVList +0 +404 +WVList +0 +207 +1 +1 +0 +405 +MItem +23 +CLIB\HANDLEIO\filelen.c +406 +WString +4 +COBJ +407 +WVList +0 +408 +WVList +0 +207 +1 +1 +0 +409 +MItem +21 +CLIB\HANDLEIO\fsync.c +410 +WString +4 +COBJ +411 +WVList +0 +412 +WVList +0 +207 +1 +1 +0 +413 +MItem +22 +CLIB\HANDLEIO\hdlman.c +414 +WString +4 +COBJ +415 +WVList +0 +416 +WVList +0 +207 +1 +1 +0 +417 +MItem +22 +CLIB\HANDLEIO\iomode.c +418 +WString +4 +COBJ +419 +WVList +0 +420 +WVList +0 +207 +1 +1 +0 +421 +MItem +24 +CLIB\HANDLEIO\iomodtty.c +422 +WString +4 +COBJ +423 +WVList +0 +424 +WVList +0 +207 +1 +1 +0 +425 +MItem +21 +CLIB\HANDLEIO\lseek.c +426 +WString +4 +COBJ +427 +WVList +0 +428 +WVList +0 +207 +1 +1 +0 +429 +MItem +24 +CLIB\HANDLEIO\lseekwnt.c +430 +WString +4 +COBJ +431 +WVList +0 +432 +WVList +0 +207 +1 +1 +0 +433 +MItem +21 +CLIB\HANDLEIO\qread.c +434 +WString +4 +COBJ +435 +WVList +0 +436 +WVList +0 +207 +1 +1 +0 +437 +MItem +21 +CLIB\HANDLEIO\qwrit.c +438 +WString +4 +COBJ +439 +WVList +0 +440 +WVList +0 +207 +1 +1 +0 +441 +MItem +20 +CLIB\HANDLEIO\read.c +442 +WString +4 +COBJ +443 +WVList +0 +444 +WVList +0 +207 +1 +1 +0 +445 +MItem +24 +CLIB\HANDLEIO\stiomode.c +446 +WString +4 +COBJ +447 +WVList +0 +448 +WVList +0 +207 +1 +1 +0 +449 +MItem +24 +CLIB\HANDLEIO\unlnkwnt.c +450 +WString +4 +COBJ +451 +WVList +0 +452 +WVList +0 +207 +1 +1 +0 +453 +MItem +21 +CLIB\HANDLEIO\write.c +454 +WString +4 +COBJ +455 +WVList +0 +456 +WVList +0 +207 +1 +1 +0 +457 +MItem +20 +CLIB\HEAP\amblksiz.c +458 +WString +4 +COBJ +459 +WVList +0 +460 +WVList +0 +207 +1 +1 +0 +461 +MItem +19 +CLIB\HEAP\ambsptr.c +462 +WString +4 +COBJ +463 +WVList +0 +464 +WVList +0 +207 +1 +1 +0 +465 +MItem +18 +CLIB\HEAP\calloc.c +466 +WString +4 +COBJ +467 +WVList +0 +468 +WVList +0 +207 +1 +1 +0 +469 +MItem +18 +CLIB\HEAP\freect.c +470 +WString +4 +COBJ +471 +WVList +0 +472 +WVList +0 +207 +1 +1 +0 +473 +MItem +20 +CLIB\HEAP\grownear.c +474 +WString +4 +COBJ +475 +WVList +0 +476 +WVList +0 +207 +1 +1 +0 +477 +MItem +18 +CLIB\HEAP\heapen.c +478 +WString +4 +COBJ +479 +WVList +0 +480 +WVList +0 +207 +1 +1 +0 +481 +MItem +20 +CLIB\HEAP\heapgrow.c +482 +WString +4 +COBJ +483 +WVList +0 +484 +WVList +0 +207 +1 +1 +0 +485 +MItem +15 +CLIB\HEAP\mem.c +486 +WString +4 +COBJ +487 +WVList +0 +488 +WVList +0 +207 +1 +1 +0 +489 +MItem +18 +CLIB\HEAP\memavl.c +490 +WString +4 +COBJ +491 +WVList +0 +492 +WVList +0 +207 +1 +1 +0 +493 +MItem +18 +CLIB\HEAP\memmax.c +494 +WString +4 +COBJ +495 +WVList +0 +496 +WVList +0 +207 +1 +1 +0 +497 +MItem +19 +CLIB\HEAP\ncalloc.c +498 +WString +4 +COBJ +499 +WVList +0 +500 +WVList +0 +207 +1 +1 +0 +501 +MItem +19 +CLIB\HEAP\nexpand.c +502 +WString +4 +COBJ +503 +WVList +0 +504 +WVList +0 +207 +1 +1 +0 +505 +MItem +17 +CLIB\HEAP\nfree.c +506 +WString +4 +COBJ +507 +WVList +0 +508 +WVList +0 +207 +1 +1 +0 +509 +MItem +20 +CLIB\HEAP\nheapchk.c +510 +WString +4 +COBJ +511 +WVList +0 +512 +WVList +0 +207 +1 +1 +0 +513 +MItem +20 +CLIB\HEAP\nheapmin.c +514 +WString +4 +COBJ +515 +WVList +0 +516 +WVList +0 +207 +1 +1 +0 +517 +MItem +20 +CLIB\HEAP\nheapset.c +518 +WString +4 +COBJ +519 +WVList +0 +520 +WVList +0 +207 +1 +1 +0 +521 +MItem +20 +CLIB\HEAP\nheapwal.c +522 +WString +4 +COBJ +523 +WVList +0 +524 +WVList +0 +207 +1 +1 +0 +525 +MItem +19 +CLIB\HEAP\nmalloc.c +526 +WString +4 +COBJ +527 +WVList +0 +528 +WVList +0 +207 +1 +1 +0 +529 +MItem +20 +CLIB\HEAP\nmemneed.c +530 +WString +4 +COBJ +531 +WVList +0 +532 +WVList +0 +207 +1 +1 +0 +533 +MItem +18 +CLIB\HEAP\nmsize.c +534 +WString +4 +COBJ +535 +WVList +0 +536 +WVList +0 +207 +1 +1 +0 +537 +MItem +20 +CLIB\HEAP\nrealloc.c +538 +WString +4 +COBJ +539 +WVList +0 +540 +WVList +0 +207 +1 +1 +0 +541 +MItem +19 +CLIB\HEAP\sbrkwnt.c +542 +WString +4 +COBJ +543 +WVList +0 +544 +WVList +0 +207 +1 +1 +0 +545 +MItem +20 +CLIB\INTEL\chipbug.c +546 +WString +4 +COBJ +547 +WVList +0 +548 +WVList +0 +207 +1 +1 +0 +549 +MItem +21 +CLIB\INTEL\grabfp87.c +550 +WString +4 +COBJ +551 +WVList +0 +552 +WVList +0 +207 +1 +1 +0 +553 +MItem +21 +CLIB\INTEL\save8087.c +554 +WString +4 +COBJ +555 +WVList +0 +556 +WVList +0 +207 +1 +1 +0 +557 +MItem +20 +CLIB\INTEL\segread.c +558 +WString +4 +COBJ +559 +WVList +0 +560 +WVList +0 +207 +1 +1 +0 +561 +MItem +21 +CLIB\KANJI\mbdtoupp.c +562 +WString +4 +COBJ +563 +WVList +0 +564 +WVList +0 +207 +1 +1 +0 +565 +MItem +15 +CLIB\MATH\abs.c +566 +WString +4 +COBJ +567 +WVList +0 +568 +WVList +0 +207 +1 +1 +0 +569 +MItem +19 +CLIB\MATH\hugeval.c +570 +WString +4 +COBJ +571 +WVList +0 +572 +WVList +0 +207 +1 +1 +0 +573 +MItem +19 +CLIB\MATH\hvalptr.c +574 +WString +4 +COBJ +575 +WVList +0 +576 +WVList +0 +207 +1 +1 +0 +577 +MItem +19 +CLIB\MATH\imaxabs.c +578 +WString +4 +COBJ +579 +WVList +0 +580 +WVList +0 +207 +1 +1 +0 +581 +MItem +19 +CLIB\MATH\imaxdiv.c +582 +WString +4 +COBJ +583 +WVList +0 +584 +WVList +0 +207 +1 +1 +0 +585 +MItem +16 +CLIB\MATH\labs.c +586 +WString +4 +COBJ +587 +WVList +0 +588 +WVList +0 +207 +1 +1 +0 +589 +MItem +17 +CLIB\MATH\llabs.c +590 +WString +4 +COBJ +591 +WVList +0 +592 +WVList +0 +207 +1 +1 +0 +593 +MItem +15 +CLIB\MATH\max.c +594 +WString +4 +COBJ +595 +WVList +0 +596 +WVList +0 +207 +1 +1 +0 +597 +MItem +15 +CLIB\MATH\min.c +598 +WString +4 +COBJ +599 +WVList +0 +600 +WVList +0 +207 +1 +1 +0 +601 +MItem +16 +CLIB\MATH\rand.c +602 +WString +4 +COBJ +603 +WVList +0 +604 +WVList +0 +207 +1 +1 +0 +605 +MItem +21 +CLIB\MBYTE\mbcupper.c +606 +WString +4 +COBJ +607 +WVList +0 +608 +WVList +0 +207 +1 +1 +0 +609 +MItem +19 +CLIB\MBYTE\mbsinc.c +610 +WString +4 +COBJ +611 +WVList +0 +612 +WVList +0 +207 +1 +1 +0 +613 +MItem +21 +CLIB\MBYTE\mbsnextc.c +614 +WString +4 +COBJ +615 +WVList +0 +616 +WVList +0 +207 +1 +1 +0 +617 +MItem +19 +CLIB\MBYTE\mbterm.c +618 +WString +4 +COBJ +619 +WVList +0 +620 +WVList +0 +207 +1 +1 +0 +621 +MItem +20 +CLIB\MBYTE\setmbcp.c +622 +WString +4 +COBJ +623 +WVList +0 +624 +WVList +0 +207 +1 +1 +0 +625 +MItem +18 +CLIB\MEMORY\bcmp.c +626 +WString +4 +COBJ +627 +WVList +0 +628 +WVList +0 +207 +1 +1 +0 +629 +MItem +19 +CLIB\MEMORY\bcopy.c +630 +WString +4 +COBJ +631 +WVList +0 +632 +WVList +0 +207 +1 +1 +0 +633 +MItem +19 +CLIB\MEMORY\bzero.c +634 +WString +4 +COBJ +635 +WVList +0 +636 +WVList +0 +207 +1 +1 +0 +637 +MItem +22 +CLIB\MEMORY\fmemccpy.c +638 +WString +4 +COBJ +639 +WVList +0 +640 +WVList +0 +207 +1 +1 +0 +641 +MItem +21 +CLIB\MEMORY\fmemchr.c +642 +WString +4 +COBJ +643 +WVList +0 +644 +WVList +0 +207 +1 +1 +0 +645 +MItem +21 +CLIB\MEMORY\fmemcmp.c +646 +WString +4 +COBJ +647 +WVList +0 +648 +WVList +0 +207 +1 +1 +0 +649 +MItem +21 +CLIB\MEMORY\fmemcpy.c +650 +WString +4 +COBJ +651 +WVList +0 +652 +WVList +0 +207 +1 +1 +0 +653 +MItem +22 +CLIB\MEMORY\fmemicmp.c +654 +WString +4 +COBJ +655 +WVList +0 +656 +WVList +0 +207 +1 +1 +0 +657 +MItem +22 +CLIB\MEMORY\fmemmove.c +658 +WString +4 +COBJ +659 +WVList +0 +660 +WVList +0 +207 +1 +1 +0 +661 +MItem +21 +CLIB\MEMORY\fmemset.c +662 +WString +4 +COBJ +663 +WVList +0 +664 +WVList +0 +207 +1 +1 +0 +665 +MItem +21 +CLIB\MEMORY\memccpy.c +666 +WString +4 +COBJ +667 +WVList +0 +668 +WVList +0 +207 +1 +1 +0 +669 +MItem +20 +CLIB\MEMORY\memchr.c +670 +WString +4 +COBJ +671 +WVList +0 +672 +WVList +0 +207 +1 +1 +0 +673 +MItem +20 +CLIB\MEMORY\memcmp.c +674 +WString +4 +COBJ +675 +WVList +0 +676 +WVList +0 +207 +1 +1 +0 +677 +MItem +20 +CLIB\MEMORY\memcpy.c +678 +WString +4 +COBJ +679 +WVList +0 +680 +WVList +0 +207 +1 +1 +0 +681 +MItem +22 +CLIB\MEMORY\memcpy_s.c +682 +WString +4 +COBJ +683 +WVList +0 +684 +WVList +0 +207 +1 +1 +0 +685 +MItem +21 +CLIB\MEMORY\memicmp.c +686 +WString +4 +COBJ +687 +WVList +0 +688 +WVList +0 +207 +1 +1 +0 +689 +MItem +22 +CLIB\MEMORY\memmov_s.c +690 +WString +4 +COBJ +691 +WVList +0 +692 +WVList +0 +207 +1 +1 +0 +693 +MItem +21 +CLIB\MEMORY\memmove.c +694 +WString +4 +COBJ +695 +WVList +0 +696 +WVList +0 +207 +1 +1 +0 +697 +MItem +20 +CLIB\MEMORY\memset.c +698 +WString +4 +COBJ +699 +WVList +0 +700 +WVList +0 +207 +1 +1 +0 +701 +MItem +21 +CLIB\MEMORY\memtest.c +702 +WString +4 +COBJ +703 +WVList +0 +704 +WVList +0 +207 +1 +1 +0 +705 +MItem +22 +CLIB\MEMORY\movedata.c +706 +WString +4 +COBJ +707 +WVList +0 +708 +WVList +0 +207 +1 +1 +0 +709 +MItem +18 +CLIB\MEMORY\swab.c +710 +WString +4 +COBJ +711 +WVList +0 +712 +WVList +0 +207 +1 +1 +0 +713 +MItem +21 +CLIB\SEARCH\bsearch.c +714 +WString +4 +COBJ +715 +WVList +0 +716 +WVList +0 +207 +1 +1 +0 +717 +MItem +21 +CLIB\SEARCH\bsrch_s.c +718 +WString +4 +COBJ +719 +WVList +0 +720 +WVList +0 +207 +1 +1 +0 +721 +MItem +19 +CLIB\SEARCH\lfind.c +722 +WString +4 +COBJ +723 +WVList +0 +724 +WVList +0 +207 +1 +1 +0 +725 +MItem +21 +CLIB\SEARCH\lsearch.c +726 +WString +4 +COBJ +727 +WVList +0 +728 +WVList +0 +207 +1 +1 +0 +729 +MItem +19 +CLIB\SEARCH\qsort.c +730 +WString +4 +COBJ +731 +WVList +0 +732 +WVList +0 +207 +1 +1 +0 +733 +MItem +21 +CLIB\SEARCH\qsort_s.c +734 +WString +4 +COBJ +735 +WVList +0 +736 +WVList +0 +207 +1 +1 +0 +737 +MItem +23 +CLIB\STREAMIO\allocfp.c +738 +WString +4 +COBJ +739 +WVList +0 +740 +WVList +0 +207 +1 +1 +0 +741 +MItem +22 +CLIB\STREAMIO\chktty.c +742 +WString +4 +COBJ +743 +WVList +0 +744 +WVList +0 +207 +1 +1 +0 +745 +MItem +24 +CLIB\STREAMIO\clearerr.c +746 +WString +4 +COBJ +747 +WVList +0 +748 +WVList +0 +207 +1 +1 +0 +749 +MItem +24 +CLIB\STREAMIO\comtflag.c +750 +WString +4 +COBJ +751 +WVList +0 +752 +WVList +0 +207 +1 +1 +0 +753 +MItem +23 +CLIB\STREAMIO\dsetefg.c +754 +WString +4 +COBJ +755 +WVList +0 +756 +WVList +0 +207 +1 +1 +0 +757 +MItem +22 +CLIB\STREAMIO\fclose.c +758 +WString +4 +COBJ +759 +WVList +0 +760 +WVList +0 +207 +1 +1 +0 +761 +MItem +22 +CLIB\STREAMIO\fdopen.c +762 +WString +4 +COBJ +763 +WVList +0 +764 +WVList +0 +207 +1 +1 +0 +765 +MItem +20 +CLIB\STREAMIO\feof.c +766 +WString +4 +COBJ +767 +WVList +0 +768 +WVList +0 +207 +1 +1 +0 +769 +MItem +22 +CLIB\STREAMIO\ferror.c +770 +WString +4 +COBJ +771 +WVList +0 +772 +WVList +0 +207 +1 +1 +0 +773 +MItem +22 +CLIB\STREAMIO\fflush.c +774 +WString +4 +COBJ +775 +WVList +0 +776 +WVList +0 +207 +1 +1 +0 +777 +MItem +21 +CLIB\STREAMIO\fgetc.c +778 +WString +4 +COBJ +779 +WVList +0 +780 +WVList +0 +207 +1 +1 +0 +781 +MItem +24 +CLIB\STREAMIO\fgetchar.c +782 +WString +4 +COBJ +783 +WVList +0 +784 +WVList +0 +207 +1 +1 +0 +785 +MItem +23 +CLIB\STREAMIO\fgetpos.c +786 +WString +4 +COBJ +787 +WVList +0 +788 +WVList +0 +207 +1 +1 +0 +789 +MItem +21 +CLIB\STREAMIO\fgets.c +790 +WString +4 +COBJ +791 +WVList +0 +792 +WVList +0 +207 +1 +1 +0 +793 +MItem +21 +CLIB\STREAMIO\flush.c +794 +WString +4 +COBJ +795 +WVList +0 +796 +WVList +0 +207 +1 +1 +0 +797 +MItem +24 +CLIB\STREAMIO\flushall.c +798 +WString +4 +COBJ +799 +WVList +0 +800 +WVList +0 +207 +1 +1 +0 +801 +MItem +21 +CLIB\STREAMIO\fopen.c +802 +WString +4 +COBJ +803 +WVList +0 +804 +WVList +0 +207 +1 +1 +0 +805 +MItem +23 +CLIB\STREAMIO\fopen_s.c +806 +WString +4 +COBJ +807 +WVList +0 +808 +WVList +0 +207 +1 +1 +0 +809 +MItem +23 +CLIB\STREAMIO\fprintf.c +810 +WString +4 +COBJ +811 +WVList +0 +812 +WVList +0 +207 +1 +1 +0 +813 +MItem +24 +CLIB\STREAMIO\fprntf_s.c +814 +WString +4 +COBJ +815 +WVList +0 +816 +WVList +0 +207 +1 +1 +0 +817 +MItem +21 +CLIB\STREAMIO\fprtf.c +818 +WString +4 +COBJ +819 +WVList +0 +820 +WVList +0 +207 +1 +1 +0 +821 +MItem +23 +CLIB\STREAMIO\fprtf_s.c +822 +WString +4 +COBJ +823 +WVList +0 +824 +WVList +0 +207 +1 +1 +0 +825 +MItem +21 +CLIB\STREAMIO\fputc.c +826 +WString +4 +COBJ +827 +WVList +0 +828 +WVList +0 +207 +1 +1 +0 +829 +MItem +24 +CLIB\STREAMIO\fputchar.c +830 +WString +4 +COBJ +831 +WVList +0 +832 +WVList +0 +207 +1 +1 +0 +833 +MItem +21 +CLIB\STREAMIO\fputs.c +834 +WString +4 +COBJ +835 +WVList +0 +836 +WVList +0 +207 +1 +1 +0 +837 +MItem +21 +CLIB\STREAMIO\fread.c +838 +WString +4 +COBJ +839 +WVList +0 +840 +WVList +0 +207 +1 +1 +0 +841 +MItem +22 +CLIB\STREAMIO\freefp.c +842 +WString +4 +COBJ +843 +WVList +0 +844 +WVList +0 +207 +1 +1 +0 +845 +MItem +23 +CLIB\STREAMIO\freop_s.c +846 +WString +4 +COBJ +847 +WVList +0 +848 +WVList +0 +207 +1 +1 +0 +849 +MItem +22 +CLIB\STREAMIO\fscanf.c +850 +WString +4 +COBJ +851 +WVList +0 +852 +WVList +0 +207 +1 +1 +0 +853 +MItem +24 +CLIB\STREAMIO\fscanf_s.c +854 +WString +4 +COBJ +855 +WVList +0 +856 +WVList +0 +207 +1 +1 +0 +857 +MItem +21 +CLIB\STREAMIO\fseek.c +858 +WString +4 +COBJ +859 +WVList +0 +860 +WVList +0 +207 +1 +1 +0 +861 +MItem +23 +CLIB\STREAMIO\fsetpos.c +862 +WString +4 +COBJ +863 +WVList +0 +864 +WVList +0 +207 +1 +1 +0 +865 +MItem +21 +CLIB\STREAMIO\ftell.c +866 +WString +4 +COBJ +867 +WVList +0 +868 +WVList +0 +207 +1 +1 +0 +869 +MItem +21 +CLIB\STREAMIO\fwide.c +870 +WString +4 +COBJ +871 +WVList +0 +872 +WVList +0 +207 +1 +1 +0 +873 +MItem +22 +CLIB\STREAMIO\fwrite.c +874 +WString +4 +COBJ +875 +WVList +0 +876 +WVList +0 +207 +1 +1 +0 +877 +MItem +20 +CLIB\STREAMIO\getc.c +878 +WString +4 +COBJ +879 +WVList +0 +880 +WVList +0 +207 +1 +1 +0 +881 +MItem +23 +CLIB\STREAMIO\getchar.c +882 +WString +4 +COBJ +883 +WVList +0 +884 +WVList +0 +207 +1 +1 +0 +885 +MItem +20 +CLIB\STREAMIO\gets.c +886 +WString +4 +COBJ +887 +WVList +0 +888 +WVList +0 +207 +1 +1 +0 +889 +MItem +22 +CLIB\STREAMIO\gets_s.c +890 +WString +4 +COBJ +891 +WVList +0 +892 +WVList +0 +207 +1 +1 +0 +893 +MItem +20 +CLIB\STREAMIO\getw.c +894 +WString +4 +COBJ +895 +WVList +0 +896 +WVList +0 +207 +1 +1 +0 +897 +MItem +24 +CLIB\STREAMIO\initfile.c +898 +WString +4 +COBJ +899 +WVList +0 +900 +WVList +0 +207 +1 +1 +0 +901 +MItem +23 +CLIB\STREAMIO\ioalloc.c +902 +WString +4 +COBJ +903 +WVList +0 +904 +WVList +0 +207 +1 +1 +0 +905 +MItem +19 +CLIB\STREAMIO\iob.c +906 +WString +4 +COBJ +907 +WVList +0 +908 +WVList +0 +207 +1 +1 +0 +909 +MItem +23 +CLIB\STREAMIO\iobaddr.c +910 +WString +4 +COBJ +911 +WVList +0 +912 +WVList +0 +207 +1 +1 +0 +913 +MItem +22 +CLIB\STREAMIO\iobptr.c +914 +WString +4 +COBJ +915 +WVList +0 +916 +WVList +0 +207 +1 +1 +0 +917 +MItem +24 +CLIB\STREAMIO\noefgfmt.c +918 +WString +4 +COBJ +919 +WVList +0 +920 +WVList +0 +207 +1 +1 +0 +921 +MItem +22 +CLIB\STREAMIO\perror.c +922 +WString +4 +COBJ +923 +WVList +0 +924 +WVList +0 +207 +1 +1 +0 +925 +MItem +22 +CLIB\STREAMIO\printf.c +926 +WString +4 +COBJ +927 +WVList +0 +928 +WVList +0 +207 +1 +1 +0 +929 +MItem +24 +CLIB\STREAMIO\printf_s.c +930 +WString +4 +COBJ +931 +WVList +0 +932 +WVList +0 +207 +1 +1 +0 +933 +MItem +20 +CLIB\STREAMIO\prtf.c +934 +WString +4 +COBJ +935 +WVList +0 +936 +WVList +0 +207 +1 +1 +0 +937 +MItem +22 +CLIB\STREAMIO\prtf_s.c +938 +WString +4 +COBJ +939 +WVList +0 +940 +WVList +0 +207 +1 +1 +0 +941 +MItem +20 +CLIB\STREAMIO\putc.c +942 +WString +4 +COBJ +943 +WVList +0 +944 +WVList +0 +207 +1 +1 +0 +945 +MItem +23 +CLIB\STREAMIO\putchar.c +946 +WString +4 +COBJ +947 +WVList +0 +948 +WVList +0 +207 +1 +1 +0 +949 +MItem +20 +CLIB\STREAMIO\puts.c +950 +WString +4 +COBJ +951 +WVList +0 +952 +WVList +0 +207 +1 +1 +0 +953 +MItem +20 +CLIB\STREAMIO\putw.c +954 +WString +4 +COBJ +955 +WVList +0 +956 +WVList +0 +207 +1 +1 +0 +957 +MItem +22 +CLIB\STREAMIO\rewind.c +958 +WString +4 +COBJ +959 +WVList +0 +960 +WVList +0 +207 +1 +1 +0 +961 +MItem +21 +CLIB\STREAMIO\scanf.c +962 +WString +4 +COBJ +963 +WVList +0 +964 +WVList +0 +207 +1 +1 +0 +965 +MItem +23 +CLIB\STREAMIO\scanf_s.c +966 +WString +4 +COBJ +967 +WVList +0 +968 +WVList +0 +207 +1 +1 +0 +969 +MItem +20 +CLIB\STREAMIO\scnf.c +970 +WString +4 +COBJ +971 +WVList +0 +972 +WVList +0 +207 +1 +1 +0 +973 +MItem +22 +CLIB\STREAMIO\scnf_s.c +974 +WString +4 +COBJ +975 +WVList +0 +976 +WVList +0 +207 +1 +1 +0 +977 +MItem +22 +CLIB\STREAMIO\setbuf.c +978 +WString +4 +COBJ +979 +WVList +0 +980 +WVList +0 +207 +1 +1 +0 +981 +MItem +22 +CLIB\STREAMIO\setefg.c +982 +WString +4 +COBJ +983 +WVList +0 +984 +WVList +0 +207 +1 +1 +0 +985 +MItem +23 +CLIB\STREAMIO\setvbuf.c +986 +WString +4 +COBJ +987 +WVList +0 +988 +WVList +0 +207 +1 +1 +0 +989 +MItem +21 +CLIB\STREAMIO\tmpfl.c +990 +WString +4 +COBJ +991 +WVList +0 +992 +WVList +0 +207 +1 +1 +0 +993 +MItem +23 +CLIB\STREAMIO\tmputil.c +994 +WString +4 +COBJ +995 +WVList +0 +996 +WVList +0 +207 +1 +1 +0 +997 +MItem +18 +CLIB\STRING\bits.c +998 +WString +4 +COBJ +999 +WVList +0 +1000 +WVList +0 +207 +1 +1 +0 +1001 +MItem +21 +CLIB\STRING\bprintf.c +1002 +WString +4 +COBJ +1003 +WVList +0 +1004 +WVList +0 +207 +1 +1 +0 +1005 +MItem +22 +CLIB\STRING\fsetbits.c +1006 +WString +4 +COBJ +1007 +WVList +0 +1008 +WVList +0 +207 +1 +1 +0 +1009 +MItem +21 +CLIB\STRING\fstrcat.c +1010 +WString +4 +COBJ +1011 +WVList +0 +1012 +WVList +0 +207 +1 +1 +0 +1013 +MItem +21 +CLIB\STRING\fstrchr.c +1014 +WString +4 +COBJ +1015 +WVList +0 +1016 +WVList +0 +207 +1 +1 +0 +1017 +MItem +21 +CLIB\STRING\fstrcmp.c +1018 +WString +4 +COBJ +1019 +WVList +0 +1020 +WVList +0 +207 +1 +1 +0 +1021 +MItem +21 +CLIB\STRING\fstrcpy.c +1022 +WString +4 +COBJ +1023 +WVList +0 +1024 +WVList +0 +207 +1 +1 +0 +1025 +MItem +22 +CLIB\STRING\fstrcspn.c +1026 +WString +4 +COBJ +1027 +WVList +0 +1028 +WVList +0 +207 +1 +1 +0 +1029 +MItem +21 +CLIB\STRING\fstrdup.c +1030 +WString +4 +COBJ +1031 +WVList +0 +1032 +WVList +0 +207 +1 +1 +0 +1033 +MItem +22 +CLIB\STRING\fstricmp.c +1034 +WString +4 +COBJ +1035 +WVList +0 +1036 +WVList +0 +207 +1 +1 +0 +1037 +MItem +21 +CLIB\STRING\fstrlen.c +1038 +WString +4 +COBJ +1039 +WVList +0 +1040 +WVList +0 +207 +1 +1 +0 +1041 +MItem +21 +CLIB\STRING\fstrlwr.c +1042 +WString +4 +COBJ +1043 +WVList +0 +1044 +WVList +0 +207 +1 +1 +0 +1045 +MItem +22 +CLIB\STRING\fstrncat.c +1046 +WString +4 +COBJ +1047 +WVList +0 +1048 +WVList +0 +207 +1 +1 +0 +1049 +MItem +22 +CLIB\STRING\fstrncmp.c +1050 +WString +4 +COBJ +1051 +WVList +0 +1052 +WVList +0 +207 +1 +1 +0 +1053 +MItem +22 +CLIB\STRING\fstrncpy.c +1054 +WString +4 +COBJ +1055 +WVList +0 +1056 +WVList +0 +207 +1 +1 +0 +1057 +MItem +22 +CLIB\STRING\fstrnicm.c +1058 +WString +4 +COBJ +1059 +WVList +0 +1060 +WVList +0 +207 +1 +1 +0 +1061 +MItem +22 +CLIB\STRING\fstrnset.c +1062 +WString +4 +COBJ +1063 +WVList +0 +1064 +WVList +0 +207 +1 +1 +0 +1065 +MItem +22 +CLIB\STRING\fstrpbrk.c +1066 +WString +4 +COBJ +1067 +WVList +0 +1068 +WVList +0 +207 +1 +1 +0 +1069 +MItem +22 +CLIB\STRING\fstrrchr.c +1070 +WString +4 +COBJ +1071 +WVList +0 +1072 +WVList +0 +207 +1 +1 +0 +1073 +MItem +21 +CLIB\STRING\fstrrev.c +1074 +WString +4 +COBJ +1075 +WVList +0 +1076 +WVList +0 +207 +1 +1 +0 +1077 +MItem +21 +CLIB\STRING\fstrset.c +1078 +WString +4 +COBJ +1079 +WVList +0 +1080 +WVList +0 +207 +1 +1 +0 +1081 +MItem +21 +CLIB\STRING\fstrspn.c +1082 +WString +4 +COBJ +1083 +WVList +0 +1084 +WVList +0 +207 +1 +1 +0 +1085 +MItem +22 +CLIB\STRING\fstrspnp.c +1086 +WString +4 +COBJ +1087 +WVList +0 +1088 +WVList +0 +207 +1 +1 +0 +1089 +MItem +21 +CLIB\STRING\fstrstr.c +1090 +WString +4 +COBJ +1091 +WVList +0 +1092 +WVList +0 +207 +1 +1 +0 +1093 +MItem +21 +CLIB\STRING\fstrtok.c +1094 +WString +4 +COBJ +1095 +WVList +0 +1096 +WVList +0 +207 +1 +1 +0 +1097 +MItem +21 +CLIB\STRING\fstrupr.c +1098 +WString +4 +COBJ +1099 +WVList +0 +1100 +WVList +0 +207 +1 +1 +0 +1101 +MItem +20 +CLIB\STRING\selptr.c +1102 +WString +4 +COBJ +1103 +WVList +0 +1104 +WVList +0 +207 +1 +1 +0 +1105 +MItem +20 +CLIB\STRING\sneptr.c +1106 +WString +4 +COBJ +1107 +WVList +0 +1108 +WVList +0 +207 +1 +1 +0 +1109 +MItem +22 +CLIB\STRING\snprintf.c +1110 +WString +4 +COBJ +1111 +WVList +0 +1112 +WVList +0 +207 +1 +1 +0 +1113 +MItem +22 +CLIB\STRING\snprtf_s.c +1114 +WString +4 +COBJ +1115 +WVList +0 +1116 +WVList +0 +207 +1 +1 +0 +1117 +MItem +21 +CLIB\STRING\sprintf.c +1118 +WString +4 +COBJ +1119 +WVList +0 +1120 +WVList +0 +207 +1 +1 +0 +1121 +MItem +22 +CLIB\STRING\sprntf_s.c +1122 +WString +4 +COBJ +1123 +WVList +0 +1124 +WVList +0 +207 +1 +1 +0 +1125 +MItem +20 +CLIB\STRING\sscanf.c +1126 +WString +4 +COBJ +1127 +WVList +0 +1128 +WVList +0 +207 +1 +1 +0 +1129 +MItem +22 +CLIB\STRING\sscanf_s.c +1130 +WString +4 +COBJ +1131 +WVList +0 +1132 +WVList +0 +207 +1 +1 +0 +1133 +MItem +22 +CLIB\STRING\stncat_s.c +1134 +WString +4 +COBJ +1135 +WVList +0 +1136 +WVList +0 +207 +1 +1 +0 +1137 +MItem +22 +CLIB\STRING\stncpy_s.c +1138 +WString +4 +COBJ +1139 +WVList +0 +1140 +WVList +0 +207 +1 +1 +0 +1141 +MItem +20 +CLIB\STRING\strcat.c +1142 +WString +4 +COBJ +1143 +WVList +0 +1144 +WVList +0 +207 +1 +1 +0 +1145 +MItem +22 +CLIB\STRING\strcat_s.c +1146 +WString +4 +COBJ +1147 +WVList +0 +1148 +WVList +0 +207 +1 +1 +0 +1149 +MItem +20 +CLIB\STRING\strchr.c +1150 +WString +4 +COBJ +1151 +WVList +0 +1152 +WVList +0 +207 +1 +1 +0 +1153 +MItem +21 +CLIB\STRING\strcoll.c +1154 +WString +4 +COBJ +1155 +WVList +0 +1156 +WVList +0 +207 +1 +1 +0 +1157 +MItem +20 +CLIB\STRING\strcpy.c +1158 +WString +4 +COBJ +1159 +WVList +0 +1160 +WVList +0 +207 +1 +1 +0 +1161 +MItem +22 +CLIB\STRING\strcpy_s.c +1162 +WString +4 +COBJ +1163 +WVList +0 +1164 +WVList +0 +207 +1 +1 +0 +1165 +MItem +21 +CLIB\STRING\strcspn.c +1166 +WString +4 +COBJ +1167 +WVList +0 +1168 +WVList +0 +207 +1 +1 +0 +1169 +MItem +20 +CLIB\STRING\strdup.c +1170 +WString +4 +COBJ +1171 +WVList +0 +1172 +WVList +0 +207 +1 +1 +0 +1173 +MItem +22 +CLIB\STRING\streln_s.c +1174 +WString +4 +COBJ +1175 +WVList +0 +1176 +WVList +0 +207 +1 +1 +0 +1177 +MItem +22 +CLIB\STRING\strerr_s.c +1178 +WString +4 +COBJ +1179 +WVList +0 +1180 +WVList +0 +207 +1 +1 +0 +1181 +MItem +22 +CLIB\STRING\strerror.c +1182 +WString +4 +COBJ +1183 +WVList +0 +1184 +WVList +0 +207 +1 +1 +0 +1185 +MItem +21 +CLIB\STRING\stricmp.c +1186 +WString +4 +COBJ +1187 +WVList +0 +1188 +WVList +0 +207 +1 +1 +0 +1189 +MItem +21 +CLIB\STRING\strlcat.c +1190 +WString +4 +COBJ +1191 +WVList +0 +1192 +WVList +0 +207 +1 +1 +0 +1193 +MItem +21 +CLIB\STRING\strlcpy.c +1194 +WString +4 +COBJ +1195 +WVList +0 +1196 +WVList +0 +207 +1 +1 +0 +1197 +MItem +20 +CLIB\STRING\strlen.c +1198 +WString +4 +COBJ +1199 +WVList +0 +1200 +WVList +0 +207 +1 +1 +0 +1201 +MItem +20 +CLIB\STRING\strlwr.c +1202 +WString +4 +COBJ +1203 +WVList +0 +1204 +WVList +0 +207 +1 +1 +0 +1205 +MItem +21 +CLIB\STRING\strncat.c +1206 +WString +4 +COBJ +1207 +WVList +0 +1208 +WVList +0 +207 +1 +1 +0 +1209 +MItem +21 +CLIB\STRING\strncmp.c +1210 +WString +4 +COBJ +1211 +WVList +0 +1212 +WVList +0 +207 +1 +1 +0 +1213 +MItem +21 +CLIB\STRING\strncpy.c +1214 +WString +4 +COBJ +1215 +WVList +0 +1216 +WVList +0 +207 +1 +1 +0 +1217 +MItem +22 +CLIB\STRING\strnicmp.c +1218 +WString +4 +COBJ +1219 +WVList +0 +1220 +WVList +0 +207 +1 +1 +0 +1221 +MItem +22 +CLIB\STRING\strnln_s.c +1222 +WString +4 +COBJ +1223 +WVList +0 +1224 +WVList +0 +207 +1 +1 +0 +1225 +MItem +21 +CLIB\STRING\strnset.c +1226 +WString +4 +COBJ +1227 +WVList +0 +1228 +WVList +0 +207 +1 +1 +0 +1229 +MItem +21 +CLIB\STRING\strpbrk.c +1230 +WString +4 +COBJ +1231 +WVList +0 +1232 +WVList +0 +207 +1 +1 +0 +1233 +MItem +21 +CLIB\STRING\strrchr.c +1234 +WString +4 +COBJ +1235 +WVList +0 +1236 +WVList +0 +207 +1 +1 +0 +1237 +MItem +20 +CLIB\STRING\strrev.c +1238 +WString +4 +COBJ +1239 +WVList +0 +1240 +WVList +0 +207 +1 +1 +0 +1241 +MItem +20 +CLIB\STRING\strset.c +1242 +WString +4 +COBJ +1243 +WVList +0 +1244 +WVList +0 +207 +1 +1 +0 +1245 +MItem +20 +CLIB\STRING\strspn.c +1246 +WString +4 +COBJ +1247 +WVList +0 +1248 +WVList +0 +207 +1 +1 +0 +1249 +MItem +21 +CLIB\STRING\strspnp.c +1250 +WString +4 +COBJ +1251 +WVList +0 +1252 +WVList +0 +207 +1 +1 +0 +1253 +MItem +20 +CLIB\STRING\strstr.c +1254 +WString +4 +COBJ +1255 +WVList +0 +1256 +WVList +0 +207 +1 +1 +0 +1257 +MItem +20 +CLIB\STRING\strtok.c +1258 +WString +4 +COBJ +1259 +WVList +0 +1260 +WVList +0 +207 +1 +1 +0 +1261 +MItem +22 +CLIB\STRING\strtok_s.c +1262 +WString +4 +COBJ +1263 +WVList +0 +1264 +WVList +0 +207 +1 +1 +0 +1265 +MItem +20 +CLIB\STRING\strupr.c +1266 +WString +4 +COBJ +1267 +WVList +0 +1268 +WVList +0 +207 +1 +1 +0 +1269 +MItem +21 +CLIB\STRING\strxfrm.c +1270 +WString +4 +COBJ +1271 +WVList +0 +1272 +WVList +0 +207 +1 +1 +0 +1273 +MItem +18 +CLIB\TIME\gmtime.c +1274 +WString +4 +COBJ +1275 +WVList +0 +1276 +WVList +0 +207 +1 +1 +0 +1277 +MItem +20 +CLIB\TIME\leapyear.c +1278 +WString +4 +COBJ +1279 +WVList +0 +1280 +WVList +0 +207 +1 +1 +0 +1281 +MItem +20 +CLIB\TIME\localtim.c +1282 +WString +4 +COBJ +1283 +WVList +0 +1284 +WVList +0 +207 +1 +1 +0 +1285 +MItem +20 +CLIB\TIME\locmktim.c +1286 +WString +4 +COBJ +1287 +WVList +0 +1288 +WVList +0 +207 +1 +1 +0 +1289 +MItem +18 +CLIB\TIME\mktime.c +1290 +WString +4 +COBJ +1291 +WVList +0 +1292 +WVList +0 +207 +1 +1 +0 +1293 +MItem +16 +CLIB\TIME\time.c +1294 +WString +4 +COBJ +1295 +WVList +0 +1296 +WVList +0 +207 +1 +1 +0 +1297 +MItem +20 +CLIB\TIME\timeutil.c +1298 +WString +4 +COBJ +1299 +WVList +0 +1300 +WVList +0 +207 +1 +1 +0 +1301 +MItem +17 +CLIB\TIME\tzset.c +1302 +WString +4 +COBJ +1303 +WVList +0 +1304 +WVList +0 +207 +1 +1 +0 +1305 +MItem +3 +*.h +1306 +WString +3 +NIL +1307 +WVList +0 +1308 +WVList +0 +-1 +1 +1 +0 +1309 +MItem +20 +CLIB\MATH\randnext.h +1310 +WString +3 +NIL +1311 +WVList +0 +1312 +WVList +0 +1305 +1 +1 +0 +1313 +MItem +20 +CLIB\STRING\errstr.h +1314 +WString +3 +NIL +1315 +WVList +0 +1316 +WVList +0 +1305 +1 +1 +0 +1317 +MItem +22 +CLIB\STRING\nextftok.h +1318 +WString +3 +NIL +1319 +WVList +0 +1320 +WVList +0 +1305 +1 +1 +0 +1321 +MItem +21 +CLIB\STRING\nexttok.h +1322 +WString +3 +NIL +1323 +WVList +0 +1324 +WVList +0 +1305 +1 +1 +0 +1325 +MItem +21 +CLIB\STRING\setbits.h +1326 +WString +3 +NIL +1327 +WVList +0 +1328 +WVList +0 +1305 +1 +1 +0