13#if !defined(BYTE_ORDER)
14#if defined(__i386__) || defined(__alpha__) || defined(__alpha) \
15 || defined(_M_IX86) || defined(_M_IA64) || defined(_M_X64) || defined(_M_ALPHA) \
16 || defined(_AMD64_) || defined(_M_AMD64) \
17 || ((defined(_M_ARM) || defined(_M_ARM64)) && defined(_WIN32)) \
18 || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__))) \
19 || (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
20#define BYTE_ORDER 1234
22#define BYTE_ORDER 4321
27#define LITTLE_ENDIAN 1234
30#define BIG_ENDIAN 4321
56#define spGetSignalLength(filename, headsize, type) (spGetFileSize(filename, headsize) / (spFileOffset)sizeof(type))
58#define spFSkipData(len, fp, type) (spFSkipByte((len) * (long)sizeof(type), fp) / (long)sizeof(type))
80extern void spSwapByte(
void *data,
long length,
int samp_byte);
94#ifdef SP_SUPPORT_64BIT_INT
104extern void spSwapLongC64(
char *data_c64,
long length);
112extern long spFReadLong(
long *data,
long length,
int swap, FILE *fp);
125#ifdef SP_SUPPORT_64BIT_INT
161#define spFReadDWORD(data, length, fp) spFReadULONG(data, length, fp)
186extern long spFReadBitToDouble(
double *data,
long length,
double max,
int samp_bit,
int swap, FILE *fp);
192extern long spFReadFrameBit(
double *data,
long length,
long shift,
double max,
int samp_bit,
int swap, FILE *fp);
213#ifdef SP_SUPPORT_64BIT_INT
249#define spFWriteDWORD(data, length, fp) spFWriteULONG(data, length, fp)
288extern long _spInterleaveData(
char *ddata,
long dlength,
char *idata,
long ilength,
int num_channel,
int samp_byte);
298#define spInterleaveData(ddata, dlength, idata, ilength, num_channel, type) \
299_spInterleaveData((char *)(ddata), dlength, (char *)(idata), ilength, num_channel, sizeof(type))
301#define spInterleaveShort(ddata, dlength, idata, ilength, num_channel) \
302spInterleaveData(ddata, dlength, idata, ilength, num_channel, short)
304#define spInterleaveLong(ddata, dlength, idata, ilength, num_channel) \
305spInterleaveData(ddata, dlength, idata, ilength, num_channel, long)
307#define spInterleaveLong32(ddata, dlength, idata, ilength, num_channel) \
308spInterleaveData(ddata, dlength, idata, ilength, num_channel, spLong32)
310#define spInterleaveFloat(ddata, dlength, idata, ilength, num_channel) \
311spInterleaveData(ddata, dlength, idata, ilength, num_channel, float)
313#define spInterleaveDouble(ddata, dlength, idata, ilength, num_channel) \
314spInterleaveData(ddata, dlength, idata, ilength, num_channel, double)
317extern long _spDeinterleaveData(
char *idata,
long ilength,
char *ddata,
long dlength,
int num_channel,
int samp_byte);
327#define spDeinterleaveData(idata, ilength, ddata, dlength, num_channel, type) \
328_spDeinterleaveData((char *)(idata), ilength, (char *)(ddata), dlength, num_channel, sizeof(type))
330#define spDeinterleaveShort(idata, ilength, ddata, dlength, num_channel) \
331spDeinterleaveData(idata, ilength, ddata, dlength, num_channel, short)
333#define spDeinterleaveLong(idata, ilength, ddata, dlength, num_channel) \
334spDeinterleaveData(idata, ilength, ddata, dlength, num_channel, long)
336#define spDeinterleaveLong32(idata, ilength, ddata, dlength, num_channel) \
337spDeinterleaveData(idata, ilength, ddata, dlength, num_channel, spLong32)
339#define spDeinterleaveFloat(idata, ilength, ddata, dlength, num_channel) \
340spDeinterleaveData(idata, ilength, ddata, dlength, num_channel, float)
342#define spDeinterleaveDouble(idata, ilength, ddata, dlength, num_channel) \
343spDeinterleaveData(idata, ilength, ddata, dlength, num_channel, double)
449extern int spSPutLine(
const char *input,
char *line,
int size);
474extern int spSScanNSetup(
const char *line,
char *name,
int namelen,
char *value,
int valuelen);
481extern unsigned char spLinear2ALaw(
int pcm_val);
483extern int spALaw2Linear(
unsigned char a_val);
485extern unsigned char spLinear2ULaw(
int pcm_val);
487extern int spULaw2Linear(
unsigned char u_val);
489extern unsigned char spALaw2ULaw(
unsigned char aval);
491extern unsigned char spULaw2ALaw(
unsigned char uval);
499#if !defined(SP_DISABLE_ABBREVIATION)
500#define getfilesize spGetFileSize
501#define getfilesize_txt spGetTextFileSize
502#define fskipheader spFSkipHeader
503#define fskipbyte spFSkipByte
504#define shiftshort spShiftShort
505#define shiftlong spShiftLong
506#define shiftfloat spShiftFloat
507#define shiftdouble spShiftDouble
508#define swapshort spSwapShort
509#define swaplong spSwapLong
510#define swaplong32 spSwapLong32
511#define swapulong32 spSwapULong32
512#define swapfloat spSwapFloat
513#define swapdouble spSwapDouble
514#define freadshort spFReadShort
515#define freadlong spFReadLong
516#define freadlong32 spFReadLong32
517#define freadulong32 spFReadULong32
518#define freadlong24 spFReadLong24
519#define freadulong24 spFReadULong24
520#define freadlong64 spFReadLong64
521#define freadulong64 spFReadULong64
522#define freadfloatweighted spFReadFloatWeighted
523#define freadfloat spFReadFloat
524#define freaddoubleweighted spFReadDoubleWeighted
525#define freaddouble spFReadDouble
526#define freadbyte spFReadByte
527#define freadsbyte spFReadSignedByte
528#define freadulaw spFReadULaw
529#define freadalaw spFReadALaw
530#define freadshorttodweighted spFReadShortToDoubleWeighted
531#define freadshorttod spFReadShortToDouble
532#define freadlongtodweighted spFReadLongToDoubleWeighted
533#define freadlongtod spFReadLongToDouble
534#define freadlong32todweighted spFReadLong32ToDoubleWeighted
535#define freadlong32tod spFReadLong32ToDouble
536#define freadlong24todweighted spFReadLong24ToDoubleWeighted
537#define freadlong24tod spFReadLong24ToDouble
538#define freadfloattodweighted spFReadFloatToDoubleWeighted
539#define freadfloattod spFReadFloatToDouble
540#define freadbittodoubleweighted spFReadBitToDoubleWeighted
541#define freadbittodouble spFReadBitToDouble
542#define freadframebit spFReadFrameBit
544#define fwriteshort spFWriteShort
545#define fwritelong spFWriteLong
546#define fwritelong32 spFWriteLong32
547#define fwriteulong32 spFWriteULong32
548#define fwritelong24 spFWriteLong24
549#define fwriteulong24 spFWriteULong24
550#define fwritelong64 spFWriteLong64
551#define fwriteulong64 spFWriteULong64
552#define fwritefloatweighted spFWriteFloatWeighted
553#define fwritefloat spFWriteFloat
554#define fwritedoubleweighted spFWriteDoubleWeighted
555#define fwritedouble spFWriteDouble
556#define fwritebyte spFWriteByte
557#define fwritesbyte spFWriteSignedByte
558#define fwriteulaw spFWriteULaw
559#define fwritealaw spFWriteALaw
560#define fwritedoubletosweighted spFWriteDoubleToShortWeighted
561#define fwritedoubletos spFWriteDoubleToShort
562#define fwritedoubletolweighted spFWriteDoubleToLongWeighted
563#define fwritedoubletol spFWriteDoubleToLong
564#define fwritedoubletol32weighted spFWriteDoubleToLong32Weighted
565#define fwritedoubletol32 spFWriteDoubleToLong32
566#define fwritedoubletol24weighted spFWriteDoubleToLong24Weighted
567#define fwritedoubletol24 spFWriteDoubleToLong24
568#define fwritedoubletofweighted spFWriteDoubleToFloatWeighted
569#define fwritedoubletof spFWriteDoubleToFloat
570#define fwritedoubletobitweighted spFWriteDoubleToBitWeighted
571#define fwritedoubletobit spFWriteDoubleToBit
572#define fwriteframebit spFWriteFrameBit
573#define fwritelong32tos spFWriteLong32ToShort
574#define fwritelong24tos spFWriteLong24ToShort
576#define getnumrow spGetNumRow
577#define getnumcol spGetNumColumn
578#define fgetncol spFGetNColumn
579#define fgetcol spFGetColumn
580#define sgetncol spSGetNColumn
581#define sgetcol spSGetColumn
582#define sgetnextncol spSGetNextNColumn
583#define fgetnline spFGetNLine
584#define fgetline spFGetLine
585#define getline spGetLine
586#define fputline spFPutLine
587#define sputline spSPutLine
588#define fputstring spFPutString
589#define sputstring spSPutString
590#define fgetsn spFGetNString
591#define getsn spGetNString
592#define sgetsn spSGetNString
594#define snscansetup spSScanNSetup
595#define sscansetup spSScanSetup
597#define linear2alaw spLinear2ALaw
598#define alaw2linear spALaw2Linear
599#define linear2ulaw spLinear2ULaw
600#define ulaw2linear spULaw2Linear
601#define alaw2ulaw spALaw2ULaw
602#define ulaw2alaw spULaw2ALaw
604#define getsiglen spGetSignalLength
605#define fskipdata spFSkipData
608#define skipheader spFSkipHeader
609#define skipbyte spFSkipByte
610#define skipdata spFSkipData
612#define getnumrow_txt spGetNumRow
613#define getnumcol_txt spGetNumColumn
615#define fgetcol_txt spFGetColumn
616#define sgetcol_txt spSGetColumn
618#define gets0 spGetNString
#define spBYTE
Definition spDefs.h:200
#define spLONG
Definition spDefs.h:194
#define spWORD
Definition spDefs.h:201
#define spINT8
Definition spDefs.h:198
#define spINT16
Definition spDefs.h:199
#define spULONG
Definition spDefs.h:195
void spShiftLong(long *data, long length, long shift)
long spFWriteLong(long *data, long length, int swap, FILE *fp)
long spFReadByte(short *data, long length, FILE *fp)
void spShiftShort(short *data, long length, long shift)
int spSGetNColumn(char *buf, int size, int col, const char *line)
int spFPutString(const char *input, FILE *fp)
int spSScanNSetup(const char *line, char *name, int namelen, char *value, int valuelen)
long spFWriteWORD(spWORD *data, long length, FILE *fp)
long spFReadFloatToDouble(double *data, long length, int swap, FILE *fp)
long spFWriteLong64(spLong64 *data, long length, int swap, FILE *fp)
long spFReadLong(long *data, long length, int swap, FILE *fp)
long spFWriteDoubleToFloat(double *data, long length, int swap, FILE *fp)
long spFWriteDoubleToShortWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFReadFloatToDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFReadULaw(short *data, long length, FILE *fp)
long spFWriteFloat(float *data, long length, int swap, FILE *fp)
spFileOffset spGetFileSize(const char *filename, long headsize)
long spFWriteINT16(spINT16 *data, long length, FILE *fp)
long spFWriteFloatWeighted(float *data, long length, float weight, int swap, FILE *fp)
void spSwapDouble(double *data, long length)
long spFReadFloatWeighted(float *data, long length, float weight, int swap, FILE *fp)
long spFReadLong64(spLong64 *data, long length, int swap, FILE *fp)
long spFReadLong24ToDouble(double *data, long length, int swap, FILE *fp)
int spFGetLine(char *buf, FILE *fp)
long spFWriteByte(short *data, long length, FILE *fp)
long spFWriteDoubleToLong(double *data, long length, int swap, FILE *fp)
long spFWriteULong32(unsigned long *data, long length, int swap, FILE *fp)
long spFWriteULONG(spULONG *data, long length, FILE *fp)
int spFGetColumn(char *buf, int col, FILE *fp)
char * spFGetNString(char *buf, int size, FILE *fp)
long spFReadLong32Direct(spLong32 *data, long length, int swap, FILE *fp)
long spFReadULONG(spULONG *data, long length, FILE *fp)
long spFWriteBYTE(spBYTE *data, long length, FILE *fp)
long spFWriteULaw(short *data, long length, FILE *fp)
long spFWriteDoubleToLong32Weighted(double *data, long length, double weight, int swap, FILE *fp)
long spFReadULong32(unsigned long *data, long length, int swap, FILE *fp)
long spFReadWORD(spWORD *data, long length, FILE *fp)
long spFReadULong64(spULong64 *data, long length, int swap, FILE *fp)
int spGetNLine(char *buf, int size)
long spFReadLongToDouble(double *data, long length, int swap, FILE *fp)
long spFReadLongToDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFReadBitToDoubleWeighted(double *data, long length, double weight, int samp_bit, int swap, FILE *fp)
long spFWriteDoubleToBitWeighted(double *data, long length, double weight, int samp_bit, int swap, FILE *fp)
void spSwapLong(long *data, long length)
void spSwapFloat(float *data, long length)
char * spSGetNextNColumn(char *buf, int size, const char *line)
long spFWriteLong32Direct(spLong32 *data, long length, int swap, FILE *fp)
void spSwapLong64(spLong64 *data, long length)
int spSGetColumn(char *buf, int col, const char *line)
void spShiftFloat(float *data, long length, long shift)
long spFWriteDouble(double *data, long length, int swap, FILE *fp)
long spFWriteDoubleToShort(double *data, long length, int swap, FILE *fp)
long spFWriteDoubleToLongWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFWriteULong64(spULong64 *data, long length, int swap, FILE *fp)
long spFReadBitToDouble(double *data, long length, double max, int samp_bit, int swap, FILE *fp)
long spFReadShortToDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFReadINT8(spINT8 *data, long length, FILE *fp)
long spFReadLONG(spLONG *data, long length, FILE *fp)
char * spSGetNextCSVNColumn(char *buf, int size, const char *line)
int spGetCSVNumColumn(const char *filename)
long spFWriteDoubleToLong24Weighted(double *data, long length, double weight, int swap, FILE *fp)
long spFReadBYTE(spBYTE *data, long length, FILE *fp)
long spFWriteINT8(spINT8 *data, long length, FILE *fp)
long spFReadLong24(long *data, long length, int swap, FILE *fp)
long spFReadLong32(long *data, long length, int swap, FILE *fp)
int spSGetCSVNColumn(char *buf, int size, int col, const char *line)
int spSPutString(const char *input, char *line, int size)
long spFReadLong24ToDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spGetTextFileSize(const char *filename)
int spGetNumColumn(const char *filename)
long spFWriteLong32(long *data, long length, int swap, FILE *fp)
int spFGetCSVNColumn(char *buf, int size, int col, FILE *fp)
void spSwapShort(short *data, long length)
void spSwapULong32(spULong32 *data, long length)
long _spDeinterleaveData(char *idata, long ilength, char *ddata, long dlength, int num_channel, int samp_byte)
void spShiftDouble(double *data, long length, long shift)
int spGetCSVNumRow(const char *filename)
int spFGetNColumn(char *buf, int size, int col, FILE *fp)
long _spInterleaveData(char *ddata, long dlength, char *idata, long ilength, int num_channel, int samp_byte)
char * spGetNString(char *buf, int size)
long spFWriteALaw(short *data, long length, FILE *fp)
long spFReadDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFWriteLONG(spLONG *data, long length, FILE *fp)
long spFReadULong24(unsigned long *data, long length, int swap, FILE *fp)
char * spSGetNString(char *buf, int size, const char *string)
long spFWriteShort(short *data, long length, int swap, FILE *fp)
int spSPutLine(const char *input, char *line, int size)
long spFWriteDoubleToFloatWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFWriteDoubleToBit(double *data, long length, double max, int samp_bit, int swap, FILE *fp)
long spFWriteLong32ToShort(long *data, long length, int swap, FILE *fp)
long spFReadLong32ToDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
void spFSkipHeader(long headsize, FILE *fp)
long spFReadULong32Direct(spULong32 *data, long length, int swap, FILE *fp)
int spFGetNLine(char *buf, int size, FILE *fp)
void spSwapLong32(spLong32 *data, long length)
int spSScanSetup(const char *line, char *name, char *value)
int spGetNumRow(const char *filename)
long spFWriteLong24ToShort(long *data, long length, int swap, FILE *fp)
long spFWriteDoubleWeighted(double *data, long length, double weight, int swap, FILE *fp)
long spFWriteDoubleToLong24(double *data, long length, int swap, FILE *fp)
long spFReadALaw(short *data, long length, FILE *fp)
long spFReadShortToDouble(double *data, long length, int swap, FILE *fp)
long spFReadShort(short *data, long length, int swap, FILE *fp)
long spFReadLong32ToDouble(double *data, long length, int swap, FILE *fp)
long spFWriteLong24(long *data, long length, int swap, FILE *fp)
void spSwapULong64(spULong64 *data, long length)
long spFWriteSignedByte(short *data, long length, FILE *fp)
int spFPutLine(const char *input, FILE *fp)
long spFReadFloat(float *data, long length, int swap, FILE *fp)
long spFWriteULong32Direct(spULong32 *data, long length, int swap, FILE *fp)
long spFWriteULong24(unsigned long *data, long length, int swap, FILE *fp)
long spFReadDouble(double *data, long length, int swap, FILE *fp)
long spFSkipByte(long len, FILE *fp)
long spFReadINT16(spINT16 *data, long length, FILE *fp)
long spFWriteDoubleToLong32(double *data, long length, int swap, FILE *fp)
long spFReadSignedByte(short *data, long length, FILE *fp)