Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

openedf.h File Reference

#include <stdio.h>
#include <nsnet.h>

Go to the source code of this file.

Data Structures

struct  EDFDecodedChannelHeader
struct  EDFDecodedConfig
struct  EDFDecodedHeader
struct  EDFInputIterator
struct  EDFPackedChannelHeader
struct  EDFPackedHeader

Defines

#define MAXCHANNELS   32
#define BYTESPERSAMPLE   2
#define MAXHEADERLEN   ((MAXCHANNELS+1) * 256)

Functions

EDFInputIterator * newEDFInputIterator (const struct EDFDecodedConfig *cfg)
int stepEDFInputIterator (struct EDFInputIterator *edfi)
int fetchSamples (const struct EDFInputIterator *edfi, short *samples, FILE *fp)
void freeEDFInputIterator (struct EDFInputIterator *edfi)
int EDFUnpackInt (const char *inp, int fieldLen)
double EDFUnpackDouble (const char *inp, int fieldLen)
const char * EDFUnpackString (const char *inp, int fieldLen)
int EDFEncodePacket (char *target, const struct EDFDecodedConfig *cfg)
int writeEDF (int fd, const struct EDFDecodedConfig *cfg)
int readEDF (int fd, struct EDFDecodedConfig *cfg)
int writeEDFString (const struct EDFDecodedConfig *cfg, char *buf, int *buflen)
int readEDFString (struct EDFDecodedConfig *cfg, const char *buf, int len)
int setEDFHeaderBytes (struct EDFDecodedConfig *cfg)
int getDataRecordChunkSize (const struct EDFDecodedConfig *cfg)
double getSamplesPerSecond (const struct EDFDecodedConfig *cfg, int whichChan)
double getSecondsPerSample (const struct EDFDecodedConfig *cfg, int whichChan)
int isValidREDF (const struct EDFDecodedConfig *cfg)
int makeREDFConfig (struct EDFDecodedConfig *result, const struct EDFDecodedConfig *source)
const char * getLastError (void)
const char * getDMY (void)
const char * getHMS (void)


Define Documentation

#define BYTESPERSAMPLE   2
 

Definition at line 33 of file openedf.h.

Referenced by fetchSamples(), and getDataRecordChunkSize().

#define MAXCHANNELS   32
 

Definition at line 32 of file openedf.h.

Referenced by doesMatchP2(), doesMatchP3(), eatCharacter(), idleHandler(), main(), readEDF(), readEDFString(), writeEDF(), and writeEDFString().

#define MAXHEADERLEN   ((MAXCHANNELS+1) * 256)
 

Definition at line 34 of file openedf.h.

Referenced by main().


Function Documentation

int EDFEncodePacket (  char *  target,
const struct EDFDecodedConfig *  cfg
) 
 

Definition at line 86 of file openedf.c.

References cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataFormat, EDFDecodedHeader::dataRecordChannels, EDFDecodedHeader::dataRecordCount, EDFDecodedHeader::dataRecordSeconds, EDFDecodedChannelHeader::digiMax, EDFDecodedChannelHeader::digiMin, EDFDecodedChannelHeader::dimUnit, EDFDecodedConfig::hdr, EDFDecodedHeader::headerRecordBytes, EDFDecodedChannelHeader::label, EDFDecodedHeader::localPatient, EDFDecodedHeader::localRecorder, EDFDecodedHeader::manufacturerID, EDFDecodedChannelHeader::physMax, EDFDecodedChannelHeader::physMin, EDFDecodedChannelHeader::prefiltering, EDFDecodedHeader::recordingStartDate, EDFDecodedHeader::recordingStartTime, EDFDecodedChannelHeader::reserved, EDFDecodedChannelHeader::sampleCount, sampleCount, STORECFD, STORECFI, STORECFS, STOREHFD, STOREHFI, STOREHFS, and EDFDecodedChannelHeader::transducer.

Referenced by writeEDF(), and writeEDFString().

double EDFUnpackDouble (  const char *  inp,
int  fieldLen
) 
 

Definition at line 49 of file openedf.c.

References EDFUnpackString().

int EDFUnpackInt (  const char *  inp,
int  fieldLen
) 
 

Definition at line 44 of file openedf.c.

References EDFUnpackString().

const char* EDFUnpackString (  const char *  inp,
int  fieldLen
) 
 

Definition at line 54 of file openedf.c.

Referenced by EDFUnpackDouble(), and EDFUnpackInt().

int fetchSamples (  const struct EDFInputIterator *  edfi,
short *  samples,
FILE *  fp
) 
 

Definition at line 294 of file openedf.c.

References BYTESPERSAMPLE, EDFInputIterator::cfg, EDFDecodedConfig::chan, EDFInputIterator::dataRecord, EDFDecodedHeader::dataRecordChannels, EDFDecodedConfig::hdr, readDataRecord(), EDFDecodedChannelHeader::sampleCount, sampleCount, EDFInputIterator::sampleNum, and samples.

Referenced by main().

void freeEDFInputIterator (  struct EDFInputIterator *  edfi  ) 
 

Definition at line 261 of file openedf.c.

References EDFInputIterator::dataRecord.

Referenced by main().

int getDataRecordChunkSize (  const struct EDFDecodedConfig *  cfg  ) 
 

Definition at line 240 of file openedf.c.

References BYTESPERSAMPLE, cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordChannels, EDFDecodedConfig::hdr, and EDFDecodedChannelHeader::sampleCount.

Referenced by main(), newEDFInputIterator(), and readDataRecord().

const char* getDMY (  void   ) 
 

Definition at line 338 of file openedf.c.

References buf.

Referenced by main(), and makeREDFConfig().

const char* getHMS (  void   ) 
 

Definition at line 349 of file openedf.c.

References buf.

Referenced by main(), and makeREDFConfig().

const char* getLastError (  void   ) 
 

Definition at line 387 of file openedf.c.

double getSamplesPerSecond (  const struct EDFDecodedConfig *  cfg,
int  whichChan
) 
 

Definition at line 235 of file openedf.c.

References cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordSeconds, EDFDecodedConfig::hdr, and EDFDecodedChannelHeader::sampleCount.

Referenced by main().

double getSecondsPerSample (  const struct EDFDecodedConfig *  cfg,
int  whichChan
) 
 

Definition at line 230 of file openedf.c.

References cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordSeconds, EDFDecodedConfig::hdr, and EDFDecodedChannelHeader::sampleCount.

int isValidREDF (  const struct EDFDecodedConfig *  cfg  ) 
 

Definition at line 312 of file openedf.c.

References cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordChannels, EDFDecodedConfig::hdr, EDFDecodedChannelHeader::sampleCount, and setLastError().

Referenced by makeREDFConfig().

int makeREDFConfig (  struct EDFDecodedConfig *  result,
const struct EDFDecodedConfig *  source
) 
 

Definition at line 367 of file openedf.c.

References getDMY(), getHMS(), EDFDecodedConfig::hdr, isValidREDF(), EDFDecodedHeader::recordingStartDate, EDFDecodedHeader::recordingStartTime, and setEDFHeaderBytes().

Referenced by cmdSetHeader(), and main().

struct EDFInputIterator* newEDFInputIterator (  const struct EDFDecodedConfig *  cfg  ) 
 

Definition at line 248 of file openedf.c.

References cfg, and getDataRecordChunkSize().

Referenced by main().

int readEDF (  int  fd,
struct EDFDecodedConfig *  cfg
) 
 

Definition at line 204 of file openedf.c.

References cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordChannels, EDFDecodeChannelHeader(), EDFDecodeHeaderPreamble(), EDFDecodedConfig::hdr, EDFDecodedHeader::headerRecordBytes, MAXCHANNELS, and setEDFHeaderBytes().

Referenced by main().

int readEDFString (  struct EDFDecodedConfig *  cfg,
const char *  buf,
int  len
) 
 

Definition at line 145 of file openedf.c.

References buf, cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordChannels, EDFDecodeChannelHeader(), EDFDecodeHeaderPreamble(), EDFDecodedConfig::hdr, EDFDecodedHeader::headerRecordBytes, MAXCHANNELS, rprintf(), and setEDFHeaderBytes().

Referenced by cmdSetHeader(), and main().

int setEDFHeaderBytes (  struct EDFDecodedConfig *  cfg  ) 
 

Definition at line 198 of file openedf.c.

References cfg, EDFDecodedHeader::dataRecordChannels, EDFDecodedConfig::hdr, and EDFDecodedHeader::headerRecordBytes.

Referenced by main(), makeREDFConfig(), readEDF(), and readEDFString().

int stepEDFInputIterator (  struct EDFInputIterator *  edfi  ) 
 

Definition at line 268 of file openedf.c.

References EDFInputIterator::cfg, EDFDecodedConfig::chan, EDFInputIterator::dataRecordNum, EDFDecodedChannelHeader::sampleCount, and EDFInputIterator::sampleNum.

Referenced by main().

int writeEDF (  int  fd,
const struct EDFDecodedConfig *  cfg
) 
 

Definition at line 184 of file openedf.c.

References cfg, EDFEncodePacket(), EDFDecodedConfig::hdr, EDFDecodedHeader::headerRecordBytes, and MAXCHANNELS.

Referenced by main().

int writeEDFString (  const struct EDFDecodedConfig *  cfg,
char *  buf,
int *  buflen
) 
 

Definition at line 167 of file openedf.c.

References buf, cfg, EDFEncodePacket(), EDFDecodedConfig::hdr, EDFDecodedHeader::headerRecordBytes, and MAXCHANNELS.

Referenced by cmdSetHeader(), and main().


Generated on Tue Feb 8 00:05:19 2005 for Neuroserver by doxygen 1.3.3