uint
    FILENAME_SIZE = 30,
    POINTERSIZE = (1 + 16 + 1) * 2;

ushort
    TOPAZ_EIGHTY = 8,
    TOPAZ_SIXTY = 9;

type
    timeval_t = unknown 8,

    Preferences_t = struct {
	ushort pr_FontHeight;
	ushort pr_PrinterPort;
	uint pr_BaudRate;
	timeval_t pr_KeyRptSpeed, pr_KeyRptDelay, pr_DoubleClick;
	[POINTERSIZE]uint pr_PointerMatrix;
	ushort pr_XOffset, pr_YOffset;
	uint pr_color17, pr_color18, pr_color19;
	uint pr_PointerTicks;
	uint pr_color0, pr_color1, pr_color2, pr_color3;
	ushort pr_ViewXOffset, pr_ViewYOffset;
	uint pr_ViewInitX, ViewInitY;
	uint pr_EnableCLI;
	uint pr_PrinterType;
	[FILENAME_SIZE]char pr_PrinterFileName;
	uint pr_PrintPitch;
	uint pr_PrintQuality;
	uint pr_PrintSpacing;
	uint pr_PrintLeftMargin;
	uint pr_PrintRightMargin;
	uint pr_PrintImage;
	uint pr_PrintAspect;
	int pr_PrintThreshold;
	uint pr_PaperSize;
	uint pr_PaperLength;
	uint pr_PaperType;
	ushort pr_SerRWBits;
	ushort pr_SerStopBuf;
	ushort pr_SerParShk;
	ushort pr_LaceWB;
	[FILENAME_SIZE]char pr_WorkName;
	[16]byte pr_padding;
    };

ushort
    LACEWB	    = 0x01,

    PARALLEL_PRINTER= 0x00,
    SERIAL_PRINTER  = 0x01,

    BAUD_110	    = 0x00,
    BAUD_300	    = 0x01,
    BAUD_1200	    = 0x02,
    BAUD_2400	    = 0x03,
    BAUD_4800	    = 0x04,
    BAUD_9600	    = 0x05,
    BAUD_19200	    = 0x06,
    BAUD_MIDI	    = 0x07,

    FANFOLD	    = 0x00,
    SINGLE	    = 0x80;

uint
    PICA	    = 0x0000,
    ELITE	    = 0x0400,
    FINE	    = 0x0800,

    DRAFT	    = 0x0000,
    LETTER	    = 0x0100,

    SIX_LPI	    = 0x0000,
    EIGHT_LPI	    = 0x0200,

    IMAGE_POSITIVE  = 0x0000,
    IMAGE_NEGATIVE  = 0x0001,

    ASPECT_HORIZ    = 0x0000,
    ASPECT_VERT     = 0x0001,

    SHADE_BW	    = 0x0000,
    SHADE_GREYSCALE = 0x0001,
    SHADE_COLOR     = 0x0002,

    US_LETTER	    = 0x0000,
    US_LEGAL	    = 0x0010,
    N_TRACTOR	    = 0x0020,
    W_TRACTOR	    = 0x0030,
    CUSTOM	    = 0x0040,

    CUSTOM_NAME     = 0x0000,
    ALPHA_P_101     = 0x0001,
    BROTHER_15XL    = 0x0002,
    CBM_MPS1000     = 0x0003,
    DIAB_630	    = 0x0004,
    DIAB_ADB_D25    = 0x0005,
    DIAB_C_150	    = 0x0006,
    EPSON	    = 0x0007,
    EPSON_JX_80     = 0x0008,
    OKIMATE_20	    = 0x0009,
    QUME_LP_20	    = 0x000A,
    HP_LASERJET     = 0x000B,
    HP_LASERJET_PLUS= 0x000C;

ushort
    SREAD_BITS	    = 0xF0,
    SWRITE_BITS     = 0x0F,

    SSTOP_BITS	    = 0xF0,
    SBUFSIZE_BITS   = 0x0F,

    SPARITY_BITS    = 0xF0,
    SHSHAKE_BITS    = 0x0F,

    SPARITY_NONE    = 0,
    SPARITY_EVEN    = 1,
    SPARITY_ODD     = 2,

    SHSHAKE_XON     = 0,
    SHSHAKE_RTS     = 1,
    SHSHAKE_NONE    = 2;

extern
    GetDefPrefs(*Preferences_t pref; ulong size)*Preferences_t,
    GetPrefs(*Preferences_t pref; ulong size)*Preferences_t,
    SetPrefs(*Preferences_t pref; ulong size; ulong inform)void,
    SRBNUM(ushort n)ushort,
    SWBNUM(ushort n)ushort,
    SSBNUM(ushort n)ushort,
    SPARNUM(ushort n)ushort,
    SHAKNUM(ushort n)ushort;
