Update of /cvsroot/subtrick/TiTan/src/lib/ansi
In directory usw-pr-cvs1:/tmp/cvs-serv12841
Modified Files:
Makefile
Added Files:
isascii.c m_isascii.c isxdigit.c m_isxdigit.c isalnum.c
m_isalnum.c
Log Message:
some changes in older ctype libs an some new libs
--- NEW FILE: isascii.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
*/
/*
it takes the 'c' checks whether its an ascii caracter then returns 1
otherwise it return 0
*/
int isascii (int c)
{
while (c >0)
{
if ( c <=127)
return 1;
else
return 0;
}
return 0;
}
--- NEW FILE: m_isascii.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
*/
#include <stdio.h>
int main ()
{
char f='d';
if (isascii(f))
printf ("%c is an ascii\n",f);
else
printf ("%c is not ascii\n",f);
return 0;
}
--- NEW FILE: isxdigit.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
*/
/*
function thet take 'c' and cheks if its a digit or a char
between a and f then its an hexdcimal digit
*/
int isxdigit (int c)
{
if (isdigit(c) || c>='A'&& c<='F' || c>='a' && c<='f')
return 1;
else
return 0;
return 0;
}
--- NEW FILE: m_isxdigit.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
*/
#include <stdio.h>
int main ()
{
char c='j';
if (isxdigit(c))
printf ("%c is an hex\n",c);
else
printf ("%c is not hex\n",c);
return 0;
}
--- NEW FILE: isalnum.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 alnum (int c)
{
if (isalpha (c) || isdigit(c))
return 1;
else
return 0;
return 0;
}
--- NEW FILE: m_isalnum.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
*/
#include <stdio.h>
int main(void)
{
char c=' ';
if (isalnum(c))
printf ("%c is alpha num",c);
else
printf ("%c is not alpha num",c);
return 0;
}
Index: Makefile
===================================================================
RCS file: /cvsroot/subtrick/TiTan/src/lib/ansi/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile 30 Aug 2002 19:40:25 -0000 1.2
--- Makefile 2 Sep 2002 07:35:39 -0000 1.3
***************
*** 4,8 ****
all: memcpy memchr memcmp memset strcat strchr strlen strcpy \
! isalpha isdigit isspace islower isupper
memchr:
--- 4,8 ----
all: memcpy memchr memcmp memset strcat strchr strlen strcpy \
! isalpha isdigit isspace islower isupper toupper tolower isascii isxdigit isalnum
memchr:
***************
*** 45,49 ****
$(CC) -c isupper.c
$(CC) m_isupper.c isupper.o -o isupper.out
!
clean:
rm *.o
--- 45,63 ----
$(CC) -c isupper.c
$(CC) m_isupper.c isupper.o -o isupper.out
! toupper:
! $(CC) -c toupper.c
! $(CC) m_toupper.c toupper.o -o toupper.out
! tolower:
! $(CC) -c tolower.c
! $(CC) m_tolower.c tolower.o -o tolower.out
! isascii:
! $(CC) -c isascii.c
! $(CC) m_isascii.c isascii.o -o isascii.out
! isxdigit:
! $(CC) -c isdigit.c isxdigit.c
! $(CC) m_isxdigit.c isdigit.o isxdigit.o -o isxdigit.out
! isalnum:
! $(CC) -c isalpha.c isdigit.c isalnum.c
! $(CC) m_isalnum.c isdigit.o isalpha.c isalnum.o -o isalnum.out
clean:
rm *.o
|