Db_buffer *new_buf (PktChannel *src, Save_params *params) { Db_buffer *buf; int maxsamp ; allot (Db_buffer *, buf, 1); strncpy (buf->net, src->net, PKT_NAMESIZE); strncpy (buf->sta, src->sta, PKT_NAMESIZE); strncpy (buf->chan, src->chan, PKT_NAMESIZE); buf->stime = src->time; buf->crnt_time = src->time; buf->samprate = src->samprate; buf->nsamp = 0 ; buf->data = 0; buf->params = params; if( buf->params->segsiz ) buf->tmax = buf->stime + buf->params->segsiz ; else buf->tmax = BIG_NUMBER ; buf->db = params->db; buf->file = 0 ; buf->path = 0 ; if ( params->datacode == trSEED ) { buf->steim = stinit (buf); } else { buf->steim = 0 ; } return buf ; }
void init() { system("cls"); printf("**********************************\n"); printf("* *\n"); printf("**********************************\n"); system("pause"); stinit(); }
void wrt_last_rec ( Db_buffer *buf ) { int result ; char *s ; if ( buf->params->datacode == trSEED ) { result = csteim (buf->steim, save_seed, 0, 0) ; if ( result < 0 ) die ( 1, "steim compression failed to write final bytes\n" ) ; else if ( result > 0 ) { complain ( 1, "steim compression problems for %s_%s_%s at %s\n", buf->net, buf->sta, buf->chan, s=strtime(buf->crnt_time) ); free(s) ; } if ( buf->steim != 0 ) { freesteim ( buf->steim ) ; buf->steim = stinit ( buf ) ; } } }