forked from HDFGroup/hdf5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathH5Pf.c
4859 lines (4455 loc) · 112 KB
/
H5Pf.c
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/****h* H5Pf/H5Pf
* PURPOSE
* This file contains C stubs for H5P Fortran APIs
*
* COPYRIGHT
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the LICENSE file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
******
*/
#include "H5f90.h"
#include "H5Eprivate.h"
#include "H5public.h"
#ifdef H5_HAVE_PARALLEL
#include <mpi.h>
/* Support for C to Fortran translation in MPI */
#ifndef H5_HAVE_MPI_MULTI_LANG_Comm
#define MPI_Comm_c2f(comm) (int_f)(comm)
#define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
#endif /*MPI Comm*/
#ifndef H5_HAVE_MPI_MULTI_LANG_Info
#define MPI_Info_c2f(info) (int_f)(info)
#define MPI_Info_f2c(info) (MPI_Info)(info)
#endif /*MPI Info*/
#endif /*H5_HAVE_PARALLEL*/
/****if* H5Pf/h5pcreate_c
* NAME
* h5pcreate_c
* PURPOSE
* Call H5Pcreate to create a property list
* INPUTS
* cls - property list class identifier
* OUTPUTS
* prp_id - identifier of the created property list
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pcreate_c(hid_t_f *cls, hid_t_f *prp_id)
/******/
{
hid_t c_prp_id;
int_f ret_value = 0;
c_prp_id = H5Pcreate((hid_t)*cls);
if (c_prp_id < 0)
HGOTO_DONE(FAIL);
*prp_id = (hid_t_f)c_prp_id;
done:
return ret_value;
}
/****if* H5Pf/h5pcopy_c
* NAME
* h5pcopy_c
* PURPOSE
* Call H5Pcopy to copy property list
* INPUTS
* prp_id - identifier of the property list to be copied
* OUTPUTS
* new_prp_id - identifier of the new property list
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pcopy_c(hid_t_f *prp_id, hid_t_f *new_prp_id)
/******/
{
hid_t c_new_prp_id;
int_f ret_value = 0;
c_new_prp_id = H5Pcopy((hid_t)*prp_id);
if (c_new_prp_id < 0)
HGOTO_DONE(FAIL);
*new_prp_id = (hid_t_f)c_new_prp_id;
done:
return ret_value;
}
/****if* H5Pf/h5pequal_c
* NAME
* h5pequal_c
* PURPOSE
* Call H5Pequal to check if two property lists are equal
* INPUTS
* plist1_id - property list identifier
* plist2_id - property list identifier
* OUTPUTS
* c_flag - flag to indicate that lists are equal
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pequal_c(hid_t_f *plist1_id, hid_t_f *plist2_id, int_f *c_flag)
/******/
{
htri_t c_c_flag;
int_f ret_value = 0;
c_c_flag = H5Pequal((hid_t)*plist1_id, (hid_t)*plist2_id);
if (c_c_flag < 0)
HGOTO_DONE(FAIL);
*c_flag = (int_f)c_c_flag;
done:
return ret_value;
}
/****if* H5Pf/h5pget_class_c
* NAME
* h5pget_class_c
* PURPOSE
* Call H5Pget_class to determine property list class
* INPUTS
* prp_id - identifier of the dataspace
* OUTPUTS
* classtype - class type
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_class_c(hid_t_f *prp_id, hid_t_f *classtype)
/******/
{
hid_t c_classtype;
int_f ret_value = 0;
if ((c_classtype = H5Pget_class((hid_t)*prp_id)) < 0)
HGOTO_DONE(FAIL);
*classtype = (hid_t_f)c_classtype;
done:
return ret_value;
}
/****if* H5Pf/h5pset_preserve_c
* NAME
* h5pset_preserve_c
* PURPOSE
* Call H5Pset_preserve to set transfer property for compound
* datatype
* INPUTS
* prp_id - property list identifier
* flag - TRUE/FALSE flag
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_preserve_c(hid_t_f *prp_id, int_f *flag)
/******/
{
int ret_value = 0;
hid_t c_prp_id;
herr_t status;
bool c_flag = 0;
if (*flag > 0)
c_flag = 1;
c_prp_id = (hid_t)*prp_id;
status = H5Pset_preserve(c_prp_id, c_flag);
if (status < 0)
ret_value = -1;
return ret_value;
}
/****if* H5Pf/h5pget_preserve_c
* NAME
* h5pget_preserve_c
* PURPOSE
* Call H5Pget_preserve to set transfer property for compound
* datatype
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* flag - TRUE/FALSE flag
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_preserve_c(hid_t_f *prp_id, int_f *flag)
/******/
{
int ret_value = 0;
hid_t c_prp_id;
int c_flag;
c_prp_id = (hid_t)*prp_id;
c_flag = H5Pget_preserve(c_prp_id);
if (c_flag < 0)
ret_value = -1;
*flag = (int_f)c_flag;
return ret_value;
}
/****if* H5Pf/h5pset_deflate_c
* NAME
* h5pset_deflate_c
* PURPOSE
* Call H5Pset_deflate to set deflate level
* INPUTS
* prp_id - property list identifier
* level - level of deflation
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_deflate_c(hid_t_f *prp_id, int_f *level)
/******/
{
int ret_value = 0;
hid_t c_prp_id;
unsigned c_level;
herr_t status;
c_prp_id = (hid_t)*prp_id;
c_level = (unsigned)*level;
status = H5Pset_deflate(c_prp_id, c_level);
if (status < 0)
ret_value = -1;
return ret_value;
}
/****if* H5Pf/h5pset_chunk_c
* NAME
* h5pset_chunk_c
* PURPOSE
* Call H5Pset_chunk to set the sizes of chunks for a chunked
* layout dataset
* INPUTS
* prp_id - property list identifier
* rank - number of dimensions of each chunk
* dims - array of the size of each chunk
* RETURNS
* 0 on success, -1 on failure
* Saturday, August 14, 1999
* SOURCE
*/
int_f
h5pset_chunk_c(hid_t_f *prp_id, int_f *rank, hsize_t_f *dims)
/******/
{
int ret_value = -1;
hid_t c_prp_id = (hid_t)*prp_id;
int c_rank = (int)*rank;
hsize_t c_dims[H5S_MAX_RANK];
herr_t status;
int i;
/*
* Transpose dimension arrays because of C-FORTRAN storage order
*/
for (i = 0; i < c_rank; i++)
c_dims[i] = (hsize_t)dims[c_rank - i - 1];
status = H5Pset_chunk(c_prp_id, c_rank, c_dims);
if (status < 0)
goto DONE;
ret_value = 0;
DONE:
return ret_value;
}
/****if* H5Pf/h5pget_chunk_c
* NAME
* h5pget_chunk_c
* PURPOSE
* Call H5Pget_chunk to get the sizes of chunks for a chunked
* layout dataset for at list max_rank number of dimensions
* INPUTS
* prp_id - property list identifier
* max rank - maximum number of dimensions to return
* dims - array of the size of each chunk
* RETURNS
* number of chunk's dimnesion on success, -1 on failure
* SOURCE
*/
int_f
h5pget_chunk_c(hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims)
/******/
{
int ret_value = -1;
hid_t c_prp_id = (hid_t)*prp_id;
hsize_t c_dims[H5S_MAX_RANK];
int rank;
int c_max_rank = (int)*max_rank;
int i;
rank = H5Pget_chunk(c_prp_id, c_max_rank, c_dims);
/*
* Transpose dimension arrays because of C-FORTRAN storage order
*/
for (i = 0; i < c_max_rank; i++)
dims[c_max_rank - i - 1] = (hsize_t_f)c_dims[i];
if (rank < 0)
return ret_value;
ret_value = (int_f)rank;
return ret_value;
}
/****if* H5Pf/h5pget_version_c
* NAME
* h5pget_version_c
* PURPOSE
* Call H5Pget_version to get the version information
* of various objects for a file creation property list
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* boot - array to put boot block version number
* freelist - array to put global freelist version number
* stab - array to put symbol table version number
* shhdr - array to put shared object header version number
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
#ifdef H5_NO_DEPRECATED_SYMBOLS
int_f
h5pget_version_c(hid_t_f H5_ATTR_UNUSED *prp_id, int_f *boot, int_f *freelist, int_f *stab, int_f *shhdr)
/******/
{
/*
* Fill in fake values [since we need a file ID to call H5Fget_info :-( -QAK ]
*/
*boot = (int_f)0;
*freelist = (int_f)0;
*stab = (int_f)0;
*shhdr = (int_f)0;
return 0;
}
#else /* H5_NO_DEPRECATED_SYMBOLS */
int_f
h5pget_version_c(hid_t_f *prp_id, int_f *boot, int_f *freelist, int_f *stab, int_f *shhdr)
/******/
{
herr_t ret;
unsigned c_boot;
unsigned c_freelist;
unsigned c_stab;
unsigned c_shhdr;
/*
* Call H5Pget_version function.
*/
ret = H5Pget_version((hid_t)*prp_id, &c_boot, &c_freelist, &c_stab, &c_shhdr);
if (ret < 0)
return -1;
*boot = (int_f)c_boot;
*freelist = (int_f)c_freelist;
*stab = (int_f)c_stab;
*shhdr = (int_f)c_shhdr;
return 0;
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/****if* H5Pf/h5pget_sizes_c
* NAME
* h5pget_sizes_c
* PURPOSE
* Call H5Pget_sizes to get the size of the offsets
* and lengths used in an HDF5 file
* INPUTS
* prp_id - property list identifier
* Outputs sizeof_addr - Size of an object offset in bytes
* sizeof_size - Size of an object length in bytes
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_sizes_c(hid_t_f *prp_id, size_t_f *sizeof_addr, size_t_f *sizeof_size)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
size_t c_sizeof_addr;
size_t c_sizeof_size;
/*
* Call H5Pget_sizes function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_sizes(c_prp_id, &c_sizeof_addr, &c_sizeof_size);
if (ret < 0)
return ret_value;
*sizeof_addr = (size_t_f)c_sizeof_addr;
*sizeof_size = (size_t_f)c_sizeof_size;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pset_sizes_c
* NAME
* h5pset_sizes_c
* PURPOSE
* Call H5Pset_sizes to set the size of the offsets
* INPUTS
* prp_id - property list identifier
* sizeof_addr - Size of an object offset in bytes
* sizeof_size - Size of an object length in bytes
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_sizes_c(hid_t_f *prp_id, size_t_f *sizeof_addr, size_t_f *sizeof_size)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
size_t c_addr, c_size;
c_addr = (size_t)*sizeof_addr;
c_size = (size_t)*sizeof_size;
/*
* Call H5Pset_sizes function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_sizes(c_prp_id, c_addr, c_size);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pset_sym_k_c
* NAME
* h5pset_sym_k_c
* PURPOSE
* Call H5Pset_sym_k to set the size of parameters used
* to control the symbol table node
* INPUTS
* prp_id - property list identifier
* ik - Symbol table tree rank
* lk - Symbol table node size
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_sym_k_c(hid_t_f *prp_id, int_f *ik, int_f *lk)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
unsigned c_ik;
unsigned c_lk;
herr_t ret;
/*
* Call H5Pset_sym_k function.
*/
c_prp_id = (hid_t)*prp_id;
c_ik = (unsigned)*ik;
c_lk = (unsigned)*lk;
ret = H5Pset_sym_k(c_prp_id, c_ik, c_lk);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_sym_k_c
* NAME
* h5pget_sym_k_c
* PURPOSE
* Call H5Pget_sym_k to get the size of parameters used
* to control the symbol table node
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* ik - Symbol table tree rank
* lk - Symbol table node size
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_sym_k_c(hid_t_f *prp_id, int_f *ik, int_f *lk)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
unsigned c_ik;
unsigned c_lk;
/*
* Call H5Pget_sym_k function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_sym_k(c_prp_id, &c_ik, &c_lk);
*ik = (int_f)c_ik;
*lk = (int_f)c_lk;
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pset_istore_k_c
* NAME
* h5pset_istore_k_c
* PURPOSE
* Call H5Pset_istore_k to set the size of the parameter
* used to control the B-trees for indexing chunked datasets
* INPUTS
* prp_id - property list identifier
* ik - Symbol table tree rank
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_istore_k_c(hid_t_f *prp_id, int_f *ik)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
unsigned c_ik;
herr_t ret;
/*
* Call H5Pset_istore_k function.
*/
c_prp_id = (hid_t)*prp_id;
c_ik = (unsigned)*ik;
ret = H5Pset_istore_k(c_prp_id, c_ik);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_istore_k_c
* NAME
* h5pget_istore_k_c
* PURPOSE
* Call H5Pget_istore_k to get the size of parameters used
* to control the B-trees for indexing chunked datasets
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* ik - Symbol table tree rank
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_istore_k_c(hid_t_f *prp_id, int_f *ik)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
unsigned c_ik;
/*
* Call H5Pget_istore_k function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_istore_k(c_prp_id, &c_ik);
*ik = (int_f)c_ik;
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_driver_c
* NAME
* h5pget_driver_c
* PURPOSE
* Call H5Pget_driver to get low-level file driver identifier
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* driver - low-level file driver identifier
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_driver_c(hid_t_f *prp_id, hid_t_f *driver)
/******/
{
int ret_value = -1;
hid_t c_driver;
/*
* Call H5Pget_driver function.
*/
c_driver = H5Pget_driver((hid_t)*prp_id);
if (c_driver < 0)
goto DONE;
*driver = (hid_t_f)c_driver;
ret_value = 0;
DONE:
return ret_value;
}
/****if* H5Pf/h5pset_fapl_stdio_c
* NAME
* h5pset_fapl_stdio_c
* PURPOSE
* Call H5Pset_stdio to set the low level file driver to
* use the functions declared in the stdio.h
* INPUTS
* prp_id - property list identifier
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_fapl_stdio_c(hid_t_f *prp_id)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
/*
* Call H5Pset_fapl_stdio function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_stdio(c_prp_id);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
#ifdef NO_SUCH_F90_FUNCTION
/****if* H5Pf/h5pget_fapl_stdio_c
* NAME
* h5pget_fapl_stdio_c
* PURPOSE
* Call H5Pget_fapl_stdio to determine whether the low level file driver
* uses the functions declared in the stdio.h
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* io - value indicates whether the file driver uses
* the functions declared in the stdio.h
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_fapl_stdio_c(hid_t_f *prp_id, int_f *io)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
/*
* Call H5Pget_fapl_stdio function.
*/
c_prp_id = *prp_id;
ret = H5Pget_fapl_stdio(c_prp_id);
if (ret < 0)
return ret_value;
*io = (int_f)ret;
ret_value = 0;
return ret_value;
}
#endif /*NO_SUCH_F90_FUNCTION*/
/****if* H5Pf/h5pset_fapl_sec2_c
* NAME
* h5pset_fapl_sec2_c
* PURPOSE
* Call H5Pset_fapl_sec2 to set the low level file driver to
* use the functions declared in the unistd.h
* INPUTS
* prp_id - property list identifier
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_fapl_sec2_c(hid_t_f *prp_id)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
/*
* Call H5Pset_fapl_sec2 function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_sec2(c_prp_id);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
#ifdef NO_SUCH_F90_FUNCTION
/****if* H5Pf/h5pget_fapl_sec2_c
* NAME
* h5pget_fapl_sec2_c
* PURPOSE
* Call H5Pget_fapl_stdio to determine whether the low level file driver
* uses the functions declared in the unistd.h
* INPUTS
* prp_id - property list identifier
* OUTPUTS
* sec2 - value indicates whether the file driver uses
* the functions declared in the unistd.h
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_fapl_sec2_c(hid_t_f *prp_id, int_f *sec2)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
/*
* Call H5Pget_fapl_sec2 function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_fapl_sec2(c_prp_id);
if (ret < 0)
return ret_value;
*sec2 = (int_f)ret;
ret_value = 0;
return ret_value;
}
#endif /*NO_SUCH_F90_FUNCTION*/
/****if* H5Pf/h5pset_alignment_c
* NAME
* h5pset_alignment_c
* PURPOSE
* Call H5Pset_alignment to set alignment properties of
* a file access property list
* INPUTS
* prp_id - property list identifier
* threshold - Threshold value
* alignment - Alignment value
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_alignment_c(hid_t_f *prp_id, hsize_t_f *threshold, hsize_t_f *alignment)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
hsize_t c_threshold, c_alignment;
c_threshold = (hsize_t)*threshold;
c_alignment = (hsize_t)*alignment;
/*
* Call H5Pset_alignment function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_alignment(c_prp_id, c_threshold, c_alignment);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_alignment_c
* NAME
* h5pget_alignment_c
* PURPOSE
* Call H5Pget_alignment to get alignment properties of
* a file access property list
* INPUTS
* prp_id - property list identifier
* threshold - Threshold value
* alignment - Alignment value
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_alignment_c(hid_t_f *prp_id, hsize_t_f *threshold, hsize_t_f *alignment)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
hsize_t c_threshold, c_alignment;
/*
* Call H5Pget_alignment function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_alignment(c_prp_id, &c_threshold, &c_alignment);
if (ret < 0)
return ret_value;
*threshold = (hsize_t_f)c_threshold;
*alignment = (hsize_t_f)c_alignment;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pset_fapl_core_c
* NAME
* h5pset_fapl_core_c
* PURPOSE
* Call H5Pset_fapl_core to set the low-level file driver
* to use malloc() and free()
* INPUTS
* prp_id - property list identifier
* increment - File block size in bytes
* flag - Boolean flag indicating whether to write the
* file contents to disk when the file is closed.
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_fapl_core_c(hid_t_f *prp_id, size_t_f *increment, int_f *flag)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
size_t c_increment;
bool c_backing_store;
c_increment = (size_t)*increment;
c_backing_store = (bool)*flag;
/*
* Call H5Pset_fapl_core function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_fapl_core_c
* NAME
* h5pget_fapl_core_c
* PURPOSE
* Call H5Pget_fapl_core to determine whether the file access
* property list is set to the core drive
* INPUTS
* prp_id - property list identifier
* Outputs increment - File block size in bytes
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_fapl_core_c(hid_t_f *prp_id, size_t_f *increment, int_f *flag)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
size_t c_increment = 0;
bool c_backing_store;
*flag = 0;
/*
* Call H5Pset_fapl_core function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store);
if (ret < 0)
return ret_value;
*increment = (size_t_f)c_increment;
if (c_backing_store > 0)
*flag = 1;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pset_fapl_family_c
* NAME
* h5pset_fapl_family_c
* PURPOSE
* Call H5Pset_fapl_family to set the file access properties list
* to the family driver
* INPUTS
* prp_id - property list identifier
* memb_size - Logical size, in bytes, of each family member.
* memb_plist - Identifier of the file access property list
* for each member of the family
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f *memb_size, hid_t_f *memb_plist)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
hsize_t c_memb_size;
hid_t c_memb_plist;
c_memb_size = (hsize_t)*memb_size;
c_memb_plist = (hid_t)*memb_plist;
/*
* Call H5Pset_fapl_family function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist);
if (ret < 0)
return ret_value;
ret_value = 0;
return ret_value;
}
/****if* H5Pf/h5pget_fapl_family_c
* NAME
* h5pget_fapl_family_c
* PURPOSE
* Call H5Pget_fapl_family to determine whether the file access
* property list is set to the family driver
* INPUTS
* prp_id - property list identifier
* memb_size - Logical size, in bytes, of each family member.
* memb_plist - Identifier of the file access property list
* for each member of the family
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/
int_f
h5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f *memb_size, hid_t_f *memb_plist)
/******/
{
int ret_value = -1;
hid_t c_prp_id;
herr_t ret = -1;
hsize_t c_memb_size = 0;
hid_t c_memb_plist = -1;
/*
* Call H5Pget_fapl_family function.
*/
c_prp_id = (hid_t)*prp_id;
ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist);
if (ret < 0)
return ret_value;
*memb_size = (hsize_t_f)c_memb_size;
*memb_plist = (hid_t_f)c_memb_plist;
ret_value = 0;