Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
status.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "status.h"
+ Include dependency graph for status.c:

Go to the source code of this file.

Functions

int mhdf_isError (mhdf_Status const *status)
 Return 1 if passed status object indicates an error. Zero otherwise. More...
 
const char * mhdf_message (mhdf_Status const *status)
 Get the error message given a status object.
More...
 
void mhdf_setOkay (mhdf_Status *status)
 
void mhdf_setFail (mhdf_Status *status, const char *fmt,...)
 

Function Documentation

◆ mhdf_isError()

int mhdf_isError ( mhdf_Status const *  status)

Return 1 if passed status object indicates an error. Zero otherwise.

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 26 of file status.c.

27 {
28  return !!status->message[0];
29 }

References struct_mhdf_Status::message.

Referenced by alloc_file_desc(), check_valid_adjacencies(), check_valid_elem_conn(), check_valid_parents_children(), check_valid_poly_conn(), check_valid_set_contents(), check_valid_sets(), check_valid_tag(), check_valid_var_len_tag(), moab::ReadHDF5::create_tag(), get_elem_desc(), get_tag_desc(), iMOAB_ReadHeaderInfo(), moab::ReadHDF5::is_error(), main(), mhdf_getFileSummary(), moab::ReadHDF5::read_qa(), moab::ReadHDF5::read_tag_values_all(), moab::ReadHDF5::read_tag_values_partial(), realloc_data(), moab::ReadHDF5::set_up_read(), and moab::WriteHDF5::write_file().

◆ mhdf_message()

◆ mhdf_setFail()

void mhdf_setFail ( mhdf_Status status,
const char *  fmt,
  ... 
)

Definition at line 41 of file status.c.

42 {
43  if( status )
44  {
45  va_list args;
46  va_start( args, fmt );
47  vsnprintf( status->message, MHDF_MESSAGE_BUFFER_LEN, fmt, args );
48  va_end( args );
49  if( !status->message[0] ) strncpy( status->message, "(Uknown error)", MHDF_MESSAGE_BUFFER_LEN );
50  }
51 }

References struct_mhdf_Status::message, and MHDF_MESSAGE_BUFFER_LEN.

Referenced by create_tag_common(), get_elem_type_enum(), get_file_id_size(), get_tag(), get_tag_desc(), get_tag_type(), make_hdf_group(), mhdf_addElement(), mhdf_alloc_FileHandle(), mhdf_check_valid_file(), mhdf_checkOpenHandles(), mhdf_closeData(), mhdf_closeFile(), mhdf_create_scalar_attrib(), mhdf_create_table_with_prop(), mhdf_createAdjacency(), mhdf_createConnectivity(), mhdf_createDenseTagData(), mhdf_createFile(), mhdf_createNodeCoords(), mhdf_createPolyConnectivity(), mhdf_createSetChildren(), mhdf_createSetData(), mhdf_createSetParents(), mhdf_createSparseTagData(), mhdf_createVarLenTagData(), mhdf_elem_group_from_handle(), mhdf_find_attribute(), mhdf_getElemHandles(), mhdf_getElemName(), mhdf_getElemTypeName(), mhdf_getNativeType(), mhdf_getNumberTags(), mhdf_getTagDataType(), mhdf_getTagInfo(), mhdf_getTagNames(), mhdf_getTagValues(), mhdf_haveAdjacency(), mhdf_haveDenseTag(), mhdf_haveNodes(), mhdf_haveSets(), mhdf_is_in_group(), mhdf_malloc(), mhdf_open_table(), mhdf_open_table2(), mhdf_open_table_simple(), mhdf_openAdjacency(), mhdf_openConnectivity(), mhdf_openDenseTagData(), mhdf_openFileWithOpt(), mhdf_openPolyConnectivity(), mhdf_openSetChildren(), mhdf_openSetData(), mhdf_openSetMeta(), mhdf_openSetParents(), mhdf_openSparseTagData(), mhdf_read_scalar_attrib(), mhdf_readHistory(), mhdf_readSetMetaColumn(), mhdf_readwrite(), mhdf_readwrite_column(), mhdf_readwriteSetMeta(), mhdf_realloc(), mhdf_write_max_id(), mhdf_writeHistory(), read_tag_attrib_data(), scan_for_max_id(), and store_tag_val_in_attrib().

◆ mhdf_setOkay()

void mhdf_setOkay ( 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 36 of file status.c.

37 {
38  if( status ) status->message[0] = '\0';
39 }

References struct_mhdf_Status::message.

Referenced by create_tag_common(), get_tag(), mhdf_addElement(), mhdf_closeData(), mhdf_closeFile(), mhdf_create_table_with_prop(), mhdf_createConnectivity(), mhdf_createDenseTagData(), mhdf_createFile(), mhdf_createNodeCoords(), mhdf_createPolyConnectivity(), mhdf_createSetMeta(), mhdf_createSparseTagData(), mhdf_createVarLenTagData(), mhdf_getElemHandles(), mhdf_getElemName(), mhdf_getElemTypeName(), mhdf_getFileSummary(), mhdf_getNativeType(), mhdf_getNextStartId(), mhdf_getNumberTags(), mhdf_getTagInfo(), mhdf_getTagNames(), mhdf_getTagValues(), mhdf_haveAdjacency(), mhdf_haveDenseTag(), mhdf_haveNodes(), mhdf_haveSets(), mhdf_isPolyElement(), mhdf_open_table(), mhdf_open_table2(), mhdf_open_table_simple(), mhdf_openConnectivity(), mhdf_openConnectivitySimple(), mhdf_openDenseTagData(), mhdf_openFileWithOpt(), mhdf_openNodeCoords(), mhdf_openNodeCoordsSimple(), mhdf_openPolyConnectivity(), mhdf_openSetMeta(), mhdf_openSetMetaSimple(), mhdf_openSparseTagData(), mhdf_readHistory(), mhdf_readSetMetaColumn(), mhdf_readwrite(), mhdf_readwrite_column(), mhdf_readwriteSetMeta(), and mhdf_writeHistory().