DEFINITION MODULE AmigaGuideD;(*$Implementation:=FALSE*)
(* 03-May-94/bp *)

(* V39 *)

FROM SYSTEM IMPORT
  ADDRESS,BPTR,LONGSET;
FROM ExecD IMPORT
  Library,Message,Node;
FROM UtilityD IMPORT
  tagUser,Hook,TagItemPtr;


CONST
  amigaGuideName="amigaguide.library";
TYPE
  AmigaGuideBasePtr=POINTER TO AmigaGuideBase;
  AmigaGuideBase=RECORD
    lib:Library;
  END;

CONST
  apshToolID=11000;
  startupMsgID		=apshToolID+1;
  loginToolID		=apshToolID+2;
  logoutToolID		=apshToolID+3;
  shutdownMsgID		=apshToolID+4;
  activateToolID	=apshToolID+5;
  deactivateToolID	=apshToolID+6;
  activeToolID		=apshToolID+7;
  inactiveToolID	=apshToolID+8;
  toolStatusID		=apshToolID+9;
  toolCmdID		=apshToolID+10;
  toolCmdReplyID	=apshToolID+11;
  shutdownToolID	=apshToolID+12;

(* Tags fuer GetAmigaGuideAttr(): *)
  agaDummy=tagUser;
  agaPath=agaDummy+1;
  agaXRefList=agaDummy+2;
  agaActivate=agaDummy+3;
  agaContext=agaDummy+4;
  agaHelpGroup=agaDummy+5;
  agaReserved1=agaDummy+6;
  agaReserved2=agaDummy+7;
  agaReserved3=agaDummy+8;
  agaARexxPort=agaDummy+9;
  agaARexxPortName=agaDummy+10;

TYPE
  StrPtr=ADDRESS; (* zeigt auf String *)
  AMIGAGUIDECONTEXT=ADDRESS;
  AmigaGuideContext=ADDRESS;

  AmigaGuideMsgPtr=POINTER TO AmigaGuideMsg;
  AmigaGuideMsg=RECORD
    msg:Message;
    type:LONGCARD;
    data:ADDRESS;
    sSize:LONGCARD;
    dType:LONGCARD;
    priRet:LONGCARD;
    secRet:LONGCARD;
    system1:ADDRESS;
    system2:ADDRESS;
  END;

  NewAmigaGuidePtr=POINTER TO NewAmigaGuide;
  NewAmigaGuide=RECORD
    lock:BPTR;
    name:StrPtr;
    screen:ADDRESS; (*ScreenPtr; no Intuition! *)
    pubScreen:StrPtr;
    hostPort:StrPtr;
    clientPort:StrPtr;
    baseName:StrPtr;
    flags:LONGSET;
    context:POINTER TO StrPtr;
    node:StrPtr;
    line:LONGINT;
    extens:TagItemPtr;
    client:ADDRESS;
  END;

CONST
  (* Bitnummern fuer Flags: *)
  htLoadIndex=0;
  htLoadAll=1;
  htCacheNode=2;
  htCacheDb=3;
  htUnique=15;
  htNoActive=16;

  htfcSysGads=LONGSET{31};

  hthOpen=0;
  hthClose=1;

  hterrNotEnoughMemory	=100;
  hterrCantOpenDatabase	=101;
  hterrCantFindNode	=102;
  hterrCantOpenNode	=103;
  hterrCantOpenWindow	=104;
  hterrInvalidCommand	=105;
  hterrCantComplete	=106;
  hterrPortClosed	=107;
  hterrCantCreatePort	=108;
  hterrKeywordNotFound	=113;

TYPE
  XRefPtr=POINTER TO XRef;
  XRef=RECORD
    node:Node;
    pad:CARDINAL;
    df:ADDRESS; (*DocFilePtr; nicht definiert? *)
    file:StrPtr;
    name:StrPtr;
    line:LONGINT;
  END;

CONST
  xrSize=SIZE(XRef);

  xrGeneric	=0;
  xrFunction	=1;
  xrCommand	=2;
  xrInclude	=3;
  xrMacro	=4;
  xrStruct	=5;
  xrField	=6;
  xrTypedef	=7;
  xrDefine	=8;

TYPE
  AmigaGuideHostPtr=POINTER TO AmigaGuideHost;
  AmigaGuideHost=RECORD
    dispatcher:Hook;
    reserved:LONGCARD;
    flags:LONGSET;
    useCnt:LONGCARD;
    systemData:ADDRESS;
    userData:ADDRESS;
  END;

CONST
  hmFindNode=1;
  hmOpenNode=2;
  hmCloseNode=3;
  hmExpunge=10;

TYPE
  (* hmFindNode *)
  opFindHostPtr=POINTER TO opFindHost;
  opFindHost=RECORD
    methodID:LONGCARD;
    attrs:TagItemPtr;
    name:StrPtr;
    toc:StrPtr;
    title:StrPtr;
    next:StrPtr;
    prev:StrPtr;
  END;

  (* hmOpenNode, hmCloseNode *)
  opNodeIOPtr=POINTER TO opNodeIO;
  opNodeIO=RECORD
    methodID:LONGCARD;
    attrs:TagItemPtr;
    node:StrPtr;
    fileName:StrPtr;
    docBuffer:StrPtr;
    buffLen:LONGCARD;
    flags:LONGSET;
  END;

CONST
  (* FlagBits: *)
  htnKeep=0;
  htnReserved1=1;
  htnReserved2=2;
  htnASCII=3;
  htnReserved3=4;
  htnClean=5;
  htnDone=6;

  (* Tags: *)
  htnaScreen	=tagUser+1;
  htnaPens	=tagUser+2;
  htnaRectangle	=tagUser+3;
  htnaHelpGroup =tagUser+5;

TYPE
  (* hmExpunge *)
  opExpungeNodePtr=POINTER TO opExpungeNode;
  opExpungeNode=RECORD
    methodID:LONGCARD;
    attrs:TagItemPtr;
  END;

END AmigaGuideD.noimp
