1/**
2 * MOAB, a Mesh-Oriented datABase, is a software component for creating,
3 * storing and accessing finite element mesh data.
4 *
5 * Copyright 2004 Sandia Corporation. Under the terms of Contract
6 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
7 * retains certain rights in this software.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 */1516#ifndef mhdf_FILE_UTIL_H17#define mhdf_FILE_UTIL_H1819#include<sys/types.h>20#include<H5Ipublic.h>21#include"status.h"22#include"file-handle.h"2324#ifdef __cplusplus25extern"C" {
26#endif2728void* mhdf_malloc( size_t size, mhdf_Status* status );
29void* mhdf_realloc( void* ptr, size_t size, mhdf_Status* status );
3031size_tmhdf_name_to_path( constchar* name, char* path, size_t path_len );
3233intmhdf_path_to_name( constchar* path, char* name );
3435char* mhdf_name_to_path_copy( constchar* name, mhdf_Status* status );
3637char* mhdf_name_to_path_cat( constchar* prefix, constchar* name, mhdf_Status* status );
3839hid_tmhdf_elem_group_from_handle( FileHandle* file_ptr, constchar* elem_handle, mhdf_Status* status );
4041intmhdf_create_scalar_attrib( hid_t object, constchar* name, hid_t type, constvoid* value, mhdf_Status* status );
4243/* If type is zero, assumes opaque type.
44 On error, sets status and returns zero.
45 On success, returns non-zero and does not modify status */46intmhdf_read_scalar_attrib( hid_t object, constchar* name, hid_t type, void* value, mhdf_Status* status );
4748/* Search the specified object to see if it contains an
49 an attribute with passed name. Returns -1 on error, 1
50 if attribute was found, and zero if attribute was not
51 found.
52 */53intmhdf_find_attribute( hid_t object, constchar* attrib_name, unsignedint* index_out, mhdf_Status* status );
5455intmhdf_is_in_group( hid_t group, constchar* name, mhdf_Status* status );
5657intmhdf_read_data( hid_t data_table,
58long offset,
59long count,
60hid_t type,
61void* array,
62hid_t read_prop,
63 mhdf_Status* status );
6465intmhdf_write_data( hid_t data_table,
66long offset,
67long count,
68hid_t type,
69constvoid* array,
70hid_t write_prop,
71 mhdf_Status* status );
7273intmhdf_read_column( hid_t data_table,
74int column,
75long offset,
76long count,
77hid_t type,
78void* array,
79hid_t read_prop,
80 mhdf_Status* status );
8182intmhdf_write_column( hid_t data_table,
83int column,
84long offset,
85long count,
86hid_t type,
87constvoid* array,
88hid_t write_prop,
89 mhdf_Status* status );
9091hid_tmhdf_create_table( hid_t group, constchar* path, hid_t type, int rank, hsize_t* dims, mhdf_Status* status );
9293hid_tmhdf_create_table_with_prop( hid_t group,
94constchar* path,
95hid_t type,
96int rank,
97hsize_t* dims,
98hid_t dataset_creation_prop,
99 mhdf_Status* status );
100101hid_tmhdf_open_table( hid_t group, constchar* path, int columns, hsize_t* rows_out, mhdf_Status* status );
102103hid_tmhdf_open_table2( hid_t group,
104constchar* path,
105int rank,
106hsize_t* dims_out,
107long* start_id_out,
108 mhdf_Status* status );
109110hid_tmhdf_open_table_simple( hid_t group, constchar* path, mhdf_Status* status );
111112intmhdf_compact_to_ranges( int* length_in_out, int* ids_in, int ordered );
113114hid_tget_elem_type_enum( FileHandle* file_ptr, mhdf_Status* status );
115116voidmhdf_api_begin_internal( void );
117voidmhdf_api_end_internal( int expected_diff, constchar* filename, int linenumber );
118119intmhdf_write_max_id( FileHandle* file_ptr, mhdf_Status* status );
120121#ifndef DEBUG_OPEN_HANDLES122#define API_BEGIN123#define API_END_H( n )124#else125#define API_BEGIN mhdf_api_begin_internal()126#define API_END_H( n ) mhdf_api_end_internal( n, __FILE__, __LINE__ )127#endif128#define API_END API_END_H( 0 )129130#ifdef __cplusplus131 } /* extern "C" */132#endif133134#endif