Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
filedescriptorregistry.h File Reference

Go to the source code of this file.

Description

Registry for used file descriptors.

This registry stores all acquired file descriptors for lookup, they will be freed when not referenced anymore.

Definition in file filedescriptorregistry.h.

Functions

void lumiera_filedescriptorregistry_destroy (void)
 Destroy and free the global file descriptor registry. More...
 
LumieraFiledescriptor lumiera_filedescriptorregistry_ensure (LumieraFiledescriptor template)
 Ensures that a filedescriptor is in the registry. More...
 
void lumiera_filedescriptorregistry_init (void)
 Initialise the global file descriptor registry. More...
 
void lumiera_filedescriptorregistry_remove (LumieraFiledescriptor self)
 Removes a file descriptor from the registry. More...
 

Function Documentation

void lumiera_filedescriptorregistry_init ( void  )

Initialise the global file descriptor registry.

Opening hard linked files will be targeted to the same file descriptor. This function never fails but dies on error.

Todo:
proper backend/subsystem failure

Definition at line 89 of file filedescriptorregistry.c.

References cmp_fn(), delete_fn(), filedescriptorregistry, filedescriptorregistry_mutex, key_fn(), LUMIERA_DIE, lumiera_mutex_init(), psplay_new(), and TRACE().

Referenced by lumiera_backend_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lumiera_filedescriptorregistry_destroy ( void  )

Destroy and free the global file descriptor registry.

Never fails.

Definition at line 102 of file filedescriptorregistry.c.

References filedescriptorregistry, filedescriptorregistry_mutex, lumiera_mutex_destroy(), NULL, psplay_delete(), psplay_nelements(), and TRACE().

Referenced by lumiera_backend_destroy().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraFiledescriptor lumiera_filedescriptorregistry_ensure ( LumieraFiledescriptor  template)

Ensures that a filedescriptor is in the registry.

Looks template up and if not found, create a new one from template.

Returns
filedescriptor from registry

Definition at line 117 of file filedescriptorregistry.c.

References filedescriptorregistry, filedescriptorregistry_mutex, lumiera_filedescriptor_new(), LUMIERA_MUTEX_SECTION, NULL, psplay_find(), and psplay_insert().

Referenced by lumiera_filedescriptor_acquire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lumiera_filedescriptorregistry_remove ( LumieraFiledescriptor  self)

Removes a file descriptor from the registry.

Definition at line 146 of file filedescriptorregistry.c.

References filedescriptorregistry, filedescriptorregistry_mutex, LUMIERA_MUTEX_SECTION, and psplay_remove().

Referenced by lumiera_filedescriptor_delete().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: