{ Based on MKMsgSqu - Copyright 1993 by Mark May (1:110/290;maym@dmapub.dma.org)
Changes (c) 1998-2000 by Bernhard R. Link (2:2476/841.64;brl@gmx.de)
****************************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
****************************************************************************}
Unit MkSqType;
{$I platform.inc}
{$I mkglobal.inc}
{$I gpackrec.inc}
interface
Uses {$IFDEF PPC_VIRTUAL}
     use32,
     {$ENDIF}
     aTypes,aString, {independent aXX-Types}
     FTNAddr;        {Addresses e.a.}

Const
  SqHdrId = $AFAE4453;
  SqLinkNext = 0;
  SqLinkPrev = 1;
  SqNullFrame = 0;
  SqFrameMsg = 0;
  SqFrameFree = 1;
  SqFrameRLE = 2;
  SqFrameLZW = 3;
  SqFromSize = 36;
  SqToSize = 36;
  SqSubjSize = 72;
  SqMaxReply = 10;

Type SqBaseType = packed Record
  Len: uInt2; {Length of this record}
  Rsvd1: uInt2; {Future use}
  NumMsg: Int4; {Number of messages}
  HighMsg: Int4; {Highest msg}
  SkipMsg: Int4; {# of msgs to keep in beginning of area}
  HighWater: Int4; {High water UMsgId}
  Uid: Int4; {Next UMsgId}
  Base:array[0..79]of aChar;{Base name of Squish file}
  BeginFrame: TFileOfs4; {Offset of first frame in file}
  LastFrame: TFileOfs4; {Offset of last frame in file}
  FirstFree: TFileOfs4; {Offset of first free frame in file}
  LastFree: TFileOfs4; {Offset of last free frame in file}
  EndFrame: TFileOfs4; {Pointer to end of file}
  MaxMsg: Int4; {Maximum number of messages}
  KeepDays: uInt2; {Maximum age of messages}
  SqFrameHdrSize: uInt2; {Size of frame header}
  Rsvd2: Array[1..124] of uInt1; {Future use}
  End;


Type SqFrameHdrType = packed Record
  Id: uInt4; {Must equal SqHdrId}
  NextFrame: TFileOfs4; {Next msg frame}
  PrevFrame: TFileOfs4; {Prior msg frame}
  FrameLength: Int4; {Length of this frame not counting header}
  MsgLength: Int4; {Length of message}
  ControlLength: Int4; {Length of control information}
  FrameType: uInt2; {Type of message frame}
  Rsvd: uInt2; {Future use}
  End;


Type SqMsgHdrType = packed Record
  Attr: Int4; {Msg attribute}
  MsgFrom:Array[0..SqFromSize-1]of aChar;{Nul Term from name}
  MsgTo:Array[0..SqToSize-1]of achar;{Nul term to name}
  Subj:Array[0..SqSubjSize-1]of aChar;{Nul term subject}
  Orig: TFTNAddr; {Origin address}
  Dest: TFTNAddr; {Destination address}
  DateWritten: Int4; {Date/Time msg written}
  DateArrived: Int4; {Date/Time msg arrived here}
  UtcOffset: uInt2; {Minutes offset from UTC}
  ReplyTo: Int4; {Original msg}
  Replies: Array[1..SqMaxReply] of Int4; {Replies}
  AzDate: Array[0..19]of aChar;{AsciiZ "Fido" style date ('dd mmm yy  hh:mm:ss')}
  End;

implementation
end.

