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

Go to the source code of this file.

Description

Filehandles manage the underlying POSIX filehandle for a file descriptor.

Since we want to support handling of more files than POSIX filehandles are available on a common system the filehandles are opened, cached and closed on demand, see 'filehandlecache'. Access to filehandles is locked from elsewhere (filedescriptor, filehandlecache)

Definition in file filehandle.h.

#include "lib/error.h"
#include "lib/llist.h"
#include "backend/filedescriptor.h"

Classes

struct  lumiera_filehandle
 File handles. More...
 

Typedefs

typedef lumiera_filehandle * LumieraFilehandle
 

Functions

void * lumiera_filehandle_destroy_node (LList node)
 destroy the resources associated either a filehandle structure. More...
 
static int lumiera_filehandle_get (LumieraFilehandle self)
 just accessor, no safety net More...
 
int lumiera_filehandle_handle (LumieraFilehandle self)
 
LumieraFilehandle lumiera_filehandle_init (LumieraFilehandle self, LumieraFiledescriptor descriptor)
 Initialise filehandle structure. More...
 
LumieraFilehandle lumiera_filehandle_new (LumieraFiledescriptor descriptor)
 Allocate a new filehandle structure. More...
 

Typedef Documentation

typedef lumiera_filehandle* LumieraFilehandle

Definition at line 38 of file filehandle.h.


Class Documentation

struct lumiera_filehandle_struct
Class Members
llist cachenode
int fd
unsigned use_cnt
LumieraFiledescriptor descriptor
+ Collaboration diagram for lumiera_filehandle:

Function Documentation

LumieraFilehandle lumiera_filehandle_init ( LumieraFilehandle  self,
LumieraFiledescriptor  descriptor 
)

Initialise filehandle structure.

Parameters
selffilehandle structure to be initialised
descriptoron which this filehandle will be attached
Returns
new filehandle structure

Definition at line 43 of file filehandle.c.

References TRACE().

Referenced by lumiera_filehandle_new(), and lumiera_filehandlecache_handle_acquire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

LumieraFilehandle lumiera_filehandle_new ( LumieraFiledescriptor  descriptor)

Allocate a new filehandle structure.

Parameters
descriptoron which this filehandle will be attached
Returns
new filehandle structure

Definition at line 58 of file filehandle.c.

References lumiera_filehandle_init(), and lumiera_malloc().

Referenced by lumiera_filehandlecache_handle_acquire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* lumiera_filehandle_destroy_node ( LList  node)

destroy the resources associated either a filehandle structure.

This function is used by the filehandle cache to recycle filehandle structs.

Parameters
nodepointer to the cache node member of a struct filehandle
Returns
pointer to the start of the memory of the destroyed filehandle

Definition at line 66 of file filehandle.c.

References TRACE().

Referenced by lumiera_filehandlecache_new().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lumiera_filehandle_handle ( LumieraFilehandle  self)

Definition at line 81 of file filehandle.c.

References LUMIERA_ERROR_SET_CRITICAL, LUMIERA_FILE_MASK, lumiera_filedescriptor_flags(), lumiera_filedescriptor_name(), lumiera_filedescriptor_samestat(), and TRACE().

Referenced by lumiera_filedescriptor_delete(), and lumiera_filedescriptor_handle_acquire().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int lumiera_filehandle_get ( LumieraFilehandle  self)
inlinestatic

just accessor, no safety net

Definition at line 95 of file filehandle.h.

Referenced by lumiera_filedescriptor_unlock().

+ Here is the caller graph for this function: