forked from KolibriOS/kolibrios
OpenWatcom clib and sdk/sound
git-svn-id: svn://kolibrios.org@359 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
61
programs/develop/open watcom/trunk/clib/h/clibi64.h
Normal file
61
programs/develop/open watcom/trunk/clib/h/clibi64.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
32
programs/develop/open watcom/trunk/clib/h/close.h
Normal file
32
programs/develop/open watcom/trunk/clib/h/close.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 );
|
35
programs/develop/open watcom/trunk/clib/h/errorno.h
Normal file
35
programs/develop/open watcom/trunk/clib/h/errorno.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
||||
|
||||
|
85
programs/develop/open watcom/trunk/clib/h/exitwmsg.h
Normal file
85
programs/develop/open watcom/trunk/clib/h/exitwmsg.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
53
programs/develop/open watcom/trunk/clib/h/exitwmsg.inc
Normal file
53
programs/develop/open watcom/trunk/clib/h/exitwmsg.inc
Normal file
@@ -0,0 +1,53 @@
|
||||
;*****************************************************************************
|
||||
;*
|
||||
;* 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
|
106
programs/develop/open watcom/trunk/clib/h/extfunc.h
Normal file
106
programs/develop/open watcom/trunk/clib/h/extfunc.h
Normal file
@@ -0,0 +1,106 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
43
programs/develop/open watcom/trunk/clib/h/farfunc.h
Normal file
43
programs/develop/open watcom/trunk/clib/h/farfunc.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
74
programs/develop/open watcom/trunk/clib/h/farsupp.h
Normal file
74
programs/develop/open watcom/trunk/clib/h/farsupp.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
81
programs/develop/open watcom/trunk/clib/h/fileacc.h
Normal file
81
programs/develop/open watcom/trunk/clib/h/fileacc.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
37
programs/develop/open watcom/trunk/clib/h/fixpoint.h
Normal file
37
programs/develop/open watcom/trunk/clib/h/fixpoint.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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;
|
34
programs/develop/open watcom/trunk/clib/h/flush.h
Normal file
34
programs/develop/open watcom/trunk/clib/h/flush.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 );
|
32
programs/develop/open watcom/trunk/clib/h/fprtf.h
Normal file
32
programs/develop/open watcom/trunk/clib/h/fprtf.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 );
|
45
programs/develop/open watcom/trunk/clib/h/ftos.h
Normal file
45
programs/develop/open watcom/trunk/clib/h/ftos.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
41
programs/develop/open watcom/trunk/clib/h/handleio.h
Normal file
41
programs/develop/open watcom/trunk/clib/h/handleio.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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;
|
207
programs/develop/open watcom/trunk/clib/h/heap.h
Normal file
207
programs/develop/open watcom/trunk/clib/h/heap.h
Normal file
@@ -0,0 +1,207 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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: Heap library configuration for various platforms.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
|
||||
#if defined(_M_IX86)
|
||||
#include <i86.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__DOS_EXT__)
|
||||
#if defined(__386__) && \
|
||||
!defined(__WINDOWS_386__) && \
|
||||
!defined(__WINDOWS__) && \
|
||||
!defined(__OS2__) && \
|
||||
!defined(__NT__) && \
|
||||
!defined(__OSI__) && \
|
||||
!defined(__UNIX__)
|
||||
#define __DOS_EXT__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef unsigned int tag;
|
||||
typedef struct freelistp frl;
|
||||
typedef struct freelistp _WCNEAR *frlptr;
|
||||
typedef struct freelist _WCFAR *farfrlptr;
|
||||
typedef unsigned char _WCNEAR *PTR;
|
||||
typedef unsigned char _WCFAR *FARPTR;
|
||||
typedef struct miniheapblkp _WCNEAR *mheapptr;
|
||||
|
||||
/*
|
||||
** NOTE: the size of these data structures is critical to the alignemnt
|
||||
** of the pointers returned by malloc().
|
||||
*/
|
||||
struct freelist {
|
||||
tag len; /* length of block in free list */
|
||||
unsigned int prev; /* offset of previous block in free list */
|
||||
unsigned int next; /* offset of next block in free list */
|
||||
};
|
||||
struct heapblk {
|
||||
tag heaplen; /* size of heap (0 = 64K) */
|
||||
unsigned int prevseg; /* segment selector for previous heap */
|
||||
unsigned int nextseg; /* segment selector for next heap */
|
||||
unsigned int rover; /* roving pointer into free list */
|
||||
unsigned int b4rover; /* largest block before rover */
|
||||
unsigned int largest_blk; /* largest block in the heap */
|
||||
unsigned int numalloc; /* number of allocated blocks in heap */
|
||||
unsigned int numfree; /* number of free blocks in the heap */
|
||||
struct freelist freehead; /* listhead of free blocks in heap */
|
||||
};
|
||||
|
||||
struct freelistp {
|
||||
tag len;
|
||||
frlptr prev;
|
||||
frlptr next;
|
||||
};
|
||||
struct heapblkp {
|
||||
tag heaplen;
|
||||
unsigned int prevseg;
|
||||
unsigned int nextseg;
|
||||
frlptr rover;
|
||||
unsigned int b4rover;
|
||||
unsigned int largest_blk;
|
||||
unsigned int numalloc;
|
||||
unsigned int numfree;
|
||||
frl freehead;
|
||||
};
|
||||
|
||||
struct miniheapblkp {
|
||||
tag len;
|
||||
mheapptr prev;
|
||||
mheapptr next;
|
||||
frlptr rover;
|
||||
unsigned int b4rover;
|
||||
unsigned int largest_blk;
|
||||
unsigned int numalloc;
|
||||
unsigned int numfree;
|
||||
frl freehead;
|
||||
};
|
||||
|
||||
struct heapstart {
|
||||
struct heapblk h;
|
||||
struct freelist first;
|
||||
};
|
||||
|
||||
struct heapend {
|
||||
tag last_tag;
|
||||
struct freelist last;
|
||||
};
|
||||
|
||||
#ifdef __DOS_EXT__
|
||||
struct dpmi_hdr {
|
||||
unsigned long dpmi_handle;
|
||||
tag dos_seg_value; // 0 => DPMI block, else DOS segment
|
||||
};
|
||||
#endif
|
||||
|
||||
extern unsigned _curbrk;
|
||||
extern mheapptr _WCNEAR __nheapbeg;
|
||||
#if defined(_M_IX86)
|
||||
extern __segment __fheap;
|
||||
extern __segment __bheap;
|
||||
extern __segment __fheapRover;
|
||||
#endif
|
||||
extern int __heap_enabled;
|
||||
extern unsigned int __LargestSizeB4Rover;
|
||||
extern struct miniheapblkp _WCNEAR *__MiniHeapRover;
|
||||
extern unsigned int __LargestSizeB4MiniHeapRover;
|
||||
extern struct miniheapblkp _WCNEAR *__MiniHeapFreeRover;
|
||||
|
||||
extern size_t __LastFree( void );
|
||||
extern int __NHeapWalk( struct _heapinfo *entry, mheapptr heapbeg );
|
||||
extern int __ExpandDGROUP( unsigned int __amt );
|
||||
#if defined(_M_IX86)
|
||||
extern unsigned __AllocSeg( unsigned int __amt );
|
||||
extern unsigned __GrowSeg( __segment __seg, unsigned int __amt );
|
||||
extern int __FreeSeg( __segment seg );
|
||||
extern int __HeapWalk( struct _heapinfo *entry, __segment seg, unsigned all );
|
||||
extern int __HeapMin( __segment seg, unsigned one_seg );
|
||||
extern int __HeapSet( __segment seg, unsigned fill );
|
||||
#endif
|
||||
|
||||
#if defined(__DOS_EXT__)
|
||||
extern void __FreeDPMIBlocks( void );
|
||||
extern void *__ReAllocDPMIBlock( frlptr p1, unsigned req_size );
|
||||
extern void *__ExpandDPMIBlock( frlptr, unsigned );
|
||||
#endif
|
||||
|
||||
extern int __HeapManager_expand( __segment seg, unsigned offset,
|
||||
size_t req_size, size_t *growth_size );
|
||||
|
||||
extern void _WCFAR __HeapInit( void _WCNEAR *start, unsigned int amount );
|
||||
|
||||
_WCRTLINK extern void _WCNEAR *__brk( unsigned );
|
||||
|
||||
#if defined(_M_IX86)
|
||||
#define _DGroup() FP_SEG((&__nheapbeg))
|
||||
#else
|
||||
#define _DGroup() 0
|
||||
#endif
|
||||
// __IsCtsNHeap() is used to determine whether the operating system provides
|
||||
// a continuous near heap block. __ExpandDGroup should slice for more near
|
||||
// heap under those operating systems with __IsCtsNHeap() == 1.
|
||||
#if defined(__WARP__) || \
|
||||
defined(__NT__) || \
|
||||
defined(__WINDOWS_386__) || \
|
||||
defined(__WINDOWS_286__)
|
||||
#define __IsCtsNHeap() 0
|
||||
#elif defined(__DOS_EXT__)
|
||||
#define __IsCtsNHeap() ((_IsRationalZeroBase() || _IsCodeBuilder()) ? 0 : 1)
|
||||
#else
|
||||
#define __IsCtsNHeap() 1
|
||||
#endif
|
||||
|
||||
extern unsigned __MemAllocator( unsigned __sz, unsigned __seg, unsigned __off );
|
||||
extern void __MemFree( unsigned __ptr, unsigned __seg, unsigned __off );
|
||||
#if defined(_M_IX86)
|
||||
#if defined(__386__)
|
||||
#pragma aux __MemAllocator "*" parm [eax] [edx] [ebx];
|
||||
#pragma aux __MemFree "*" parm [eax] [edx] [ebx];
|
||||
#else
|
||||
#pragma aux __MemAllocator "*" parm [ax] [dx] [bx];
|
||||
#pragma aux __MemFree "*" parm [ax] [dx] [bx];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define PARAS_IN_64K (0x1000)
|
||||
#define END_TAG (~0)
|
||||
|
||||
#define TAG_SIZE (sizeof(tag))
|
||||
#if defined(M_I86)
|
||||
#define ROUND_SIZE (TAG_SIZE-1)
|
||||
#else
|
||||
#define ROUND_SIZE (TAG_SIZE+TAG_SIZE-1)
|
||||
#endif
|
||||
#define FRL_SIZE ((sizeof(frl)+ROUND_SIZE)&~ROUND_SIZE)
|
||||
|
||||
#define __HM_SUCCESS 0
|
||||
#define __HM_FAIL 1
|
||||
#define __HM_TRYGROW 2
|
59
programs/develop/open watcom/trunk/clib/h/heapacc.h
Normal file
59
programs/develop/open watcom/trunk/clib/h/heapacc.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 _HEAPACC_H_INCLUDED
|
||||
#define _HEAPACC_H_INCLUDED
|
||||
/* macros for serialization of accesses to the heap */
|
||||
#if defined(__SW_BM)
|
||||
#if defined(__386__) || defined(__AXP__) || defined(__PPC__)
|
||||
extern void (*_AccessFHeap)();
|
||||
extern void (*_ReleaseFHeap)();
|
||||
extern void (*_AccessNHeap)();
|
||||
extern void (*_ReleaseNHeap)();
|
||||
#else
|
||||
extern void __AccessFHeap();
|
||||
extern void __ReleaseFHeap();
|
||||
extern void __AccessNHeap();
|
||||
extern void __ReleaseNHeap();
|
||||
#define _AccessFHeap() __AccessFHeap()
|
||||
#define _ReleaseFHeap() __ReleaseFHeap()
|
||||
#define _AccessNHeap() __AccessNHeap()
|
||||
#define _ReleaseNHeap() __ReleaseNHeap()
|
||||
#endif
|
||||
#else
|
||||
#define _AccessFHeap()
|
||||
#define _ReleaseFHeap()
|
||||
#define _AccessNHeap()
|
||||
#define _ReleaseNHeap()
|
||||
#endif
|
||||
#endif
|
||||
|
70
programs/develop/open watcom/trunk/clib/h/iomode.h
Normal file
70
programs/develop/open watcom/trunk/clib/h/iomode.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <windows.h>
|
||||
|
||||
#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
|
113
programs/develop/open watcom/trunk/clib/h/langenv.h
Normal file
113
programs/develop/open watcom/trunk/clib/h/langenv.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
40
programs/develop/open watcom/trunk/clib/h/langenvd.h
Normal file
40
programs/develop/open watcom/trunk/clib/h/langenvd.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
90
programs/develop/open watcom/trunk/clib/h/liballoc.h
Normal file
90
programs/develop/open watcom/trunk/clib/h/liballoc.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <malloc.h>
|
||||
|
||||
#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
|
41
programs/develop/open watcom/trunk/clib/h/lseek.h
Normal file
41
programs/develop/open watcom/trunk/clib/h/lseek.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
57
programs/develop/open watcom/trunk/clib/h/mbchar.h
Normal file
57
programs/develop/open watcom/trunk/clib/h/mbchar.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
358
programs/develop/open watcom/trunk/clib/h/mdef.inc
Normal file
358
programs/develop/open watcom/trunk/clib/h/mdef.inc
Normal file
@@ -0,0 +1,358 @@
|
||||
;*****************************************************************************
|
||||
;*
|
||||
;* 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 <alignment>
|
||||
_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 <p2>
|
||||
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 <p2>
|
||||
public p1
|
||||
else
|
||||
public "&p1",p2
|
||||
endif
|
||||
endm
|
||||
|
||||
xref macro p1,p2
|
||||
ifb <p2>
|
||||
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 <p2>
|
||||
extrn p1 : dword
|
||||
else
|
||||
extrn "&p1",p2 : dword
|
||||
endif
|
||||
else
|
||||
ifb <p2>
|
||||
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 <p2>
|
||||
public p1
|
||||
else
|
||||
public "&p1",p2
|
||||
endif
|
||||
endm
|
||||
|
||||
xref macro p1,p2
|
||||
ifb <p2>
|
||||
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 <function>
|
||||
xref "C",_&alias
|
||||
else
|
||||
xref "C",function
|
||||
endif
|
||||
.code
|
||||
public "C",`alias`
|
||||
ifdef _EXPORT
|
||||
`alias` proc export
|
||||
else
|
||||
`alias` proc
|
||||
endif
|
||||
ifb <function>
|
||||
jmp _&alias
|
||||
else
|
||||
jmp `function`
|
||||
endif
|
||||
`alias` endp
|
||||
endm
|
||||
|
||||
xred macro p1,p2,p3
|
||||
ifb <p3>
|
||||
extrn p1 : p2
|
||||
else
|
||||
extrn "&p1",p2 : p3
|
||||
endif
|
||||
endm
|
||||
|
100
programs/develop/open watcom/trunk/clib/h/mf.h
Normal file
100
programs/develop/open watcom/trunk/clib/h/mf.h
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
|
||||
//#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 */
|
||||
|
||||
|
||||
|
49
programs/develop/open watcom/trunk/clib/h/myvalist.h
Normal file
49
programs/develop/open watcom/trunk/clib/h/myvalist.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <stdarg.h>
|
||||
|
||||
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
|
57
programs/develop/open watcom/trunk/clib/h/orient.h
Normal file
57
programs/develop/open watcom/trunk/clib/h/orient.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
183
programs/develop/open watcom/trunk/clib/h/printf.h
Normal file
183
programs/develop/open watcom/trunk/clib/h/printf.h
Normal file
@@ -0,0 +1,183 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
91
programs/develop/open watcom/trunk/clib/h/prtscncf.h
Normal file
91
programs/develop/open watcom/trunk/clib/h/prtscncf.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* 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
|
36
programs/develop/open watcom/trunk/clib/h/qwrite.h
Normal file
36
programs/develop/open watcom/trunk/clib/h/qwrite.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
359
programs/develop/open watcom/trunk/clib/h/riscstr.h
Normal file
359
programs/develop/open watcom/trunk/clib/h/riscstr.h
Normal file
@@ -0,0 +1,359 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <string.h>
|
||||
#include <wchar.h>
|
||||
#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
|
63
programs/develop/open watcom/trunk/clib/h/rtcheck.h
Normal file
63
programs/develop/open watcom/trunk/clib/h/rtcheck.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <errno.h>
|
||||
#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
|
||||
|
211
programs/develop/open watcom/trunk/clib/h/rtdata.h
Normal file
211
programs/develop/open watcom/trunk/clib/h/rtdata.h
Normal file
@@ -0,0 +1,211 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#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
|
131
programs/develop/open watcom/trunk/clib/h/rtinit.h
Normal file
131
programs/develop/open watcom/trunk/clib/h/rtinit.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
77
programs/develop/open watcom/trunk/clib/h/scanf.h
Normal file
77
programs/develop/open watcom/trunk/clib/h/scanf.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <stdarg.h>
|
||||
|
||||
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
|
52
programs/develop/open watcom/trunk/clib/h/seterrno.h
Normal file
52
programs/develop/open watcom/trunk/clib/h/seterrno.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
||||
|
37
programs/develop/open watcom/trunk/clib/h/streamio.h
Normal file
37
programs/develop/open watcom/trunk/clib/h/streamio.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 );
|
220
programs/develop/open watcom/trunk/clib/h/struct.inc
Normal file
220
programs/develop/open watcom/trunk/clib/h/struct.inc
Normal file
@@ -0,0 +1,220 @@
|
||||
;*****************************************************************************
|
||||
;*
|
||||
;* 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>
|
||||
name = __label
|
||||
endif
|
||||
endm
|
||||
|
||||
_quif macro cc,name
|
||||
ifnb <name>
|
||||
_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 <name>
|
||||
_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
|
33
programs/develop/open watcom/trunk/clib/h/tmpfname.h
Normal file
33
programs/develop/open watcom/trunk/clib/h/tmpfname.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
293
programs/develop/open watcom/trunk/clib/h/variety.h
Normal file
293
programs/develop/open watcom/trunk/clib/h/variety.h
Normal file
@@ -0,0 +1,293 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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
|
206
programs/develop/open watcom/trunk/clib/h/watcom.h
Normal file
206
programs/develop/open watcom/trunk/clib/h/watcom.h
Normal file
@@ -0,0 +1,206 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <errno.h>
|
||||
#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
|
74
programs/develop/open watcom/trunk/clib/h/widechar.h
Normal file
74
programs/develop/open watcom/trunk/clib/h/widechar.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <stdlib.h> /* 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
|
68
programs/develop/open watcom/trunk/clib/h/xstring.h
Normal file
68
programs/develop/open watcom/trunk/clib/h/xstring.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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 <string.h>
|
||||
|
||||
#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
|
Reference in New Issue
Block a user