forked from KolibriOS/kolibrios
Clib char & math functions
git-svn-id: svn://kolibrios.org@554 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
374
programs/develop/open watcom/trunk/clib/char/chartest.c
Normal file
374
programs/develop/open watcom/trunk/clib/char/chartest.c
Normal file
@@ -0,0 +1,374 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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: Non-exhaustive test of ctype.h functions and macros.
|
||||
* Note: Tests assume the C locale.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
#include <wctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define VERIFY( exp ) if( !(exp) ) { \
|
||||
printf( "%s: ***FAILURE*** at line %d of %s.\n",\
|
||||
ProgramName, __LINE__, \
|
||||
strlwr(__FILE__) ); \
|
||||
NumErrors++; \
|
||||
}
|
||||
|
||||
#define TEST_ARRAY_SIZE 256
|
||||
#define TEST_ARRAY_SIZE_WIDE 512
|
||||
|
||||
|
||||
struct CtypeBits {
|
||||
unsigned alnum : 1;
|
||||
unsigned alpha : 1;
|
||||
unsigned blank : 1;
|
||||
unsigned cntrl : 1;
|
||||
unsigned digit : 1;
|
||||
unsigned graph : 1;
|
||||
unsigned lower : 1;
|
||||
unsigned print : 1;
|
||||
unsigned punct : 1;
|
||||
unsigned space : 1;
|
||||
unsigned upper : 1;
|
||||
unsigned xdigit : 1;
|
||||
unsigned ascii : 1;
|
||||
unsigned csym : 1;
|
||||
unsigned csymf : 1;
|
||||
};
|
||||
|
||||
struct CtypeBits MacroResults[TEST_ARRAY_SIZE];
|
||||
struct CtypeBits FunctResults[TEST_ARRAY_SIZE];
|
||||
struct CtypeBits WideMacroResults[TEST_ARRAY_SIZE_WIDE];
|
||||
struct CtypeBits WideFunctResults[TEST_ARRAY_SIZE_WIDE];
|
||||
|
||||
char ProgramName[_MAX_PATH]; /* executable filename */
|
||||
int NumErrors = 0; /* number of errors */
|
||||
|
||||
int far far_data = 0;
|
||||
|
||||
void TestClassifyMacro( void )
|
||||
/****************************/
|
||||
{
|
||||
int i;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
MacroResults[0].alnum = isalnum( EOF );
|
||||
MacroResults[0].alpha = isalpha( EOF );
|
||||
MacroResults[0].blank = isblank( EOF );
|
||||
MacroResults[0].cntrl = iscntrl( EOF );
|
||||
MacroResults[0].digit = isdigit( EOF );
|
||||
MacroResults[0].graph = isgraph( EOF );
|
||||
MacroResults[0].lower = islower( EOF );
|
||||
MacroResults[0].print = isprint( EOF );
|
||||
MacroResults[0].punct = ispunct( EOF );
|
||||
MacroResults[0].space = isspace( EOF );
|
||||
MacroResults[0].upper = isupper( EOF );
|
||||
MacroResults[0].xdigit = isxdigit( EOF );
|
||||
MacroResults[0].ascii = isascii( EOF );
|
||||
MacroResults[0].csym = __iscsym( EOF );
|
||||
MacroResults[0].csymf = __iscsymf( EOF );
|
||||
|
||||
for( i = 1; i < TEST_ARRAY_SIZE; i++ ) {
|
||||
MacroResults[i].alnum = isalnum( i );
|
||||
MacroResults[i].alpha = isalpha( i );
|
||||
MacroResults[i].blank = isblank( i );
|
||||
MacroResults[i].cntrl = iscntrl( i );
|
||||
MacroResults[i].digit = isdigit( i );
|
||||
MacroResults[i].graph = isgraph( i );
|
||||
MacroResults[i].lower = islower( i );
|
||||
MacroResults[i].print = isprint( i );
|
||||
MacroResults[i].punct = ispunct( i );
|
||||
MacroResults[i].space = isspace( i );
|
||||
MacroResults[i].upper = isupper( i );
|
||||
MacroResults[i].xdigit = isxdigit( i );
|
||||
MacroResults[i].ascii = isascii( i );
|
||||
MacroResults[i].csym = __iscsym( i );
|
||||
MacroResults[i].csymf = __iscsymf( i );
|
||||
}
|
||||
}
|
||||
|
||||
void TestClassifyFunct( void )
|
||||
/****************************/
|
||||
{
|
||||
int i;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
FunctResults[0].alnum = (isalnum)( EOF );
|
||||
FunctResults[0].alpha = (isalpha)( EOF );
|
||||
FunctResults[0].blank = (isblank)( EOF );
|
||||
FunctResults[0].cntrl = (iscntrl)( EOF );
|
||||
FunctResults[0].digit = (isdigit)( EOF );
|
||||
FunctResults[0].graph = (isgraph)( EOF );
|
||||
FunctResults[0].lower = (islower)( EOF );
|
||||
FunctResults[0].print = (isprint)( EOF );
|
||||
FunctResults[0].punct = (ispunct)( EOF );
|
||||
FunctResults[0].space = (isspace)( EOF );
|
||||
FunctResults[0].upper = (isupper)( EOF );
|
||||
FunctResults[0].xdigit = (isxdigit)( EOF );
|
||||
FunctResults[0].ascii = (isascii)( EOF );
|
||||
FunctResults[0].csym = (__iscsym)( EOF );
|
||||
FunctResults[0].csymf = (__iscsymf)( EOF );
|
||||
|
||||
for( i = 1; i < TEST_ARRAY_SIZE; i++ ) {
|
||||
FunctResults[i].alnum = (isalnum)( i );
|
||||
FunctResults[i].alpha = (isalpha)( i );
|
||||
FunctResults[i].blank = (isblank)( i );
|
||||
FunctResults[i].cntrl = (iscntrl)( i );
|
||||
FunctResults[i].digit = (isdigit)( i );
|
||||
FunctResults[i].graph = (isgraph)( i );
|
||||
FunctResults[i].lower = (islower)( i );
|
||||
FunctResults[i].print = (isprint)( i );
|
||||
FunctResults[i].punct = (ispunct)( i );
|
||||
FunctResults[i].space = (isspace)( i );
|
||||
FunctResults[i].upper = (isupper)( i );
|
||||
FunctResults[i].xdigit = (isxdigit)( i );
|
||||
FunctResults[i].ascii = (isascii)( i );
|
||||
FunctResults[i].csym = (__iscsym)( i );
|
||||
FunctResults[i].csymf = (__iscsymf)( i );
|
||||
}
|
||||
}
|
||||
|
||||
void TestClassifyWideMacro( void )
|
||||
/********************************/
|
||||
{
|
||||
int i;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
WideMacroResults[0].alnum = iswalnum( WEOF );
|
||||
WideMacroResults[0].alpha = iswalpha( WEOF );
|
||||
WideMacroResults[0].blank = iswblank( WEOF );
|
||||
WideMacroResults[0].cntrl = iswcntrl( WEOF );
|
||||
WideMacroResults[0].digit = iswdigit( WEOF );
|
||||
WideMacroResults[0].graph = iswgraph( WEOF );
|
||||
WideMacroResults[0].lower = iswlower( WEOF );
|
||||
WideMacroResults[0].print = iswprint( WEOF );
|
||||
WideMacroResults[0].punct = iswpunct( WEOF );
|
||||
WideMacroResults[0].space = iswspace( WEOF );
|
||||
WideMacroResults[0].upper = iswupper( WEOF );
|
||||
WideMacroResults[0].xdigit = iswxdigit( WEOF );
|
||||
WideMacroResults[0].ascii = isascii( WEOF );
|
||||
WideMacroResults[0].csym = __iscsym( WEOF );
|
||||
WideMacroResults[0].csymf = __iscsymf( WEOF );
|
||||
|
||||
for( i = 1; i < TEST_ARRAY_SIZE_WIDE; i++ ) {
|
||||
WideMacroResults[i].alnum = iswalnum( i );
|
||||
WideMacroResults[i].alpha = iswalpha( i );
|
||||
WideMacroResults[i].blank = iswblank( i );
|
||||
WideMacroResults[i].cntrl = iswcntrl( i );
|
||||
WideMacroResults[i].digit = iswdigit( i );
|
||||
WideMacroResults[i].graph = iswgraph( i );
|
||||
WideMacroResults[i].lower = iswlower( i );
|
||||
WideMacroResults[i].print = iswprint( i );
|
||||
WideMacroResults[i].punct = iswpunct( i );
|
||||
WideMacroResults[i].space = iswspace( i );
|
||||
WideMacroResults[i].upper = iswupper( i );
|
||||
WideMacroResults[i].xdigit = iswxdigit( i );
|
||||
WideMacroResults[i].ascii = isascii( i );
|
||||
WideMacroResults[i].csym = __iscsym( i );
|
||||
WideMacroResults[i].csymf = __iscsymf( i );
|
||||
}
|
||||
}
|
||||
|
||||
void TestClassifyWideFunct( void )
|
||||
/********************************/
|
||||
{
|
||||
int i;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
WideFunctResults[0].alnum = (iswalnum)( WEOF );
|
||||
WideFunctResults[0].alpha = (iswalpha)( WEOF );
|
||||
WideFunctResults[0].blank = (iswblank)( WEOF );
|
||||
WideFunctResults[0].cntrl = (iswcntrl)( WEOF );
|
||||
WideFunctResults[0].digit = (iswdigit)( WEOF );
|
||||
WideFunctResults[0].graph = (iswgraph)( WEOF );
|
||||
WideFunctResults[0].lower = (iswlower)( WEOF );
|
||||
WideFunctResults[0].print = (iswprint)( WEOF );
|
||||
WideFunctResults[0].punct = (iswpunct)( WEOF );
|
||||
WideFunctResults[0].space = (iswspace)( WEOF );
|
||||
WideFunctResults[0].upper = (iswupper)( WEOF );
|
||||
WideFunctResults[0].xdigit = (iswxdigit)( WEOF );
|
||||
WideFunctResults[0].ascii = (isascii)( WEOF );
|
||||
WideFunctResults[0].csym = (__iscsym)( WEOF );
|
||||
WideFunctResults[0].csymf = (__iscsymf)( WEOF );
|
||||
|
||||
for( i = 1; i < TEST_ARRAY_SIZE_WIDE; i++ ) {
|
||||
WideFunctResults[i].alnum = (iswalnum)( i );
|
||||
WideFunctResults[i].alpha = (iswalpha)( i );
|
||||
WideFunctResults[i].blank = (iswblank)( i );
|
||||
WideFunctResults[i].cntrl = (iswcntrl)( i );
|
||||
WideFunctResults[i].digit = (iswdigit)( i );
|
||||
WideFunctResults[i].graph = (iswgraph)( i );
|
||||
WideFunctResults[i].lower = (iswlower)( i );
|
||||
WideFunctResults[i].print = (iswprint)( i );
|
||||
WideFunctResults[i].punct = (iswpunct)( i );
|
||||
WideFunctResults[i].space = (iswspace)( i );
|
||||
WideFunctResults[i].upper = (iswupper)( i );
|
||||
WideFunctResults[i].xdigit = (iswxdigit)( i );
|
||||
WideFunctResults[i].ascii = (isascii)( i );
|
||||
WideFunctResults[i].csym = (__iscsym)( i );
|
||||
WideFunctResults[i].csymf = (__iscsymf)( i );
|
||||
}
|
||||
}
|
||||
|
||||
/* Helper function to print mismatches in human readable form */
|
||||
void CheckResults( struct CtypeBits *s1, struct CtypeBits *s2, int count )
|
||||
/************************************************************************/
|
||||
{
|
||||
int i;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
for( i = 0; i < TEST_ARRAY_SIZE; i++ ) {
|
||||
if( s1[i].alnum != WideMacroResults[i].alnum )
|
||||
printf( "Mismatch at %d (alnum)\n", i );
|
||||
if( s1[i].alpha != s2[i].alpha )
|
||||
printf( "Mismatch at %d (alpha)\n", i );
|
||||
if( s1[i].blank != s2[i].blank )
|
||||
printf( "Mismatch at %d (blank)\n", i );
|
||||
if( s1[i].cntrl != s2[i].cntrl )
|
||||
printf( "Mismatch at %d (cntrl)\n", i );
|
||||
if( s1[i].digit != s2[i].digit )
|
||||
printf( "Mismatch at %d (digit)\n", i );
|
||||
if( s1[i].graph != s2[i].graph )
|
||||
printf( "Mismatch at %d (graph)\n", i );
|
||||
if( s1[i].lower != s2[i].lower )
|
||||
printf( "Mismatch at %d (lower)\n", i );
|
||||
if( s1[i].print != s2[i].print )
|
||||
printf( "Mismatch at %d (print)\n", i );
|
||||
if( s1[i].punct != s2[i].punct )
|
||||
printf( "Mismatch at %d (punct)\n", i );
|
||||
if( s1[i].space != s2[i].space )
|
||||
printf( "Mismatch at %d (space)\n", i );
|
||||
if( s1[i].upper != s2[i].upper )
|
||||
printf( "Mismatch at %d (upper)\n", i );
|
||||
if( s1[i].xdigit != s2[i].xdigit )
|
||||
printf( "Mismatch at %d (xdigit)\n", i );
|
||||
if( s1[i].ascii != s2[i].ascii )
|
||||
printf( "Mismatch at %d (ascii)\n", i );
|
||||
if( s1[i].csym != s2[i].csym )
|
||||
printf( "Mismatch at %d (csym)\n", i );
|
||||
if( s1[i].csymf != s2[i].csymf )
|
||||
printf( "Mismatch at %d (csymf)\n", i );
|
||||
}
|
||||
}
|
||||
|
||||
void TestResults( void )
|
||||
/**********************/
|
||||
{
|
||||
size_t len;
|
||||
size_t wide_len;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
len = sizeof( MacroResults );
|
||||
wide_len = sizeof( WideMacroResults );
|
||||
|
||||
CheckResults( MacroResults, FunctResults, TEST_ARRAY_SIZE );
|
||||
VERIFY( !memcmp( MacroResults, FunctResults, len ) );
|
||||
VERIFY( !memcmp( WideMacroResults, WideFunctResults, wide_len ) );
|
||||
VERIFY( !memcmp( MacroResults, WideMacroResults, len ) );
|
||||
VERIFY( !memcmp( MacroResults, WideFunctResults, len ) );
|
||||
}
|
||||
|
||||
void TestConversion( void )
|
||||
/*************************/
|
||||
{
|
||||
int c, c1, c2;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
for( c = 0; c < 256; c++ ) {
|
||||
c1 = tolower( c );
|
||||
c2 = toupper( c );
|
||||
if( isalpha( c ) ) {
|
||||
if( islower( c ) )
|
||||
VERIFY( (c1 == c) && (c2 != c) );
|
||||
if( isupper( c ) )
|
||||
VERIFY( (c1 != c) && (c2 == c) );
|
||||
} else {
|
||||
VERIFY( !isalpha( c1 ) && !isalpha( c2 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TestWideConversion( void )
|
||||
/*****************************/
|
||||
{
|
||||
wchar_t c, c1, c2;
|
||||
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
for( c = 0; c < 1024; c++ ) {
|
||||
c1 = towlower( c );
|
||||
c2 = towupper( c );
|
||||
if( iswalpha( c ) ) {
|
||||
if( iswlower( c ) )
|
||||
VERIFY( (c1 == c) && (c2 != c) );
|
||||
if( iswupper( c ) )
|
||||
VERIFY( (c1 != c) && (c2 == c) );
|
||||
} else {
|
||||
VERIFY( !iswalpha( c1 ) && !iswalpha( c2 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
/********************************/
|
||||
{
|
||||
far_data++; // set ds outside DGROUP
|
||||
|
||||
/*** Initialize ***/
|
||||
strcpy( ProgramName, strlwr(argv[0]) );
|
||||
|
||||
/*** Test stuff ***/
|
||||
TestClassifyMacro();
|
||||
TestClassifyFunct();
|
||||
TestClassifyWideMacro();
|
||||
TestClassifyWideFunct();
|
||||
TestResults();
|
||||
TestConversion();
|
||||
TestWideConversion();
|
||||
|
||||
/*** Print a pass/fail message and quit ***/
|
||||
if( NumErrors == 0 ) {
|
||||
printf( "%s: SUCCESS.\n", ProgramName );
|
||||
return( EXIT_SUCCESS );
|
||||
} else {
|
||||
printf( "%s: FAILURE (%d errors).\n", ProgramName, NumErrors );
|
||||
return( EXIT_FAILURE );
|
||||
}
|
||||
}
|
38
programs/develop/open watcom/trunk/clib/char/intwctrn.h
Normal file
38
programs/develop/open watcom/trunk/clib/char/intwctrn.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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: Identifiers for internal use by wctrans() and towctrans().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef INTWCTRN_H
|
||||
#define INTWCTRN_H
|
||||
|
||||
#define WCTRANS_TOLOWER 128
|
||||
#define WCTRANS_TOUPPER 129
|
||||
|
||||
#endif
|
48
programs/develop/open watcom/trunk/clib/char/intwctyp.h
Normal file
48
programs/develop/open watcom/trunk/clib/char/intwctyp.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* 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: Identifiers for internal use by iswctype() and wctype().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef INTWCTYP_H
|
||||
#define INTWCTYP_H
|
||||
|
||||
#define WCTYPE_ALNUM 1
|
||||
#define WCTYPE_ALPHA 2
|
||||
#define WCTYPE_CNTRL 3
|
||||
#define WCTYPE_DIGIT 4
|
||||
#define WCTYPE_GRAPH 5
|
||||
#define WCTYPE_LOWER 6
|
||||
#define WCTYPE_PRINT 7
|
||||
#define WCTYPE_PUNCT 8
|
||||
#define WCTYPE_SPACE 9
|
||||
#define WCTYPE_UPPER 10
|
||||
#define WCTYPE_XDIGIT 11
|
||||
#define WCTYPE_BLANK 12
|
||||
|
||||
#endif
|
48
programs/develop/open watcom/trunk/clib/char/isalnum.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isalnum.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of isalnum().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isalnum
|
||||
|
||||
_WCRTLINK int __F_NAME(isalnum,iswalnum)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & (_LOWER|_UPPER|_DIGIT) );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/isalpha.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isalpha.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of isalpha().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isalpha
|
||||
|
||||
_WCRTLINK int __F_NAME(isalpha,iswalpha)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & (_LOWER|_UPPER) );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
43
programs/develop/open watcom/trunk/clib/char/isascii.c
Normal file
43
programs/develop/open watcom/trunk/clib/char/isascii.c
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: Implementation of isascii().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#undef isascii
|
||||
|
||||
_WCRTLINK int __F_NAME(isascii,iswascii)( INTCHAR_TYPE c )
|
||||
{
|
||||
return( (unsigned)(c) <= 0x7f );
|
||||
}
|
47
programs/develop/open watcom/trunk/clib/char/isblank.c
Normal file
47
programs/develop/open watcom/trunk/clib/char/isblank.c
Normal file
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation if isblank().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#undef isblank
|
||||
|
||||
_WCRTLINK int __F_NAME(isblank,iswblank)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( (c == ' ') || (c == '\t') );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/iscntrl.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/iscntrl.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of iscntrl().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef iscntrl
|
||||
|
||||
_WCRTLINK int __F_NAME(iscntrl,iswcntrl)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _CNTRL );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
45
programs/develop/open watcom/trunk/clib/char/iscsym.c
Normal file
45
programs/develop/open watcom/trunk/clib/char/iscsym.c
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: Implementation of __iscsym().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include <ctype.h>
|
||||
#include "widechar.h"
|
||||
#include "istable.h"
|
||||
#undef __iscsym
|
||||
|
||||
_WCRTLINK int (__iscsym)( int c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( (IsWhat( c ) & (_LOWER|_UPPER|_DIGIT)) || (c == '_') );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
45
programs/develop/open watcom/trunk/clib/char/iscsymf.c
Normal file
45
programs/develop/open watcom/trunk/clib/char/iscsymf.c
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: Implementation of __iscsymf().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include <ctype.h>
|
||||
#include "widechar.h"
|
||||
#include "istable.h"
|
||||
#undef __iscsymf
|
||||
|
||||
_WCRTLINK int (__iscsymf)( int c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( (IsWhat( c ) & (_LOWER|_UPPER)) || (c == '_') );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/isdigit.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isdigit.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of isdigit().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isdigit
|
||||
|
||||
_WCRTLINK int __F_NAME(isdigit,iswdigit)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _DIGIT );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/isgraph.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isgraph.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation if isgraph().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isgraph
|
||||
|
||||
_WCRTLINK int __F_NAME(isgraph,iswgraph)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII(c) ) {
|
||||
return( (IsWhat( c ) & (_PRINT|_SPACE)) == _PRINT );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/islower.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/islower.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of islower().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef islower
|
||||
|
||||
_WCRTLINK int __F_NAME(islower,iswlower)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _LOWER );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/isprint.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isprint.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation if isprint().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isprint
|
||||
|
||||
_WCRTLINK int __F_NAME(isprint,iswprint)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _PRINT );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/ispunct.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/ispunct.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of ispunct().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef ispunct
|
||||
|
||||
_WCRTLINK int __F_NAME(ispunct,iswpunct)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _PUNCT );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/isspace.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isspace.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation if isspace().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isspace
|
||||
|
||||
_WCRTLINK int __F_NAME(isspace,iswspace)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _SPACE );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
295
programs/develop/open watcom/trunk/clib/char/istable.c
Normal file
295
programs/develop/open watcom/trunk/clib/char/istable.c
Normal file
@@ -0,0 +1,295 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Character classification table.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include <ctype.h>
|
||||
|
||||
_WCRTLINKD const char _HUGEDATA _IsTable[257] = {
|
||||
|
||||
#define ___0__ 0
|
||||
|
||||
/* -1,EOF */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 00,NUL */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 01,SOH */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 02,STX */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 03,ETX */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 04,EOT */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 05,ENQ */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 06,NAK */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 07,BEL */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 08,BS */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 09,TAB */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL,
|
||||
/* 0A,LF */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL,
|
||||
/* 0B,VT */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL,
|
||||
/* 0C,FF */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL,
|
||||
/* 0D,CR */ ___0__|___0__|___0__|___0__|___0__|___0__|_SPACE|_CNTRL,
|
||||
/* 0E,SI */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 0F,SO */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 10, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 11, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 12, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 13, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 14, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 15, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 16, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 17, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 18, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 19, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 1A, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 1B, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 1C, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 1D, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 1E, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 1F, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 20, */ ___0__|___0__|___0__|___0__|_PRINT|___0__|_SPACE|___0__,
|
||||
/* 21, ! */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 22, " */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 23, # */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 24, $ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 25, % */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 26, & */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 27, ' */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 28, ( */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 29, ) */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 2A, * */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 2B, + */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 2C, , */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 2D, - */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 2E, . */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 2F, / */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 30, 0 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 31, 1 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 32, 2 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 33, 3 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 34, 4 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 35, 5 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 36, 6 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 37, 7 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 38, 8 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 39, 9 */ ___0__|___0__|_DIGIT|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 3A, : */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 3B, ; */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 3C, < */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 3D, = */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 3E, > */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 3F, ? */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 40, @ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 41, A */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 42, B */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 43, C */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 44, D */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 45, E */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 46, F */ ___0__|_UPPER|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 47, G */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 48, H */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 49, I */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 4A, J */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 4B, K */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 4C, L */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 4D, M */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 4E, N */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 4F, O */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 50, P */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 51, Q */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 52, R */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 53, S */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 54, T */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 55, U */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 56, V */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 57, W */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 58, X */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 59, Y */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 5A, Z */ ___0__|_UPPER|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 5B, [ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 5C, \ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 5D, ] */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 5E, ^ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 5F, _ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 60, ` */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 61, a */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 62, b */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 63, c */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 64, d */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 65, e */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 66, f */ _LOWER|___0__|___0__|_XDIGT|_PRINT|___0__|___0__|___0__,
|
||||
/* 67, g */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 68, h */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 69, i */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 6A, j */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 6B, k */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 6C, l */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 6D, m */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 6E, n */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 6F, o */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 70, p */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 71, q */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 72, r */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 73, s */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 74, t */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 75, u */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 76, v */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 77, w */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 78, x */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 79, y */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 7A, z */ _LOWER|___0__|___0__|___0__|_PRINT|___0__|___0__|___0__,
|
||||
/* 7B, { */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 7C, | */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 7D, } */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 7E, ~ */ ___0__|___0__|___0__|___0__|_PRINT|_PUNCT|___0__|___0__,
|
||||
/* 7F,DEL */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|_CNTRL,
|
||||
/* 80, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 81, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 82, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 83, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 84, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 85, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 86, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 87, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 88, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 89, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 8A, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 8B, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 8C, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 8D, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 8E, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 8F, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 90, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 91, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 92, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 93, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 94, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 95, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 96, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 97, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 98, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 99, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 9A, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 9B, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 9C, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 9D, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 9E, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* 9F, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* A9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* AA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* AB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* AC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* AD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* AE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* AF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* B9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* BA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* BB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* BC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* BD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* BE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* BF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* C9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* CA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* CB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* CC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* CD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* CE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* CF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* D9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* DA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* DB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* DC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* DD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* DE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* DF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* E9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* EA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* EB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* EC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* ED, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* EE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* EF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F0, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F1, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F2, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F3, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F4, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F5, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F6, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F7, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F8, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* F9, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* FA, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* FB, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* FC, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* FD, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* FE, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__,
|
||||
/* FF, */ ___0__|___0__|___0__|___0__|___0__|___0__|___0__|___0__ };
|
68
programs/develop/open watcom/trunk/clib/char/istable.h
Normal file
68
programs/develop/open watcom/trunk/clib/char/istable.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: _IsTable accessors (with x86 optimized versions).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef _ISTABLE_H_INCLUDED
|
||||
#define _ISTABLE_H_INCLUDED
|
||||
|
||||
#if defined(__386__)
|
||||
extern int IsWhat( int );
|
||||
#pragma aux IsWhat = \
|
||||
"and eax,0xff" \
|
||||
"mov al,_IsTable+0x1[eax]" \
|
||||
parm loadds [eax]
|
||||
#elif defined(M_I86HM)
|
||||
extern int IsWhat( int );
|
||||
#pragma aux IsWhat = \
|
||||
"push bx" \
|
||||
"mov bx,seg _IsTable" \
|
||||
"mov ds,bx" \
|
||||
"and ax,0xff" \
|
||||
"mov bx,ax" \
|
||||
"mov al,_IsTable+0x1[bx]" \
|
||||
"pop bx" \
|
||||
parm [ax] modify [ds]
|
||||
#elif defined(__I86__)
|
||||
extern int IsWhat( int );
|
||||
#pragma aux IsWhat = \
|
||||
"push bx" \
|
||||
"and ax,0xff" \
|
||||
"mov bx,ax" \
|
||||
"mov al,_IsTable+0x1[bx]" \
|
||||
"pop bx" \
|
||||
parm loadds [ax]
|
||||
#else
|
||||
static int IsWhat( int c )
|
||||
{
|
||||
return( _IsTable[TO_ASCII( c )+1] );
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
48
programs/develop/open watcom/trunk/clib/char/isupper.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isupper.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of isupper().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isupper
|
||||
|
||||
_WCRTLINK int __F_NAME(isupper,iswupper)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _UPPER );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
54
programs/develop/open watcom/trunk/clib/char/iswctype.c
Normal file
54
programs/develop/open watcom/trunk/clib/char/iswctype.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation if iswctype().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include <wctype.h>
|
||||
#include "intwctyp.h"
|
||||
|
||||
/* Determine if the given character is of the specified type. */
|
||||
_WCRTLINK int iswctype( wint_t wc, wctype_t desc )
|
||||
{
|
||||
switch( desc ) {
|
||||
case WCTYPE_ALNUM: return( iswalnum( wc ) );
|
||||
case WCTYPE_ALPHA: return( iswalpha( wc ) );
|
||||
case WCTYPE_BLANK: return( iswblank( wc ) );
|
||||
case WCTYPE_CNTRL: return( iswcntrl( wc ) );
|
||||
case WCTYPE_DIGIT: return( iswdigit( wc ) );
|
||||
case WCTYPE_GRAPH: return( iswgraph( wc ) );
|
||||
case WCTYPE_LOWER: return( iswlower( wc ) );
|
||||
case WCTYPE_PRINT: return( iswprint( wc ) );
|
||||
case WCTYPE_PUNCT: return( iswpunct( wc ) );
|
||||
case WCTYPE_SPACE: return( iswspace( wc ) );
|
||||
case WCTYPE_UPPER: return( iswupper( wc ) );
|
||||
case WCTYPE_XDIGIT: return( iswxdigit( wc ) );
|
||||
default: return( 0 );
|
||||
}
|
||||
}
|
48
programs/develop/open watcom/trunk/clib/char/isxdigit.c
Normal file
48
programs/develop/open watcom/trunk/clib/char/isxdigit.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation if isxdigit().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#include "istable.h"
|
||||
#undef isxdigit
|
||||
|
||||
_WCRTLINK int __F_NAME(isxdigit,iswxdigit)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( IS_ASCII( c ) ) {
|
||||
return( IsWhat( c ) & _XDIGT );
|
||||
} else {
|
||||
return( 0 );
|
||||
}
|
||||
}
|
45
programs/develop/open watcom/trunk/clib/char/tolower.c
Normal file
45
programs/develop/open watcom/trunk/clib/char/tolower.c
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: Implementation of tolower().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
_WCRTLINK INTCHAR_TYPE __F_NAME(tolower,towlower)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( c >= 'A' && c <= 'Z' ) {
|
||||
c = c - 'A' + 'a';
|
||||
}
|
||||
return( c );
|
||||
}
|
46
programs/develop/open watcom/trunk/clib/char/toupper.c
Normal file
46
programs/develop/open watcom/trunk/clib/char/toupper.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Open Watcom Project
|
||||
*
|
||||
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original
|
||||
* Code as defined in and that are subject to the Sybase Open Watcom
|
||||
* Public License version 1.0 (the 'License'). You may not use this file
|
||||
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
|
||||
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
|
||||
* provided with the Original Code and Modifications, and is also
|
||||
* available at www.sybase.com/developer/opensource.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
|
||||
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
|
||||
* NON-INFRINGEMENT. Please see the License for the specific language
|
||||
* governing rights and limitations under the License.
|
||||
*
|
||||
* ========================================================================
|
||||
*
|
||||
* Description: Implementation of toupper().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include "widechar.h"
|
||||
#include <ctype.h>
|
||||
#ifdef __WIDECHAR__
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
_WCRTLINK INTCHAR_TYPE __F_NAME(toupper,towupper)( INTCHAR_TYPE c )
|
||||
{
|
||||
if( c >= 'a' && c <= 'z' ) {
|
||||
c = c - 'a' + 'A';
|
||||
}
|
||||
return( c );
|
||||
}
|
||||
|
45
programs/develop/open watcom/trunk/clib/char/towctrns.c
Normal file
45
programs/develop/open watcom/trunk/clib/char/towctrns.c
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: Implementation of towctrans().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "variety.h"
|
||||
#include <wctype.h>
|
||||
#include "intwctrn.h"
|
||||
|
||||
|
||||
/* Transform character as specified by 'desc'. */
|
||||
_WCRTLINK wint_t towctrans( wint_t wc, wctrans_t desc )
|
||||
{
|
||||
switch( desc ) {
|
||||
case WCTRANS_TOLOWER: return( towlower( wc ) );
|
||||
case WCTRANS_TOUPPER: return( towupper( wc ) );
|
||||
default: return( wc );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user