|
Packit |
06dd63 |
/* Test whether a character is a blank.
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
This program is free software: you can redistribute it and/or modify
|
|
Packit |
06dd63 |
it under the terms of the GNU Lesser General Public License as published by
|
|
Packit |
06dd63 |
the Free Software Foundation; either version 2.1 of the License, or
|
|
Packit |
06dd63 |
(at your option) any later version.
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
This program is distributed in the hope that it will be useful,
|
|
Packit |
06dd63 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
06dd63 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
06dd63 |
GNU Lesser General Public License for more details.
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
You should have received a copy of the GNU Lesser General Public License
|
|
Packit |
06dd63 |
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
#include <config.h>
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
/* Specification. */
|
|
Packit |
06dd63 |
#include <ctype.h>
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
int
|
|
Packit |
06dd63 |
isblank (int c)
|
|
Packit |
06dd63 |
{
|
|
Packit |
06dd63 |
/* On all known platforms, in all predefined locales, isblank(c) is likely
|
|
Packit |
06dd63 |
equivalent with (c == ' ' || c == '\t'). Look at the glibc definition
|
|
Packit |
06dd63 |
(in glibc/localedata/locales/i18n): The "blank" characters are '\t', ' ',
|
|
Packit |
06dd63 |
U+1680, U+180E, U+2000..U+2006, U+2008..U+200A, U+205F, U+3000, and none
|
|
Packit |
06dd63 |
except the first two is present in a common 8-bit encoding. Therefore
|
|
Packit |
06dd63 |
the substitute for other platforms is not more complicated than this. */
|
|
Packit |
06dd63 |
return (c == ' ' || c == '\t');
|
|
Packit |
06dd63 |
}
|