1 /*-------------------------------------------------------------------------
2 ctype.h - ANSI functions forward declarations
4 Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net
5 Modified for pic16 port by Vangelis Rokas, 2004, <vrokas AT otenet.gr>
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING. If not, write to the
19 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22 As a special exception, if you link this library with other files,
23 some of which are compiled with SDCC, to produce an executable,
24 this library does not by itself cause the resulting executable to
25 be covered by the GNU General Public License. This exception does
26 not however invalidate any other reasons why the executable file
27 might be covered by the GNU General Public License.
28 -------------------------------------------------------------------------*/
31 1.0 - June.1.2000 1.0 - Bela Torok / bela.torok@kssg.ch
32 order: function definitions -> macros
33 corretced macro: isalpha(c)
34 added macros: _tolower(c), _toupper(c), tolower(c), toupper(c) toascii(c)
40 /* link the C libarary */
45 extern char isblank (unsigned char ) ;
46 extern char iscntrl (unsigned char ) ;
47 extern char isdigit (unsigned char ) ;
48 extern char isgraph (unsigned char ) ;
49 extern char islower (unsigned char ) ;
50 extern char isupper (unsigned char ) ;
51 extern char isprint (unsigned char ) ;
52 extern char ispunct (unsigned char ) ;
53 extern char isspace (unsigned char ) ;
54 extern char isxdigit (unsigned char ) ;
56 #define isalnum(c) (isalpha(c) || isdigit(c))
57 #define isalpha(c) (isupper(c) || islower(c))
59 /* ANSI versions of _tolower & _toupper
60 #define _tolower(c) ((c) - ('a' - 'A'))
61 #define _toupper(c) ((c) + ('a' - 'A'))
64 // The _tolower & _toupper functions below can applied to any
65 // alpha characters regardless of the case (upper or lower)
66 #define _tolower(c) ((c) | ('a' - 'A'))
67 #define _toupper(c) ((c) & ~('a' - 'A'))
69 #define tolower(c) ((isupper(c)) ? _tolower(c) : (c))
70 #define toupper(c) ((islower(c)) ? _toupper(c) : (c))
71 #define toascii(c) ((c) & 0x7F)