H5_model.c 1.76 KB
Newer Older
gsell's avatar
gsell committed
1
/*
gsell's avatar
gsell committed
2
  Copyright (c) 2006-2015, The Regents of the University of California,
gsell's avatar
gsell committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
  through Lawrence Berkeley National Laboratory (subject to receipt of any
  required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
  Institut (Switzerland).  All rights reserved.

  License: see file COPYING in top level of source distribution.
*/

#include "h5_private.h"

#include "h5core/h5_debug.h"
#include "h5core/h5_model.h"

/* H5hut data model */

gsell's avatar
gsell committed
17
#define h5_hasstep FC_MANGLING(		      \
gsell's avatar
gsell committed
18 19 20 21 22
                h5_hasstep,                   \
                H5_HASSTEP)
int
h5_hasstep (
	const h5_int64_t* f,
gsell's avatar
gsell committed
23
	const h5_int64_t* step
gsell's avatar
gsell committed
24 25 26 27 28 29
	) {

	h5_file_t fh = h5_filehandlefor2c(f);
	H5_API_ENTER (
                int,
                "f=%p, stepno=%lld",
gsell's avatar
gsell committed
30 31
                (h5_file_p)fh, (long long int)step);
	H5_API_RETURN (h5_has_step (fh, (*step)-1));
gsell's avatar
gsell committed
32 33
}

gsell's avatar
gsell committed
34
#define h5_setstep FC_MANGLING(			\
gsell's avatar
gsell committed
35 36 37 38 39 40 41 42 43
                h5_setstep,                     \
                H5_SETSTEP)
h5_int64_t
h5_setstep (
	const h5_int64_t *f,
	h5_int64_t *step ) {

	h5_file_t fh = h5_filehandlefor2c(f);
	H5_API_ENTER (h5_int64_t, "f=%p, step=%lld", (h5_file_p)fh, (long long)*step);
gsell's avatar
gsell committed
44
	H5_API_RETURN (h5_set_step (fh, (*step)-1));
gsell's avatar
gsell committed
45 46
}

gsell's avatar
gsell committed
47
#define h5_getstep FC_MANGLING(			\
gsell's avatar
gsell committed
48 49 50 51 52 53 54 55 56 57 58 59
                h5_getstep,                     \
                H5_GETSTEP)
h5_int64_t
h5_getstep (
	const h5_int64_t *f
	) {

	h5_file_t fh = h5_filehandlefor2c(f);
	H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
	H5_API_RETURN (h5_get_step (fh) + 1);
}

gsell's avatar
gsell committed
60
#define h5_getnsteps FC_MANGLING(		\
gsell's avatar
gsell committed
61 62 63 64 65 66 67 68 69 70 71
                h5_getnsteps,                   \
                H5_GETNSTEPS)
h5_int64_t
h5_getnsteps (
	const h5_int64_t *f
	) {

	h5_file_t fh = h5_filehandlefor2c(f);
	H5_API_ENTER (h5_int64_t, "f=%p", (h5_file_p)fh);
	H5_API_RETURN (h5_get_num_steps (fh));
}