Modules | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Tools

Eina tools aims to help application development, providing ways to make it safer, log errors, manage memory more efficiently and more. More...

Modules

 Benchmark
 
 Convert
 
 Counter
 This group discusses the functions that allow you to get the time spent in a part of a code.
 
 Copy On Write
 These functions provide some helper for a pseudo Copy-On-Write mechanism.
 
 Cpu
 Cpu and architecture related helpers.
 
 Error
 This group discusses the functions that provide error management for projects.
 
 File
 This group discusses the functions to handle files and directories.
 
 Lazy allocator
 
 Lock
 This group provides thread locking and synchronization capabilities.
 
 Log
 Full-featured logging system.
 
 Magic
 Eina_Magic provides run-time type-checking.
 
 Memory Pool
 This group discusses the functions that provide memory pool management.
 
 Module
 These macros allow you to define module informations like author/description/version/license. eina_modinfo - shows information about an eina module. eina_modinfo pulls out information from the eina modules given on command line.
 
 Prefix
 This group discusses the functions that provide the ability to determine the runtime location of a software package.
 
 Rectangle
 These functions provide rectangle management.
 
 Safety Checks
 
 Schedule
 
 Simple_XML
 Simplistic relaxed SAX-like XML parser.
 
 String
 Provides useful functions for C string manipulation.
 
 Thread
 Abstracts platform threads, providing a uniform API. It's modeled after POSIX THREADS (pthreads), on Linux they are almost 1:1 mapping.
 

Data Structures

struct  _Eina_Xattr
 

Macros

#define EINA_FLT_EQ(a, b)   (!!(fabsf((float)(a) - (float)(b)) <= FLT_EPSILON))
 Safe comparison of float. More...
 
#define EINA_FLT_NONZERO(a)   (!!(fpclassify((float)(a)) != FP_ZERO))
 Determines if a float is not zero. More...
 
#define EINA_DBL_EQ(a, b)   (!!(fabs((double)(a) - (double)(b)) <= DBL_EPSILON))
 Safe comparison of double. More...
 
#define EINA_DBL_NONZERO(a)   (!!(fpclassify((double)(a)) != FP_ZERO))
 Determines if a double is not zero. More...
 

Typedefs

typedef struct _Eina_Xattr Eina_Xattr
 

Enumerations

enum  Eina_Xattr_Flags {
  EINA_XATTR_INSERT,
  EINA_XATTR_REPLACE,
  EINA_XATTR_CREATED
}
 

Functions

const char * eina_environment_home_get (void)
 Returns the content of the environment referred by HOME on this system. More...
 
const char * eina_environment_tmp_get (void)
 Returns the content of the environment referred as TMPDIR on this system. More...
 
static Eina_Bool eina_dbl_exact (double a, double b)
 Warningless comparison of doubles using ==. More...
 
static Eina_Bool eina_flt_exact (float a, float b)
 Warningless comparison of floats using ==. More...
 
EAPI Eina_Iteratoreina_xattr_ls (const char *file) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
 Gets an iterator that lists all extended attribute of a file. More...
 
EAPI Eina_Iteratoreina_xattr_value_ls (const char *file) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
 Gets an iterator that list all extended attribute value related to a fd. More...
 
EAPI Eina_Iteratoreina_xattr_fd_ls (int fd) EINA_WARN_UNUSED_RESULT
 Gets an iterator that list all extended attribute related to a fd. More...
 
EAPI Eina_Iteratoreina_xattr_value_fd_ls (int fd) EINA_WARN_UNUSED_RESULT
 Gets an iterator that list all extended attribute value related to a fd. More...
 
EAPI Eina_Bool eina_xattr_copy (const char *src, const char *dst) EINA_ARG_NONNULL(1
 Copies the extended attribute from one file to another. More...
 
EAPI Eina_Bool EAPI Eina_Bool eina_xattr_fd_copy (int src, int dst)
 Copies the extended attribute from one file descriptor to another. More...
 
EAPI void * eina_xattr_get (const char *file, const char *attribute, ssize_t *size) EINA_ARG_NONNULL(1
 Retrieves an extended attribute from a file. More...
 
EAPI void * eina_xattr_fd_get (int fd, const char *attribute, ssize_t *size) EINA_ARG_NONNULL(2
 Retrieves an extended attribute from a file descriptor. More...
 
EAPI Eina_Bool eina_xattr_set (const char *file, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags) EINA_ARG_NONNULL(1
 Sets an extended attribute on a file. More...
 
EAPI Eina_Bool EAPI Eina_Bool eina_xattr_fd_set (int fd, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags) EINA_ARG_NONNULL(2
 Sets an extended attribute on a file descriptor. More...
 
EAPI Eina_Bool EAPI Eina_Bool EAPI Eina_Bool eina_xattr_del (const char *file, const char *attribute) EINA_ARG_NONNULL(1
 Deletes (removes) an extended attribute from a file. More...
 
EAPI Eina_Bool EAPI Eina_Bool EAPI Eina_Bool EAPI Eina_Bool eina_xattr_fd_del (int fd, const char *attribute) EINA_ARG_NONNULL(2)
 Deletes (removes) an extended attribute from a file descriptor. More...
 
EAPI Eina_Bool eina_xattr_string_set (const char *file, const char *attribute, const char *data, Eina_Xattr_Flags flags)
 Sets a string as a extended attribute properties. More...
 
EAPI char * eina_xattr_string_get (const char *file, const char *attribute)
 Gets a string from an extended attribute properties. More...
 
EAPI Eina_Bool eina_xattr_double_set (const char *file, const char *attribute, double value, Eina_Xattr_Flags flags)
 Sets a double as a extended attribute properties. More...
 
EAPI Eina_Bool eina_xattr_double_get (const char *file, const char *attribute, double *value)
 Gets a double from an extended attribute properties. More...
 
EAPI Eina_Bool eina_xattr_int_set (const char *file, const char *attribute, int value, Eina_Xattr_Flags flags)
 Sets an int as a extended attribute properties. More...
 
EAPI Eina_Bool eina_xattr_int_get (const char *file, const char *attribute, int *value)
 Gets a int from an extended attribute properties. More...
 

Variables

EAPI void EINA_WARN_UNUSED_RESULT
 

Detailed Description

Eina tools aims to help application development, providing ways to make it safer, log errors, manage memory more efficiently and more.

For more information refer to the string example.

Macro Definition Documentation

◆ EINA_FLT_EQ

#define EINA_FLT_EQ (   a,
 
)    (!!(fabsf((float)(a) - (float)(b)) <= FLT_EPSILON))

Safe comparison of float.

Parameters
[in]aFirst member to compare
[in]bSecond member to compare
Since
1.19
Returns
true if two floats match

◆ EINA_FLT_NONZERO

#define EINA_FLT_NONZERO (   a)    (!!(fpclassify((float)(a)) != FP_ZERO))

Determines if a float is not zero.

Parameters
[in]aThe float
Returns
true if float is not zero
Since
1.19

◆ EINA_DBL_EQ

#define EINA_DBL_EQ (   a,
 
)    (!!(fabs((double)(a) - (double)(b)) <= DBL_EPSILON))

Safe comparison of double.

Parameters
[in]aFirst member to compare
[in]bSecond member to compare
Since
1.19
Returns
true if two double match

◆ EINA_DBL_NONZERO

#define EINA_DBL_NONZERO (   a)    (!!(fpclassify((double)(a)) != FP_ZERO))

Determines if a double is not zero.

Parameters
[in]aThe double
Returns
true if double is not zero
Since
1.19

Enumeration Type Documentation

◆ Eina_Xattr_Flags

define extended attribute creation

Since
1.1
Enumerator
EINA_XATTR_INSERT 

This is the default behavior, it will either create or replace the extended attribute.

EINA_XATTR_REPLACE 

This will only succeed if the extended attribute previously existed.

EINA_XATTR_CREATED 

This will only succeed if the extended attribute wasn't previously set.

Function Documentation

◆ eina_environment_home_get()

const char* eina_environment_home_get ( void  )

Returns the content of the environment referred by HOME on this system.

Returns
A temporary string to the content referred by HOME on this system.
Note
The result of this call is highly system dependent and you better use it instead of the naive getenv("HOME").
Since
1.15

Referenced by ecore_file_app_exe_get().

◆ eina_environment_tmp_get()

const char* eina_environment_tmp_get ( void  )

Returns the content of the environment referred as TMPDIR on this system.

Returns
A temporary string to the content referred by TMPDIR on this system.
Note
The result of this call is highly system dependent and you better use it instead of the naive getenv("TMPDIR").
Since
1.15

Referenced by ecore_con_local_path_new().

◆ eina_dbl_exact()

static Eina_Bool eina_dbl_exact ( double  a,
double  b 
)
inlinestatic

Warningless comparison of doubles using ==.

Parameters
[in]aFirst member to compare
[in]bSecond member to compare
Returns
true if two doubles match
Since
1.19

◆ eina_flt_exact()

static Eina_Bool eina_flt_exact ( float  a,
float  b 
)
inlinestatic

Warningless comparison of floats using ==.

Parameters
[in]aFirst member to compare
[in]bSecond member to compare
Returns
true if two floats match
Since
1.19

◆ eina_xattr_ls()

EAPI Eina_Iterator* eina_xattr_ls ( const char *  file)

Gets an iterator that lists all extended attribute of a file.

Parameters
[in]fileThe filename to retrieve the extended attribute list from.
Returns
an iterator.

The iterator will not allocate any data during the iteration step, so you need to copy them yourself if you need.

Since
1.1

References EINA_MAGIC_SET, EINA_SAFETY_ON_NULL_RETURN_VAL, FUNC_ITERATOR_FREE, FUNC_ITERATOR_GET_CONTAINER, and FUNC_ITERATOR_NEXT.

◆ eina_xattr_value_ls()

EAPI Eina_Iterator* eina_xattr_value_ls ( const char *  file)

Gets an iterator that list all extended attribute value related to a fd.

Parameters
[in]fileThe filename to retrieve the extended attribute list from.
Returns
An iterator.

The iterator will not allocate any data during the iteration step, so you need to copy them yourself if you need. The iterator will provide an Eina_Xattr structure.

Since
1.2

References EINA_MAGIC_SET, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), FUNC_ITERATOR_FREE, FUNC_ITERATOR_GET_CONTAINER, and FUNC_ITERATOR_NEXT.

◆ eina_xattr_fd_ls()

EAPI Eina_Iterator* eina_xattr_fd_ls ( int  fd)

Gets an iterator that list all extended attribute related to a fd.

Parameters
[in]fdThe file descriptor to retrieve the extended attribute list from.
Returns
an iterator.

The iterator will not allocate any data during the iteration step, so you need to copy them yourself if you need.

Since
1.2

References EINA_MAGIC_SET, FUNC_ITERATOR_FREE, FUNC_ITERATOR_GET_CONTAINER, and FUNC_ITERATOR_NEXT.

Referenced by eina_file_xattr_get().

◆ eina_xattr_value_fd_ls()

EAPI Eina_Iterator* eina_xattr_value_fd_ls ( int  fd)

Gets an iterator that list all extended attribute value related to a fd.

Parameters
[in]fdThe file descriptor to retrieve the extended attribute list from.
Returns
An iterator.

The iterator will not allocate any data during the iteration step, so you need to copy them yourself if you need. The iterator will provide an Eina_Xattr structure.

Since
1.2

References EINA_MAGIC_SET, FUNC_ITERATOR_FREE, FUNC_ITERATOR_GET_CONTAINER, and FUNC_ITERATOR_NEXT.

Referenced by eina_file_xattr_value_get().

◆ eina_xattr_copy()

EAPI Eina_Bool eina_xattr_copy ( const char *  src,
const char *  dst 
)

Copies the extended attribute from one file to another.

Parameters
[in]srcsource file to use as input.
[in]dstdestination file to use as output.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
See also
eina_xattr_fd_copy()
Since
1.8

◆ eina_xattr_fd_copy()

EAPI Eina_Bool EAPI Eina_Bool eina_xattr_fd_copy ( int  src,
int  dst 
)

Copies the extended attribute from one file descriptor to another.

Parameters
[in]srcsource file descriptor to use as input.
[in]dstdestination file descriptor to use as output.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
See also
eina_xattr_copy()
Since
1.8

References EINA_FALSE, EINA_SAFETY_ON_NULL_GOTO, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_GOTO, EINA_SAFETY_ON_TRUE_RETURN_VAL, and EINA_TRUE.

◆ eina_xattr_get()

EAPI void* eina_xattr_get ( const char *  file,
const char *  attribute,
ssize_t *  size 
)

Retrieves an extended attribute from a file.

Parameters
[in]fileThe file to retrieve the extended attribute from.
[in]attributeThe extended attribute name to retrieve.
[out]sizeThe size of the retrieved extended attribute.
Returns
the allocated data that hold the extended attribute value.

It will return NULL and *size will be 0 if it fails.

Since
1.1

Referenced by eet_data_xattr_cipher_get(), and eina_xattr_string_get().

◆ eina_xattr_fd_get()

EAPI void* eina_xattr_fd_get ( int  fd,
const char *  attribute,
ssize_t *  size 
)

Retrieves an extended attribute from a file descriptor.

Parameters
[in]fdThe file descriptor to retrieve the extended attribute from.
[in]attributeThe extended attribute name to retrieve.
[out]sizeThe size of the retrieved extended attribute.
Returns
the allocated data that hold the extended attribute value.

It will return NULL and *size will be 0 if it fails.

Since
1.8

◆ eina_xattr_set()

EAPI Eina_Bool eina_xattr_set ( const char *  file,
const char *  attribute,
const void *  data,
ssize_t  length,
Eina_Xattr_Flags  flags 
)

Sets an extended attribute on a file.

Parameters
[in]fileThe file to set the extended attribute to.
[in]attributeThe attribute to set.
[in]dataThe data to set.
[in]lengthThe length of the data to set.
[in]flagsDefine the set policy.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.1

Referenced by eet_data_xattr_cipher_set(), and eina_xattr_string_set().

◆ eina_xattr_fd_set()

EAPI Eina_Bool EAPI Eina_Bool eina_xattr_fd_set ( int  fd,
const char *  attribute,
const void *  data,
ssize_t  length,
Eina_Xattr_Flags  flags 
)

Sets an extended attribute on a file descriptor.

Parameters
[in]fdThe file descriptor to set the extended attribute to.
[in]attributeThe attribute to set.
[in]dataThe data to set.
[in]lengthThe length of the data to set.
[in]flagsDefine the set policy.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.8

◆ eina_xattr_del()

EAPI Eina_Bool EAPI Eina_Bool EAPI Eina_Bool eina_xattr_del ( const char *  file,
const char *  attribute 
)

Deletes (removes) an extended attribute from a file.

Parameters
[in]fileThe file to del the extended attribute from.
[in]attributeThe attribute to del.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.8

◆ eina_xattr_fd_del()

EAPI Eina_Bool EAPI Eina_Bool EAPI Eina_Bool EAPI Eina_Bool eina_xattr_fd_del ( int  fd,
const char *  attribute 
)

Deletes (removes) an extended attribute from a file descriptor.

Parameters
[in]fdThe file descriptor to del the extended attribute from.
[in]attributeThe attribute to del.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.8

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ eina_xattr_string_set()

EAPI Eina_Bool eina_xattr_string_set ( const char *  file,
const char *  attribute,
const char *  data,
Eina_Xattr_Flags  flags 
)

Sets a string as a extended attribute properties.

Parameters
[in]fileThe file to set the string to.
[in]attributeThe attribute to set.
[in]dataThe NULL-terminated string to set.
[in]flagsDefine the set policy.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_xattr_set().

Referenced by eina_xattr_double_set(), and eina_xattr_int_set().

◆ eina_xattr_string_get()

EAPI char* eina_xattr_string_get ( const char *  file,
const char *  attribute 
)

Gets a string from an extended attribute properties.

Parameters
[in]fileThe file to get the string from.
[in]attributeThe attribute to get.
Returns
A valid string on success, NULL otherwise.

This call check that the string is properly NULL-terminated before returning it.

Since
1.1

References eina_xattr_get().

Referenced by eina_xattr_double_get(), and eina_xattr_int_get().

◆ eina_xattr_double_set()

EAPI Eina_Bool eina_xattr_double_set ( const char *  file,
const char *  attribute,
double  value,
Eina_Xattr_Flags  flags 
)

Sets a double as a extended attribute properties.

Parameters
[in]fileThe file to set the double to.
[in]attributeThe attribute to set.
[in]valueThe NULL-terminated double to set.
[in]flagsDefine the set policy.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.1

References eina_convert_dtoa(), and eina_xattr_string_set().

Referenced by emotion_object_last_position_save().

◆ eina_xattr_double_get()

EAPI Eina_Bool eina_xattr_double_get ( const char *  file,
const char *  attribute,
double *  value 
)

Gets a double from an extended attribute properties.

Parameters
[in]fileThe file to get the string from.
[in]attributeThe attribute to get.
[out]valueWhere to put the extracted value
Returns
EINA_TRUE on success, EINA_FALSE otherwise.

This call check that the double is correctly set.

Since
1.1

References eina_convert_atod(), EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_TRUE, and eina_xattr_string_get().

Referenced by emotion_object_last_position_load().

◆ eina_xattr_int_set()

EAPI Eina_Bool eina_xattr_int_set ( const char *  file,
const char *  attribute,
int  value,
Eina_Xattr_Flags  flags 
)

Sets an int as a extended attribute properties.

Parameters
[in]fileThe file to set the int to.
[in]attributeThe attribute to set.
[in]valueThe NULL-terminated int to set.
[in]flagsDefine the set policy.
Returns
EINA_TRUE on success, EINA_FALSE otherwise.
Since
1.1

References eina_convert_itoa(), and eina_xattr_string_set().

◆ eina_xattr_int_get()

EAPI Eina_Bool eina_xattr_int_get ( const char *  file,
const char *  attribute,
int *  value 
)

Gets a int from an extended attribute properties.

Parameters
[in]fileThe file to get the string from.
[in]attributeThe attribute to get.
[out]valueWhere to put the extracted value
Returns
EINA_TRUE on success, EINA_FALSE otherwise.

This call check that the int is correctly set.

Since
1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_xattr_string_get().