mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
tools/nolibc/ctype: split the is* functions to ctype.h
In fact there's only isdigit() for now. More should definitely be added. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
c91eb03389
commit
62a2af0774
2 changed files with 23 additions and 6 deletions
22
tools/include/nolibc/ctype.h
Normal file
22
tools/include/nolibc/ctype.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
|
||||
/*
|
||||
* ctype function definitions for NOLIBC
|
||||
* Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
|
||||
*/
|
||||
|
||||
#ifndef _NOLIBC_CTYPE_H
|
||||
#define _NOLIBC_CTYPE_H
|
||||
|
||||
#include "std.h"
|
||||
|
||||
/*
|
||||
* As much as possible, please keep functions alphabetically sorted.
|
||||
*/
|
||||
|
||||
static __attribute__((unused))
|
||||
int isdigit(int c)
|
||||
{
|
||||
return (unsigned int)(c - '0') <= 9;
|
||||
}
|
||||
|
||||
#endif /* _NOLIBC_CTYPE_H */
|
|
@ -87,18 +87,13 @@
|
|||
#include "arch.h"
|
||||
#include "types.h"
|
||||
#include "sys.h"
|
||||
#include "ctype.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
/* Used by programs to avoid std includes */
|
||||
#define NOLIBC
|
||||
|
||||
static __attribute__((unused))
|
||||
int isdigit(int c)
|
||||
{
|
||||
return (unsigned int)(c - '0') <= 9;
|
||||
}
|
||||
|
||||
static __attribute__((unused))
|
||||
const char *ltoa(long in)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue