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
40extern C int strcmp(const char *dest, const char *src);
41
51extern C int strncmp(const char *dest, const char *src, size_t count);
52
61extern C int strcasecmp(const char *dest, const char *src);
62
72extern C int strncasecmp(const char *dest, const char *src, size_t count);
73
81extern C char *strdup(const char *str);
82
104extern C char *strndup(const char *s, size_t size);
105
115extern C void * memset(void *dest, int ch, size_t count);
116
126extern C void * memcpy(void *dest, const void *src, size_t count);
127
135extern C size_t strlen(const char *str);
136
145extern C int strcpy(char *dest, const char *src);
146
156extern C int strncpy(char *dest, const char *src, size_t sz);
157
171extern C size_t strlcpy(char *dst, const char *src, size_t siz);
172
186extern C char * strcat(char *dest, const char *src);
187
205extern C char * strncat(char *dest, const char *src, size_t siz);
206
217extern C char * strerror(int errnum);
218
231extern C char * strchr(const char *s, int c);
232
246extern C char * strrchr(const char *s, int c);
247
253#endif /* __LIBC_STRING_H */
C char * strdup(const char *str)
Duplicate a string.
Definition strdup.cpp:37
C size_t strlcpy(char *dst, const char *src, size_t siz)
Copy src to string dst of size siz.
Definition strlcpy.cpp:19
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
C size_t strlen(const char *str)
Calculate the length of a string.
Definition strlen.cpp:21
C char * strrchr(const char *s, int c)
String scanning operation.
Definition strrchr.cpp:20
C int strncasecmp(const char *dest, const char *src, size_t count)
Compare two strings, ignoring case considerations.
C char * strchr(const char *s, int c)
String scanning operation.
Definition strchr.cpp:20
C char * strerror(int errnum)
The strerror function maps the number in errnum to a message string.
Definition strerror.cpp:20
C void * memset(void *dest, int ch, size_t count)
Fill memory with a constant byte.
Definition memset.cpp:20
C int strcmp(const char *dest, const char *src)
Compare two strings.
Definition strcmp.cpp:20
C void * memcpy(void *dest, const void *src, size_t count)
Copy memory from one place to another.
Definition memcpy.cpp:20
C char * strcat(char *dest, const char *src)
Concatenate two strings.
Definition strcat.cpp:20
C char * strncat(char *dest, const char *src, size_t siz)
Concatenate a string with part of another.
Definition strncat.cpp:20
C int strncpy(char *dest, const char *src, size_t sz)
Copy a string, given a maximum number of bytes.
Definition strncpy.cpp:20
C int strcpy(char *dest, const char *src)
Copy a string.
Definition strcpy.cpp:20
C char * strndup(const char *s, size_t size)
Duplicate a specific number of bytes from a string.
Definition strndup.cpp:22
C int strcasecmp(const char *dest, const char *src)
Compare two strings, ignoring case considerations.
#define C
Used to define external C functions.
Definition Macros.h:134