// read the header of a neuroscan file
// to determine offsets of arguments
#define N_ELECT 31
#include "sethead.h"
#include <stdio.h>
#include <stdlib.h> 

int main() {

FILE *f; 
SETUP *realheader;

realheader = (SETUP *)malloc(900);
f = fopen( "gro1ff01.CNT", "r");
fread( realheader, 900, 1, f);

printf("Rev          : offset %4d\t\tvalue %s\n", 
	(char *)(&(realheader->rev))-(char *)realheader, 
	realheader->rev);

printf("Type         : offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->type))-(char *)realheader, 
	realheader->type);

printf("Id           : offset %4d\t\tvalue %s\n", 
	(char *)(&(realheader->id))-(char *)realheader, 
	realheader->id);

printf("Eegupdate    : offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->eegupdate))-(char *)realheader, 
	realheader->eegupdate);

printf("Pnts         : offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->pnts))-(char *)realheader, 
	realheader->pnts);

printf("Nchannels    : offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->nchannels))-(char *)realheader, 
	realheader->nchannels);

printf("ChannelOffset: offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->ChannelOffset))-(char *)realheader, 
	realheader->ChannelOffset);

printf("NumSamples   : offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->NumSamples))-(char *)realheader, 
	realheader->NumSamples);

printf("Rate         : offset %4d\t\tvalue %d\n", 
	(char *)(&(realheader->rate))-(char *)realheader, 
	realheader->rate);
}

