#define EINA_STR_INLINE_H_
/**
- * @addtogroup Eina_Str_Group Str
+ * @addtogroup Eina_String_Group String
*
* @{
*/
/**
- * strlen() that will count up to maxlen bytes.
+ * @brief Count up to a given amount of bytes of the given string.
*
- * If one wants to know the size of @a str, but it should not be
- * greater than @a maxlen, then use this function and avoid needless
- * iterations after that size.
- *
- * @param str the string pointer, must be valid and not @c NULL.
- * @param maxlen the maximum length to allow.
+ * @param str The string pointer.
+ * @param maxlen The maximum length to allow.
* @return the string size or (size_t)-1 if greater than @a maxlen.
+ *
+ * This function returns the size of @p str, up to @p maxlen
+ * characters. It avoid needless iterations after that size. @p str
+ * must be a valid pointer and MUST not be @c NULL, otherwise this
+ * function will crash. This function returns the string size, or
+ * (size_t)-1 if the size is greater than @a maxlen.
*/
static inline size_t
eina_strlen_bounded(const char *str, size_t maxlen)
#include "eina_types.h"
/**
- * @file eina_str.h
- * @brief Contains useful C string functions.
+ * @addtogroup Eina_Tools_Group Tools
+ *
+ * @{
+ */
+
+/**
+ * @defgroup Eina_String_Group String
+ *
+ * @{
*/
/* strlcpy implementation for libc's lacking it */
#include "eina_inline_str.x"
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
#endif /* EINA_STR_H */
* API *
*============================================================================*/
+/**
+ * @addtogroup Eina_String_Group String
+ *
+ * @brief These functions provide useful C string management.
+ *
+ * @{
+ */
+
/**
* @brief Copy a c-string to another.
* separate them with @p sep. The result is stored in the buffer
* @p dst and at most @p size - 1 characters will be written and the
* string is NULL-terminated. @p a_len is the length of @p a (not
- * including '\0') and @p b_len is the length of @p b (not including
- * '\0'). This function returns the number of characters printed (not
- * including the trailing '\0' used to end output to strings). Just
+ * including '\\0') and @p b_len is the length of @p b (not including
+ * '\\0'). This function returns the number of characters printed (not
+ * including the trailing '\\0' used to end output to strings). Just
* like snprintf(), it will not write more than @p size bytes, thus a
* returned value of @p size or more means that the output was
* truncated.
*d = 0;
return s2;
}
+
+/**
+ * @}
+ */