String utility function prototypes.
More...
#include "string.h"
Go to the source code of this file.
String utility function prototypes.
int concatenateStrings |
( |
char ** |
dest, |
|
|
const char * |
src |
|
) |
| |
concatenates strings.
- Parameters
-
[in] | dest | reference to the destination string |
[in] | src | pointer to string which will be appended to destination |
- Returns
- An integer status value, TW_OK on success, error code on failure
- Note
- the original dest pointer will be free'd and replaced after the new memory has been allocated
int concatenateStringsN |
( |
char ** |
dest, |
|
|
const char * |
src, |
|
|
size_t |
maxlen |
|
) |
| |
concatenates strings uo to a maximum length.
- Parameters
-
[in] | dest | reference to the destination string |
[in] | src | pointer to string which will be appended to destination |
[in] | maxlen | The maximum length of the resulting string, excluding the terminating null |
- Returns
- An integer status value, TW_OK on success, error code on failure
- Note
- the original dest pointer will be free'd and replaced after the new memory has been allocated
char* duplicateString |
( |
const char * |
input | ) |
|
Copies a string.
- Deprecated:
- Prefer duplicateStringN() and supply a reasonable maximum based on context
- Parameters
-
[in] | input | The string to copy. |
- Returns
- A copy of
input
.
- Note
- The calling function gains ownership of the returned string and retains ownership of the
input
string.
char* duplicateStringN |
( |
const char * |
input, |
|
|
size_t |
maxlen |
|
) |
| |
Copies a string, up to some maximum length.
- Parameters
-
[in] | input | The string to copy. |
[in] | maxlen | The maximum length of the resulting string, excluding the terminating null |
- Returns
- A copy of up to the first
maxlen
chars of input
, with a null terminator.
- Note
- The calling function gains ownership of the returned string and retains ownership of the
input
string.
char* lowercase |
( |
char * |
input | ) |
|
Converts a string to lowercase.
- Parameters
-
[in] | input | The string to change to lowercase. |
- Returns
- The lowercase format of
input
.
- Note
- The string is directly modified, not copied.
char stringEndsWithSuffix |
( |
const char * |
str, |
|
|
const char * |
suf |
|
) |
| |
returns TRUE if str ends with suf.
- Parameters
-
[in] | str | reference to the string to search |
[in] | suf | a string that str must end with for this function to return TRUE |
- Returns
- TRUE if suf is present at the end of str, otherwise FALSE;
char* uppercase |
( |
char * |
input | ) |
|
Converts a string to uppercase.
- Parameters
-
[in] | input | The string to change to uppercase. |
- Returns
- The uppercase format of
input
.
- Note
- The string is directly modified, not copied.