#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <hdf5.h>
#include "util.h"
#include "status.h"
#include "names-and-paths.h"
Go to the source code of this file.
Macros | |
#define | VALGRIND_CHECK_MEM_IS_DEFINED(A, B) |
#define | VALGRIND_MAKE_MEM_UNDEFINED(A, B) |
Functions | |
void * | mhdf_malloc (size_t size, mhdf_Status *status) |
void * | mhdf_realloc (void *ptr, size_t size, mhdf_Status *status) |
size_t | mhdf_name_to_path (const char *name, char *path, size_t path_len) |
static int | mhdf_hex_char (int c) |
int | mhdf_path_to_name (const char *path, char *name) |
char * | mhdf_name_to_path_copy (const char *name, mhdf_Status *status) |
char * | mhdf_name_to_path_cat (const char *prefix, const char *name, mhdf_Status *status) |
hid_t | mhdf_elem_group_from_handle (FileHandle *file_ptr, const char *elem_handle, mhdf_Status *status) |
int | mhdf_create_scalar_attrib (hid_t object, const char *name, hid_t type, const void *value, mhdf_Status *status) |
int | mhdf_read_scalar_attrib (hid_t object, const char *name, hid_t type, void *value, mhdf_Status *status) |
static herr_t | find_attr_by_name (hid_t handle, const char *name, void *mydata) |
int | mhdf_find_attribute (hid_t object, const char *attrib_name, unsigned int *index_out, mhdf_Status *status) |
static herr_t | find_link_by_name (hid_t handle, const char *name, void *mydata) |
int | mhdf_is_in_group (hid_t group, const char *name, mhdf_Status *status) |
static int | mhdf_readwrite (hid_t data_id, int read, long offset, long count, hid_t type, void *array, hid_t io_prop, mhdf_Status *status) |
static int | mhdf_readwrite_column (hid_t data_id, int read, int column, long offset, long count, hid_t type, void *array, hid_t io_prop, mhdf_Status *status) |
int | mhdf_write_data (hid_t data_id, long offset, long count, hid_t type_id, const void *array, hid_t prop, mhdf_Status *status) |
int | mhdf_read_data (hid_t data_id, long offset, long count, hid_t type_id, void *array, hid_t prop, mhdf_Status *status) |
int | mhdf_read_column (hid_t data_id, int column, long offset, long count, hid_t type, void *array, hid_t prop, mhdf_Status *status) |
int | mhdf_write_column (hid_t data_id, int column, long offset, long count, hid_t type, const void *array, hid_t prop, mhdf_Status *status) |
hid_t | mhdf_create_table (hid_t group_id, const char *path, hid_t type, int rank, hsize_t *dims, mhdf_Status *status) |
hid_t | mhdf_create_table_with_prop (hid_t group_id, const char *path, hid_t type, int rank, hsize_t *dims, hid_t create_prop, mhdf_Status *status) |
hid_t | mhdf_open_table (hid_t group_id, const char *path, int columns, hsize_t *rows_out, mhdf_Status *status) |
hid_t | mhdf_open_table2 (hid_t group_id, const char *path, int rank, hsize_t *dims_out, long *start_id_out, mhdf_Status *status) |
hid_t | mhdf_open_table_simple (hid_t group_id, const char *path, mhdf_Status *status) |
static int | qs_comp_int (const void *ptr1, const void *ptr2) |
int | mhdf_compact_to_ranges (int *length, int *ids, int ordered) |
hid_t | get_elem_type_enum (FileHandle *file_ptr, mhdf_Status *status) |
int | mhdf_write_max_id (FileHandle *file_ptr, mhdf_Status *status) |
static int | num_open (void) |
void | mhdf_api_begin_internal (void) |
void | mhdf_api_end_internal (int expected_diff, const char *filename, int linenumber) |
Variables | |
static int | mhdf_api_handle_count = 0 |
#define VALGRIND_CHECK_MEM_IS_DEFINED | ( | A, | |
B | |||
) |
MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.
Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
|
static |
|
static |
hid_t get_elem_type_enum | ( | FileHandle * | file_ptr, |
mhdf_Status * | status | ||
) |
Definition at line 786 of file util.c.
References struct_FileHandle::hdf_handle, mhdf_setFail(), and TYPE_ENUM_PATH.
Referenced by mhdf_addElement(), and mhdf_getElemName().
void mhdf_api_begin_internal | ( | void | ) |
void mhdf_api_end_internal | ( | int | expected_diff, |
const char * | filename, | ||
int | linenumber | ||
) |
Definition at line 873 of file util.c.
References mhdf_api_handle_count, and num_open().
int mhdf_compact_to_ranges | ( | int * | length, |
int * | ids, | ||
int | ordered | ||
) |
int mhdf_create_scalar_attrib | ( | hid_t | object, |
const char * | name, | ||
hid_t | type, | ||
const void * | value, | ||
mhdf_Status * | status | ||
) |
Definition at line 164 of file util.c.
References mhdf_setFail(), and VALGRIND_CHECK_MEM_IS_DEFINED.
Referenced by create_tag_common(), mhdf_addElement(), mhdf_createConnectivity(), mhdf_createFile(), mhdf_createNodeCoords(), mhdf_createPolyConnectivity(), mhdf_createSetMeta(), mhdf_createVarLenTag(), and store_tag_val_in_attrib().
hid_t mhdf_create_table | ( | hid_t | group_id, |
const char * | path, | ||
hid_t | type, | ||
int | rank, | ||
hsize_t * | dims, | ||
mhdf_Status * | status | ||
) |
Definition at line 563 of file util.c.
References mhdf_create_table_with_prop().
Referenced by mhdf_createAdjacency(), mhdf_createConnectivity(), mhdf_createDenseTagData(), mhdf_createNodeCoords(), mhdf_createPolyConnectivity(), mhdf_createSetChildren(), mhdf_createSetData(), mhdf_createSetMeta(), mhdf_createSetParents(), mhdf_createSparseTagData(), and mhdf_createVarLenTagData().
hid_t mhdf_create_table_with_prop | ( | hid_t | group_id, |
const char * | path, | ||
hid_t | type, | ||
int | rank, | ||
hsize_t * | dims, | ||
hid_t | create_prop, | ||
mhdf_Status * | status | ||
) |
Definition at line 568 of file util.c.
References mhdf_setFail(), and mhdf_setOkay().
Referenced by mhdf_create_table().
hid_t mhdf_elem_group_from_handle | ( | FileHandle * | file_ptr, |
const char * | elem_handle, | ||
mhdf_Status * | status | ||
) |
Definition at line 146 of file util.c.
References ELEMENT_GROUP, struct_FileHandle::hdf_handle, mhdf_name_to_path_cat(), and mhdf_setFail().
Referenced by mhdf_createAdjacency(), mhdf_createConnectivity(), mhdf_createDenseTagData(), mhdf_createPolyConnectivity(), mhdf_getElemTypeName(), mhdf_haveAdjacency(), mhdf_haveDenseTag(), mhdf_isPolyElement(), mhdf_openAdjacency(), mhdf_openConnectivity(), mhdf_openConnectivitySimple(), mhdf_openDenseTagData(), and mhdf_openPolyConnectivity().
int mhdf_find_attribute | ( | hid_t | object, |
const char * | attrib_name, | ||
unsigned int * | index_out, | ||
mhdf_Status * | status | ||
) |
Definition at line 256 of file util.c.
References find_attr_by_name(), and mhdf_setFail().
Referenced by mhdf_getTagInfo(), mhdf_getTagValues(), mhdf_openSparseTagData(), and read_tag_attrib_data().
|
static |
Definition at line 85 of file util.c.
Referenced by mhdf_path_to_name().
int mhdf_is_in_group | ( | hid_t | group, |
const char * | name, | ||
mhdf_Status * | status | ||
) |
Definition at line 280 of file util.c.
References find_link_by_name(), and mhdf_setFail().
Referenced by mhdf_getTagInfo(), mhdf_haveAdjacency(), mhdf_haveDenseTag(), mhdf_haveNodes(), mhdf_haveSets(), mhdf_isPolyElement(), mhdf_readHistory(), and scan_for_max_id().
void* mhdf_malloc | ( | size_t | size, |
mhdf_Status * | status | ||
) |
MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.
Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
Definition at line 32 of file util.c.
References mhdf_setFail(), and size.
Referenced by alloc_file_desc(), mhdf_addElement(), mhdf_alloc_FileHandle(), mhdf_createDenseTagData(), mhdf_getElemHandles(), mhdf_getFileSummary(), mhdf_getTagNames(), mhdf_name_to_path_cat(), mhdf_name_to_path_copy(), mhdf_openDenseTagData(), and mhdf_readHistory().
size_t mhdf_name_to_path | ( | const char * | name, |
char * | path, | ||
size_t | path_len | ||
) |
Definition at line 48 of file util.c.
References length().
Referenced by mhdf_addElement(), mhdf_createDenseTagData(), mhdf_name_to_path_cat(), mhdf_name_to_path_copy(), and mhdf_openDenseTagData().
char* mhdf_name_to_path_cat | ( | const char * | prefix, |
const char * | name, | ||
mhdf_Status * | status | ||
) |
Definition at line 131 of file util.c.
References buffer, mhdf_malloc(), mhdf_name_to_path(), and size.
Referenced by mhdf_elem_group_from_handle().
char* mhdf_name_to_path_copy | ( | const char * | name, |
mhdf_Status * | status | ||
) |
Definition at line 118 of file util.c.
References buffer, mhdf_malloc(), mhdf_name_to_path(), and size.
Referenced by create_tag_common(), get_tag(), mhdf_getTagDataType(), and mhdf_haveDenseTag().
hid_t mhdf_open_table | ( | hid_t | group_id, |
const char * | path, | ||
int | columns, | ||
hsize_t * | rows_out, | ||
mhdf_Status * | status | ||
) |
Definition at line 601 of file util.c.
References mhdf_setFail(), and mhdf_setOkay().
Referenced by mhdf_openAdjacency(), mhdf_openDenseTagData(), mhdf_openPolyConnectivity(), mhdf_openSetChildren(), mhdf_openSetData(), mhdf_openSetParents(), and mhdf_openSparseTagData().
hid_t mhdf_open_table2 | ( | hid_t | group_id, |
const char * | path, | ||
int | rank, | ||
hsize_t * | dims_out, | ||
long * | start_id_out, | ||
mhdf_Status * | status | ||
) |
Definition at line 649 of file util.c.
References mhdf_read_scalar_attrib(), mhdf_setFail(), mhdf_setOkay(), and START_ID_ATTRIB.
Referenced by mhdf_openConnectivity(), mhdf_openNodeCoords(), and mhdf_openSetMeta().
hid_t mhdf_open_table_simple | ( | hid_t | group_id, |
const char * | path, | ||
mhdf_Status * | status | ||
) |
Definition at line 705 of file util.c.
References mhdf_setFail(), and mhdf_setOkay().
Referenced by mhdf_openConnectivitySimple(), mhdf_openNodeCoordsSimple(), and mhdf_openSetMetaSimple().
int mhdf_path_to_name | ( | const char * | path, |
char * | name | ||
) |
Definition at line 93 of file util.c.
References mhdf_hex_char().
Referenced by mhdf_addElement(), mhdf_getElemHandles(), and mhdf_getTagNames().
int mhdf_read_column | ( | hid_t | data_id, |
int | column, | ||
long | offset, | ||
long | count, | ||
hid_t | type, | ||
void * | array, | ||
hid_t | prop, | ||
mhdf_Status * | status | ||
) |
Definition at line 539 of file util.c.
References mhdf_readwrite_column().
Referenced by mhdf_readNodeCoord(), and mhdf_readNodeCoordWithOpt().
int mhdf_read_data | ( | hid_t | data_id, |
long | offset, | ||
long | count, | ||
hid_t | type_id, | ||
void * | array, | ||
hid_t | prop, | ||
mhdf_Status * | status | ||
) |
Definition at line 528 of file util.c.
References mhdf_readwrite().
Referenced by mhdf_getFileSummary(), mhdf_readAdjacency(), mhdf_readAdjacencyWithOpt(), mhdf_readConnectivity(), mhdf_readConnectivityWithOpt(), mhdf_readNodeCoords(), mhdf_readNodeCoordsWithOpt(), mhdf_readPolyConnIDs(), mhdf_readPolyConnIDsWithOpt(), mhdf_readPolyConnIndices(), mhdf_readPolyConnIndicesWithOpt(), mhdf_readSetData(), mhdf_readSetDataWithOpt(), mhdf_readSetParentsChildren(), mhdf_readSetParentsChildrenWithOpt(), mhdf_readSparseTagEntities(), mhdf_readSparseTagEntitiesWithOpt(), mhdf_readSparseTagIndices(), mhdf_readSparseTagIndicesWithOpt(), and mhdf_readTagValuesWithOpt().
int mhdf_read_scalar_attrib | ( | hid_t | object, |
const char * | name, | ||
hid_t | type, | ||
void * | value, | ||
mhdf_Status * | status | ||
) |
Definition at line 200 of file util.c.
References mhdf_setFail().
Referenced by mhdf_getTagInfo(), mhdf_open_table2(), mhdf_openPolyConnectivity(), read_tag_attrib_data(), and scan_for_max_id().
|
static |
Definition at line 288 of file util.c.
References mhdf_setFail(), mhdf_setOkay(), and VALGRIND_CHECK_MEM_IS_DEFINED.
Referenced by mhdf_read_data(), and mhdf_write_data().
|
static |
Definition at line 401 of file util.c.
References mhdf_setFail(), mhdf_setOkay(), VALGRIND_CHECK_MEM_IS_DEFINED, and VALGRIND_MAKE_MEM_UNDEFINED.
Referenced by mhdf_read_column(), and mhdf_write_column().
void* mhdf_realloc | ( | void * | ptr, |
size_t | size, | ||
mhdf_Status * | status | ||
) |
Definition at line 40 of file util.c.
References mhdf_setFail(), and size.
Referenced by realloc_data().
int mhdf_write_column | ( | hid_t | data_id, |
int | column, | ||
long | offset, | ||
long | count, | ||
hid_t | type, | ||
const void * | array, | ||
hid_t | prop, | ||
mhdf_Status * | status | ||
) |
Definition at line 551 of file util.c.
References mhdf_readwrite_column().
Referenced by mhdf_writeNodeCoord(), and mhdf_writeNodeCoordWithOpt().
int mhdf_write_data | ( | hid_t | data_id, |
long | offset, | ||
long | count, | ||
hid_t | type_id, | ||
const void * | array, | ||
hid_t | prop, | ||
mhdf_Status * | status | ||
) |
Definition at line 517 of file util.c.
References mhdf_readwrite().
Referenced by mhdf_writeAdjacency(), mhdf_writeAdjacencyWithOpt(), mhdf_writeConnectivity(), mhdf_writeConnectivityWithOpt(), mhdf_writeNodeCoords(), mhdf_writeNodeCoordsWithOpt(), mhdf_writePolyConnIDs(), mhdf_writePolyConnIDsWithOpt(), mhdf_writePolyConnIndices(), mhdf_writePolyConnIndicesWithOpt(), mhdf_writeSetData(), mhdf_writeSetDataWithOpt(), mhdf_writeSetParentsChildren(), mhdf_writeSetParentsChildrenWithOpt(), mhdf_writeSparseTagEntities(), mhdf_writeSparseTagEntitiesWithOpt(), mhdf_writeSparseTagIndices(), mhdf_writeSparseTagIndicesWithOpt(), and mhdf_writeTagValuesWithOpt().
int mhdf_write_max_id | ( | FileHandle * | file_ptr, |
mhdf_Status * | status | ||
) |
Definition at line 798 of file util.c.
References struct_FileHandle::hdf_handle, struct_FileHandle::max_id, MAX_ID_ATTRIB, mhdf_setFail(), and ROOT_GROUP.
Referenced by mhdf_createConnectivity(), mhdf_createNodeCoords(), mhdf_createPolyConnectivity(), and mhdf_createSetMeta().
|
static |
Definition at line 845 of file util.c.
Referenced by mhdf_api_begin_internal(), and mhdf_api_end_internal().
|
static |
|
static |
Definition at line 843 of file util.c.
Referenced by mhdf_api_begin_internal(), and mhdf_api_end_internal().