Update of /cvsroot/subtrick/TiTan/src/lib/ansi
In directory usw-pr-cvs1:/tmp/cvs-serv32047
Added Files:
isalpha.c isdigit.c islower.c isspace.c isupper.c m_isalpha.c
m_isdigit.c m_islower.c m_isspace.c m_isupper.c
Log Message:
Added Some ctype functions
--- NEW FILE: isalpha.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: isalpha.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
int isalpha (int c)
{
if ( (c >= 'a' && c <='z') || (c >= 'A' && c <= 'Z') )
return 1;
else
return 0;
}
--- NEW FILE: isdigit.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: isdigit.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
int isdigit (int c)
{
if (c >= '0' && c <= '9')
return 1;
else
return 0;
}
--- NEW FILE: islower.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: islower.c
* Date: 27:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
int islower (int c)
{
if (c >= 'a' && c <= 'z')
return 1;
else
return 0;
}
--- NEW FILE: isspace.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: isspace.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
int isspace (int c)
{
if ( c == ' ' || c == '\t' || c =='\n'|| c == '\r' )
return 1;
else
return 0;
}
--- NEW FILE: isupper.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: isupper.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
int isupper(int c)
{
if (c >= 'A' && c <= 'Z')
return 1;
else
return 0;
}
--- NEW FILE: m_isalpha.c ---
#include <stdio.h>
int main (void)
{
char c ='Z'+1;
if (isalpha(c))
printf ("the char '%c' isalpha\n ", c);
else
printf ("'%c' aint alpha\n",c);
return 0;
}
--- NEW FILE: m_isdigit.c ---
#include <stdio.h>
int main (void)
{
char c ='0'-1;
if (isdigit(c))
printf ("the char '%c' isdigit\n ", c);
else
printf ("'%c' aint digit\n",c);
return 0;
}
--- NEW FILE: m_islower.c ---
#include <stdio.h>
int main (void)
{
char c ='g';
if (islower(c))
printf ("the char '%c' is lower\n ", c);
else
printf ("'%c' aint lower\n",c);
return 0;
}
--- NEW FILE: m_isspace.c ---
#include <stdio.h>
int main (void)
{
char c='\r';
if (isspace(c))
printf ("'%c' is space \n",c);
else
printf (" the '%c' ins ot space \n",c);
return 0;
}
--- NEW FILE: m_isupper.c ---
#include <stdio.h>
int main(void)
{
char c ='V';
if (isupper (c))
printf ("%c is upper \n",c);
else
printf (" %c not\n",c);
return 0;
}
|