mirror of https://github.com/wolfSSL/wolfBoot.git
Added some more useful standard library functions.
parent
4b2a5f94c5
commit
c46cf51156
17
src/string.c
17
src/string.c
|
@ -26,6 +26,11 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
int islower(int c)
|
||||||
|
{
|
||||||
|
return (c >= 'a' && c <= 'z');
|
||||||
|
}
|
||||||
|
|
||||||
int isupper(int c)
|
int isupper(int c)
|
||||||
{
|
{
|
||||||
return (c >= 'A' && c <= 'Z');
|
return (c >= 'A' && c <= 'Z');
|
||||||
|
@ -33,7 +38,17 @@ int isupper(int c)
|
||||||
|
|
||||||
int tolower(int c)
|
int tolower(int c)
|
||||||
{
|
{
|
||||||
return isupper(c) ? (c) - 'A' + 'a' : c;
|
return isupper(c) ? c - 'A' + 'a' : c;
|
||||||
|
}
|
||||||
|
|
||||||
|
int toupper(int c)
|
||||||
|
{
|
||||||
|
return islower(c) ? c - 'a' + 'A' : c;
|
||||||
|
}
|
||||||
|
|
||||||
|
int isalpha(int c)
|
||||||
|
{
|
||||||
|
return (isupper(c) || islower(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
void *memset(void *s, int c, size_t n)
|
void *memset(void *s, int c, size_t n)
|
||||||
|
|
Loading…
Reference in New Issue