ГОСТ Р 56047—2014
int
BitForSample(FILE *fp)
{
int bit, offset;
if ((offset = HeaderDump(fp,"fmt *)) == -1)
return -1;
if (fseek(fp. 18. SEEK_CUR) == -1)
fatalerr(’err: %s". strerrorferrno));
bit = Readlnt(fp.2);
fseek(fp. -18 - offset. SEEK_CUR);
return bit;
}
int
NumOfChan(FILE *fp)
{
int chan, offset;
if ((offset = HeaderDump(fp.’fmt *)) == -1)
return -1;
if (fseek(fp. 6. SEEK_CUR) == -1)
fatalerrferr: %s”. strerror(errno));
chan = Readlnt(fp.2);
fseek(fp. -6 - offset. SEEK_CUR);
return chan;
}
int
FindData(FILE 4p)
{
int offset;
if (fp == NULL)
return -1;
if ((offset = HeaderDump(fp.*data">) == -1)
return -1;
if (fseek(fp, 4 + offset. SEEK_CUR) == -1)
fatalenf’err; %s“. strerror(errno));
return 1;
}
#if defined(LITTLE) && !derined(BIG)
int
Readlnt(FILE *fp. int size)
{
int I;
unsigned char c;
if (size <= 0)
return 0;
c = fgetc(fp);
I = ((int) c) & 255;
11= (Readlnt(fp. size-1)« 8);
return I;
}
#etif defined(BIG) && !defined(LITTLE)
int
Readlnt(FILE *fp. int size)
{
int l:
88