Blame gl/tests/isblank.c

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