// QSL.H
// Written by Stefan Pfeiffer, 950425
// Last modification: 950429
// (C) 1995 by Stefan Pfeiffer, DL1ELY

#ifndef QSL_H

#define QSL_H

#include "structs.h"
#include "wildmat.h"
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>

#define  TITLE     "QSL-Druck"
#define  VERSION   "v1.01"
#define  AUTHOR    "Stefan Pfeiffer, DL1ELY"
#define  DATE      "950429"

#define  INCH2MM   (float)254
#define  MM2INCH   (float)(1/INCH2MM)

typedef unsigned int UINT;
typedef signed int INT;
typedef unsigned char BYTE;
typedef unsigned char * PBYTE;
typedef unsigned long ULONG;

struct print_params
{
   BYTE unit;
   UINT vorlauf;
   UINT etikett_rand;
   UINT linker_rand;
   UINT rechter_rand;
   UINT oberer_rand;
   UINT unterer_rand;
   UINT breite;
   UINT hoehe;
   UINT abstand;
};

struct date_rec
{
   BYTE day;
   BYTE mon;
   BYTE year;
};

struct qso_filter
{
   BYTE call[20];
   BYTE locator[20];
   UINT min_dist, max_dist;
   BYTE min_hour, min_minute;
   BYTE max_hour, max_minute;
   UINT min_nr, max_nr;
   UINT min_angle, max_angle;
};

struct qso_entry
{
   BYTE call[16];
   unsigned long pos;
};


void vertvor(UINT, BYTE);
void horzvor(UINT);
void convert_print_params(struct print_params *);
void display_print_params(struct print_params);
void load_qsos(FILE *,struct qso_filter);
void sort_qsos(void);
void print_qsos(PBYTE,PBYTE,FILE *,struct date_rec date,UINT,struct print_params);
void test_print(struct print_params);
void get_date(struct date_rec *);
void get_qso_mask(struct qso_filter *);
void query_printer_params(struct print_params *);
void write_printer_params(struct print_params);
void test_print(struct print_params);
BYTE get_printer_params(struct print_params *);
void free_qsos(void);
void alloc_qsos(UINT);

#endif


