- introduced macros for enter and return from API functions
- iterators revisited
This commit is contained in:
@@ -3,6 +3,15 @@
|
||||
|
||||
#define UNUSED_ARGUMENT(x) (void)x
|
||||
|
||||
#define TRY( func ) \
|
||||
if ((int64_t)(ptrdiff_t)(func) <= (int64_t)H5_ERR) \
|
||||
return H5_ERR; \
|
||||
|
||||
#define TRY2( func ) \
|
||||
if ((int64_t)(ptrdiff_t)(func) <= (int64_t)H5_ERR) \
|
||||
goto exit; \
|
||||
|
||||
|
||||
#include "h5_types.h"
|
||||
#include "h5_errno.h"
|
||||
|
||||
@@ -11,6 +20,7 @@
|
||||
#include "h5_maps.h"
|
||||
#include "h5_openclose.h"
|
||||
#include "h5_readwrite.h"
|
||||
#include "h5_syscall.h"
|
||||
|
||||
#include "h5u_readwrite.h"
|
||||
#include "h5u_model.h"
|
||||
|
||||
@@ -225,13 +225,15 @@ h5_set_funcname (
|
||||
const char * const fname
|
||||
);
|
||||
|
||||
static inline void
|
||||
H5_ENTER_API (
|
||||
h5_file_t* const f,
|
||||
const char* const fname
|
||||
) {
|
||||
h5_set_funcname( f, fname );
|
||||
h5_debug (f, "%s", " "); // just print the function name
|
||||
}
|
||||
#define H5_API_ENTER { \
|
||||
h5_set_funcname( f, __func__ ); \
|
||||
h5_debug (f, "%s", " "); \
|
||||
} \
|
||||
|
||||
#define H5_API_RETURN(retval) \
|
||||
\
|
||||
goto exit; \
|
||||
exit: \
|
||||
return retval; \
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef __H5_SYSCALL_H
|
||||
#define __H5_SYSCALL_H
|
||||
|
||||
void*
|
||||
h5_alloc (
|
||||
h5_file_t* const f,
|
||||
void* ptr,
|
||||
const size_t size
|
||||
);
|
||||
|
||||
void*
|
||||
h5_calloc (
|
||||
h5_file_t* const f,
|
||||
const size_t count,
|
||||
const size_t size
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5_free (
|
||||
h5_file_t* const f,
|
||||
void* ptr
|
||||
);
|
||||
#endif
|
||||
@@ -54,16 +54,9 @@ h5t_init_leaf_iterator (
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_create_leaf_iterator (
|
||||
h5t_init_boundary_face_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_iterator_t** iter,
|
||||
const int codim
|
||||
);
|
||||
|
||||
h5_err_t
|
||||
h5t_create_boundary_face_iterator (
|
||||
h5_file_t* f,
|
||||
h5t_iterator_t** iter,
|
||||
h5t_iterator_t* iter,
|
||||
const int codim
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user