// CNT3.C - Routinen zum CNT3-Format
// Written by Stefan Pfeiffer, DL1ELY, 960528
// Last Modification: 960528
// (C) 1996 by Stefan Pfeiffer

#include "cnt3.h"
#include <stdio.h>
#include <mem.h>


char read_cnt3_header(FILE *f, struct cnt3_header *h)
{
   return(fread(h,1,CNT3_HEADER_SIZE,f)==CNT3_HEADER_SIZE);
};

void write_cnt3_header(FILE *f, struct cnt3_header *h)
{
   fwrite(h,1,CNT3_HEADER_SIZE,f);
};


char read_band_header(FILE *f, struct band_header *h)
{
   memset(h,0,BAND_SIZE);

   return(fread(h,1,BAND_SIZE_FILE,f)==BAND_SIZE_FILE);
};

void write_band_header(FILE *f, struct band_header *h)
{
   fwrite(h,1,BAND_SIZE_FILE,f);
};


char read_operator_record(FILE *f, struct operator_header *h)
{   
   memset(h,0,OPERATOR_SIZE);

   return(fread(h,1,OPERATOR_SIZE_FILE,f)==OPERATOR_SIZE_FILE);
};

void write_operator_record(FILE *f, struct operator_header *h)
{
   fwrite(h,1,OPERATOR_SIZE_FILE,f);
};


char read_qso_record(FILE *f, struct qso_record *q)
{
   memset(q,0,QSO_SIZE);

   return(fread(q,1,QSO_SIZE_FILE,f)==QSO_SIZE_FILE);
};

void write_qso_record(FILE *f, struct qso_record *q)
{
   fwrite(q,1,QSO_SIZE_FILE,f);
};

