F5private.h

00001 /*
00002  $Id: F5private.h,v 1.17 2008/02/15 20:09:45 werner Exp $
00003 */
00004 
00005 #ifndef __F5private_H
00006 #define __F5private_H
00007 
00008 #include <F5/hdf5inc.h>
00009 #include <F5/F5F.h>
00010 
00011 #ifdef  __cplusplus
00012 extern "C"
00013 {
00014 #endif
00015 
00021 hid_t   F5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t create_plist );
00022 
00023 void    F5T_save_perm_vector(hid_t location, int rank, int perm_vector[]);
00024 
00025 hid_t   F5I_create_contents(hid_t File_id);
00026 
00027 /*
00028   An error-silent version of H5Glink() with F5 verbosity information.
00029  */
00030 herr_t  F5Glink(hid_t loc_id, H5G_link_t link_type, const char *current_name, const char *new_name);
00031 
00032 herr_t  F5Glink_soft_to_id(hid_t loc_id, hid_t existing_id, const char*linkname);
00033         
00034 /*
00035   Retrieve the name of the time slice assocciated with the given time.
00036   The time is specified as a pointer, such that it may be NULL to indicate
00037   a static dataset.
00038  */
00039 char*F5I_timegroup(const double*time, char*destbuf, size_t len);
00040 
00041 /* Saves information per grid, at which time steps does this grid exist?
00042    Uses only ContentsGroup_hid  from the F5Path structure.
00043  */
00044 void F5I_add_grid(F5Path*fpath, const char*gridname, const double*time);
00045 
00046 /* Given some path, add save information per field (on which grids does this field reside?)
00047    Uses ContentsGroup_hid and Grid_hid from the F5Path structure.
00048    @param gridname optional explicit name of the grid, if NULL, then the
00049                    name is retrieved from the Grid_hid within the fpath.
00050  */
00051 void F5I_add_field(F5Path*fpath, const char*fieldname, const char*property);
00052 
00053 extern int F5printf_indent;
00054 F5_API void F5printf(int verbosity, const char *fmt,...);
00055 
00056 
00057 F5_API herr_t F_H5Aread(hid_t attr_id, hid_t mem_type_id, void *buf, const char*name );
00058 
00059         
00060 #define F5check(HDF5call) {herr_t err = HDF5call; if (err<0) \
00061                      F5printf(1, "** %s returned error in %s:%d\n",\
00062                               #HDF5call, __FILE__, __LINE__ ); }
00063 
00064 #ifndef H5_USE_16_API
00065 /* don't overrid if hdf5 (1.8.0 e.g.) uses backwards compat layer */
00066   #ifndef       NDEBUG  
00067     #define H5Acreate(loc,name,type,space,plist) ( F5printf(50,"H5Acreate(%s)", name), \
00068                                                H5Acreate(loc, name, type, space, plist) )
00069     #define H5Gcreate(loc,name,hint)         (F5printf(50,"H5Gcreate(%s)", name), \
00070                                               H5Gcreate(loc, name, hint) )
00071   #endif
00072 #endif
00073         
00074 #ifdef  __cplusplus
00075 }    /* extern "C" */
00076 #endif
00077 
00078 #endif  /* __F5private_H */
00079