MOAB: Mesh Oriented datABase
(version 5.4.1)
|
00001 /** 00002 * MOAB, a Mesh-Oriented datABase, is a software component for creating, 00003 * storing and accessing finite element mesh data. 00004 * 00005 * Copyright 2004 Sandia Corporation. Under the terms of Contract 00006 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 00007 * retains certain rights in this software. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 */ 00015 00016 #ifndef mhdf_FILE_UTIL_H 00017 #define mhdf_FILE_UTIL_H 00018 00019 #include <sys/types.h> 00020 #include <H5Ipublic.h> 00021 #include "status.h" 00022 #include "file-handle.h" 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 void* mhdf_malloc( size_t size, mhdf_Status* status ); 00029 void* mhdf_realloc( void* ptr, size_t size, mhdf_Status* status ); 00030 00031 size_t mhdf_name_to_path( const char* name, char* path, size_t path_len ); 00032 00033 int mhdf_path_to_name( const char* path, char* name ); 00034 00035 char* mhdf_name_to_path_copy( const char* name, mhdf_Status* status ); 00036 00037 char* mhdf_name_to_path_cat( const char* prefix, const char* name, mhdf_Status* status ); 00038 00039 hid_t mhdf_elem_group_from_handle( FileHandle* file_ptr, const char* elem_handle, mhdf_Status* status ); 00040 00041 int mhdf_create_scalar_attrib( hid_t object, const char* name, hid_t type, const void* value, mhdf_Status* status ); 00042 00043 /* If type is zero, assumes opaque type. 00044 On error, sets status and returns zero. 00045 On success, returns non-zero and does not modify status */ 00046 int mhdf_read_scalar_attrib( hid_t object, const char* name, hid_t type, void* value, mhdf_Status* status ); 00047 00048 /* Search the specified object to see if it contains an 00049 an attribute with passed name. Returns -1 on error, 1 00050 if attribute was found, and zero if attribute was not 00051 found. 00052 */ 00053 int mhdf_find_attribute( hid_t object, const char* attrib_name, unsigned int* index_out, mhdf_Status* status ); 00054 00055 int mhdf_is_in_group( hid_t group, const char* name, mhdf_Status* status ); 00056 00057 int mhdf_read_data( hid_t data_table, 00058 long offset, 00059 long count, 00060 hid_t type, 00061 void* array, 00062 hid_t read_prop, 00063 mhdf_Status* status ); 00064 00065 int mhdf_write_data( hid_t data_table, 00066 long offset, 00067 long count, 00068 hid_t type, 00069 const void* array, 00070 hid_t write_prop, 00071 mhdf_Status* status ); 00072 00073 int mhdf_read_column( hid_t data_table, 00074 int column, 00075 long offset, 00076 long count, 00077 hid_t type, 00078 void* array, 00079 hid_t read_prop, 00080 mhdf_Status* status ); 00081 00082 int mhdf_write_column( hid_t data_table, 00083 int column, 00084 long offset, 00085 long count, 00086 hid_t type, 00087 const void* array, 00088 hid_t write_prop, 00089 mhdf_Status* status ); 00090 00091 hid_t mhdf_create_table( hid_t group, const char* path, hid_t type, int rank, hsize_t* dims, mhdf_Status* status ); 00092 00093 hid_t mhdf_create_table_with_prop( hid_t group, 00094 const char* path, 00095 hid_t type, 00096 int rank, 00097 hsize_t* dims, 00098 hid_t dataset_creation_prop, 00099 mhdf_Status* status ); 00100 00101 hid_t mhdf_open_table( hid_t group, const char* path, int columns, hsize_t* rows_out, mhdf_Status* status ); 00102 00103 hid_t mhdf_open_table2( hid_t group, 00104 const char* path, 00105 int rank, 00106 hsize_t* dims_out, 00107 long* start_id_out, 00108 mhdf_Status* status ); 00109 00110 hid_t mhdf_open_table_simple( hid_t group, const char* path, mhdf_Status* status ); 00111 00112 int mhdf_compact_to_ranges( int* length_in_out, int* ids_in, int ordered ); 00113 00114 hid_t get_elem_type_enum( FileHandle* file_ptr, mhdf_Status* status ); 00115 00116 void mhdf_api_begin_internal( void ); 00117 void mhdf_api_end_internal( int expected_diff, const char* filename, int linenumber ); 00118 00119 int mhdf_write_max_id( FileHandle* file_ptr, mhdf_Status* status ); 00120 00121 #ifndef DEBUG_OPEN_HANDLES 00122 #define API_BEGIN 00123 #define API_END_H( n ) 00124 #else 00125 #define API_BEGIN mhdf_api_begin_internal() 00126 #define API_END_H( n ) mhdf_api_end_internal( n, __FILE__, __LINE__ ) 00127 #endif 00128 #define API_END API_END_H( 0 ) 00129 00130 #ifdef __cplusplus 00131 } /* extern "C" */ 00132 #endif 00133 00134 #endif