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

Data Structures

struct  _Eina_Xattr

Modules

 Benchmark
 

These functions allow you to add benchmark framework in a project for timing critical part and detect slow parts of code.


 Convert
 

These functions allow you to convert integer or real numbers to string or conversely.


 Counter
 

These functions allow you to get the time spent in a part of a code.


 Error
 

These functions provide error management for projects.


 Lazy allocator
 Lock
 

These functions provide Mutual Exclusion objects management.


 Log
 

Full-featured logging system.


 Magic
 

Eina_Magic provides run-time type-checking.


 Memory Pool
 

These functions provide memory pool management.


 Module
 

Eina module provides some helpers over POSIX dlopen().


 Rectangle
 

These functions provide rectangle management.


 Safety Checks
 

Safety checks are a set of macros to check for parameters or values that should never happen, it is similar in concept to assert(), but will log and return instead of abort() your program.


 Simple_XML
 

Simplistic relaxed SAX-like XML parser.


 String
 

Provide useful functions for C string manipulation.


 File
 

Functions to handle files and directories.


Typedefs

typedef struct _Eina_Xattr Eina_Xattr

Enumerations

enum  Eina_Xattr_Flags {
  EINA_XATTR_INSERT,
  EINA_XATTR_REPLACE,
  EINA_XATTR_CREATED
}
 define extended attribute creation More...

Functions

Eina_Iteratoreina_xattr_ls (const char *file)
 Get an iterator that list all extended attribute of a file.
Eina_Iteratoreina_xattr_value_ls (const char *file)
 Get an iterator that list all extended attribute value related to a fd.
Eina_Iteratoreina_xattr_fd_ls (int fd)
 Get an iterator that list all extended attribute related to a fd.
Eina_Iteratoreina_xattr_value_fd_ls (int fd)
 Get an iterator that list all extended attribute value related to a fd.
void * eina_xattr_get (const char *file, const char *attribute, ssize_t *size)
 Retrieve an extended attribute from a file.
Eina_Bool eina_xattr_set (const char *file, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags)
 Set an extended attribute on a file.
Eina_Bool eina_xattr_string_set (const char *file, const char *attribute, const char *data, Eina_Xattr_Flags flags)
 Set a string as a extended attribute properties.
char * eina_xattr_string_get (const char *file, const char *attribute)
 Get a string from an extended attribute properties.
Eina_Bool eina_xattr_double_set (const char *file, const char *attribute, double value, Eina_Xattr_Flags flags)
 Set a double as a extended attribute properties.
Eina_Bool eina_xattr_double_get (const char *file, const char *attribute, double *value)
 Get a double from an extended attribute properties.
Eina_Bool eina_xattr_int_set (const char *file, const char *attribute, int value, Eina_Xattr_Flags flags)
 Set an int as a extended attribute properties.
Eina_Bool eina_xattr_int_get (const char *file, const char *attribute, int *value)
 Get a int from an extended attribute properties.

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.


Enumeration Type Documentation

define extended attribute creation

Since:
1.1
Enumerator:
EINA_XATTR_INSERT 

This is the default behaviour, 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_Iterator* eina_xattr_ls ( const char *  file)

Get an iterator that list all extended attribute of a file.

Parameters:
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_Iterator* eina_xattr_value_ls ( const char *  file)

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

Parameters:
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.

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

Parameters:
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().

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

Parameters:
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().

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

Retrieve an extended attribute from a file.

Parameters:
fileThe file to retrieve the extended attribute from.
attributeThe extended attribute name to retrieve.
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

References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

Referenced by eina_xattr_string_get().

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

Set an extended attribute on a file.

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

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, EINA_TRUE, EINA_XATTR_CREATED, EINA_XATTR_INSERT, and EINA_XATTR_REPLACE.

Referenced by eina_xattr_string_set().

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

Set a string as a extended attribute properties.

Parameters:
fileThe file to set the string to.
attributeThe attribute to set.
dataThe NULL terminated string to set.
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().

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

Get a string from an extended attribute properties.

Parameters:
fileThe file to get the string from.
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_Bool eina_xattr_double_set ( const char *  file,
const char *  attribute,
double  value,
Eina_Xattr_Flags  flags 
)

Set a double as a extended attribute properties.

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

References eina_convert_dtoa(), and eina_xattr_string_set().

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

Get a double from an extended attribute properties.

Parameters:
fileThe file to get the string from.
attributeThe attribute to get.
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().

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

Set an int as a extended attribute properties.

Parameters:
fileThe file to set the int to.
attributeThe attribute to set.
valueThe NULL terminated int to set.
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_Bool eina_xattr_int_get ( const char *  file,
const char *  attribute,
int *  value 
)

Get a int from an extended attribute properties.

Parameters:
fileThe file to get the string from.
attributeThe attribute to get.
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().