00001 #pragma once
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00029 #include <glib.h>
00030 #include <stdlib.h>
00031 #include <pthread.h>
00032 #include "gfal_prototypes.h"
00033 #include "gfal_constants.h"
00034
00035 struct _gfal_file_descriptor_container{
00036 GHashTable* container;
00037 pthread_mutex_t m_container;
00038 };
00039
00040 struct _gfal_file_handle_{
00041 char module_name[GFAL_MODULE_NAME_SIZE];
00042 GMutex* lock;
00043 off_t offset;
00044 gpointer ext_data;
00045 gpointer fdesc;
00046 };
00047
00048
00049 gfal_fdesc_container_handle gfal_file_descriptor_handle_create(GDestroyNotify destroyer);
00050
00051 int gfal_add_new_file_desc(gfal_fdesc_container_handle fhandle, gpointer pfile, GError** err);
00052
00053 gboolean gfal_remove_file_desc(gfal_fdesc_container_handle fhandle, int key, GError** err);
00054
00055
00056 gpointer gfal_get_file_desc(gfal_fdesc_container_handle fhandle, int key, GError** err);
00057
00058
00059
00060
00061 gfal_file_handle gfal_file_handle_bind(gfal_fdesc_container_handle h, int file_desc, GError** err);
00062
00063
00064
00065 gfal_file_handle gfal_file_handle_new(const char* module_name, gpointer fdesc);
00066
00067 gfal_file_handle gfal_file_handle_ext_new(const char* module_name, gpointer fdesc, gpointer ext_data);
00068
00069
00070 void gfal_file_handle_delete(gfal_file_handle fh);
00071
00072 void gfal_file_handle_lock(gfal_file_handle fh);
00073
00074 void gfal_file_handle_unlock(gfal_file_handle fh);