Provides a subset of the standard C string library functions for Xinu.
More...
Functions |
char * | strncat (char *, char *, int) |
char * | strchr (const char *, int) |
int | strcmp (const char *, const char *) |
int | strncmp (char *, char *, int) |
char * | strcpy (char *, const char *) |
char * | strncpy (char *, char *, int) |
int | strlen (const char *) |
int | memcmp (const void *, const void *, int) |
int | memcpy (void *, void *, int) |
Detailed Description
Provides a subset of the standard C string library functions for Xinu.
Function Documentation
int memcmp |
( |
const void * |
s1, |
|
|
const void * |
s2, |
|
|
int |
n |
|
) |
| |
Compare memory (ISO C89).
Assumes memory locations are same length
- Parameters:
-
*s1 | first memory location |
*s2 | second memory location |
n | length to compare |
- Returns:
- s1>s2: >0 s1==s2: 0 s1<s2: <0
int memcpy |
( |
void * |
dst, |
|
|
void * |
src, |
|
|
int |
n |
|
) |
| |
Memory copy, copy a location in memory from src to dst.
- Parameters:
-
dst | destination location |
src | source location |
n | amount of data (in bytes) to copy |
- Returns:
- should equal n, if not something went wrong
char* strchr |
( |
const char * |
s, |
|
|
int |
c |
|
) |
| |
Returns a pointer to the location in a string at which which a particular character appears.
- Parameters:
-
*s | string to search |
c | character to locate |
- Returns:
- the pointer in the string, NULL if character not found
int strcmp |
( |
const char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
Compare strings.
- Parameters:
-
*s1 | first memory location |
*s2 | second memory location |
- Returns:
- s1>s2: >0 s1==s2: 0 s1<s2: <0
char* strcpy |
( |
char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
Copy string s2 to s1.
s1 must be large enough.
- Parameters:
-
s1 | first string |
s2 | second string |
- Returns:
- s1
int strlen |
( |
const char * |
s | ) |
|
Returns the number of non-NULL bytes in a string.
- Parameters:
-
- Returns:
- length of the string
char* strncat |
( |
char * |
s1, |
|
|
char * |
s2, |
|
|
int |
n |
|
) |
| |
Concatenate s2 on the end of s1.
S1's space must be large enough. At most n characters are moved.
- Parameters:
-
*s1 | first string |
*s2 | second string |
n | length to concatenate |
- Returns:
- s1
int strncmp |
( |
char * |
s1, |
|
|
char * |
s2, |
|
|
int |
n |
|
) |
| |
Compare strings (at most n bytes).
- Parameters:
-
*s1 | first memory location |
*s2 | second memory location |
n | length to compare |
- Returns:
- s1>s2: >0 s1==s2: 0 s1<s2: <0
char* strncpy |
( |
char * |
s1, |
|
|
char * |
s2, |
|
|
int |
n |
|
) |
| |
Copy string s2 to s1, truncating or null-padding to always copy n bytes.
- Parameters:
-
s1 | first string |
s2 | second string |
n | length of s2 to copy |
- Returns:
- s1