#ifndef __INC_POS_PDOS_SEGMENT_H
#define __INC_POS_PDOS_SEGMENT_H
/*******************************************************************
 Includes Release 24
 (C) Copyright 1995-1997 proDAD
     All Rights Reserved

 $AUT Holger Burkarth
 $DAT >>Segment.h<<   24 Mar 1997    10:11:47 - (C) ProDAD
*******************************************************************/
#ifndef __INC_POS_PDOS_DOSTYPES_H
#include <pDOS/DosTypes.h>
#endif
#ifndef __INC_POS_PEXEC_LIST_H
#include <pExec/List.h>
#endif
#ifndef __INC_POS_PDOS_DOSBASE_H
#include <pDOS/DosBase.h>
#endif
 #ifndef __INC_POS_PEXEC_EXECBASE_H
 #include <pExec/ExecBase.h>
 #endif


/*----------------------------------
-----------------------------------*/
struct pOS_Segment
{
  struct pOS_Segment* seg_Next;
  size_t              seg_Size;
  UBYTE               seg_Reserved2[8];
};



/*----------------------------------
-----------------------------------*/
struct pOS_SegmentLst
{
  struct pOS_ExNode  sel_Node;

  UWORD              sel_UsedCnt;
  UWORD              sel_Flags;     /* (enum pOS_SegmLstFlags) */

  VOID (*sel_Func)(_R_LB struct pOS_DosBase*,_R_A0 const struct pOS_SegmentLst*);

  UBYTE              sel_Reserved2[8];
  struct pOS_Segment sel_Seg;
};




enum pOS_SegmLstFlags
{
  SEGLSF_ROM      =0x0001,      /* Seg befindet sich im ROM */
  SEGLSF_NoPrg    =0x0002,      /* Segm darf nicht als Command gestartet werden (Device,Library) */
  SEGLSF_Script   =0x0004,      /* Segm is Script */
  SEGLSF_Pure     =0x0008,      /* FIBF_Pure is set */

  SEGLSF_FreeName =0x0100       /* sel_Node.ln_Name is pOS_AllocVec()ed */
};




/*----------------------------------
-----------------------------------*/
struct pOS_ISegmentData
{
  struct pOS_SegmentLst *isgd_SegmLst;      /* Result */
  struct pOS_FileHandle *isgd_FH;           /* (~NULL) */
  SLONG                  isgd_Error;
  UBYTE                  isgd_Reserved1[8];

  __ARID__ APTR (*isgd_Alloc_func)(_R_LB struct pOS_ExecBase*,_R_D0 size_t,_R_D1 ULONG requ,_R_A4 struct pOS_ISegmentData*);
  VOID          (*isgd_Free_func) (_R_LB struct pOS_ExecBase*,_R_A0 __ARID__ APTR adr,_R_D0 size_t,_R_A4 struct pOS_ISegmentData*);
  dossize_t     (*isgd_Read_func) (_R_LB struct pOS_DosBase*, _R_A0 struct pOS_FileHandle*,_R_A1 APTR,_R_D0 dossize_t,_R_A4 struct pOS_ISegmentData*);

  UBYTE isgd_Reserved2[8];
};



#endif
