Sync biosiglite with upstream

parent e8eb26bf
......@@ -30,18 +30,12 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#if !defined(_MSC_VER)
#if defined(__MINGW32__)
#include <sys/param.h>
#endif
#include <time.h>
#include "physicalunits.h"
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C
#endif
#ifdef __cplusplus
extern "C" {
......@@ -114,7 +108,7 @@ char *getlogin (void);
#define BIOSIG_VERSION_MAJOR 1
#define BIOSIG_VERSION_MINOR 9
#define BIOSIG_PATCHLEVEL 0
#define BIOSIG_PATCHLEVEL 2
// for backward compatibility
#define BIOSIG_VERSION_STEPPING BIOSIG_PATCHLEVEL
#define BIOSIG_VERSION (BIOSIG_VERSION_MAJOR * 10000 + BIOSIG_VERSION_MINOR * 100 + BIOSIG_PATCHLEVEL)
......@@ -578,9 +572,9 @@ extern const struct FileFormatStringTable_t FileFormatStringTable [];
# define bswap_64(x) __builtin_bswap64(x)
# include <winsock2.h>
# if !defined(_MSC_VER)
# if defined(__MINGW32__)
# include <sys/param.h>
# endif
# endif
# if BYTE_ORDER == LITTLE_ENDIAN
# define htobe16(x) htons(x)
# define htole16(x) (x)
......@@ -593,15 +587,15 @@ extern const struct FileFormatStringTable_t FileFormatStringTable [];
# define le32toh(x) (x)
# define htole64(x) (x)
# if !defined(_MSC_VER)
# define htobe64(x) __builtin_bswap64(x)
# define be64toh(x) __builtin_bswap64(x)
# else
# define ntohll(x) (((_int64)(ntohl((int)((x << 32) >> 32))) << 32) | (unsigned int)ntohl(((int)(x >> 32))))
# define htonll(x) ntohll(x)
# define htobe64(x) htonll(x)
# define be64toh(x) ntohll(x)
# endif
# if defined(__MINGW32__)
# define htobe64(x) __builtin_bswap64(x)
# define be64toh(x) __builtin_bswap64(x)
# else
# define ntohll(x) (((_int64)(ntohl((int)((x << 32) >> 32))) << 32) | (unsigned int)ntohl(((int)(x >> 32))))
# define htonll(x) ntohll(x)
# define htobe64(x) htonll(x)
# define be64toh(x) ntohll(x)
# endif
# define le64toh(x) (x)
# elif BYTE_ORDER == BIG_ENDIAN
......@@ -930,9 +924,6 @@ static inline void bef64a( double i, void* r) {
#ifndef isfinite
# define isfinite(a) (-INFINITY < (a) && (a) < INFINITY)
#endif
#ifndef isnan
# define isnan(a) ((a)!=(a))
#endif
/*
The macro IS_SET() can be used to test for defines in
......
......@@ -27,8 +27,6 @@
#include "biosig-network.h"
#define min(a,b) (((a) < (b)) ? (a) : (b))
#ifdef _WIN32
#define TC (char*) // WINSOCK's send and recv require (char*)buf
......
......@@ -38,6 +38,8 @@
#define socklen_t int
#endif
/* mingw/include/errno.h */
#ifndef _INC_ERRNO
#define EALREADY WSAEALREADY
#define ECONNABORTED WSAECONNABORTED
#define ECONNREFUSED WSAECONNREFUSED
......@@ -58,6 +60,7 @@
#define EMSGSIZE WSAEMSGSIZE
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#endif
#if 0 //!__linux__
// needed by MinGW on Windows
......
This diff is collapsed.
......@@ -305,6 +305,10 @@ else if (VERBOSE_LEVEL>7)
lei16a(i,e+6);
}
}
hdr->ID.Manufacturer.Name = "CED - Cambridge Electronic Devices";
hdr->ID.Manufacturer.Model = NULL;
hdr->ID.Manufacturer.Version = NULL;
hdr->ID.Manufacturer.SerialNumber = NULL;
if (VERBOSE_LEVEL>7) fprintf(stdout,"\n******* Data Section variable information (n=%i,%i)*********\n", d,NumberOfDataSections);
datapos = LastDataSectionHeaderOffset; //H1LEN + H2LEN*hdr->NS + n*36;
......
......@@ -27,6 +27,7 @@
#include <stddef.h>
*/
#include <ctype.h>
#include <math.h> // define macro isnan()
#include <stdlib.h>
#include <string.h>
#include "../biosig-dev.h"
......
......@@ -1125,6 +1125,10 @@ int sopen_SCP_read(HDRTYPE* hdr) {
}
hdr->CHANNEL[i].SPR = en1064.Section3.lead[i].end - en1064.Section3.lead[i].start + 1;
if (VERBOSE_LEVEL>7)
fprintf(stdout,"%s (line %i): SCP Section %i #%i SPR=%d/%d\n",__FILE__,__LINE__,curSect,i,hdr->CHANNEL[i].SPR,hdr->SPR);
hdr->SPR = lcm(hdr->SPR,hdr->CHANNEL[i].SPR);
hdr->CHANNEL[i].LeadIdCode = LeadIdCode;
hdr->CHANNEL[i].Label[0]= 0;
......@@ -1259,6 +1263,8 @@ int sopen_SCP_read(HDRTYPE* hdr) {
en1064.Section6.dT_us = leu16p(PtrCurSect+curSectPos+2);
aECG->FLAG.DIFF = *(PtrCurSect+curSectPos+4);
if (VERBOSE_LEVEL>7) fprintf(stdout, "%s (line %i) Compression(Diff=%i Huffman=%i RefBeat=%i Bimodal=%i)\n", __func__, __LINE__, aECG->FLAG.DIFF, aECG->FLAG.HUFFMAN, aECG->FLAG.REF_BEAT, aECG->FLAG.BIMODAL);
if ((section[5].length>4) && en1064.Section5.dT_us)
dT_us = en1064.Section5.dT_us;
else
......@@ -1707,7 +1713,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef ANDROID
fprintf(stdout, "\nUse SCP_DECODE (Huffman=%i RefBeat=%i Bimodal=%i)\n", aECG->FLAG.HUFFMAN, aECG->FLAG.REF_BEAT, aECG->FLAG.BIMODAL);
if (VERBOSE_LEVEL > 7)
fprintf(stdout, "\nUse SCP_DECODE (Diff=%i Huffman=%i RefBeat=%i Bimodal=%i)\n", aECG->FLAG.DIFF, aECG->FLAG.HUFFMAN, aECG->FLAG.REF_BEAT, aECG->FLAG.BIMODAL);
#endif
textual.des.acquiring.protocol_revision_number = aECG->Section1.Tag14.VERSION;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment