home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / libraries / amigaguide.h next >
C/C++ Source or Header  |  1993-10-15  |  7KB  |  237 lines

  1. #ifndef LIBRARIES_AMIGAGUIDE_H
  2. #define LIBRARIES_AMIGAGUIDE_H
  3. /*
  4. **    $VER: amigaguide.h 39.4 (22.3.93)
  5. **    Includes Release 40.15
  6. **
  7. **    C prototypes. For use with 32 bit integers only.
  8. **
  9. **    (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif /* EXEC_TYPES_H */
  15.  
  16. #ifndef EXEC_LISTS_H
  17. #include <exec/lists.h>
  18. #endif /* EXEC_LISTS_H */
  19.  
  20. #ifndef EXEC_NODES_H
  21. #include <exec/nodes.h>
  22. #endif /* EXEC_NODES_H */
  23.  
  24. #ifndef EXEC_SEMAPHORES_H
  25. #include <exec/semaphores.h>
  26. #endif
  27.  
  28. #ifndef INTUITION_INTUITION_H
  29. #include <intuition/intuition.h>
  30. #endif
  31.  
  32. #ifndef INTUITION_SCREENS_H
  33. #include <intuition/screens.h>
  34. #endif
  35.  
  36. #ifndef INTUITION_CLASSUSR_H
  37. #include <intuition/classusr.h>
  38. #endif
  39.  
  40. #ifndef DO_DOS_H
  41. #include <dos/dos.h>
  42. #endif
  43.  
  44. #ifndef UTILITY_TAGITEM_H
  45. #include <utility/tagitem.h>
  46. #endif
  47.  
  48. #ifndef APSH_TOOL_ID
  49. #define    APSH_TOOL_ID 11000L
  50. #define    StartupMsgID        (APSH_TOOL_ID+1L)    /* Startup message */
  51. #define    LoginToolID        (APSH_TOOL_ID+2L)    /* Login a tool SIPC port */
  52. #define    LogoutToolID        (APSH_TOOL_ID+3L)    /* Logout a tool SIPC port */
  53. #define    ShutdownMsgID        (APSH_TOOL_ID+4L)    /* Shutdown message */
  54. #define    ActivateToolID        (APSH_TOOL_ID+5L)    /* Activate tool */
  55. #define    DeactivateToolID    (APSH_TOOL_ID+6L)    /* Deactivate tool */
  56. #define    ActiveToolID        (APSH_TOOL_ID+7L)    /* Tool Active */
  57. #define    InactiveToolID        (APSH_TOOL_ID+8L)    /* Tool Inactive */
  58. #define    ToolStatusID        (APSH_TOOL_ID+9L)    /* Status message */
  59. #define    ToolCmdID        (APSH_TOOL_ID+10L)    /* Tool command message */
  60. #define    ToolCmdReplyID        (APSH_TOOL_ID+11L)    /* Reply to tool command */
  61. #define    ShutdownToolID        (APSH_TOOL_ID+12L)    /* Shutdown tool */
  62. #endif
  63.  
  64. /* Attributes accepted by GetAmigaGuideAttr() */
  65. #define    AGA_Dummy        (TAG_USER)
  66. #define    AGA_Path        (AGA_Dummy+1)
  67. #define    AGA_XRefList        (AGA_Dummy+2)
  68. #define    AGA_Activate        (AGA_Dummy+3)
  69. #define    AGA_Context        (AGA_Dummy+4)
  70.  
  71. #define    AGA_HelpGroup        (AGA_Dummy+5)
  72.     /* (ULONG) Unique identifier */
  73.  
  74. #define    AGA_Reserved1        (AGA_Dummy+6)
  75. #define    AGA_Reserved2        (AGA_Dummy+7)
  76. #define    AGA_Reserved3        (AGA_Dummy+8)
  77.  
  78. #define    AGA_ARexxPort        (AGA_Dummy+9)
  79.     /* (struct MsgPort *) Pointer to the ARexx message port (V40) */
  80.  
  81. #define    AGA_ARexxPortName    (AGA_Dummy+10)
  82.    /* (STRPTR) Used to specify the ARexx port name (V40) (not copied) */
  83.  
  84.  
  85. typedef void *AMIGAGUIDECONTEXT;
  86.  
  87. struct AmigaGuideMsg
  88. {
  89.     struct Message     agm_Msg;            /* Embedded Exec message structure */
  90.     ULONG         agm_Type;            /* Type of message */
  91.     APTR         agm_Data;            /* Pointer to message data */
  92.     ULONG         agm_DSize;            /* Size of message data */
  93.     ULONG         agm_DType;            /* Type of message data */
  94.     ULONG         agm_Pri_Ret;            /* Primary return value */
  95.     ULONG         agm_Sec_Ret;            /* Secondary return value */
  96.     APTR         agm_System1;
  97.     APTR         agm_System2;
  98. };
  99.  
  100. /* Allocation description structure */
  101. struct NewAmigaGuide
  102. {
  103.     BPTR         nag_Lock;            /* Lock on the document directory */
  104.     STRPTR         nag_Name;            /* Name of document file */
  105.     struct Screen    *nag_Screen;            /* Screen to place windows within */
  106.     STRPTR         nag_PubScreen;            /* Public screen name to open on */
  107.     STRPTR         nag_HostPort;            /* Application's ARexx port name */
  108.     STRPTR         nag_ClientPort;        /* Name to assign to the clients ARexx port */
  109.     STRPTR         nag_BaseName;            /* Base name of the application */
  110.     ULONG         nag_Flags;            /* Flags */
  111.     STRPTR        *nag_Context;            /* NULL terminated context table */
  112.     STRPTR         nag_Node;            /* Node to align on first (defaults to Main) */
  113.     LONG         nag_Line;            /* Line to align on */
  114.     struct TagItem    *nag_Extens;            /* Tag array extension */
  115.     VOID        *nag_Client;            /* Private! MUST be NULL */
  116. };
  117.  
  118. /* public Client flags */
  119. #define    HTF_LOAD_INDEX        (1L<<0)            /* Force load the index at init time */
  120. #define    HTF_LOAD_ALL        (1L<<1)            /* Force load the entire database at init */
  121. #define    HTF_CACHE_NODE        (1L<<2)            /* Cache each node as visited */
  122. #define    HTF_CACHE_DB        (1L<<3)            /* Keep the buffers around until expunge */
  123. #define    HTF_UNIQUE        (1L<<15)        /* Unique ARexx port name */
  124. #define    HTF_NOACTIVATE        (1L<<16)        /* Don't activate window */
  125.  
  126. #define    HTFC_SYSGADS        0x80000000
  127.  
  128. /* Callback function ID's */
  129. #define    HTH_OPEN        0
  130. #define    HTH_CLOSE        1
  131.  
  132. #define    HTERR_NOT_ENOUGH_MEMORY        100L
  133. #define    HTERR_CANT_OPEN_DATABASE    101L
  134. #define    HTERR_CANT_FIND_NODE        102L
  135. #define    HTERR_CANT_OPEN_NODE        103L
  136. #define    HTERR_CANT_OPEN_WINDOW        104L
  137. #define    HTERR_INVALID_COMMAND        105L
  138. #define    HTERR_CANT_COMPLETE        106L
  139. #define    HTERR_PORT_CLOSED        107L
  140. #define    HTERR_CANT_CREATE_PORT        108L
  141. #define    HTERR_KEYWORD_NOT_FOUND        113L
  142.  
  143. typedef struct AmigaGuideHost *AMIGAGUIDEHOST;
  144.  
  145. /* Cross reference node */
  146. struct XRef
  147. {
  148.     struct Node         xr_Node;            /* Embedded node */
  149.     UWORD         xr_Pad;            /* Padding */
  150.     struct DocFile    *xr_DF;                /* Document defined in */
  151.     STRPTR         xr_File;            /* Name of document file */
  152.     STRPTR         xr_Name;            /* Name of item */
  153.     LONG         xr_Line;            /* Line defined at */
  154. };
  155.  
  156. #define    XRSIZE    (sizeof (struct XRef))
  157.  
  158. /* Types of cross reference nodes */
  159. #define    XR_GENERIC    0
  160. #define    XR_FUNCTION    1
  161. #define    XR_COMMAND    2
  162. #define    XR_INCLUDE    3
  163. #define    XR_MACRO    4
  164. #define    XR_STRUCT    5
  165. #define    XR_FIELD    6
  166. #define    XR_TYPEDEF    7
  167. #define    XR_DEFINE    8
  168.  
  169. /* Callback handle */
  170. struct AmigaGuideHost
  171. {
  172.     struct Hook         agh_Dispatcher;        /* Dispatcher */
  173.     ULONG         agh_Reserved;            /* Must be 0 */
  174.     ULONG         agh_Flags;
  175.     ULONG         agh_UseCnt;            /* Number of open nodes */
  176.     APTR         agh_SystemData;        /* Reserved for system use */
  177.     APTR         agh_UserData;            /* Anything you want... */
  178. };
  179.  
  180. /* Methods */
  181. #define    HM_FINDNODE    1
  182. #define    HM_OPENNODE    2
  183. #define    HM_CLOSENODE    3
  184. #define    HM_EXPUNGE    10        /* Expunge DataBase */
  185.  
  186. /* HM_FINDNODE */
  187. struct opFindHost
  188. {
  189.     ULONG MethodID;
  190.     struct TagItem *ofh_Attrs;        /*  R: Additional attributes */
  191.     STRPTR ofh_Node;            /*  R: Name of node */
  192.     STRPTR ofh_TOC;            /*  W: Table of Contents */
  193.     STRPTR ofh_Title;            /*  W: Title to give to the node */
  194.     STRPTR ofh_Next;            /*  W: Next node to browse to */
  195.     STRPTR ofh_Prev;            /*  W: Previous node to browse to */
  196. };
  197.  
  198. /* HM_OPENNODE, HM_CLOSENODE */
  199. struct opNodeIO
  200. {
  201.     ULONG MethodID;
  202.     struct TagItem *onm_Attrs;        /*  R: Additional attributes */
  203.     STRPTR onm_Node;            /*  R: Node name and arguments */
  204.     STRPTR onm_FileName;        /*  W: File name buffer */
  205.     STRPTR onm_DocBuffer;        /*  W: Node buffer */
  206.     ULONG onm_BuffLen;            /*  W: Size of buffer */
  207.     ULONG onm_Flags;            /* RW: Control flags */
  208. };
  209.  
  210. /* onm_Flags */
  211. #define    HTNF_KEEP    (1L<<0)    /* Don't flush this node until database is
  212.                  * closed. */
  213. #define    HTNF_RESERVED1    (1L<<1)    /* Reserved for system use */
  214. #define    HTNF_RESERVED2    (1L<<2)    /* Reserved for system use */
  215. #define    HTNF_ASCII    (1L<<3)    /* Node is straight ASCII */
  216. #define    HTNF_RESERVED3    (1L<<4)    /* Reserved for system use */
  217. #define    HTNF_CLEAN    (1L<<5)    /* Remove the node from the database */
  218. #define    HTNF_DONE    (1L<<6)    /* Done with node */
  219.  
  220. /* onm_Attrs */
  221. #define    HTNA_Dummy    (TAG_USER)
  222. #define    HTNA_Screen    (HTNA_Dummy+1)    /* (struct Screen *) Screen that window resides in */
  223. #define    HTNA_Pens    (HTNA_Dummy+2)    /* Pen array (from DrawInfo) */
  224. #define    HTNA_Rectangle    (HTNA_Dummy+3)    /* Window box */
  225.  
  226. #define    HTNA_HelpGroup    (HTNA_Dummy+5)    /* (ULONG) unique identifier */
  227.  
  228.  
  229. /* HM_EXPUNGE */
  230. struct opExpungeNode
  231. {
  232.     ULONG MethodID;
  233.     struct TagItem *oen_Attrs;        /*  R: Additional attributes */
  234. };
  235.  
  236. #endif /* LIBRARIES_AMIGAGUIDE_H */
  237.