libc: minimal: Add an implementation of iscntrl()
Implement the iscntrl() function, which returns whether a character is a control one or not. Ref: https://en.cppreference.com/w/c/string/byte/iscntrl Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
69311ccc3d
commit
38f6fd05bf
1 changed files with 5 additions and 0 deletions
|
@ -69,6 +69,11 @@ static inline int isalnum(int chr)
|
||||||
return (int)(isalpha(chr) || isdigit(chr));
|
return (int)(isalpha(chr) || isdigit(chr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int iscntrl(int c)
|
||||||
|
{
|
||||||
|
return (int)((((unsigned int)c) <= 31U) || (((unsigned int)c) == 127U));
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue