1*05ab2901SDag-Erling Smørgrav /* isblank - compatibility implementation of isblank 2*05ab2901SDag-Erling Smørgrav * 3*05ab2901SDag-Erling Smørgrav * Copyright (c) 2015, NLnet Labs. All rights reserved. 4*05ab2901SDag-Erling Smørgrav * 5*05ab2901SDag-Erling Smørgrav * This software is open source. 6*05ab2901SDag-Erling Smørgrav * 7*05ab2901SDag-Erling Smørgrav * Redistribution and use in source and binary forms, with or without 8*05ab2901SDag-Erling Smørgrav * modification, are permitted provided that the following conditions 9*05ab2901SDag-Erling Smørgrav * are met: 10*05ab2901SDag-Erling Smørgrav * 11*05ab2901SDag-Erling Smørgrav * Redistributions of source code must retain the above copyright notice, 12*05ab2901SDag-Erling Smørgrav * this list of conditions and the following disclaimer. 13*05ab2901SDag-Erling Smørgrav * 14*05ab2901SDag-Erling Smørgrav * Redistributions in binary form must reproduce the above copyright notice, 15*05ab2901SDag-Erling Smørgrav * this list of conditions and the following disclaimer in the documentation 16*05ab2901SDag-Erling Smørgrav * and/or other materials provided with the distribution. 17*05ab2901SDag-Erling Smørgrav * 18*05ab2901SDag-Erling Smørgrav * Neither the name of the NLNET LABS nor the names of its contributors may 19*05ab2901SDag-Erling Smørgrav * be used to endorse or promote products derived from this software without 20*05ab2901SDag-Erling Smørgrav * specific prior written permission. 21*05ab2901SDag-Erling Smørgrav * 22*05ab2901SDag-Erling Smørgrav * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23*05ab2901SDag-Erling Smørgrav * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24*05ab2901SDag-Erling Smørgrav * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25*05ab2901SDag-Erling Smørgrav * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26*05ab2901SDag-Erling Smørgrav * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27*05ab2901SDag-Erling Smørgrav * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 28*05ab2901SDag-Erling Smørgrav * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29*05ab2901SDag-Erling Smørgrav * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30*05ab2901SDag-Erling Smørgrav * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31*05ab2901SDag-Erling Smørgrav * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32*05ab2901SDag-Erling Smørgrav * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33*05ab2901SDag-Erling Smørgrav */ 34*05ab2901SDag-Erling Smørgrav 35*05ab2901SDag-Erling Smørgrav #include "config.h" 36*05ab2901SDag-Erling Smørgrav 37*05ab2901SDag-Erling Smørgrav /* return true for a blank character: space or tab */ 38*05ab2901SDag-Erling Smørgrav int isblank(int c); 39*05ab2901SDag-Erling Smørgrav 40*05ab2901SDag-Erling Smørgrav /* implementation of isblank. unsigned char is the argument */ 41*05ab2901SDag-Erling Smørgrav int 42*05ab2901SDag-Erling Smørgrav isblank(int c) 43*05ab2901SDag-Erling Smørgrav { 44*05ab2901SDag-Erling Smørgrav return (c==' ' || c=='\t'); 45*05ab2901SDag-Erling Smørgrav } 46