Applied patch from Mika Lindqvist: This patch implements both strlwr() and strupr() functions in libroot and includes strupr() in kernel build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26226 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
72401b8f9e
commit
765ae3a785
@ -66,8 +66,8 @@ extern size_t strlcpy(char *dest, const char *source, size_t length);
|
||||
|
||||
extern size_t strnlen(const char *string, size_t count);
|
||||
|
||||
/* extern char *strlwr(char *string); */
|
||||
/* extern char *strupr(char *string); */
|
||||
extern char *strlwr(char *string);
|
||||
extern char *strupr(char *string);
|
||||
|
||||
/* extern char *strsep(char **stringPointer, const char *delimiter); */
|
||||
|
||||
|
@ -138,6 +138,7 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define asm __asm
|
||||
|
||||
@ -206,18 +207,6 @@ do { \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* Kernel doesn't have strupr, should be fixed. */
|
||||
static __inline char *
|
||||
strupr(char *str)
|
||||
{
|
||||
char *c = str;
|
||||
while(*c) {
|
||||
*c = toupper(*c);
|
||||
c++;
|
||||
}
|
||||
return(str);
|
||||
}
|
||||
|
||||
#else /* _KERNEL_MODE */
|
||||
|
||||
#include <ctype.h>
|
||||
|
@ -109,6 +109,7 @@ KernelMergeObject kernel_lib_posix.o :
|
||||
strspn.c
|
||||
strstr.c
|
||||
strtok.c
|
||||
strupr.c
|
||||
|
||||
: $(TARGET_KERNEL_PIC_CCFLAGS)
|
||||
;
|
||||
|
@ -25,6 +25,7 @@ MergeObject posix_string.o :
|
||||
strerror.c
|
||||
strlcat.c
|
||||
strlcpy.c
|
||||
strlwr.c
|
||||
strncat.c
|
||||
strncmp.c
|
||||
strncpy.c
|
||||
@ -34,6 +35,7 @@ MergeObject posix_string.o :
|
||||
strspn.c
|
||||
strstr.c
|
||||
strtok.c
|
||||
strupr.c
|
||||
strxfrm.c
|
||||
;
|
||||
|
||||
|
19
src/system/libroot/posix/string/strlwr.c
Normal file
19
src/system/libroot/posix/string/strlwr.c
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
** Copyright 2008, Mika Lindqvist. All rights reserved.
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
char *
|
||||
strlwr(char *str)
|
||||
{
|
||||
char *c = str;
|
||||
while(*c) {
|
||||
*c = tolower(*c);
|
||||
c++;
|
||||
}
|
||||
return(str);
|
||||
}
|
||||
|
19
src/system/libroot/posix/string/strupr.c
Normal file
19
src/system/libroot/posix/string/strupr.c
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
** Copyright 2008, Mika Lindqvist. All rights reserved.
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
char *
|
||||
strupr(char *str)
|
||||
{
|
||||
char *c = str;
|
||||
while(*c) {
|
||||
*c = toupper(*c);
|
||||
c++;
|
||||
}
|
||||
return(str);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user