| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

string.h
Go to the documentation of this file.
1
9 #ifndef __STRING_H__
10 #define __STRING_H__
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #include <compiler.h>
17 #include <stddef.h>
18
19 #ifdef __STDC_WANT_LIB_EXT1__
20 #include "errno.h"
21
33 extern errno_t memcpy_s(void *restrict dest, rsize_t dest_max, const void *restrict src, rsize_t n);
34
44 extern errno_t memmove_s(void *dest, rsize_t dest_max, const void *src, rsize_t n);
45
55 extern errno_t memset_s(void *block, rsize_t block_max, int c, rsize_t n);
56
65 extern size_t strnlen_s(const char *s, size_t s_max);
66
77 extern errno_t strcpy_s(char *restrict dest, rsize_t dest_max, const char *restrict src);
78
89 extern errno_t strncpy_s(char *restrict dest,
90 rsize_t dest_max,
91 const char *restrict src,
92 rsize_t n);
93
104 extern errno_t strcat_s(char *restrict dest, rsize_t dest_max, const char *restrict src);
105
117 extern errno_t strncat_s(char *restrict dest,
118 rsize_t dest_max,
119 const char *restrict src,
120 rsize_t n);
121
131 extern errno_t strerror_s(char *buf, rsize_t bufmax, errno_t errnum);
132
133 #endif /* __STDC_WANT_LIB_EXT1__ */
134
143 void *memcpy(void *dest, const void *src, size_t n) __attribute__ ((nonnull));
144
152 void *memmove(void *dest, const void *src, size_t n) __attribute__ ((nonnull));
153
163 int memcmp(const void *s1, const void *s2, size_t n) __attribute__ ((nonnull));
164
172 void *memset(void *block, int c, size_t size) __attribute__ ((nonnull));
173
174
189 size_t strlen(const char *s) __attribute__ ((nonnull));
190
206 size_t strnlen(const char * s, size_t n) __attribute__ ((nonnull));
207
231 char *strcpy(char *dest, const char *src) __attribute__ ((nonnull));
232
257 char *strncpy(char *dest, const char *src, size_t n) __attribute__ ((nonnull));
258
265 char *strdup(const char *s) __attribute__ ((nonnull));
266
289 char *strstr(const char *text, const char *pattern) __attribute__ ((nonnull));
290
315 char *strncat(char *dest, const char *src, size_t n) __attribute__ ((nonnull));
316
339 size_t strlcat(char *dest, const char *src, size_t n) __attribute__ ((nonnull));
340
364 char *strcat(char *dest, const char *src) __attribute__ ((nonnull));
365
403 int strcmp(const char *s1, const char *s2) __attribute__ ((nonnull));
404
443 int strncmp(const char *s1, const char *s2, size_t n) __attribute__ ((nonnull));
444
463 char *strrchr(const char *s, int c) __attribute__ ((nonnull));
464
471 const char *strerror(int errnum);
472
480 void *memchr(const void *s, int c, size_t n) __attribute__ ((nonnull));
481
489 void *memrchr(const void *s, int c, size_t n) __attribute__ ((nonnull));
490
509 char *strchr(const char *s, int c) __attribute__ ((nonnull));
510
518 char *strchrnul(const char *s, int c) __attribute__ ((nonnull));
519
527 size_t strspn(const char *s, const char *accept);
528
536 size_t strcspn(const char *s, const char *reject);
537
560 char *strtok(char *str, const char *delim);
561
571 char *strtok_r(char *_restrict_ s, const char *_restrict_ sep, char **_restrict_ p);
572
582 int strerror_r(int errnum, char *buf, size_t buflen);
583
584 #ifdef __cplusplus
585 }
586 #endif
587
588 #endif
589
strlcat
size_t strlcat(char *dest, const char *src, size_t n)
Append the NUL-terminated string src to the end of dest string, overwriting the terminating null byte...
memcpy
void * memcpy(void *dest, const void *src, size_t n)
Copy memory area from src to dst. The memory must not overlap. To copy overlapped area use memmove() ...
memmove
void * memmove(void *dest, const void *src, size_t n)
Copy memory area from src to dest. The memory may overlap.
strtok
char * strtok(char *str, const char *delim)
Function breaks a string into a sequence of zero or more nonempty tokens.
strrchr
char * strrchr(const char *s, int c)
Find last occurence of character c in string s.
strerror
const char * strerror(int errnum)
Return a pointer to a string that describes the error code passed in the argument errnum...
memcmp
int memcmp(const void *s1, const void *s2, size_t n)
Compare fist n bytes of memory pointed by s1 and s2.
errno.h
system error numbers
strdup
char * strdup(const char *s)
Return a pointer to a new string which is a duplicate of the string s. Memory for the new string is o...
strchr
char * strchr(const char *s, int c)
Find first occurence of character c in string s.
strtok_r
char * strtok_r(char *_restrict_ s, const char *_restrict_ sep, char **_restrict_ p)
Function breaks a string into a sequence of zero or more nonempty tokens.
memset
void * memset(void *block, int c, size_t size)
Fill size bytes with a constant value.
accept
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
Accept a connection on a socket.
strnlen
size_t strnlen(const char *s, size_t n)
Calculate the length of the fixed-size string s, excluding the terminating null byte (&#39;\0&#39;)...
strncmp
int strncmp(const char *s1, const char *s2, size_t n)
Compare at most n bytes of two strings s1 and s2.
strcat_s
errno_t strcat_s(char *restrict dest, rsize_t dest_max, const char *restrict src)
Check arguments and append the src string to the dest string, overwriting the terminating null byte (...
strcmp
int strcmp(const char *s1, const char *s2)
Compare the two strings s1 and s2.
memrchr
void * memrchr(const void *s, int c, size_t n)
Find a character in an area of memory.
strerror_r
int strerror_r(int errnum, char *buf, size_t buflen)
Returns the error string in the user-supplied buf of length buflen. XSI-compliant version...
strncat
char * strncat(char *dest, const char *src, size_t n)
Append the src string to the dest string, overwriting the terminating null byte (&#39;\0&#39;) at the end of ...
strerror_s
errno_t strerror_s(char *buf, rsize_t bufmax, errno_t errnum)
Check arguments and return a pointer to a buf string that describes the errnum error code...
strcspn
size_t strcspn(const char *s, const char *reject)
Calculate the length of the initial segment of s which consists entirely of bytes not in reject...
memset_s
errno_t memset_s(void *block, rsize_t block_max, int c, rsize_t n)
Check arguments and fill n bytes of block sized memory with c constant value.
errno_t
int errno_t
Definition: errno.h:297
strstr
char * strstr(const char *text, const char *pattern)
Find the first occurrence of the substring pattern in the string text. The terminating null bytes (&#39;\...
strspn
size_t strspn(const char *s, const char *accept)
Calculate the length (in bytes) of the initial segment of s which consists entirely of bytes in accep...
strcat
char * strcat(char *dest, const char *src)
Append the src string to the dest string, overwriting the terminating null byte (&#39;\0&#39;) at the end of ...
strcpy
char * strcpy(char *dest, const char *src)
Copy the string pointed to by src, including the terminating null byte (&#39;\0&#39;), to the buffer pointed ...
memmove_s
errno_t memmove_s(void *dest, rsize_t dest_max, const void *src, rsize_t n)
Check arguments and copy src sized memory area to dest. Memory may be overlapped. ...
strlen
size_t strlen(const char *s)
Calculate the length of the string s, excluding the terminating null byte (&#39;\0&#39;). ...
strncpy_s
errno_t strncpy_s(char *restrict dest, rsize_t dest_max, const char *restrict src, rsize_t n)
Check arguments and copy at most n bytes of the src string, including the terminating null byte (&#39;\0&#39;...
strncat_s
errno_t strncat_s(char *restrict dest, rsize_t dest_max, const char *restrict src, rsize_t n)
Check arguments and append at most n bytes of src string to the dest string, overwriting the terminat...
memchr
void * memchr(const void *s, int c, size_t n)
Find a character in an area of memory.
memcpy_s
errno_t memcpy_s(void *restrict dest, rsize_t dest_max, const void *restrict src, rsize_t n)
Check arguments and copy src sized memory area to dest. Memory must not be overlapped. To copy overlapped area use memmove_s() function.
strcpy_s
errno_t strcpy_s(char *restrict dest, rsize_t dest_max, const char *restrict src)
Check arguments and copy the src string, including the terminating null byte (&#39;\0&#39;), to the dest sized buffer. If n is bigger than size of src then the remaining characters (after &#39;\0&#39;) are unspecified.
strncpy
char * strncpy(char *dest, const char *src, size_t n)
Copy at most n bytes of the string pointed to by src, including the terminating null byte (&#39;\0&#39;)...
strnlen_s
size_t strnlen_s(const char *s, size_t s_max)
Check arguments and calculate the length of the s fixed-size string, excluding the terminating null b...
strchrnul
char * strchrnul(const char *s, int c)
Find first occurence of character c in string s.