/*ProfiPacket - packet radio terminal program
  Copyright (C) 1999  Alexander Feigl

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program 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 General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

  Author:

  Alexander Feigl
  Burachstraße 51

  D-88250 Weingarten

  Mail : Alexander.Feigl@gmx.de
*/


#ifndef AMIGAEMU_INCLUDED

#define AMIGAEMU_INCLUDED

#include <stddef.h>

/* defines for TRUE and FALSE */

#define TRUE 1
#define FALSE 0

/* defines for dos */

#define MODE_OLDFILE 1005
#define MODE_NEWFILE 1006
#define MODE_READWRITE 1004

#define OFFSET_BEGINNING -1
#define OFFSET_CURRENT 0
#define OFFSET_END 1

#define REC_SHARED 1

#define FORMAT_INT 0
#define DOS_FIB 0

/* defines for exec */

#define MEMF_PUBLIC 0

/* needed types */

typedef void *BPTR;
typedef void *Object;         /* dummy , remove when complete port */

/* needed exec structures */

struct Node {
    struct  Node *ln_Succ;
    struct  Node *ln_Pred;
    unsigned char     ln_Type;
      signed char     ln_Pri;
    unsigned char    *ln_Name;
};

#define NT_UNKNOWN 0


struct List {
   struct  Node    *lh_Head;
   struct  Node    *lh_Tail;
   struct  Node    *lh_TailPred;
   unsigned char    lh_Type;
   unsigned char    lh_pad;
 };

struct DateStamp {

   unsigned long    ds_Days;
   unsigned long    ds_Minute;
   unsigned long    ds_Tick;
 };

struct Hook
{
    struct Node    h_MinNode;
    unsigned long  (*h_Entry)();
    unsigned long  (*h_SubEntry)();    /* dummy, remove when complete port*/
    void *	   h_Data;		
};

struct ClockData
{
    unsigned short sec;
    unsigned short min;
    unsigned short hour;
    unsigned short mday;
    unsigned short month;
    unsigned short year;
    unsigned short wday;
};

struct DateTime {
	struct DateStamp  dat_Stamp;
	unsigned char     dat_Format;
	unsigned char     dat_Flags;
	unsigned char    *dat_StrDay;
	unsigned char    *dat_StrDate;
	unsigned char    *dat_StrTime;
};


struct FileInfoBlock {
   unsigned long       fib_DiskKey;
   unsigned long       fib_DirEntryType;
   unsigned char       fib_FileName[108];
   unsigned long       fib_Protection;
   unsigned long       fib_EntryType;
   unsigned long       fib_Size;
   unsigned long       fib_NumBlocks;
   struct DateStamp    fib_Date;
   unsigned char       fib_Comment[80];
};


void *AllocVec(unsigned long size,unsigned long requirements);
void FreeVec(void *memory);

BPTR Open(const unsigned char *file,unsigned long mode);
signed long Read(BPTR file,const void *memory,unsigned long size);
signed long Write(BPTR file,void *memory,unsigned long size);
void Close(BPTR file);
int DeleteFile(const unsigned char *file);

void RawDoFmt(const unsigned char *format,void *data,
              void (*proc)(),unsigned char *dest);
              

#endif AMIGAEMU_INCLUDED