libmcs
0.6.0
|
#include "libmcs/mcs.h"
Functions | |
size_t | mcs_strnlen (const char *str, size_t len) |
Determines the length of a string, limited by an arbitrary length. More... | |
char * | mcs_strndup (const char *str, size_t len) |
Duplicates a string, limited to a specific length. More... | |
int | mcs_create_directory (const char *path, mode_t mode) |
A utility function which creates a directory. More... | |
size_t | mcs_strlcat (char *dest, const char *src, size_t count) |
Concatenates a string, limited to a maximum buffer size. More... | |
size_t | mcs_strlcpy (char *dest, const char *src, size_t size) |
Copies a string, limited to a maximum buffer size. More... | |
int mcs_create_directory | ( | const char * | path, |
mode_t | mode | ||
) |
A utility function which creates a directory.
This function creates a directory. It recurses to handle any parents which also need to be created.
path | The path to create. |
mode | The mode of the directory that should be created. |
References mcs_strndup().
size_t mcs_strlcat | ( | char * | dest, |
const char * | src, | ||
size_t | count | ||
) |
Concatenates a string, limited to a maximum buffer size.
This is a function which is useful for safely copying a string.
dest | The string to copy to. |
src | The string to copy from. |
count | The maximum allowed length of the string. |
size_t mcs_strlcpy | ( | char * | dest, |
const char * | src, | ||
size_t | size | ||
) |
Copies a string, limited to a maximum buffer size.
This is a function which is useful for safely copying a string.
dest | The string to copy to. |
src | The string to copy from. |
size | The maximum allowed length of the string. |
char* mcs_strndup | ( | const char * | str, |
size_t | len | ||
) |
Duplicates a string, limited to a specific length.
This is a function which duplicates a string limited to a maximum length.
str | The string to duplicate. |
len | The maximum allowed length of the string. |
References mcs_strnlen().
Referenced by mcs_create_directory().
size_t mcs_strnlen | ( | const char * | str, |
size_t | len | ||
) |
Determines the length of a string, limited by an arbitrary length.
This is a function which is useful for limiting the length of a string.
str | The string to test. |
len | The maximum allowed length of the string. |
Referenced by mcs_strndup().