#include <string.h>
#include <limits.h>
+#include "eina_private.h"
+
static int eina_str_has_suffix_helper(const char *str, const char *suffix,
int (*cmp)(const char *, const char *));
/**
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-size_t
+EAPI size_t
eina_strlcpy(char *dst, const char *src, size_t siz)
{
#ifdef HAVE_STRLCPY
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
-size_t
+EAPI size_t
eina_strlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
* @return true if str has the given prefix
* @brief checks if the string has the given prefix
*/
-int
+EAPI int
eina_str_has_prefix(const char *str, const char *prefix)
{
size_t str_len;
* @return true if str has the given suffix
* @brief checks if the string has the given suffix
*/
-int
+EAPI int
eina_str_has_suffix(const char *str, const char *suffix)
{
return eina_str_has_suffix_helper(str, suffix, strcmp);
* @return true if str has the given extension
* @brief checks if the string has the given extension
*/
-int
+EAPI int
eina_str_has_extension(const char *str, const char *ext)
{
return eina_str_has_suffix_helper(str, ext, strcasecmp);
* To free it: free the first element of the array
* and the array itself.
*/
-char **
+EAPI char **
eina_str_split(const char *str, const char *delim, int max_tokens)
{
char *s, *sep, **str_array;
*
* @see eina_str_join() and eina_str_join_static()
*/
-size_t
+EAPI size_t
eina_str_join_len(char *dst, size_t size, char sep, const char *a, size_t a_len, const char *b, size_t b_len)
{
size_t ret = a_len + b_len + 1;