root/sys/dev/pci/drm/include/linux/ctype.h
/*      $OpenBSD: ctype.h,v 1.3 2026/03/09 23:58:03 jsg Exp $   */
/*
 * Copyright (c) 2015 Mark Kettenis
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef _LINUX_CTYPE_H
#define _LINUX_CTYPE_H

#define _U      0x01
#define _L      0x02
#define _N      0x04
#define _S      0x08
#define _P      0x10
#define _C      0x20
#define _X      0x40
#define _B      0x80

static inline int
isascii(int c)
{
        return ((unsigned int)c <= 0177);
}

static inline int
isprint(int c)
{
        if (c == -1)
                return (0);
        if ((unsigned char)c >= 040 && (unsigned char)c <= 0176)
                return (1);
        return (0);
}

static inline int
isgraph(int c)
{
        if (c == -1)
                return (0);
        if ((unsigned char)c >= 041 && (unsigned char)c <= 0176)
                return (1);
        return (0);
}

static inline int
isspace(int c)
{
        return (c == ' ' || c == '\t');
}
#endif