FreeNOS
string.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __LIBC_STRING_H
19 #define __LIBC_STRING_H
20 
21 #include <sys/types.h>
22 #include "errno.h"
23 
40 extern C int strcmp(const char *dest, const char *src);
41 
51 extern C int strncmp(const char *dest, const char *src, size_t count);
52 
61 extern C int strcasecmp(const char *dest, const char *src);
62 
72 extern C int strncasecmp(const char *dest, const char *src, size_t count);
73 
81 extern C char *strdup(const char *str);
82 
104 extern C char *strndup(const char *s, size_t size);
105 
115 extern C void * memset(void *dest, int ch, size_t count);
116 
126 extern C void * memcpy(void *dest, const void *src, size_t count);
127 
135 extern C size_t strlen(const char *str);
136 
145 extern C int strcpy(char *dest, const char *src);
146 
156 extern C int strncpy(char *dest, const char *src, size_t sz);
157 
171 extern C size_t strlcpy(char *dst, const char *src, size_t siz);
172 
186 extern C char * strcat(char *dest, const char *src);
187 
205 extern C char * strncat(char *dest, const char *src, size_t siz);
206 
217 extern C char * strerror(int errnum);
218 
231 extern C char * strchr(const char *s, int c);
232 
246 extern C char * strrchr(const char *s, int c);
247 
253 #endif /* __LIBC_STRING_H */
strncmp
C int strncmp(const char *dest, const char *src, size_t count)
Compare two strings, by only a maximum number of bytes.
Definition: strncmp.cpp:20
strlcpy
C size_t strlcpy(char *dst, const char *src, size_t siz)
Copy src to string dst of size siz.
Definition: strlcpy.cpp:19
strlen
C size_t strlen(const char *str)
Calculate the length of a string.
Definition: strlen.cpp:21
types.h
strndup
C char * strndup(const char *s, size_t size)
Duplicate a specific number of bytes from a string.
Definition: strndup.cpp:22
strrchr
C char * strrchr(const char *s, int c)
String scanning operation.
Definition: strrchr.cpp:20
strcpy
C int strcpy(char *dest, const char *src)
Copy a string.
Definition: strcpy.cpp:20
strdup
C char * strdup(const char *str)
Duplicate a string.
Definition: strdup.cpp:37
C
#define C
Used to define external C functions.
Definition: Macros.h:134
strcat
C char * strcat(char *dest, const char *src)
Concatenate two strings.
Definition: strcat.cpp:20
strcmp
C int strcmp(const char *dest, const char *src)
Compare two strings.
Definition: strcmp.cpp:20
strerror
C char * strerror(int errnum)
The strerror function maps the number in errnum to a message string.
Definition: strerror.cpp:20
strncat
C char * strncat(char *dest, const char *src, size_t siz)
Concatenate a string with part of another.
Definition: strncat.cpp:20
memset
C void * memset(void *dest, int ch, size_t count)
Fill memory with a constant byte.
Definition: memset.cpp:20
strcasecmp
C int strcasecmp(const char *dest, const char *src)
Compare two strings, ignoring case considerations.
Definition: strcasecmp.cpp:21
memcpy
C void * memcpy(void *dest, const void *src, size_t count)
Copy memory from one place to another.
Definition: memcpy.cpp:20
strncpy
C int strncpy(char *dest, const char *src, size_t sz)
Copy a string, given a maximum number of bytes.
Definition: strncpy.cpp:20
strchr
C char * strchr(const char *s, int c)
String scanning operation.
Definition: strchr.cpp:20
errno.h
strncasecmp
C int strncasecmp(const char *dest, const char *src, size_t count)
Compare two strings, ignoring case considerations.
Definition: strncasecmp.cpp:21