The HDF Group

HDF Reference Manual


[HE Interface][Top]


HEclear

VOID HEclear( )

Purpose
Clears all information on reported errors from the error stack.
Return value
None.
Description
HEpush creates an error stack. HEclear is then used to clear this stack after all errors are processed or when desired.

[HE Interface][Top]


HEprint/heprntf/heprnt

VOID HEprint(FILE *stream, int32 level)

stream
IN:
Stream to print error message to
level
IN:
Level of error stack to print

Purpose
Prints information to the error stack.
Return value
None.
 
Fortran function returns 0 (zero) on success or -1 on failure.
Description
If level is 0, all of the errors currently on the error stack are printed. Output from this function is sent to the file pointed to by stream.
 
The following information is printed: the ASCII description of the error, the reporting routine, the reporting routine as source file name, and the line at which the error was reported. If the programmer has supplied extra information by means of HEreport, this information is printed as well.
 
The FORTRAN-77 routine heprnt uses one less parameter than the C routine because it doesn't allow the user to specify the print stream. Instead, it always prints to stdout.
 
The FORTRAN-77 routine heprntf is available on all platforms; heprnt is not supported on Microsoft Windows platforms.
 
The heprntf parameter filename is the name of the file to which error output is to be written. If the value of filename is an empty string (''), error output will be written to standard output, stdout.

FORTRAN
integer function heprntf(filename, level)
 
character*(*) filename
 
integer level
 
 
 
integer function heprnt(level)
 
integer level

[HE Interface][Top]


HEpush

VOID HEpush(int16 error_code, char *funct_name, char *file_name, intn line)

error_code
IN:
HDF error code corresponding to the error
func_name
IN:
Name of function in which the error occurred
file_name
IN:
Name of file in which the error occurred
line
IN:
Line number in the file that error occurred

Purpose
Pushes a new error onto the error stack.
Return value
None.
Description
HEpush pushes the file name, function name, line number, and generic description of the error onto the error stack. HEreport can then be used to give a more case-specific description of the error.
 
If the stack is full, the error will be ignored. HEpush assumes that the character strings func_name and file_name are in semi-permanent storage, so only pointers to the strings are saved.

[HE Interface][Top]


HEreport

VOID HEreport(char *format, ... )

format
IN:
Output string specification

Purpose
Adds a text string to the description of the most-recently-reported error (only one text string per error).
Return value
None
Description
HEpush places on the error stack the file name, function name, line number, and a generic description of the error type. HEreport can then be used to give a more case-specific description of the error. Only one additional annotation can be attached to each error report.
 
The format argument must conform to the string specification requirements of printf.

[HE Interface][Top]


HEstring/hestringf

const char *HEstring(hdf_err_code_t error_code)

error_code
IN:
HDF error code

Purpose
Returns the error message associated with specified error code.
Return value
Returns a pointer to a string associated with the error code, if successful.
Description
Returns a text description of the given error code. These strings are statically declared and should not be deallocated from memory (using the free routine) by the user. If a defined text description cannot be found a generic default message is returned.

FORTRAN
integer function hestringf(error_code, error_message)
 
integer error_code
 
character*(*) error_message

[HE Interface][Top]


HEvalue

int16 HEvalue(int32 level)

level
IN:
Level of the error stack to be returned

Purpose
Returns an error code from the specified level of the error stack.
Return value
The error code if successful or DFE_NONE otherwise.
Description
HEvalue returns the error code at the top of the stack, when level is 1. Refer to Table 1B of Section 1 in this reference manual for a complete list of HDF4 error codes.


HDF 4.2.6 - June 2011
Copyright
The HDF Group
www.hdfgroup.org
The HDF Group