-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfdf_grid_meta.c
More file actions
53 lines (41 loc) · 888 Bytes
/
Copy pathfdf_grid_meta.c
File metadata and controls
53 lines (41 loc) · 888 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "fdf_grid_meta.h"
#include "fdf_types_full.h"
#include "fdf_data_types.h"
#include "fdf_enums.h"
#include <stdlib.h>
fdf_grid_meta *fdf_grid_meta_init()
{
fdf_grid_meta *p = malloc(sizeof(fdf_grid_meta));
if( p != NULL ){
p->type = FDF_DATA_DOUBLE;
p->size = 0;
}
return p;
}
void fdf_grid_meta_destroy( fdf_grid_meta *p )
{
free(p);
}
unsigned int fdf_grid_meta_get_type( const fdf_grid_meta *grid_spec )
{
return grid_spec->type;
}
int fdf_grid_meta_set_type( fdf_grid_meta *grid_spec, unsigned int type )
{
if( fdf_verify_data_type( type ) ){
grid_spec->type = type;
}
return FDF_SUCCESS;
}
int fdf_grid_meta_get_size( const fdf_grid_meta *grid_spec )
{
return grid_spec->size;
}
int fdf_grid_meta_set_size( fdf_grid_meta *grid_spec, int size )
{
if( size <= 0 ){
return FDF_INVALID_GRID_SIZE;
}
grid_spec->size = size;
return FDF_SUCCESS;
}