summaryrefslogtreecommitdiffstats
path: root/src/model/gi_type_data_init.c (plain)
blob: 4a161c750047e28500fd538a85a0049bba9dec54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "gi_type_data_init.h"
#include "gi_type_data.h"

/*
 * There should be some way to automate the generation of these values
 * or at least this source file based on just the definition of the
 * struct.  Perhaps an HDF5 precompiler could do such a thing.
 */
void
gi_type_data_init (size_t *dst_size, size_t *dst_offset, size_t *dst_sizes,
		   hid_t *field_type)
{
  *dst_size = sizeof (gi_type_data);

  dst_offset[0] = HOFFSET (gi_type_data, gi);
  dst_offset[1] = HOFFSET (gi_type_data, type);
  dst_offset[2] = HOFFSET (gi_type_data, protein);

  gi_type_data dst_buf[1];

  dst_sizes[0] = sizeof (dst_buf[0].gi);
  dst_sizes[1] = sizeof (dst_buf[0].type);
  dst_sizes[2] = sizeof (dst_buf[0].protein);

  field_type[0] = H5T_NATIVE_INT;

  hid_t type_h5t = H5Tcopy (H5T_C_S1);
  H5Tset_size (type_h5t, 2);
  field_type[1] = type_h5t;

  hid_t protein_h5t = H5Tcopy (H5T_C_S1);
  H5Tset_size (protein_h5t, 7);
  field_type[2] = protein_h5t;

  return;
}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.