Page tree

The license could not be verified: License Certificate has expired!

 

JAVA

FORTRAN

C++

C

 

Link

H5E_CLEAR1

Clears the error stack for the current thread

Procedure:

H5E_CLEAR1(void)

Signature:

herr_t H5Eclear1(void)

SUBROUTINE h5eclear_f(hdferr) 
  IMPLICIT NONE 
  INTEGER, INTENT(OUT) :: hdferr  ! Error code 

END SUBROUTINE h5eclear_f

Parameters:

None.

Description:

H5E_CLEAR1 clears the error stack for the current thread.

The stack is also cleared whenever an API function is called, with certain exceptions (for instance, H5E_PRINT1).

Returns:

Returns a non-negative value if successful; otherwise returns a negative value.

Example:

test / err_compat.c [465:509]  1.10/master  HDFFV/hdf5
int
main(void)
{
    hid_t		file, fapl;
    char		filename[1024];
    const char          *FUNC_main="main";

    fprintf(stderr, "   This program tests the Error API compatible with HDF5 v1.6.  There're supposed to be some error messages\n");
    fapl = h5_fileaccess();

    h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
    if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
	TEST_ERROR ;

    /* Test error stack */

    /* Push an error onto error stack */
    H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE,
            "Error test failed");

    /* Print out the errors on stack */
    dump_error();

    /* Empty error stack */
    H5Eclear1();

    /* Test error API */
    if(test_error1() < 0) TEST_ERROR ;

    if(test_error2(file) < 0) {
        H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG,
                "Error test failed");
        H5Eprint1(stderr);
    }

    if(H5Fclose(file) < 0) TEST_ERROR ;
    h5_clean_files(FILENAME, fapl);

    printf("All error API tests passed.\n");
    return 0;

 error:
    printf("***** ERROR TEST FAILED! *****\n");
    return 1;
}

Fortran example coming soon.

History:
Release    C
1.8.0Function H5Eclear renamed to H5Eclear1 and deprecated in this release.

--- Last Modified: April 13, 2018 | 12:37 PM