|
From: <ze...@us...> - 2002-09-01 23:46:18
|
Update of /cvsroot/subtrick/TiTan/src/lib/ansi
In directory usw-pr-cvs1:/tmp/cvs-serv3105
Added Files:
m_tolower.c m_toupper.c tolower.c toupper.c
Log Message:
the new ctype libs
--- NEW FILE: m_tolower.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: tolower.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
#include <stdio.h>
#include <string.h>
int main()
{
char string[] = "WHAT EVER MAN";
char *ptr;
ptr = string;
for (;*ptr;){ *ptr++ = tolower(*ptr);}
printf ("%s\n",string);
return 0;
}
int tolower (int x)
{
//printf ("%c \n",x);
if (x >='A' && x <= 'Z')
x = x + 32;
// printf ("%c \n",x);
return x;
}
--- NEW FILE: m_toupper.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: toupper.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
#include <stdio.h>
#include <string.h>
int main()
{
char string[] = "what ever man";
char *ptr;
ptr = string;
for (;*ptr;){ *ptr++ = toupper(*ptr);}
printf ("%s\n",string);
return 0;
}
int toupper (int x)
{
//printf ("%c \n",x);
if (x >='a' && x <= 'z')
x = x - 32;
// printf ("%c \n",x);
return x;
}
--- NEW FILE: tolower.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: tolower.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
/*
it takes an integer value 'x' if it in lower case
its returned or if its in uper case it change it
to lower case and return it
*/
int tolower (int x)
{
//printf ("%c \n",x);
if (x >='A' && x <= 'Z')
x = x + 32;
// printf ("%c \n",x);
return x;
}
--- NEW FILE: toupper.c ---
/* TiTaN OS
*
* Please read license Agreement
* (c)2002 SubTrick Group
* Part Of the clib
*
* file: toupper.c
* Date: 31:08:02
* Type: ANSI
* LIB: ctype.h
* Written by: Emad Zakaria
*/
/*
it takes an integer value 'x' if it in upper case
its returned or if its in lower case it change it
to upper case and return it
*/
int toupper (int x)
{
if (x >='a' && x <= 'z')
x = x - 32;
return x;
}
|