2010-07-27 01:22:20 -07:00
|
|
|
#ifndef EINA_UNICODE_H
|
|
|
|
#define EINA_UNICODE_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup Eina_Data_Types_Group Data Types
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @addtogroup Eina_Unicode_String Unicode String
|
|
|
|
*
|
|
|
|
* @brief These functions provide basic unicode string handling
|
|
|
|
*
|
|
|
|
* Eina_Unicode is a type that holds unicode codepoints.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "eina_config.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef Eina_Unicode
|
|
|
|
* A type that holds Unicode codepoints.
|
|
|
|
*/
|
|
|
|
#if EINA_SIZEOF_WCHAR_T >= 4
|
|
|
|
# include <wchar.h>
|
2010-07-27 19:37:05 -07:00
|
|
|
typedef wchar_t Eina_Unicode;
|
2010-07-27 01:22:20 -07:00
|
|
|
#elif defined(EINA_HAVE_INTTYPES_H)
|
|
|
|
# include <inttypes.h>
|
2010-07-27 19:37:05 -07:00
|
|
|
typedef uint32_t Eina_Unicode;
|
2010-07-27 01:22:20 -07:00
|
|
|
#elif defined(EINA_HAVE_STDINT_H)
|
|
|
|
# include <stdint.h>
|
2010-07-27 19:37:05 -07:00
|
|
|
typedef uint32_t Eina_Unicode;
|
2010-07-27 01:22:20 -07:00
|
|
|
#else
|
|
|
|
/* Hope that int is big enough */
|
2010-07-27 19:37:05 -07:00
|
|
|
typedef unsigned int Eina_Unicode;
|
2010-07-27 01:22:20 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "eina_types.h"
|
|
|
|
|
|
|
|
extern const Eina_Unicode *EINA_UNICODE_EMPTY_STRING;
|
|
|
|
|
|
|
|
EAPI size_t
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_strlen(
|
|
|
|
const Eina_Unicode *ustr) EINA_ARG_NONNULL(1);
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
EAPI Eina_Unicode *
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_strdup(
|
|
|
|
const Eina_Unicode *text) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1)
|
|
|
|
EINA_MALLOC;
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
EAPI int
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_strcmp(
|
|
|
|
const Eina_Unicode *a,
|
|
|
|
const Eina_Unicode *b) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
EAPI Eina_Unicode *
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_strcpy(
|
|
|
|
Eina_Unicode *dest,
|
|
|
|
const Eina_Unicode *source);
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
EAPI Eina_Unicode *
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_strstr(
|
|
|
|
const Eina_Unicode *haystack,
|
|
|
|
const Eina_Unicode *needle) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
EAPI Eina_Unicode *
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_strncpy(
|
|
|
|
Eina_Unicode *dest,
|
|
|
|
const Eina_Unicode *source,
|
|
|
|
size_t n);
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
EAPI Eina_Unicode *
|
2010-07-27 19:37:05 -07:00
|
|
|
eina_unicode_escape(
|
|
|
|
const Eina_Unicode *str);
|
2010-07-27 01:22:20 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|