Commit c5f3b7fa authored by gsell's avatar gsell

src/h5core/{h5_file.c,h5_init.c,private/h5_init.h}

- refactor 'h5_initialize()' and 'h5_finalize()'
parent a81c79e5
...@@ -617,7 +617,7 @@ h5_close_h5hut ( ...@@ -617,7 +617,7 @@ h5_close_h5hut (
void void
) { ) {
H5_CORE_API_ENTER (h5_err_t, "%s", ""); H5_CORE_API_ENTER (h5_err_t, "%s", "");
TRY (h5priv_finalize ()); TRY (h5_finalize ());
TRY (hdf5_close ()); TRY (hdf5_close ());
H5_RETURN (H5_SUCCESS); H5_RETURN (H5_SUCCESS);
} }
......
...@@ -741,9 +741,10 @@ _h5_exit (int status) { ...@@ -741,9 +741,10 @@ _h5_exit (int status) {
} }
h5_err_t h5_err_t
h5priv_initialize ( h5_initialize (
void void
) { ) {
if (h5_initialized) return 0;
memset (&h5_call_stack, 0, sizeof (h5_call_stack)); memset (&h5_call_stack, 0, sizeof (h5_call_stack));
// must be set here, otherwise next statement will fail! // must be set here, otherwise next statement will fail!
h5_initialized = 1; h5_initialized = 1;
...@@ -785,7 +786,7 @@ h5priv_initialize ( ...@@ -785,7 +786,7 @@ h5priv_initialize (
} }
h5_err_t h5_err_t
h5priv_finalize ( h5_finalize (
void void
) { ) {
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void"); H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
......
...@@ -20,10 +20,10 @@ extern "C" { ...@@ -20,10 +20,10 @@ extern "C" {
#endif #endif
h5_err_t h5_err_t
h5priv_initialize (void); h5_initialize (void);
h5_err_t h5_err_t
h5priv_finalize (void); h5_finalize (void);
extern int h5_initialized; extern int h5_initialized;
extern h5_dta_types_t h5_dta_types; extern h5_dta_types_t h5_dta_types;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment