#ifndef EINA_INLINE_ARRAY_X_
#define EINA_INLINE_ARRAY_X_
+#include <stdio.h>
+
/**
* @cond LOCAL
*/
* #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, #EINA_TRUE is
* returned.
*/
-#include <stdio.h>
static inline Eina_Bool
eina_array_push(Eina_Array *array, const void *data)
#include "eina_unicode.h"
#include "eina_ustringshare.h"
+
/**
- * @addtogroup Eina_UStringshare_Group UStringshare
+ * @addtogroup Eina_UStringshare_Group Unicode Stringshare
*
* @{
*/
*/
EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
+#ifndef EINA_LOG_DOMAIN_DEFAULT
+
/**
* @def EINA_LOG_DOMAIN_DEFAULT
* This macro defines the domain to use with the macros EINA_LOG_DOM_DBG(),
* @endcode
*
*/
-#ifndef EINA_LOG_DOMAIN_DEFAULT
-#define EINA_LOG_DOMAIN_DEFAULT EINA_LOG_DOMAIN_GLOBAL
-#endif
+# define EINA_LOG_DOMAIN_DEFAULT EINA_LOG_DOMAIN_GLOBAL
+
+#endif /* EINA_LOG_DOMAIN_DEFAULT */
/**
#include "eina_types.h"
-#define EINA_VERSION_MAJOR 1
-#define EINA_VERSION_MINOR 0
-
-typedef struct _Eina_Version
-{
- int major;
- int minor;
- int micro;
- int revision;
-} Eina_Version;
-
-EAPI extern Eina_Version *eina_version;
-
/**
* @addtogroup Eina_Core_Group Core
*
* @{
*/
+/**
+ * @def EINA_VERSION_MAJOR
+ * @brief Major version of Eina
+ */
+#define EINA_VERSION_MAJOR 1
+
+/**
+ * @def EINA_VERSION_MINOR
+ * @brief Minor version of Eina
+ */
+#define EINA_VERSION_MINOR 0
+
+/**
+ * @struct Eina_Version
+ * The version of Eina.
+ */
+typedef struct _Eina_Version
+{
+ int major; /**< Major component of the version */
+ int minor; /**< Minor component of the version */
+ int micro; /**< Micro component of the version */
+ int revision; /**< Revision component of the version */
+} Eina_Version;
+
+EAPI extern Eina_Version *eina_version;
+
EAPI int eina_init(void);
EAPI int eina_shutdown(void);
EAPI int eina_threads_init(void);
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_common_log_dom, __VA_ARGS__)
extern int _eina_share_common_log_dom;
+
#endif /* EINA_STRINGSHARE_H_ */
*
* @{
*/
+
/**
- * @addtogroup Eina_String_Buffer_Group String Buffer
- *
- * @brief These functions provide string buffers management.
- *
- * The String Buffer data type is designed to be a mutable string,
- * allowing to append, prepend or insert a string to a buffer.
+ * @defgroup Eina_String_Buffer_Group String Buffer
*
* @{
*/
+
/**
* @typedef Eina_Strbuf
* Type for a string buffer.
* @see eina_strbuf_string_get()
*/
EAPI Eina_Strbuf *eina_strbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Free a string buffer.
*
* created by eina_strbuf_new().
*/
EAPI void eina_strbuf_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
+
/**
* @brief Reset a string buffer.
*
* @see eina_strbuf_append_length()
*/
EAPI Eina_Bool eina_strbuf_append(Eina_Strbuf *buf, const char *str) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append an escaped string to a buffer, reallocating as necessary.
*
* #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf, const char *str) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append a string to a buffer, reallocating as necessary,
* limited by the given length.
* @see eina_strbuf_append_length()
*/
EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf, const char *str, size_t maxlen) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append a string of exact length to a buffer, reallocating as necessary.
*
* @see eina_strbuf_append_n()
*/
EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf, const char *str, size_t length) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append a character to a string buffer, reallocating as
* necessary.
* #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf, char c) EINA_ARG_NONNULL(1);
+
/**
* @brief Append a string to a buffer, reallocating as necessary.
*
* @see eina_strbuf_append()
*/
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
+
/**
* @brief Append a string to a buffer, reallocating as necessary.
*
* @param buf The string buffer to append to.
* @param fmt The string to append.
+ * @param args The variable arguments.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* @see eina_strbuf_append()
*/
EAPI Eina_Bool eina_strbuf_append_vprintf(Eina_Strbuf *buf, const char *fmt, va_list args) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a string to a buffer, reallocating as necessary.
*
* is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_insert(Eina_Strbuf *buf, const char *str, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert an escaped string to a buffer, reallocating as
* necessary.
* returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_insert_escaped(Eina_Strbuf *buf, const char *str, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a string to a buffer, reallocating as necessary. Limited by maxlen.
*
* otherwise, #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf, const char *str, size_t maxlen, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a string of exact length to a buffer, reallocating as necessary.
*
* @see eina_strbuf_insert_n()
*/
EAPI Eina_Bool eina_strbuf_insert_length(Eina_Strbuf *buf, const char *str, size_t length, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a character to a string buffer, reallocating as
* necessary.
* returned.
*/
EAPI Eina_Bool eina_strbuf_insert_char(Eina_Strbuf *buf, char c, size_t pos) EINA_ARG_NONNULL(1);
+
/**
* @brief Insert a string to a buffer, reallocating as necessary.
*
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*/
EAPI Eina_Bool eina_strbuf_insert_printf(Eina_Strbuf *buf, const char *fmt, size_t pos, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 4);
+
/**
* @brief Insert a string to a buffer, reallocating as necessary.
*
* @param buf The string buffer to insert.
* @param fmt The string to insert.
* @param pos The position to insert the string.
+ * @param args The variable arguments.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*/
EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt, size_t pos, va_list args) EINA_ARG_NONNULL(1, 2);
* @brief Prepend the given string to the given buffer
*
* @param buf The string buffer to prepend to.
- * @param str The string to prepend.
+ * @param fmt The string to prepend.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This macro is calling eina_strbuf_insert_printf() at position 0.If @p buf
*
* @param buf The string buffer to prepend to.
* @param fmt The string to prepend.
+ * @param args The variable arguments.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This macro is calling eina_strbuf_insert_vprintf() at position 0.If @p buf
*/
EAPI Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
+
/**
* @brief Retrieve a pointer to the contents of a string buffer
*
* @see eina_strbuf_string_steal()
*/
EAPI const char *eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Steal the contents of a string buffer.
*
* @see eina_strbuf_string_get()
*/
EAPI char *eina_strbuf_string_steal(Eina_Strbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+
/**
* @brief Free the contents of a string buffer but not the buffer.
*
* This function frees the string contained in @p buf without freeing
* @p buf.
*/
-EAPI void eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
+EAPI void eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
+
/**
* @brief Retrieve the length of the string buffer content.
*
* This function returns the length of @p buf.
*/
EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
/**
/**
* @}
*/
+
/**
* @}
*/
+
#endif /* EINA_STRBUF_H */
*
* @{
*/
+
/**
- * @addtogroup Eina_Unicode_String_Buffer_Group Unicode String Buffer
- *
- * @brief These functions provide unicode string buffers management.
- *
- * The Unicode String Buffer data type is designed to be a mutable string,
- * allowing to append, prepend or insert a string to a buffer.
+ * @defgroup Eina_Unicode_String_Buffer_Group Unicode String Buffer
*
* @{
*/
* created by eina_ustrbuf_new().
*/
EAPI void eina_ustrbuf_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
+
/**
* @brief Reset a string buffer.
*
* @see eina_ustrbuf_append_length()
*/
EAPI Eina_Bool eina_ustrbuf_append(Eina_UStrbuf *buf, const Eina_Unicode *str) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append an escaped string to a buffer, reallocating as necessary.
*
* #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf, const Eina_Unicode *str) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append a string to a buffer, reallocating as necessary,
* limited by the given length.
* @see eina_ustrbuf_append_length()
*/
EAPI Eina_Bool eina_ustrbuf_append_n(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t maxlen) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Append a string of exact length to a buffer, reallocating as necessary.
*
* is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert an escaped string to a buffer, reallocating as
* necessary.
* returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert_escaped(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a string to a buffer, reallocating as necessary. Limited by maxlen.
*
* otherwise, #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert_n(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t maxlen, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a string of exact length to a buffer, reallocating as necessary.
*
* @see eina_ustrbuf_insert_n()
*/
EAPI Eina_Bool eina_ustrbuf_insert_length(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t length, size_t pos) EINA_ARG_NONNULL(1, 2);
+
/**
* @brief Insert a character to a string buffer, reallocating as
* necessary.
* @brief Prepend the given string to the given buffer
*
* @param buf The string buffer to prepend to.
- * @param str The string to prepend.
+ * @param fmt The string to prepend.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This macro is calling eina_ustrbuf_insert_printf() at position 0.If @p buf
*
* @param buf The string buffer to prepend to.
* @param fmt The string to prepend.
+ * @param args The variable arguments.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This macro is calling eina_ustrbuf_insert_vprintf() at position 0.If @p buf
*/
EAPI Eina_Bool
eina_ustrbuf_remove(Eina_UStrbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
+
/**
* @brief Retrieve a pointer to the contents of a string buffer
*
*/
EAPI const Eina_Unicode *
eina_ustrbuf_string_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
/**
* @brief Steal the contents of a string buffer.
*
*/
EAPI Eina_Unicode *
eina_ustrbuf_string_steal(Eina_UStrbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+
/**
* @brief Free the contents of a string buffer but not the buffer.
*
*/
EAPI void
eina_ustrbuf_string_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
+
/**
* @brief Retrieve the length of the string buffer content.
*
*/
EAPI size_t
eina_ustrbuf_length_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
/**
* @}
*/
+
/**
* @}
*/
+
#endif /* EINA_STRBUF_H */
#include "eina_array.h"
/*============================================================================*
-* Local *
-*============================================================================*/
+ * Local *
+ *============================================================================*/
/**
* @cond LOCAL
/*============================================================================*
-* Global *
-*============================================================================*/
+ * Global *
+ *============================================================================*/
/**
* @internal
}
/*============================================================================*
-* API *
-*============================================================================*/
+ * API *
+ *============================================================================*/
/**
* @addtogroup Eina_Array_Group Array
* if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#include <stdio.h>
+
#ifdef EFL_HAVE_POSIX_THREADS
# include <pthread.h>
#endif
#include "eina_rectangle.h"
#include "eina_safety_checks.h"
-static Eina_Version _version = { VMAJ, VMIN, VMIC, VREV };
-EAPI Eina_Version *eina_version = &_version;
-
/*============================================================================*
* Local *
*============================================================================*/
* @cond LOCAL
*/
+static Eina_Version _version = { VMAJ, VMIN, VMIC, VREV };
+
static int _eina_main_count = 0;
#ifdef EFL_HAVE_THREADS
static int _eina_main_thread_count = 0;
* Global *
*============================================================================*/
+
/*============================================================================*
* API *
*============================================================================*/
*/
/**
+ * @var eina_version
+ * @brief Eina version (defined at configuration time)
+ */
+EAPI Eina_Version *eina_version = &_version;
+
+/**
* @brief Initialize the Eina library.
*
* @return 1 or greater on success, 0 on error.
* Local *
*============================================================================*/
+/**
+ * @cond LOCAL
+ */
+
+#define _STRBUF_DATA_TYPE char
+#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
+#define _STRBUF_STRUCT_NAME Eina_Strbuf
+#define _STRBUF_STRLEN_FUNC(x) strlen(x)
+#define _STRBUF_STRESCAPE_FUNC(x) eina_str_escape(x)
+#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
+#define _STRBUF_MAGIC_STR __STRBUF_MAGIC_STR
+static const char __STRBUF_MAGIC_STR[] = "Eina Strbuf";
+
+#define _FUNC_EXPAND(y) eina_strbuf_ ## y
+
+/**
+ * @endcond
+ */
+
/*============================================================================*
* Global *
* API *
*============================================================================*/
+
+/**
+ * @addtogroup Eina_String_Buffer_Group String Buffer
+ *
+ * @brief These functions provide string buffers management.
+ *
+ * The String Buffer data type is designed to be a mutable string,
+ * allowing to append, prepend or insert a string to a buffer.
+ *
+ * @{
+ */
+
EAPI Eina_Bool
eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...)
{
/* Unicode */
-#define _STRBUF_DATA_TYPE char
-#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
-#define _STRBUF_STRUCT_NAME Eina_Strbuf
-#define _STRBUF_STRLEN_FUNC(x) strlen(x)
-#define _STRBUF_STRESCAPE_FUNC(x) eina_str_escape(x)
-#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
-#define _STRBUF_MAGIC_STR __STRBUF_MAGIC_STR
-static const char __STRBUF_MAGIC_STR[] = "Eina Strbuf";
-
-#define _FUNC_EXPAND(y) eina_strbuf_ ## y
-
#include "eina_strbuf_template_c.x"
+
+/**
+ * @}
+ */
#define EINA_STRBUF_MAX_STEP 4096
/**
+ * @endcond
+ */
+
+/*============================================================================*
+* Global *
+*============================================================================*/
+
+/**
+ * @internal
+ * @brief Initialize the strbuf module.
+ *
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ *
+ * This function sets up the strbuf module of Eina. It is called by
+ * eina_init().
+ *
+ * @see eina_init()
+ */
+Eina_Bool
+eina_strbuf_common_init(void)
+{
+ return EINA_TRUE;
+}
+
+/**
+ * @internal
+ * @brief Shut down the strbuf module.
+ *
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ *
+ * This function shuts down the strbuf module set up by
+ * eina_strbuf_common_init(). It is called by eina_shutdown().
+ *
+ * @see eina_shutdown()
+ */
+Eina_Bool
+eina_strbuf_common_shutdown(void)
+{
+ return EINA_TRUE;
+}
+
+/**
* @internal
*
* init the buffer
return EINA_TRUE;
}
-/**
- * @endcond
- */
-
-/*============================================================================*
-* Global *
-*============================================================================*/
-
-/**
- * @cond LOCAL
- */
-
-/**
- * @internal
- * @brief Initialize the strbuf module.
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
- *
- * This function sets up the strbuf module of Eina. It is called by
- * eina_init().
- *
- * @see eina_init()
- */
-Eina_Bool
-eina_strbuf_common_init(void)
-{
- return EINA_TRUE;
-}
-
-/**
- * @internal
- * @brief Shut down the strbuf module.
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
- *
- * This function shuts down the strbuf module set up by
- * eina_strbuf_common_init(). It is called by eina_shutdown().
- *
- * @see eina_shutdown()
- */
-Eina_Bool
-eina_strbuf_common_shutdown(void)
-{
- return EINA_TRUE;
-}
-
/*============================================================================*
* API *
*============================================================================*/
{
return buf->len;
}
-/**
- * @endcond
- */
/**
- * @addtogroup Eina_Data_Types_Group Data Types
- *
- * @{
- */
-/**
* @addtogroup Eina_String_Buffer_Group String Buffer
*
* @brief These functions provide string buffers management.
*
* @{
*/
-/*FIXME: Implementing them here is a hack! */
-#ifdef _STRBUF_CSIZE
-# undef _STRBUF_CSIZE
-#endif
-#ifdef _STRBUF_MAGIC
-# undef _STRBUF_MAGIC
-#endif
-#ifdef _STRBUF_MAGIC_STR
-# undef _STRBUF_MAGIC_STR
-#endif
+
+/**
+ * @cond LOCAL
+ */
+
+/*FIXME: Implementing them here is a hack! */
#define _STRBUF_CSIZE 1
#define _STRBUF_MAGIC EINA_MAGIC_STRBUF
#define _STRBUF_MAGIC_STR __STRBUF_STR_MAGIC_STR
static const char __STRBUF_STR_MAGIC_STR[] = "Eina Strbuf";
+
+/**
+ * @endcond
+ */
+
+
/**
- * @ brief Replace the n-th string with an other string.
+ * @brief Replace the n-th string with an other string.
*
* @param buf The string buffer to work with.
* @param str The string to replace.
/**
* @}
*/
-/**
- * @}
- */
#include "eina_unicode.h"
#include "eina_ustrbuf.h"
+/*============================================================================*
+ * Local *
+ *============================================================================*/
+
+/**
+ * @cond LOCAL
+ */
#define _STRBUF_DATA_TYPE Eina_Unicode
#define _STRBUF_CSIZE sizeof(_STRBUF_DATA_TYPE)
#define _FUNC_EXPAND(y) eina_ustrbuf_ ## y
+/**
+ * @endcond
+ */
+
+
+/*============================================================================*
+ * Global *
+ *============================================================================*/
+
+
+/*============================================================================*
+ * API *
+ *============================================================================*/
+
+/**
+ * @addtogroup Eina_Unicode_String_Buffer_Group Unicode String Buffer
+ *
+ * @brief These functions provide unicode string buffers management.
+ *
+ * The Unicode String Buffer data type is designed to be a mutable string,
+ * allowing to append, prepend or insert a string to a buffer.
+ *
+ * @{
+ */
+
#include "eina_strbuf_template_c.x"
+
+/**
+ * @}
+ */