| 1 | /* |
| 2 | |
| 3 | Copyright (C) 2021 Alois Schloegl <[email protected]> |
| 4 | |
| 5 | This file is part of the "BioSig for C/C++" repository |
| 6 | (biosig4c++) at http://biosig.sf.net/ |
| 7 | |
| 8 | BioSig is free software; you can redistribute it and/or |
| 9 | modify it under the terms of the GNU General Public License |
| 10 | as published by the Free Software Foundation; either version 3 |
| 11 | of the License, or (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | */ |
| 22 | |
| 23 | |
| 24 | #include <assert.h> |
| 25 | #include <ctype.h> |
| 26 | #include <stddef.h> |
| 27 | #include <stdio.h> |
| 28 | #include <stdlib.h> |
| 29 | #include <string.h> |
| 30 | #ifdef WITH_HDF5 |
| 31 | #include <hdf5/serial/hdf5.h> |
| 32 | #include <hdf5/serial/hdf5_hl.h> |
| 33 | #endif |
| 34 | #include "../biosig.h" |
| 35 | |
| 36 | int sopen_hdf5(HDRTYPE* hdr) { |
| 37 | #ifdef WITH_HDF5 |
| 38 | /* |
| 39 | file hdr->FileName is already opened and hdr->HeadLen bytes are read |
| 40 | These are available from hdr->AS.Header. |
| 41 | |
| 42 | ToDo: populate hdr |
| 43 | */ |
| 44 | size_t count = hdr->HeadLen; |
| 45 | fprintf(stdout,"Trying to read HDF data using \"%s\"\n",H5_VERS_INFO); |
| 46 | |
| 47 | // identify which type/origin of HDF5 |
| 48 | biosigERROR(hdr, B4C_FORMAT_UNSUPPORTED, "Error reading HDF5 file"); |
| 49 | |
| 50 | ifclose(hdr); |
| 51 | return(-1); |
| 52 | #else // WITH_MATIO |
| 53 | biosigERROR(hdr, B4C_FORMAT_UNSUPPORTED, "SOPEN(HDF5): - HDF5 format not supported - libbiosig need to be recompiled with libhdf5 support."); |
| 54 | return(-1); |
| 55 | #endif // WITH_MATIO |
| 56 | } |
| 57 |