diff --git a/library/GNUmakefile.68k b/library/GNUmakefile.68k index b1eb9a9..b5bb3cb 100644 --- a/library/GNUmakefile.68k +++ b/library/GNUmakefile.68k @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.68k,v 1.52 2005-05-08 08:51:29 obarthel Exp $ +# $Id: GNUmakefile.68k,v 1.53 2005-05-11 20:15:24 obarthel Exp $ # # :ts=8 # @@ -127,6 +127,7 @@ C_LIB = \ ctype_isalnum.o \ ctype_isalpha.o \ ctype_isascii.o \ + ctype_isblank.o \ ctype_iscntrl.o \ ctype_isdigit.o \ ctype_isgraph.o \ diff --git a/library/GNUmakefile.os4 b/library/GNUmakefile.os4 index aa7aeec..c68b4aa 100644 --- a/library/GNUmakefile.os4 +++ b/library/GNUmakefile.os4 @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.os4,v 1.55 2005-05-08 08:51:29 obarthel Exp $ +# $Id: GNUmakefile.os4,v 1.56 2005-05-11 20:15:25 obarthel Exp $ # # :ts=8 # @@ -125,6 +125,7 @@ C_LIB = \ ctype_isalnum.o \ ctype_isalpha.o \ ctype_isascii.o \ + ctype_isblank.o \ ctype_iscntrl.o \ ctype_isdigit.o \ ctype_isgraph.o \ diff --git a/library/changes b/library/changes index a5f714c..34b74d3 100644 --- a/library/changes +++ b/library/changes @@ -60,6 +60,8 @@ - mktime() now handles one leap second gracefully. +- Added isblank(). + c.lib 1.191 (9.4.2005) diff --git a/library/ctype_isblank.c b/library/ctype_isblank.c new file mode 100644 index 0000000..f445631 --- /dev/null +++ b/library/ctype_isblank.c @@ -0,0 +1,52 @@ +/* + * $Id: ctype_isblank.c,v 1.1 2005-05-11 20:15:25 obarthel Exp $ + * + * :ts=4 + * + * Portable ISO 'C' (1994) runtime library for the Amiga computer + * Copyright (c) 2002-2005 by Olaf Barthel + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Neither the name of Olaf Barthel nor the names of contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _CTYPE_HEADERS_H +#include "ctype_headers.h" +#endif /* _CTYPE_HEADERS_H */ + +/****************************************************************************/ + +#undef isspace + +/****************************************************************************/ + +int +isblank(int c) +{ + int result; + + result = (c == '\t' || c == ' '); + + return(result); +} diff --git a/library/include/ctype.h b/library/include/ctype.h index 8fd6589..163f44e 100644 --- a/library/include/ctype.h +++ b/library/include/ctype.h @@ -1,5 +1,5 @@ /* - * $Id: ctype.h,v 1.5 2005-01-09 15:20:33 obarthel Exp $ + * $Id: ctype.h,v 1.6 2005-05-11 20:15:28 obarthel Exp $ * * :ts=4 * @@ -57,6 +57,7 @@ extern int islower(int c); extern int isupper(int c); extern int isspace(int c); +extern int isblank(int c); extern int tolower(int c); extern int toupper(int c); @@ -99,6 +100,7 @@ extern const unsigned char __ctype_table[]; #define islower(c) ((__ctype_table[(c) & 255] & __CTYPE_LOWER_CASE) != 0) #define isupper(c) ((__ctype_table[(c) & 255] & __CTYPE_UPPER_CASE) != 0) #define isspace(c) ((__ctype_table[(c) & 255] & __CTYPE_WHITE_SPACE) != 0) +#define isblank(c) ((c) == ' ' || (c) == '\t') /****************************************************************************/ diff --git a/library/include/stdio.h b/library/include/stdio.h index 0f6d0f8..87b9ca4 100644 --- a/library/include/stdio.h +++ b/library/include/stdio.h @@ -1,5 +1,5 @@ /* - * $Id: stdio.h,v 1.13 2005-05-08 17:02:16 obarthel Exp $ + * $Id: stdio.h,v 1.14 2005-05-11 20:15:28 obarthel Exp $ * * :ts=4 * @@ -377,7 +377,6 @@ extern int putchar_unlocked(int c); extern FILE * fdopen(int file_descriptor, const char * type); extern int fileno(FILE * file); extern int asprintf(char **ret, const char *format, ...); -extern int snprintf(char *s,size_t size,const char *format,...); extern int vsnprintf(char *s,size_t size,const char *format,va_list arg); extern int pclose(FILE *stream); extern FILE * popen(const char *command, const char *type); @@ -426,6 +425,7 @@ extern int __vasprintf(const char *file,int line,char **ret,const char *format,v extern int vfscanf(FILE *stream, const char *format, va_list arg); extern int vsscanf(const char *s, const char *format, va_list arg); extern int vscanf(const char *format,va_list arg); +extern int snprintf(char *s,size_t size,const char *format,...); /****************************************************************************/ diff --git a/library/smakefile b/library/smakefile index 7150dad..225c713 100644 --- a/library/smakefile +++ b/library/smakefile @@ -1,5 +1,5 @@ # -# $Id: smakefile,v 1.40 2005-05-08 08:51:29 obarthel Exp $ +# $Id: smakefile,v 1.41 2005-05-11 20:15:25 obarthel Exp $ # # :ts=8 # @@ -104,6 +104,7 @@ CTYPE_OBJ = \ ctype_isalnum.o \ ctype_isalpha.o \ ctype_isascii.o \ + ctype_isblank.o \ ctype_iscntrl.o \ ctype_isdigit.o \ ctype_isgraph.o \