2882
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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 |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
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 |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
4192
|
23 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
2882
|
24 #pragma implementation |
|
25 #endif |
|
26 |
|
27 #ifdef HAVE_CONFIG_H |
|
28 #include <config.h> |
|
29 #endif |
|
30 |
3503
|
31 #include <iostream> |
2882
|
32 |
4051
|
33 #include "lo-sstream.h" |
2882
|
34 #include "lo-utils.h" |
|
35 |
4513
|
36 #include "Cell.h" |
2882
|
37 #include "defun.h" |
|
38 #include "error.h" |
4994
|
39 #include "ov.h" |
2882
|
40 #include "ov-list.h" |
|
41 #include "unwind-prot.h" |
|
42 |
4687
|
43 #include "byte-swap.h" |
|
44 #include "ls-oct-ascii.h" |
|
45 #include "ls-oct-binary.h" |
|
46 #include "ls-hdf5.h" |
|
47 #include "ls-utils.h" |
|
48 |
3219
|
49 DEFINE_OCTAVE_ALLOCATOR (octave_list); |
2882
|
50 |
4612
|
51 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_list, "list", "list"); |
2882
|
52 |
4513
|
53 octave_list::octave_list (const Cell& c) |
4591
|
54 : octave_base_value (), data () |
4513
|
55 { |
|
56 int n = c.length (); |
|
57 |
4591
|
58 data.resize (dim_vector (1, n)); |
4513
|
59 |
|
60 for (int i = 0; i < n; i++) |
4591
|
61 data(i) = c(i); |
4513
|
62 } |
|
63 |
4994
|
64 octave_value_list |
4247
|
65 octave_list::subsref (const std::string& type, |
4994
|
66 const std::list<octave_value_list>& idx, int nargout) |
3933
|
67 { |
4994
|
68 octave_value_list retval; |
3933
|
69 |
|
70 switch (type[0]) |
|
71 { |
|
72 case '(': |
|
73 { |
|
74 octave_value_list tmp_idx = idx.front (); |
|
75 |
|
76 if (tmp_idx.length () == 1) |
|
77 { |
|
78 idx_vector i = tmp_idx (0).index_vector (); |
|
79 |
4842
|
80 Cell tmp = data.index (i); |
|
81 |
4994
|
82 retval(0) = octave_value (new octave_list (tmp)); |
3933
|
83 } |
|
84 else |
|
85 error ("only one index allowed for lists"); |
|
86 } |
|
87 break; |
|
88 |
|
89 case '{': |
|
90 { |
|
91 octave_value_list tmp_idx = idx.front (); |
|
92 |
|
93 if (tmp_idx.length () == 1) |
|
94 { |
|
95 idx_vector i = tmp_idx (0).index_vector (); |
|
96 |
4591
|
97 Cell tmp = data.index (i); |
3933
|
98 |
|
99 if (tmp.length () == 1) |
4994
|
100 retval(0) = tmp(0); |
4842
|
101 else |
4994
|
102 retval(0) = octave_value (tmp, true); |
3933
|
103 } |
|
104 else |
|
105 error ("only one index allowed for lists"); |
|
106 } |
|
107 break; |
|
108 |
|
109 case '.': |
|
110 { |
|
111 std::string nm = type_name (); |
|
112 error ("%s cannot be indexed with %c", nm.c_str (), type[0]); |
|
113 } |
|
114 break; |
|
115 |
|
116 default: |
|
117 panic_impossible (); |
|
118 } |
|
119 |
4994
|
120 // XXX FIXME XXX -- perhaps there should be an |
|
121 // octave_value_list::next_subsref member function? See also |
|
122 // octave_user_function::subsref. |
|
123 |
|
124 if (idx.size () > 1) |
|
125 retval = retval(0).next_subsref (nargout, type, idx); |
|
126 |
|
127 return retval; |
3933
|
128 } |
|
129 |
|
130 octave_value |
|
131 octave_list::do_index_op (const octave_value_list& idx, int resize_ok) |
2882
|
132 { |
|
133 octave_value retval; |
|
134 |
|
135 if (idx.length () == 1) |
|
136 { |
3219
|
137 idx_vector i = idx (0).index_vector (); |
2882
|
138 |
4591
|
139 retval = octave_list (data.index (i, resize_ok)); |
2882
|
140 } |
|
141 else |
|
142 error ("lists may only be indexed by a single scalar"); |
|
143 |
|
144 return retval; |
|
145 } |
|
146 |
3933
|
147 octave_value |
4247
|
148 octave_list::subsasgn (const std::string& type, |
4219
|
149 const std::list<octave_value_list>& idx, |
3933
|
150 const octave_value& rhs) |
|
151 { |
|
152 octave_value retval; |
|
153 |
|
154 int n = type.length (); |
|
155 |
|
156 octave_value t_rhs = rhs; |
|
157 |
|
158 if (n > 1) |
|
159 { |
|
160 switch (type[0]) |
|
161 { |
|
162 case '(': |
|
163 { |
|
164 octave_value tmp = do_index_op (idx.front (), true); |
|
165 |
|
166 if (! tmp.is_defined ()) |
|
167 tmp = octave_value::empty_conv (type.substr (1), rhs); |
|
168 |
|
169 if (! error_state) |
|
170 { |
4219
|
171 std::list<octave_value_list> next_idx (idx); |
3933
|
172 |
4219
|
173 next_idx.erase (next_idx.begin ()); |
3933
|
174 |
|
175 t_rhs = tmp.subsasgn (type.substr (1), next_idx, rhs); |
|
176 } |
|
177 } |
|
178 break; |
|
179 |
|
180 case '{': |
|
181 case '.': |
|
182 { |
|
183 std::string nm = type_name (); |
|
184 error ("%s cannot be indexed with %c", nm.c_str (), type[0]); |
|
185 } |
|
186 break; |
|
187 |
|
188 default: |
|
189 panic_impossible (); |
|
190 } |
|
191 } |
|
192 |
3940
|
193 if (! error_state) |
3933
|
194 { |
3940
|
195 switch (type[0]) |
|
196 { |
|
197 case '(': |
|
198 { |
|
199 octave_value_list i = idx.front (); |
3933
|
200 |
4769
|
201 int len = i.length (); |
|
202 |
|
203 for (int k = 0; k < len; k++) |
|
204 data.set_index (i(k).index_vector ()); |
|
205 |
|
206 ::assign (data, Cell (t_rhs), Cell::resize_fill_value ()); |
3933
|
207 |
3940
|
208 retval = octave_value (this, count + 1); |
|
209 } |
|
210 break; |
3933
|
211 |
3940
|
212 case '{': |
|
213 case '.': |
|
214 { |
|
215 std::string nm = type_name (); |
|
216 error ("%s cannot be indexed with %c", nm.c_str (), type[0]); |
|
217 } |
|
218 break; |
3933
|
219 |
3940
|
220 default: |
|
221 panic_impossible (); |
|
222 } |
3933
|
223 } |
|
224 |
|
225 return retval; |
|
226 } |
|
227 |
2882
|
228 void |
3196
|
229 octave_list::assign (const octave_value_list& idx, const octave_value& rhs) |
|
230 { |
|
231 if (idx.length () == 1) |
|
232 { |
3202
|
233 int i = idx(0).int_value (true); |
3196
|
234 |
|
235 if (! error_state) |
|
236 { |
4591
|
237 int n = data.length (); |
3196
|
238 |
4461
|
239 if (i > 0) |
|
240 { |
|
241 if (Vwarn_resize_on_range_error && i > n) |
|
242 warning ("list index = %d out of range", i); |
|
243 |
4591
|
244 data(i-1) = rhs; |
4461
|
245 } |
3196
|
246 else |
3202
|
247 error ("list index = %d out of range", i); |
3196
|
248 } |
3202
|
249 else |
|
250 error ("list index must be an integer"); |
3196
|
251 } |
|
252 else |
|
253 error ("lists may only be indexed by a single scalar"); |
|
254 } |
|
255 |
4791
|
256 size_t |
|
257 octave_list::byte_size (void) const |
|
258 { |
|
259 size_t retval = 0; |
|
260 |
|
261 for (int i = 0; i < numel (); i++) |
|
262 retval += data(i).byte_size (); |
|
263 |
|
264 return retval; |
|
265 } |
|
266 |
4591
|
267 octave_value_list |
|
268 octave_list::list_value (void) const |
|
269 { |
|
270 octave_value_list retval; |
|
271 |
|
272 int n = data.length (); |
|
273 |
|
274 retval.resize (n); |
|
275 |
|
276 for (int i = 0; i < n; i++) |
|
277 retval(i) = data(i); |
|
278 |
|
279 return retval; |
|
280 } |
|
281 |
3196
|
282 void |
3523
|
283 octave_list::print (std::ostream& os, bool) const |
2901
|
284 { |
|
285 print_raw (os); |
|
286 } |
|
287 |
|
288 void |
3523
|
289 octave_list::print_raw (std::ostream& os, bool) const |
2882
|
290 { |
2985
|
291 unwind_protect::begin_frame ("octave_list_print"); |
2882
|
292 |
4591
|
293 int n = data.length (); |
2882
|
294 |
3196
|
295 if (n > 0) |
2882
|
296 { |
3196
|
297 indent (os); |
|
298 os << "("; |
|
299 newline (os); |
|
300 |
|
301 increment_indent_level (); |
2916
|
302 |
3196
|
303 for (int i = 0; i < n; i++) |
|
304 { |
4051
|
305 OSSTREAM buf; |
|
306 |
|
307 buf << "[" << i+1 << "]" << OSSTREAM_ENDS; |
2882
|
308 |
4591
|
309 octave_value val = data(i); |
2916
|
310 |
4051
|
311 val.print_with_name (os, OSSTREAM_STR (buf)); |
3196
|
312 |
4051
|
313 OSSTREAM_FREEZE (buf); |
3196
|
314 } |
2882
|
315 |
3196
|
316 decrement_indent_level (); |
2882
|
317 |
3196
|
318 indent (os); |
|
319 os << ")"; |
|
320 } |
|
321 else |
|
322 os << "()"; |
|
323 |
2901
|
324 newline (os); |
2882
|
325 |
2985
|
326 unwind_protect::run_frame ("octave_list_print"); |
2882
|
327 } |
|
328 |
2901
|
329 bool |
3523
|
330 octave_list::print_name_tag (std::ostream& os, const std::string& name) const |
2901
|
331 { |
|
332 indent (os); |
4591
|
333 if (data.length () == 0) |
3196
|
334 os << name << " = "; |
|
335 else |
|
336 { |
|
337 os << name << " ="; |
|
338 newline (os); |
|
339 } |
2901
|
340 return false; |
|
341 } |
|
342 |
2993
|
343 DEFUN (list, args, , |
3447
|
344 "-*- texinfo -*-\n\ |
3448
|
345 @deftypefn {Built-in Function} {} list (@var{a1}, @var{a2}, @dots{})\n\ |
3447
|
346 Create a new list with elements given by the arguments @var{a1},\n\ |
|
347 @var{a2}, @dots{}.\n\ |
|
348 @end deftypefn") |
2882
|
349 { |
4591
|
350 static bool warned = false; |
|
351 |
|
352 if (! warned) |
|
353 { |
|
354 warning ("list objects are deprecated; use cell arrays instead"); |
|
355 warned = true; |
|
356 } |
|
357 |
2882
|
358 return octave_value (args); |
|
359 } |
|
360 |
3219
|
361 DEFUN (nth, args, , |
3447
|
362 "-*- texinfo -*-\n\ |
|
363 @deftypefn {Built-in Function} {} nth (@var{list}, @var{n})\n\ |
|
364 Return the @var{n}-th element of @var{list}.\n\ |
|
365 @end deftypefn") |
3219
|
366 { |
|
367 octave_value retval; |
|
368 |
|
369 if (args.length () == 2) |
|
370 { |
|
371 octave_value_list lst = args(0).list_value (); |
|
372 |
|
373 if (! error_state) |
|
374 { |
|
375 int n = args(1).int_value (true); |
|
376 |
|
377 if (! error_state) |
|
378 { |
|
379 if (n > 0 && n <= lst.length ()) |
|
380 retval = lst(n-1); |
|
381 else |
|
382 error ("nth: index = %d out of range", n); |
|
383 } |
|
384 else |
|
385 error ("nth: second argument must be an integer"); |
|
386 } |
|
387 else |
|
388 error ("nth: first argument must be a list"); |
|
389 } |
|
390 else |
|
391 print_usage ("nth"); |
|
392 |
|
393 return retval; |
|
394 } |
|
395 |
2882
|
396 DEFUN (append, args, , |
3447
|
397 "-*- texinfo -*-\n\ |
|
398 @deftypefn {Built-in Function} {} append (@var{list}, @var{a1}, @var{a2}, @dots{})\n\ |
|
399 Return a new list created by appending @var{a1}, @var{a1}, @dots{}, to\n\ |
|
400 @var{list}. If any of the arguments to be appended is a list, its\n\ |
|
401 elements are appended individually. For example,\n\ |
2882
|
402 \n\ |
3447
|
403 @example\n\ |
|
404 x = list (1, 2);\n\ |
|
405 y = list (3, 4);\n\ |
|
406 append (x, y);\n\ |
|
407 @end example\n\ |
3219
|
408 \n\ |
3447
|
409 @noindent\n\ |
|
410 results in the list containing the four elements @samp{(1 2 3 4)}, not\n\ |
|
411 a list containing the three elements @samp{(1 2 (3 4))}.\n\ |
|
412 @end deftypefn") |
2882
|
413 { |
|
414 octave_value retval; |
|
415 |
|
416 int nargin = args.length (); |
|
417 |
|
418 if (nargin > 1) |
|
419 { |
|
420 octave_value_list tmp = args(0).list_value (); |
|
421 |
|
422 if (! error_state) |
|
423 { |
|
424 for (int i = 1; i < nargin; i++) |
3219
|
425 { |
|
426 octave_value ov = args(i); |
|
427 |
|
428 if (ov.is_list ()) |
|
429 tmp.append (ov.list_value ()); |
|
430 else |
|
431 tmp.append (ov); |
|
432 } |
2882
|
433 |
4233
|
434 retval = octave_value (tmp); |
2882
|
435 } |
|
436 } |
|
437 else |
|
438 print_usage ("append"); |
|
439 |
|
440 return retval; |
|
441 } |
|
442 |
|
443 DEFUN (reverse, args, , |
3447
|
444 "-*- texinfo -*-\n\ |
|
445 @deftypefn {Built-in Function} {} reverse (@var{list})\n\ |
|
446 Return a new list created by reversing the elements of @var{list}.\n\ |
|
447 @end deftypefn") |
2882
|
448 { |
|
449 octave_value retval; |
|
450 |
|
451 int nargin = args.length (); |
|
452 |
|
453 if (nargin == 1) |
|
454 { |
|
455 octave_value_list tmp = args(0).list_value (); |
|
456 |
|
457 if (! error_state) |
4233
|
458 retval = octave_value (tmp.reverse ()); |
2882
|
459 } |
|
460 else |
|
461 print_usage ("reverse"); |
|
462 |
|
463 return retval; |
|
464 } |
|
465 |
3196
|
466 DEFUN (splice, args, , |
3447
|
467 "-*- texinfo -*-\n\ |
|
468 @deftypefn {Built-in Function} {} splice (@var{list_1}, @var{offset}, @var{length}, @var{list_2})\n\ |
|
469 Replace @var{length} elements of @var{list_1} beginning at\n\ |
|
470 @var{offset} with the contents of @var{list_2} (if any). If\n\ |
|
471 @var{length} is omitted, all elements from @var{offset} to the end of\n\ |
|
472 @var{list_1} are replaced. As a special case, if @var{offset} is one\n\ |
|
473 greater than the length of @var{list_1} and @var{length} is 0, splice\n\ |
3448
|
474 is equivalent to @code{append (@var{list_1}, @var{list_2})}.\n\ |
3447
|
475 @end deftypefn") |
3196
|
476 { |
|
477 octave_value retval; |
|
478 |
|
479 int nargin = args.length (); |
|
480 |
|
481 if (nargin > 1 && nargin < 5) |
|
482 { |
|
483 octave_value_list list_1 = args(0).list_value (); |
|
484 |
|
485 if (! error_state) |
|
486 { |
3202
|
487 int offset = args(1).int_value (true); |
3196
|
488 |
|
489 if (! error_state) |
|
490 { |
3202
|
491 offset--; |
|
492 |
|
493 int length = 0; |
|
494 |
|
495 octave_value_list list_2; |
3196
|
496 |
3202
|
497 if (nargin < 3) |
|
498 length = list_1.length () - offset; |
|
499 else |
|
500 { |
|
501 length = args(2).int_value (true); |
3196
|
502 |
3202
|
503 if (! error_state) |
3196
|
504 { |
3202
|
505 if (nargin == 4) |
|
506 { |
|
507 list_2 = args(3).list_value (); |
3196
|
508 |
3202
|
509 if (error_state) |
|
510 error ("splice: fourth argument must be a list"); |
3196
|
511 } |
|
512 } |
3202
|
513 else |
|
514 error ("splice: LENGTH must be an integer"); |
|
515 } |
3196
|
516 |
3202
|
517 if (! error_state) |
4233
|
518 retval = octave_value (list_1.splice (offset, length, list_2)); |
3196
|
519 } |
|
520 else |
|
521 error ("splice: OFFSET must be an integer"); |
|
522 } |
|
523 else |
|
524 error ("splice: first argument must be a list"); |
|
525 } |
|
526 else |
|
527 print_usage ("splice"); |
|
528 |
|
529 return retval; |
|
530 } |
|
531 |
4687
|
532 bool |
|
533 octave_list::save_ascii (std::ostream& os, bool& infnan_warned, |
|
534 bool strip_nan_and_inf) |
|
535 { |
|
536 octave_value_list lst = list_value (); |
|
537 os << "# length: " << lst.length () << "\n"; |
|
538 |
|
539 for (int i = 0; i < lst.length (); ++i) |
|
540 { |
|
541 // should we use lst.name_tags () to label the elements? |
|
542 char s[20]; |
|
543 sprintf (s, "_%d", i); |
|
544 bool b = save_ascii_data (os, lst (i), s, infnan_warned, |
|
545 strip_nan_and_inf, 0, 0); |
|
546 |
|
547 if (! b) |
|
548 return false; |
|
549 } |
|
550 |
|
551 return true; |
|
552 } |
|
553 |
|
554 bool |
|
555 octave_list::load_ascii (std::istream& is) |
|
556 { |
|
557 int len = 0; |
|
558 bool success = true; |
|
559 |
|
560 if (extract_keyword (is, "length", len) && len >= 0) |
|
561 { |
|
562 if (len > 0) |
|
563 { |
|
564 octave_value_list lst; |
|
565 |
|
566 for (int j = 0; j < len; j++) |
|
567 { |
|
568 octave_value t2; |
|
569 bool dummy; |
|
570 |
|
571 // recurse to read list elements |
|
572 std::string nm |
|
573 = read_ascii_data (is, std::string (), dummy, t2, count); |
|
574 |
|
575 if (!is) |
|
576 break; |
|
577 |
|
578 lst.append (t2); |
|
579 } |
|
580 |
|
581 if (is) |
|
582 data = lst; |
|
583 else |
|
584 { |
|
585 error ("load: failed to load list"); |
|
586 success = false; |
|
587 } |
|
588 } |
|
589 else if (len == 0 ) |
|
590 data = Cell (0, 0); |
|
591 else |
|
592 panic_impossible (); |
|
593 } |
|
594 else { |
|
595 error ("load: failed to extract number of elements in list"); |
|
596 success = false; |
|
597 } |
|
598 |
|
599 return success; |
|
600 } |
|
601 |
|
602 bool |
|
603 octave_list::save_binary (std::ostream& os, bool& save_as_floats) |
|
604 { |
|
605 octave_value_list lst = list_value (); |
|
606 |
|
607 FOUR_BYTE_INT len = lst.length(); |
|
608 os.write (X_CAST (char *, &len), 4); |
|
609 |
|
610 for (int i = 0; i < lst.length (); i++) |
|
611 { |
|
612 // should we use lst.name_tags () to label the elements? |
|
613 char s[20]; |
|
614 sprintf (s, "_%d", i); |
|
615 |
|
616 // Recurse to print sub-value. |
|
617 bool b = save_binary_data (os, lst(i), s, "", 0, save_as_floats); |
|
618 |
|
619 if (! b) |
|
620 return false; |
|
621 } |
|
622 |
|
623 return true; |
|
624 } |
|
625 |
|
626 bool |
|
627 octave_list::load_binary (std::istream& is, bool swap, |
|
628 oct_mach_info::float_format fmt) |
|
629 { |
|
630 FOUR_BYTE_INT len; |
|
631 if (! is.read (X_CAST (char *, &len), 4)) |
|
632 return false; |
|
633 if (swap) |
4944
|
634 swap_bytes<4> (&len); |
4687
|
635 |
|
636 if (len > 0) |
|
637 { |
|
638 octave_value_list lst; |
|
639 |
|
640 for (int i = 0; i < len; i++) |
|
641 { |
|
642 octave_value t2; |
|
643 bool dummy; |
|
644 std::string doc; |
|
645 |
|
646 // recurse to read list elements |
|
647 std::string nm = read_binary_data (is, swap, fmt, std::string (), |
|
648 dummy, t2, doc); |
|
649 |
|
650 if (!is) |
|
651 return false; |
|
652 |
|
653 lst.append(t2); |
|
654 } |
|
655 |
|
656 if (is) |
|
657 data = lst; |
|
658 else |
|
659 { |
|
660 error ("load: failed to load list"); |
|
661 return false; |
|
662 } |
|
663 |
|
664 } |
|
665 else if (len == 0 ) |
|
666 data = Cell (0, 0); |
|
667 else |
|
668 return false; |
|
669 |
|
670 return true; |
|
671 } |
|
672 |
|
673 #if defined (HAVE_HDF5) |
4944
|
674 |
4687
|
675 bool |
|
676 octave_list::save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) |
|
677 { |
|
678 hid_t data_hid = -1; |
|
679 |
|
680 data_hid = H5Gcreate (loc_id, name, 0); |
|
681 if (data_hid < 0) return false; |
|
682 |
|
683 // recursively add each element of the list to this group |
|
684 octave_value_list lst = list_value (); |
|
685 |
|
686 for (int i = 0; i < lst.length (); ++i) |
|
687 { |
|
688 // should we use lst.name_tags () to label the elements? |
|
689 char s[20]; |
|
690 sprintf (s, "_%d", i); |
|
691 bool retval2 = add_hdf5_data (data_hid, lst (i), s, "", |
|
692 false, save_as_floats); |
|
693 if (! retval2) |
|
694 break; |
|
695 } |
|
696 |
|
697 H5Gclose (data_hid); |
4837
|
698 |
4687
|
699 return true; |
|
700 } |
|
701 |
|
702 bool |
|
703 octave_list::load_hdf5 (hid_t loc_id, const char *name, |
|
704 bool have_h5giterate_bug) |
|
705 { |
|
706 bool retval = false; |
|
707 |
|
708 hdf5_callback_data dsub; |
|
709 |
4696
|
710 herr_t retval2 = -1; |
4687
|
711 octave_value_list lst; |
|
712 int current_item = 0; |
4696
|
713 #ifdef HAVE_H5GGET_NUM_OBJS |
|
714 hsize_t num_obj = 0; |
5060
|
715 hid_t group_id = H5Gopen (loc_id, name); |
|
716 H5Gget_num_objs (group_id, &num_obj); |
|
717 H5Gclose (group_id); |
4696
|
718 |
|
719 while (current_item < static_cast<int> (num_obj) |
|
720 && (retval2 = H5Giterate (loc_id, name, ¤t_item, |
|
721 hdf5_read_next_data, &dsub)) > 0) |
|
722 #else |
4687
|
723 while ((retval2 = H5Giterate (loc_id, name, ¤t_item, |
|
724 hdf5_read_next_data, &dsub)) > 0) |
4696
|
725 #endif |
4687
|
726 { |
|
727 lst.append (dsub.tc); |
|
728 |
|
729 if (have_h5giterate_bug) |
|
730 current_item++; // H5Giterate returned the last index processed |
|
731 } |
|
732 |
|
733 if (retval2 >= 0) |
|
734 { |
|
735 data = lst; |
|
736 retval = true; |
|
737 } |
|
738 |
|
739 return retval; |
|
740 } |
4944
|
741 |
4687
|
742 #endif |
|
743 |
2882
|
744 /* |
|
745 ;;; Local Variables: *** |
|
746 ;;; mode: C++ *** |
|
747 ;;; End: *** |
|
748 */ |