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:
@@ -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 size_t strnlen(const char *string, size_t count);
|
||||||
|
|
||||||
/* extern char *strlwr(char *string); */
|
extern char *strlwr(char *string);
|
||||||
/* extern char *strupr(char *string); */
|
extern char *strupr(char *string);
|
||||||
|
|
||||||
/* extern char *strsep(char **stringPointer, const char *delimiter); */
|
/* extern char *strsep(char **stringPointer, const char *delimiter); */
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define asm __asm
|
#define asm __asm
|
||||||
|
|
||||||
@@ -206,18 +207,6 @@ do { \
|
|||||||
} while (0)
|
} 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 */
|
#else /* _KERNEL_MODE */
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ KernelMergeObject kernel_lib_posix.o :
|
|||||||
strspn.c
|
strspn.c
|
||||||
strstr.c
|
strstr.c
|
||||||
strtok.c
|
strtok.c
|
||||||
|
strupr.c
|
||||||
|
|
||||||
: $(TARGET_KERNEL_PIC_CCFLAGS)
|
: $(TARGET_KERNEL_PIC_CCFLAGS)
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ MergeObject posix_string.o :
|
|||||||
strerror.c
|
strerror.c
|
||||||
strlcat.c
|
strlcat.c
|
||||||
strlcpy.c
|
strlcpy.c
|
||||||
|
strlwr.c
|
||||||
strncat.c
|
strncat.c
|
||||||
strncmp.c
|
strncmp.c
|
||||||
strncpy.c
|
strncpy.c
|
||||||
@@ -34,6 +35,7 @@ MergeObject posix_string.o :
|
|||||||
strspn.c
|
strspn.c
|
||||||
strstr.c
|
strstr.c
|
||||||
strtok.c
|
strtok.c
|
||||||
|
strupr.c
|
||||||
strxfrm.c
|
strxfrm.c
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user