Mercurial > octave
annotate libinterp/corefcn/ls-hdf5.cc @ 21200:fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
* builtins.h, Cell.cc, __contourc__.cc, __dispatch__.cc, __dsearchn__.cc,
__ichol__.cc, __ilu__.cc, __lin_interpn__.cc, __pchip_deriv__.cc, __qp__.cc,
balance.cc, besselj.cc, betainc.cc, bitfcns.cc, bsxfun.cc,
c-file-ptr-stream.cc, c-file-ptr-stream.h, cellfun.cc, colloc.cc,
comment-list.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc,
defaults.cc, defaults.in.h, defun-dld.h, defun.cc, defun.h, det.cc, dirfns.cc,
display.cc, dlmread.cc, dot.cc, dynamic-ld.cc, eig.cc, ellipj.cc, error.cc,
errwarn.cc, event-queue.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc,
find.cc, gammainc.cc, gcd.cc, getgrent.cc, getpwent.cc, getrusage.cc,
givens.cc, gl-render.cc, gl2ps-print.cc, graphics.cc, graphics.in.h, gripes.cc,
hash.cc, help.cc, hess.cc, hex2num.cc, input.cc, inv.cc, jit-ir.cc,
jit-typeinfo.cc, jit-util.cc, jit-util.h, kron.cc, load-path.cc, load-save.cc,
lookup.cc, ls-ascii-helper.cc, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat4.cc,
ls-mat5.cc, ls-oct-binary.cc, ls-oct-text.cc, ls-oct-text.h, ls-utils.cc,
ls-utils.h, lsode.cc, lu.cc, luinc.cc, mappers.cc, matrix_type.cc, max.cc,
mex.h, mexproto.h, mgorth.cc, nproc.cc, oct-errno.in.cc, oct-fstrm.cc,
oct-hdf5-types.cc, oct-hdf5.h, oct-hist.cc, oct-iostrm.cc, oct-lvalue.cc,
oct-map.cc, oct-prcstrm.cc, oct-procbuf.cc, oct-stream.cc, oct-strstrm.cc,
octave-link.cc, ordschur.cc, pager.cc, pinv.cc, pr-output.cc, procstream.cc,
profiler.cc, psi.cc, pt-jit.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc,
regexp.cc, schur.cc, sighandlers.cc, sparse-xdiv.cc, sparse-xpow.cc, sparse.cc,
spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc,
sylvester.cc, symtab.cc, syscalls.cc, sysdep.cc, sysdep.h, time.cc, toplev.cc,
tril.cc, tsearch.cc, txt-eng-ft.cc, txt-eng.cc, typecast.cc, urlwrite.cc,
utils.cc, variables.cc, xdiv.cc, xnorm.cc, xpow.cc, zfstream.cc,
__delaunayn__.cc, __eigs__.cc, __fltk_uigetfile__.cc, __glpk__.cc,
__init_fltk__.cc, __init_gnuplot__.cc, __magick_read__.cc, __osmesa_print__.cc,
__voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc,
colamd.cc, convhulln.cc, dmperm.cc, fftw.cc, oct-qhull.h, qr.cc, symbfact.cc,
symrcm.cc, oct-conf.in.cc, ov-base-diag.cc, ov-base-int.cc, ov-base-mat.cc,
ov-base-scalar.cc, ov-base-sparse.cc, ov-base.cc, ov-bool-mat.cc,
ov-bool-sparse.cc, ov-bool.cc, ov-builtin.cc, ov-cell.cc, ov-ch-mat.cc,
ov-class.cc, ov-classdef.cc, ov-colon.cc, ov-complex.cc, ov-cs-list.cc,
ov-cx-diag.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-dld-fcn.cc, ov-fcn-handle.cc,
ov-fcn-inline.cc, ov-fcn.cc, ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc,
ov-flt-cx-mat.cc, ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-int16.cc,
ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-java.cc, ov-lazy-idx.cc,
ov-mex-fcn.cc, ov-null-mat.cc, ov-oncleanup.cc, ov-perm.cc, ov-range.cc,
ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc,
ov-struct.cc, ov-typeinfo.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc,
ov-uint8.cc, ov-usr-fcn.cc, ov.cc, ovl.cc, octave.cc, op-b-b.cc, op-b-bm.cc,
op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc,
op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc,
op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc,
op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc,
op-dm-template.cc, op-dms-template.cc, op-double-conv.cc, op-fcdm-fcdm.cc,
op-fcdm-fdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc,
op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc,
op-fdm-fdm.cc, op-float-conv.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fm.cc,
op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc,
op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc,
op-int-conv.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc,
op-m-sm.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc,
op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc,
op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc,
op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc,
op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc,
op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc,
op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, pt-arg-list.cc,
pt-array-list.cc, pt-assign.cc, pt-binop.cc, pt-bp.cc, pt-cbinop.cc,
pt-cell.cc, pt-check.cc, pt-classdef.cc, pt-cmd.cc, pt-colon.cc, pt-colon.h,
pt-const.cc, pt-decl.cc, pt-eval.cc, pt-except.cc, pt-exp.cc, pt-fcn-handle.cc,
pt-funcall.cc, pt-id.cc, pt-idx.cc, pt-jump.cc, pt-loop.cc, pt-mat.cc,
pt-misc.cc, pt-pr-code.cc, pt-select.cc, pt-stmt.cc, pt-unop.cc, pt.cc,
token.cc, Array-jit.cc, Array-os.cc, Array-sym.cc, Array-tc.cc, version.cc:
Indent #ifdef blocks in libinterp.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 05 Feb 2016 16:29:08 -0800 |
parents | e39e05d90788 |
children | 2cf8bc5c7017 |
rev | line source |
---|---|
4634 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
18678
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
4634 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
4634 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
4634 | 20 |
21 */ | |
22 | |
23 // Author: Steven G. Johnson <stevenj@alum.mit.edu> | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
21100
diff
changeset
|
26 # include <config.h> |
4634 | 27 #endif |
28 | |
29 #if defined (HAVE_HDF5) | |
30 | |
31 #include <cfloat> | |
32 #include <cstring> | |
33 #include <cctype> | |
34 | |
35 #include <fstream> | |
36 #include <iomanip> | |
37 #include <iostream> | |
38 #include <string> | |
4726 | 39 #include <vector> |
4634 | 40 |
41 #include "byte-swap.h" | |
42 #include "data-conv.h" | |
43 #include "file-ops.h" | |
44 #include "glob-match.h" | |
45 #include "lo-mappers.h" | |
46 #include "mach-info.h" | |
47 #include "oct-env.h" | |
48 #include "oct-time.h" | |
49 #include "quit.h" | |
50 #include "str-vec.h" | |
8377
25bc2d31e1bf
improve OCTAVE_LOCAL_BUFFER
Jaroslav Hajek <highegg@gmail.com>
parents:
7336
diff
changeset
|
51 #include "oct-locbuf.h" |
4634 | 52 |
53 #include "Cell.h" | |
54 #include "defun.h" | |
55 #include "error.h" | |
21100
e39e05d90788
Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents:
21022
diff
changeset
|
56 #include "errwarn.h" |
4634 | 57 #include "load-save.h" |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
58 #include "oct-hdf5.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20449
diff
changeset
|
59 #include "ovl.h" |
4634 | 60 #include "oct-map.h" |
61 #include "ov-cell.h" | |
62 #include "pager.h" | |
63 #include "pt-exp.h" | |
64 #include "sysdep.h" | |
65 #include "unwind-prot.h" | |
66 #include "utils.h" | |
67 #include "variables.h" | |
68 #include "version.h" | |
69 #include "dMatrix.h" | |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
10315
diff
changeset
|
70 #include "ov-lazy-idx.h" |
4634 | 71 |
72 #include "ls-utils.h" | |
73 #include "ls-hdf5.h" | |
74 | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
75 hdf5_fstreambase::hdf5_fstreambase (const char *name, int mode, int /* prot */) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
76 : file_id (-1), current_item (-1) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
77 { |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
78 if (mode & std::ios::in) |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
79 file_id = H5Fopen (name, H5F_ACC_RDONLY, octave_H5P_DEFAULT); |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
80 else if (mode & std::ios::out) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
81 { |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
82 if (mode & std::ios::app && H5Fis_hdf5 (name) > 0) |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
83 file_id = H5Fopen (name, H5F_ACC_RDWR, octave_H5P_DEFAULT); |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
84 else |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
85 file_id = H5Fcreate (name, H5F_ACC_TRUNC, octave_H5P_DEFAULT, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
86 octave_H5P_DEFAULT); |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
87 } |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
88 if (file_id < 0) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
89 std::ios::setstate (std::ios::badbit); |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
90 |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
91 current_item = 0; |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
92 } |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
93 |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
94 void |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
95 hdf5_fstreambase::close (void) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
96 { |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
97 if (file_id >= 0) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
98 { |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
99 if (H5Fclose (file_id) < 0) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
100 std::ios::setstate (std::ios::badbit); |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
101 file_id = -1; |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
102 } |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
103 } |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
104 |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
105 void |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
106 hdf5_fstreambase::open (const char *name, int mode, int) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
107 { |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
108 clear (); |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
109 |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
110 if (mode & std::ios::in) |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
111 file_id = H5Fopen (name, H5F_ACC_RDONLY, octave_H5P_DEFAULT); |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
112 else if (mode & std::ios::out) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
113 { |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
114 if (mode & std::ios::app && H5Fis_hdf5 (name) > 0) |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
115 file_id = H5Fopen (name, H5F_ACC_RDWR, octave_H5P_DEFAULT); |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
116 else |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
117 file_id = H5Fcreate (name, H5F_ACC_TRUNC, octave_H5P_DEFAULT, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
118 octave_H5P_DEFAULT); |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
119 } |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
120 if (file_id < 0) |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
121 std::ios::setstate (std::ios::badbit); |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
122 |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
123 current_item = 0; |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
124 } |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
125 |
4634 | 126 static std::string |
127 make_valid_identifier (const std::string& nm) | |
128 { | |
129 std::string retval; | |
130 | |
131 size_t nm_len = nm.length (); | |
132 | |
133 if (nm_len > 0) | |
134 { | |
135 if (! isalpha (nm[0])) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
136 retval += '_'; |
4634 | 137 |
138 for (size_t i = 0; i < nm_len; i++) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
139 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
140 char c = nm[i]; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
141 retval += (isalnum (c) || c == '_') ? c : '_'; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
142 } |
4634 | 143 } |
144 | |
145 return retval; | |
146 } | |
147 | |
148 // Define this to 1 if/when HDF5 supports automatic conversion between | |
149 // integer and floating-point binary data: | |
150 #define HAVE_HDF5_INT2FLOAT_CONVERSIONS 0 | |
151 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
152 // Given two compound types t1 and t2, determine whether they |
4634 | 153 // are compatible for reading/writing. This function only |
154 // works for non-nested types composed of simple elements (ints, floats...), | |
155 // which is all we need it for | |
156 | |
157 bool | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
158 hdf5_types_compatible (octave_hdf5_id t1, octave_hdf5_id t2) |
4634 | 159 { |
160 int n; | |
161 if ((n = H5Tget_nmembers (t1)) != H5Tget_nmembers (t2)) | |
162 return false; | |
163 | |
164 for (int i = 0; i < n; ++i) | |
165 { | |
166 hid_t mt1 = H5Tget_member_type (t1, i); | |
167 hid_t mt2 = H5Tget_member_type (t2, i); | |
168 | |
169 if (H5Tget_class (mt1) != H5Tget_class (mt2)) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
170 return false; |
4634 | 171 |
172 H5Tclose (mt2); | |
173 H5Tclose (mt1); | |
174 } | |
175 | |
176 return true; | |
177 } | |
178 | |
179 // Return true if loc_id has the attribute named attr_name, and false | |
180 // otherwise. | |
181 | |
182 bool | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
183 hdf5_check_attr (octave_hdf5_id loc_id, const char *attr_name) |
4634 | 184 { |
185 bool retval = false; | |
186 | |
187 // we have to pull some shenanigans here to make sure | |
188 // HDF5 doesn't print out all sorts of error messages if we | |
189 // call H5Aopen for a non-existing attribute | |
190 | |
191 H5E_auto_t err_func; | |
192 void *err_func_data; | |
193 | |
194 // turn off error reporting temporarily, but save the error | |
195 // reporting function: | |
196 | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
197 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
198 H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
199 H5Eset_auto (octave_H5E_DEFAULT, 0, 0); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
200 #else |
4634 | 201 H5Eget_auto (&err_func, &err_func_data); |
202 H5Eset_auto (0, 0); | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
203 #endif |
4634 | 204 |
205 hid_t attr_id = H5Aopen_name (loc_id, attr_name); | |
206 | |
207 if (attr_id >= 0) | |
208 { | |
209 // successful | |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
210 retval = true; |
4634 | 211 H5Aclose (attr_id); |
212 } | |
213 | |
214 // restore error reporting: | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
215 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
216 H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
217 #else |
4634 | 218 H5Eset_auto (err_func, err_func_data); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
219 #endif |
4634 | 220 return retval; |
221 } | |
222 | |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
223 bool |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
224 hdf5_get_scalar_attr (octave_hdf5_id loc_id, octave_hdf5_id type_id, |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
225 const char *attr_name, void *buf) |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
226 { |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
227 bool retval = false; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
228 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
229 // we have to pull some shenanigans here to make sure |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
230 // HDF5 doesn't print out all sorts of error messages if we |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
231 // call H5Aopen for a non-existing attribute |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
232 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
233 H5E_auto_t err_func; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
234 void *err_func_data; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
235 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
236 // turn off error reporting temporarily, but save the error |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
237 // reporting function: |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
238 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
239 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
240 H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
241 H5Eset_auto (octave_H5E_DEFAULT, 0, 0); |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
242 #else |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
243 H5Eget_auto (&err_func, &err_func_data); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
244 H5Eset_auto (0, 0); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
245 #endif |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
246 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
247 hid_t attr_id = H5Aopen_name (loc_id, attr_name); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
248 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
249 if (attr_id >= 0) |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
250 { |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
251 hid_t space_id = H5Aget_space (attr_id); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
252 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
253 hsize_t rank = H5Sget_simple_extent_ndims (space_id); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
254 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
255 if (rank == 0) |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
256 retval = H5Aread (attr_id, type_id, buf) >= 0; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
257 H5Aclose (attr_id); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
258 } |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
259 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
260 // restore error reporting: |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
261 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
262 H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
263 #else |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
264 H5Eset_auto (err_func, err_func_data); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
265 #endif |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
266 return retval; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
267 } |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
268 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
269 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
270 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
271 |
4687 | 272 // The following subroutines creates an HDF5 representations of the way |
273 // we will store Octave complex types (pairs of floating-point numbers). | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
274 // NUM_TYPE is the HDF5 numeric type to use for storage (e.g. |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
275 // H5T_NATIVE_DOUBLE to save as 'double'). Note that any necessary |
4687 | 276 // conversions are handled automatically by HDF5. |
4634 | 277 |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
278 octave_hdf5_id |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
279 hdf5_make_complex_type (octave_hdf5_id num_type) |
4634 | 280 { |
281 hid_t type_id = H5Tcreate (H5T_COMPOUND, sizeof (double) * 2); | |
282 | |
283 H5Tinsert (type_id, "real", 0 * sizeof (double), num_type); | |
284 H5Tinsert (type_id, "imag", 1 * sizeof (double), num_type); | |
285 | |
286 return type_id; | |
287 } | |
288 | |
289 // This function is designed to be passed to H5Giterate, which calls it | |
290 // on each data item in an HDF5 file. For the item whose name is NAME in | |
291 // the group GROUP_ID, this function sets dv->tc to an Octave representation | |
292 // of that item. (dv must be a pointer to hdf5_callback_data.) (It also | |
293 // sets the other fields of dv). | |
294 // | |
295 // It returns 1 on success (in which case H5Giterate stops and returns), | |
296 // -1 on error, and 0 to tell H5Giterate to continue on to the next item | |
297 // (e.g. if NAME was a data type we don't recognize). | |
298 | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
299 octave_hdf5_err |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
300 hdf5_read_next_data (octave_hdf5_id group_id, const char *name, void *dv) |
4634 | 301 { |
19739
3fa35defe495
Adjust spacing of static_cast<> calls to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
302 hdf5_callback_data *d = static_cast<hdf5_callback_data *> (dv); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
303 hid_t type_id = -1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
304 hid_t type_class_id = -1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
305 hid_t data_id = -1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
306 hid_t subgroup_id = -1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
307 hid_t space_id = -1;; |
4634 | 308 |
309 H5G_stat_t info; | |
310 herr_t retval = 0; | |
311 bool ident_valid = valid_identifier (name); | |
312 | |
313 std::string vname = name; | |
314 | |
315 // Allow identifiers as all digits so we can load lists saved by | |
316 // earlier versions of Octave. | |
317 | |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
18676
diff
changeset
|
318 if (! ident_valid) |
4634 | 319 { |
320 // fix the identifier, replacing invalid chars with underscores | |
321 vname = make_valid_identifier (vname); | |
322 | |
323 // check again (in case vname was null, empty, or some such thing): | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
324 ident_valid = valid_identifier (vname); |
4634 | 325 } |
326 | |
327 H5Gget_objinfo (group_id, name, 1, &info); | |
328 | |
4687 | 329 if (info.type == H5G_GROUP && ident_valid) |
4634 | 330 { |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
331 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
332 subgroup_id = H5Gopen (group_id, name, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
333 #else |
4687 | 334 subgroup_id = H5Gopen (group_id, name); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
335 #endif |
4634 | 336 |
337 if (subgroup_id < 0) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
338 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
339 retval = subgroup_id; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
340 goto done; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
341 } |
4634 | 342 |
4687 | 343 if (hdf5_check_attr (subgroup_id, "OCTAVE_NEW_FORMAT")) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
344 { |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
345 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
346 data_id = H5Dopen (subgroup_id, "type", octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
347 #else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
348 data_id = H5Dopen (subgroup_id, "type"); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
349 #endif |
4634 | 350 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
351 if (data_id < 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
352 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
353 retval = data_id; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
354 goto done; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
355 } |
4634 | 356 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
357 type_id = H5Dget_type (data_id); |
4687 | 358 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
359 type_class_id = H5Tget_class (type_id); |
4687 | 360 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
361 if (type_class_id != H5T_STRING) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
362 goto done; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
363 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
364 space_id = H5Dget_space (data_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
365 hsize_t rank = H5Sget_simple_extent_ndims (space_id); |
4687 | 366 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
367 if (rank != 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
368 goto done; |
4687 | 369 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
370 int slen = H5Tget_size (type_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
371 if (slen < 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
372 goto done; |
4687 | 373 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
374 OCTAVE_LOCAL_BUFFER (char, typ, slen); |
4687 | 375 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
376 // create datatype for (null-terminated) string to read into: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
377 hid_t st_id = H5Tcopy (H5T_C_S1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
378 H5Tset_size (st_id, slen); |
4687 | 379 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
380 if (H5Dread (data_id, st_id, octave_H5S_ALL, octave_H5S_ALL, octave_H5P_DEFAULT, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
381 typ) < 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
382 goto done; |
4687 | 383 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
384 H5Tclose (st_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
385 H5Dclose (data_id); |
4687 | 386 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
387 d->tc = octave_value_typeinfo::lookup_type (typ); |
4687 | 388 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
389 retval = (d->tc.load_hdf5 (subgroup_id, "value") ? 1 : -1); |
4687 | 390 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
391 // check for OCTAVE_GLOBAL attribute: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
392 d->global = hdf5_check_attr (subgroup_id, "OCTAVE_GLOBAL"); |
4687 | 393 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
394 H5Gclose (subgroup_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
395 } |
4634 | 396 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
397 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
398 // an HDF5 group is treated as an octave structure by |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
399 // default (since that preserves name information), and an |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
400 // octave list otherwise. |
4687 | 401 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
402 if (hdf5_check_attr (subgroup_id, "OCTAVE_LIST")) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
403 d->tc = octave_value_typeinfo::lookup_type ("list"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
404 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
405 d->tc = octave_value_typeinfo::lookup_type ("struct"); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
406 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
407 // check for OCTAVE_GLOBAL attribute: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
408 d->global = hdf5_check_attr (subgroup_id, "OCTAVE_GLOBAL"); |
4687 | 409 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
410 H5Gclose (subgroup_id); |
4634 | 411 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
412 retval = (d->tc.load_hdf5 (group_id, name) ? 1 : -1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
413 } |
4687 | 414 |
415 } | |
416 else if (info.type == H5G_DATASET && ident_valid) | |
417 { | |
20449
df4165dfc676
maint: Fix misspelled word compatibility in code comments.
Rik <rik@octave.org>
parents:
20264
diff
changeset
|
418 // For backwards compatibility. |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
419 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
420 data_id = H5Dopen (group_id, name, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
421 #else |
4687 | 422 data_id = H5Dopen (group_id, name); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
423 #endif |
4687 | 424 |
425 if (data_id < 0) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
426 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
427 retval = data_id; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
428 goto done; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
429 } |
4634 | 430 |
4687 | 431 type_id = H5Dget_type (data_id); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
432 |
4687 | 433 type_class_id = H5Tget_class (type_id); |
434 | |
435 if (type_class_id == H5T_FLOAT) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
436 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
437 space_id = H5Dget_space (data_id); |
4687 | 438 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
439 hsize_t rank = H5Sget_simple_extent_ndims (space_id); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
440 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
441 if (rank == 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
442 d->tc = octave_value_typeinfo::lookup_type ("scalar"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
443 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
444 d->tc = octave_value_typeinfo::lookup_type ("matrix"); |
4687 | 445 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
446 H5Sclose (space_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
447 } |
4948 | 448 else if (type_class_id == H5T_INTEGER) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
449 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
450 // What integer type do we really have.. |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
451 std::string int_typ; |
4948 | 452 #ifdef HAVE_H5T_GET_NATIVE_TYPE |
17861
870f3e12e163
maint: Use phrase "FIXME:" for problem areas in code.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
453 // FIXME: test this code and activated with an autoconf |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
454 // test!! It is also incorrect for 64-bit indexing!! |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
455 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
456 switch (H5Tget_native_type (type_id, H5T_DIR_ASCEND)) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
457 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
458 case H5T_NATIVE_CHAR: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
459 int_typ = "int8 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
460 break; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
461 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
462 case H5T_NATIVE_SHORT: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
463 int_typ = "int16 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
464 break; |
4948 | 465 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
466 case H5T_NATIVE_INT: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
467 case H5T_NATIVE_LONG: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
468 int_typ = "int32 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
469 break; |
4948 | 470 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
471 case H5T_NATIVE_LLONG: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
472 int_typ = "int64 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
473 break; |
4948 | 474 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
475 case H5T_NATIVE_UCHAR: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
476 int_typ = "uint8 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
477 break; |
4948 | 478 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
479 case H5T_NATIVE_USHORT: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
480 int_typ = "uint16 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
481 break; |
4948 | 482 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
483 case H5T_NATIVE_UINT: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
484 case H5T_NATIVE_ULONG: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
485 int_typ = "uint32 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
486 break; |
4948 | 487 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
488 case H5T_NATIVE_ULLONG: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
489 int_typ = "uint64 "; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
490 break; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
491 } |
4948 | 492 #else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
493 hid_t int_sign = H5Tget_sign (type_id); |
4948 | 494 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
495 if (int_sign == H5T_SGN_ERROR) |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
496 warning ("load: can't read '%s' (unknown datatype)", name); |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
497 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
498 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
499 if (int_sign == H5T_SGN_NONE) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
500 int_typ.append ("u"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
501 int_typ.append ("int"); |
4948 | 502 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
503 int slen = H5Tget_size (type_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
504 if (slen < 0) |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
505 warning ("load: can't read '%s' (unknown datatype)", name); |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
506 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
507 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
508 switch (slen) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
509 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
510 case 1: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
511 int_typ.append ("8 "); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
512 break; |
4948 | 513 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
514 case 2: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
515 int_typ.append ("16 "); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
516 break; |
4948 | 517 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
518 case 4: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
519 int_typ.append ("32 "); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
520 break; |
4948 | 521 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
522 case 8: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
523 int_typ.append ("64 "); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
524 break; |
4948 | 525 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
526 default: |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
527 warning ("load: can't read '%s' (unknown datatype)", |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
528 name); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
529 int_typ = ""; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
530 break; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
531 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
532 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
533 } |
4948 | 534 #endif |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
535 if (int_typ == "") |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
536 warning ("load: can't read '%s' (unknown datatype)", name); |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
537 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
538 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
539 // Matrix or scalar? |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
540 space_id = H5Dget_space (data_id); |
4948 | 541 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
542 hsize_t rank = H5Sget_simple_extent_ndims (space_id); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
543 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
544 if (rank == 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
545 int_typ.append ("scalar"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
546 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
547 int_typ.append ("matrix"); |
4948 | 548 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
549 d->tc = octave_value_typeinfo::lookup_type (int_typ); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
550 H5Sclose (space_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
551 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
552 } |
4687 | 553 else if (type_class_id == H5T_STRING) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
554 d->tc = octave_value_typeinfo::lookup_type ("string"); |
4687 | 555 else if (type_class_id == H5T_COMPOUND) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
556 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
557 hid_t complex_type = hdf5_make_complex_type (H5T_NATIVE_DOUBLE); |
4687 | 558 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
559 if (hdf5_types_compatible (type_id, complex_type)) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
560 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
561 // read complex matrix or scalar variable |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
562 space_id = H5Dget_space (data_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
563 hsize_t rank = H5Sget_simple_extent_ndims (space_id); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
564 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
565 if (rank == 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
566 d->tc = octave_value_typeinfo::lookup_type ("complex scalar"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
567 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
568 d->tc = octave_value_typeinfo::lookup_type ("complex matrix"); |
4687 | 569 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
570 H5Sclose (space_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
571 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
572 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
573 // Assume that if its not complex its a range. If its not |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
574 // it'll be rejected later in the range code |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
575 d->tc = octave_value_typeinfo::lookup_type ("range"); |
4687 | 576 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
577 H5Tclose (complex_type); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
578 } |
4687 | 579 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
580 { |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
581 warning ("load: can't read '%s' (unknown datatype)", name); |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
582 retval = 0; // unknown datatype; skip |
18676
5bd1ca29c5f0
Clean up questionable code bits identified by clang sanitize.
Rik <rik@octave.org>
parents:
18100
diff
changeset
|
583 return retval; |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
584 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
585 |
4687 | 586 // check for OCTAVE_GLOBAL attribute: |
587 d->global = hdf5_check_attr (data_id, "OCTAVE_GLOBAL"); | |
588 | |
589 H5Tclose (type_id); | |
590 H5Dclose (data_id); | |
591 | |
9881
b3089dba88bf
Remove HDF5 cruft for older versions of HDF5
Kacper Kowalik
parents:
8920
diff
changeset
|
592 retval = (d->tc.load_hdf5 (group_id, name) ? 1 : -1); |
4634 | 593 } |
4687 | 594 |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
595 if (! ident_valid) |
4634 | 596 { |
597 // should we attempt to handle invalid identifiers by converting | |
598 // bad characters to '_', say? | |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
599 warning ("load: skipping invalid identifier '%s' in hdf5 file", |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
600 name); |
4634 | 601 } |
602 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
603 done: |
4634 | 604 if (retval < 0) |
605 error ("load: error while reading hdf5 item %s", name); | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
606 |
4634 | 607 if (retval > 0) |
608 { | |
609 // get documentation string, if any: | |
610 int comment_length = H5Gget_comment (group_id, name, 0, 0); | |
611 | |
612 if (comment_length > 1) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
613 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
614 OCTAVE_LOCAL_BUFFER (char, tdoc, comment_length); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
615 H5Gget_comment (group_id, name, comment_length, tdoc); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
616 d->doc = tdoc; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
617 } |
4634 | 618 else if (vname != name) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
619 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
620 // the name was changed; store the original name |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
621 // as the documentation string: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
622 d->doc = name; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
623 } |
4634 | 624 |
625 // copy name (actually, vname): | |
626 d->name = vname; | |
627 } | |
628 | |
629 return retval; | |
630 } | |
631 | |
632 // Read the next Octave variable from the stream IS, which must really be | |
633 // an hdf5_ifstream. Return the variable value in tc, its doc string | |
634 // in doc, and whether it is global in global. The return value is | |
635 // the name of the variable, or NULL if none were found or there was | |
4687 | 636 // and error. |
4634 | 637 std::string |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
638 read_hdf5_data (std::istream& is, const std::string& /* filename */, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
639 bool& global, octave_value& tc, std::string& doc, |
17709
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
640 const string_vector& argv, int argv_idx, int argc) |
4634 | 641 { |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
642 check_hdf5_types (); |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19739
diff
changeset
|
643 |
4634 | 644 std::string retval; |
645 | |
646 doc.resize (0); | |
647 | |
5760 | 648 hdf5_ifstream& hs = dynamic_cast<hdf5_ifstream&> (is); |
4634 | 649 hdf5_callback_data d; |
650 | |
4696 | 651 herr_t H5Giterate_retval = -1; |
652 | |
653 hsize_t num_obj = 0; | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
654 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
655 hid_t group_id = H5Gopen (hs.file_id, "/", octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
656 #else |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
657 hid_t group_id = H5Gopen (hs.file_id, "/"); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
658 #endif |
5060 | 659 H5Gget_num_objs (group_id, &num_obj); |
660 H5Gclose (group_id); | |
17709
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
661 |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
662 // For large datasets and out-of-core functionality, |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
663 // check if only parts of the data is requested |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
664 bool load_named_vars = argv_idx < argc; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
665 while (load_named_vars && hs.current_item < static_cast<int> (num_obj)) |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
666 { |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
667 std::vector<char> var_name; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
668 bool found = false; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
669 size_t len = 0; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
670 |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
671 len = H5Gget_objname_by_idx (hs.file_id, hs.current_item, 0, 0); |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
672 var_name.resize (len+1); |
18678
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
18676
diff
changeset
|
673 H5Gget_objname_by_idx (hs.file_id, hs.current_item, &var_name[0], len+1); |
17709
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
674 |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
675 for (int i = argv_idx; i < argc; i++) |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
676 { |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
677 glob_match pattern (argv[i]); |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
678 if (pattern.match (std::string (&var_name[0]))) |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
679 { |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
680 found = true; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
681 break; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
682 } |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
683 } |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
684 |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
685 if (found) |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
686 break; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
687 |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
688 hs.current_item++; |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
689 } |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
690 |
5415a9cd61d4
Implement faster partial loading of HDF5 files.
Rik <rik@octave.org>
parents:
16892
diff
changeset
|
691 |
4696 | 692 if (hs.current_item < static_cast<int> (num_obj)) |
693 H5Giterate_retval = H5Giterate (hs.file_id, "/", &hs.current_item, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
694 hdf5_read_next_data, &d); |
4634 | 695 |
696 if (H5Giterate_retval > 0) | |
697 { | |
698 global = d.global; | |
699 tc = d.tc; | |
700 doc = d.doc; | |
701 } | |
702 else | |
703 { | |
704 // an error occurred (H5Giterate_retval < 0) or there are no | |
705 // more datasets print an error message if retval < 0? | |
706 // hdf5_read_next_data already printed one, probably. | |
707 } | |
708 | |
709 if (! d.name.empty ()) | |
710 retval = d.name; | |
711 | |
712 return retval; | |
713 } | |
714 | |
715 // Add an attribute named attr_name to loc_id (a simple scalar | |
716 // attribute with value 1). Return value is >= 0 on success. | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
717 octave_hdf5_err |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
718 hdf5_add_attr (octave_hdf5_id loc_id, const char *attr_name) |
4634 | 719 { |
720 herr_t retval = 0; | |
721 | |
722 hid_t as_id = H5Screate (H5S_SCALAR); | |
723 | |
724 if (as_id >= 0) | |
725 { | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
726 #if HAVE_HDF5_18 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
727 hid_t a_id = H5Acreate (loc_id, attr_name, H5T_NATIVE_UCHAR, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
728 as_id, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
729 #else |
4634 | 730 hid_t a_id = H5Acreate (loc_id, attr_name, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
731 H5T_NATIVE_UCHAR, as_id, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
732 #endif |
4634 | 733 if (a_id >= 0) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
734 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
735 unsigned char attr_val = 1; |
4634 | 736 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
737 retval = H5Awrite (a_id, H5T_NATIVE_UCHAR, &attr_val); |
4634 | 738 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
739 H5Aclose (a_id); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
740 } |
4634 | 741 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
742 retval = a_id; |
4634 | 743 |
744 H5Sclose (as_id); | |
745 } | |
746 else | |
747 retval = as_id; | |
748 | |
749 return retval; | |
750 } | |
751 | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
752 octave_hdf5_err |
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
753 hdf5_add_scalar_attr (octave_hdf5_id loc_id, octave_hdf5_id type_id, |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
754 const char *attr_name, void *buf) |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
755 { |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
756 herr_t retval = 0; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
757 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
758 hid_t as_id = H5Screate (H5S_SCALAR); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
759 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
760 if (as_id >= 0) |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
761 { |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
762 #if HAVE_HDF5_18 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
763 hid_t a_id = H5Acreate (loc_id, attr_name, type_id, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
764 as_id, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
765 #else |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
766 hid_t a_id = H5Acreate (loc_id, attr_name, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
767 type_id, as_id, octave_H5P_DEFAULT); |
11176
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
768 #endif |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
769 if (a_id >= 0) |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
770 { |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
771 retval = H5Awrite (a_id, type_id, buf); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
772 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
773 H5Aclose (a_id); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
774 } |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
775 else |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
776 retval = a_id; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
777 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
778 H5Sclose (as_id); |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
779 } |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
780 else |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
781 retval = as_id; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
782 |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
783 return retval; |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
784 } |
2271261f088a
Address precision issue in ranges saved to HDF5 files
David Bateman <dbateman@free.fr>
parents:
10325
diff
changeset
|
785 |
4805 | 786 // Save an empty matrix, if needed. Returns |
787 // > 0 Saved empty matrix | |
788 // = 0 Not an empty matrix; did nothing | |
789 // < 0 Error condition | |
790 int | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
791 save_hdf5_empty (octave_hdf5_id loc_id, const char *name, const dim_vector d) |
4805 | 792 { |
793 hsize_t sz = d.length (); | |
6276 | 794 OCTAVE_LOCAL_BUFFER (octave_idx_type, dims, sz); |
4805 | 795 bool empty = false; |
18100
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17861
diff
changeset
|
796 hid_t space_hid = -1; |
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17861
diff
changeset
|
797 hid_t data_hid = -1; |
4805 | 798 int retval; |
799 for (hsize_t i = 0; i < sz; i++) | |
800 { | |
801 dims[i] = d(i); | |
802 if (dims[i] < 1) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
803 empty = true; |
4805 | 804 } |
805 | |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
806 if (! empty) |
4805 | 807 return 0; |
808 | |
5760 | 809 space_hid = H5Screate_simple (1, &sz, 0); |
4805 | 810 if (space_hid < 0) return space_hid; |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
811 #if HAVE_HDF5_18 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
812 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_IDX, space_hid, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
813 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
814 #else |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
815 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_IDX, space_hid, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
816 octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
817 #endif |
4805 | 818 if (data_hid < 0) |
819 { | |
820 H5Sclose (space_hid); | |
821 return data_hid; | |
822 } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
823 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
824 retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
825 octave_H5P_DEFAULT, dims) >= 0; |
4805 | 826 |
827 H5Dclose (data_hid); | |
828 H5Sclose (space_hid); | |
829 | |
830 if (retval >= 0) | |
831 retval = hdf5_add_attr (loc_id, "OCTAVE_EMPTY_MATRIX"); | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
832 |
4805 | 833 return (retval == 0 ? 1 : retval); |
834 } | |
835 | |
836 // Load an empty matrix, if needed. Returns | |
837 // > 0 loaded empty matrix, dimensions returned | |
838 // = 0 Not an empty matrix; did nothing | |
839 // < 0 Error condition | |
840 int | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
841 load_hdf5_empty (octave_hdf5_id loc_id, const char *name, dim_vector &d) |
4805 | 842 { |
14861
f7afecdd87ef
maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
843 if (! hdf5_check_attr (loc_id, "OCTAVE_EMPTY_MATRIX")) |
4805 | 844 return 0; |
845 | |
846 hsize_t hdims, maxdims; | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
847 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
848 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
849 #else |
4805 | 850 hid_t data_hid = H5Dopen (loc_id, name); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
851 #endif |
4805 | 852 hid_t space_id = H5Dget_space (data_hid); |
853 H5Sget_simple_extent_dims (space_id, &hdims, &maxdims); | |
854 int retval; | |
855 | |
5351 | 856 OCTAVE_LOCAL_BUFFER (octave_idx_type, dims, hdims); |
857 | |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
858 retval = H5Dread (data_hid, H5T_NATIVE_IDX, octave_H5S_ALL, octave_H5S_ALL, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
859 octave_H5P_DEFAULT, dims); |
4805 | 860 if (retval >= 0) |
861 { | |
862 d.resize (hdims); | |
863 for (hsize_t i = 0; i < hdims; i++) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
864 d(i) = dims[i]; |
4805 | 865 } |
866 | |
867 H5Sclose (space_id); | |
868 H5Dclose (data_hid); | |
869 | |
870 return (retval == 0 ? hdims : retval); | |
871 } | |
872 | |
4634 | 873 // save_type_to_hdf5 is not currently used, since hdf5 doesn't yet support |
874 // automatic float<->integer conversions: | |
875 | |
876 #if HAVE_HDF5_INT2FLOAT_CONVERSIONS | |
877 | |
878 // return the HDF5 type id corresponding to the Octave save_type | |
879 | |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
880 octave_hdf5_id |
4634 | 881 save_type_to_hdf5 (save_type st) |
882 { | |
883 switch (st) | |
884 { | |
885 case LS_U_CHAR: | |
886 return H5T_NATIVE_UCHAR; | |
887 | |
888 case LS_U_SHORT: | |
889 return H5T_NATIVE_USHORT; | |
890 | |
891 case LS_U_INT: | |
892 return H5T_NATIVE_UINT; | |
893 | |
894 case LS_CHAR: | |
895 return H5T_NATIVE_CHAR; | |
896 | |
897 case LS_SHORT: | |
898 return H5T_NATIVE_SHORT; | |
899 | |
900 case LS_INT: | |
901 return H5T_NATIVE_INT; | |
902 | |
903 case LS_FLOAT: | |
904 return H5T_NATIVE_FLOAT; | |
905 | |
906 case LS_DOUBLE: | |
907 default: | |
908 return H5T_NATIVE_DOUBLE; | |
909 } | |
910 } | |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
20940
diff
changeset
|
911 #endif |
4634 | 912 |
913 // Add the data from TC to the HDF5 location loc_id, which could | |
914 // be either a file or a group within a file. Return true if | |
915 // successful. This function calls itself recursively for lists | |
916 // (stored as HDF5 groups). | |
917 | |
4687 | 918 bool |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
919 add_hdf5_data (octave_hdf5_id loc_id, const octave_value& tc, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
920 const std::string& name, const std::string& doc, |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
921 bool mark_as_global, bool save_as_floats) |
4634 | 922 { |
923 hsize_t dims[3]; | |
18100
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17861
diff
changeset
|
924 hid_t type_id, space_id, data_id, data_type_id; |
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17861
diff
changeset
|
925 type_id = space_id = data_id = data_type_id = -1; |
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17861
diff
changeset
|
926 |
4687 | 927 bool retval = false; |
928 octave_value val = tc; | |
8401
712cfdc2e417
allow saving diagonal & permutation matrices to hdf5 as full
Jaroslav Hajek <highegg@gmail.com>
parents:
8377
diff
changeset
|
929 // FIXME: diagonal & permutation matrices currently don't know how to save |
712cfdc2e417
allow saving diagonal & permutation matrices to hdf5 as full
Jaroslav Hajek <highegg@gmail.com>
parents:
8377
diff
changeset
|
930 // themselves, so we convert them first to normal matrices using A = A(:,:). |
712cfdc2e417
allow saving diagonal & permutation matrices to hdf5 as full
Jaroslav Hajek <highegg@gmail.com>
parents:
8377
diff
changeset
|
931 // This is a temporary hack. |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
932 if (val.is_diag_matrix () || val.is_perm_matrix () |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
10315
diff
changeset
|
933 || val.type_id () == octave_lazy_index::static_type_id ()) |
8914
354179c24c79
fix hdf5 saving of diag & perm matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
934 val = val.full_value (); |
8401
712cfdc2e417
allow saving diagonal & permutation matrices to hdf5 as full
Jaroslav Hajek <highegg@gmail.com>
parents:
8377
diff
changeset
|
935 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
936 std::string t = val.type_name (); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
937 #if HAVE_HDF5_18 |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
938 data_id = H5Gcreate (loc_id, name.c_str (), octave_H5P_DEFAULT, octave_H5P_DEFAULT, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
939 octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
940 #else |
4687 | 941 data_id = H5Gcreate (loc_id, name.c_str (), 0); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
942 #endif |
4687 | 943 if (data_id < 0) |
944 goto error_cleanup; | |
4634 | 945 |
4687 | 946 // attach the type of the variable |
947 type_id = H5Tcopy (H5T_C_S1); H5Tset_size (type_id, t.length () + 1); | |
948 if (type_id < 0) | |
949 goto error_cleanup; | |
4634 | 950 |
4687 | 951 dims[0] = 0; |
5760 | 952 space_id = H5Screate_simple (0 , dims, 0); |
4687 | 953 if (space_id < 0) |
954 goto error_cleanup; | |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
955 #if HAVE_HDF5_18 |
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
956 data_type_id = H5Dcreate (data_id, "type", type_id, space_id, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
957 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
958 #else |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
959 data_type_id = H5Dcreate (data_id, "type", type_id, space_id, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
960 #endif |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
961 if (data_type_id < 0 || H5Dwrite (data_type_id, type_id, octave_H5S_ALL, octave_H5S_ALL, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20955
diff
changeset
|
962 octave_H5P_DEFAULT, t.c_str ()) < 0) |
4687 | 963 goto error_cleanup; |
4634 | 964 |
4687 | 965 // Now call the real function to save the variable |
966 retval = val.save_hdf5 (data_id, "value", save_as_floats); | |
4634 | 967 |
968 // attach doc string as comment: | |
4687 | 969 if (retval && doc.length () > 0 |
4634 | 970 && H5Gset_comment (loc_id, name.c_str (), doc.c_str ()) < 0) |
4687 | 971 retval = false; |
4634 | 972 |
973 // if it's global, add an attribute "OCTAVE_GLOBAL" with value 1 | |
4687 | 974 if (retval && mark_as_global) |
4634 | 975 retval = hdf5_add_attr (data_id, "OCTAVE_GLOBAL") >= 0; |
976 | |
4687 | 977 // We are saving in the new variable format, so mark it |
978 if (retval) | |
979 retval = hdf5_add_attr (data_id, "OCTAVE_NEW_FORMAT") >= 0; | |
980 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
981 error_cleanup: |
4634 | 982 |
4687 | 983 if (data_type_id >= 0) |
984 H5Dclose (data_type_id); | |
4634 | 985 |
4687 | 986 if (type_id >= 0) |
987 H5Tclose (type_id); | |
4634 | 988 |
989 if (space_id >= 0) | |
990 H5Sclose (space_id); | |
991 | |
4687 | 992 if (data_id >= 0) |
993 H5Gclose (data_id); | |
994 | |
995 if (! retval) | |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
996 error ("save: error while writing '%s' to hdf5 file", name.c_str ()); |
4634 | 997 |
998 return retval; | |
999 } | |
1000 | |
1001 // Write data from TC in HDF5 (binary) format to the stream OS, | |
1002 // which must be an hdf5_ofstream, returning true on success. | |
1003 | |
1004 bool | |
1005 save_hdf5_data (std::ostream& os, const octave_value& tc, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
1006 const std::string& name, const std::string& doc, |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
1007 bool mark_as_global, bool save_as_floats) |
4634 | 1008 { |
20264
bfe66db8addb
don't include hdf5.h or use HDF5 typedefs in public header files (bug #43180)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
1009 check_hdf5_types (); |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19739
diff
changeset
|
1010 |
5760 | 1011 hdf5_ofstream& hs = dynamic_cast<hdf5_ofstream&> (os); |
4634 | 1012 |
1013 return add_hdf5_data (hs.file_id, tc, name, doc, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
1014 mark_as_global, save_as_floats); |
4634 | 1015 } |
1016 | |
1017 #endif |