home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / BGUI / include / bgui / bgui_arexx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-09  |  4.1 KB  |  165 lines

  1. #ifndef BGUI_AREXX_H
  2. #define BGUI_AREXX_H
  3. /*
  4.  * @(#) $Header: /cvsroot/bgui/include/bgui_arexx.h,v 41.11 2000/05/09 20:37:09 mlemos Exp $
  5.  *
  6.  * $VER: bgui_arexx.h 41.10 (11.10.98)
  7.  * C Header for the BOOPSI ARexx interface class.
  8.  *
  9.  * (C) Copyright 1998 Manuel Lemos.
  10.  * (C) Copyright 1996-1997 Ian J. Einman.
  11.  * (C) Copyright 1993-1996 Jaba Development.
  12.  * (C) Copyright 1993-1996 Jan van den Baard.
  13.  * All Rights Reserved.
  14.  *
  15.  * $Log: bgui_arexx.h,v $
  16.  * Revision 41.11  2000/05/09 20:37:09  mlemos
  17.  * Bumped to revision 41.11
  18.  *
  19.  * Revision 41.1  2000/05/09 20:01:41  mlemos
  20.  * Merged with the branch Manuel_Lemos_fixes.
  21.  *
  22.  * Revision 1.1.2.2  1999/02/19 05:00:55  mlemos
  23.  * Added support for Storm C.
  24.  *
  25.  * Revision 1.1.2.1  1998/10/12 01:47:18  mlemos
  26.  * Initial revision integrated from Ian sources.
  27.  *
  28.  *
  29.  *
  30.  */
  31.  
  32. #ifndef EXEC_TYPES_H
  33. #include <exec/types.h>
  34. #endif
  35.  
  36. #ifndef EXEC_MEMORY_H
  37. #include <exec/memory.h>
  38. #endif
  39.  
  40. #ifndef DOS_DOS_H
  41. #include <dos/dos.h>
  42. #endif
  43.  
  44. #ifndef DOS_RDARGS_H
  45. #include <dos/rdargs.h>
  46. #endif
  47.  
  48. #ifndef REXX_STORAGE_H
  49. #include <rexx/storage.h>
  50. #endif
  51.  
  52. #ifndef REXX_RXSLIB_H
  53. #include <rexx/rxslib.h>
  54. #endif
  55.  
  56. #ifndef REXX_ERRORS_H
  57. #include <rexx/errors.h>
  58. #endif
  59.  
  60. #ifndef INTUITION_CLASSES_H
  61. #include <intuition/classes.h>
  62. #endif
  63.  
  64. #ifndef INTUITION_CLASSUSR_H
  65. #include <intuition/classusr.h>
  66. #endif
  67.  
  68. /* Tags */
  69. #define AREXX_TB                        (TAG_USER+0x30000)
  70.  
  71. #define AREXX_HostName                  (AREXX_TB+1)    /* I-G-- */
  72. #define AREXX_FileExtension             (AREXX_TB+2)    /* I---- */
  73. #define AREXX_CommandList               (AREXX_TB+3)    /* I---- */
  74. #define AREXX_SignalMask                (AREXX_TB+4)    /* --G-- */
  75. #define AREXX_ErrorCode                 (AREXX_TB+5)    /* I---- */
  76.  
  77. /* Methods */
  78. #define AREXX_MB                        (0x30000)
  79.  
  80. /* ARexx class event-handler. */
  81. #define AREXXM_HANDLE_EVENT             (AREXX_MB+1)
  82.  
  83. /* Execute a host command. */
  84. #define AREXXM_EXECUTE                  (AREXX_MB+2)
  85.  
  86. struct acmExecute {
  87.         ULONG                   MethodID;
  88.         UBYTE                  *acme_CommandString;
  89.         LONG                   *acme_RC;
  90.         LONG                   *acme_RC2;
  91.         UBYTE                 **acme_Result;
  92.         BPTR                    acme_IO;
  93. };
  94.  
  95. /*
  96. **      The routines from the command-list will receive a pointer
  97. **      to this structure.  In this structure are the parsed arguments
  98. **      and storage to put the results of the command.
  99. **/
  100. typedef struct {
  101.         ULONG                   *ra_ArgList;      /* Result of ReadArgs(). */
  102.         LONG                     ra_RC;           /* Primary result. */
  103.         LONG                     ra_RC2;          /* Secondary result. */
  104.         UBYTE                   *ra_Result;       /* RESULT variable. */
  105. }       REXXARGS;
  106.  
  107. /*
  108.  * Compiler specific stuff.
  109.  */
  110. #ifdef _DCC
  111. #ifndef ASM
  112. #define ASM
  113. #endif
  114. #ifndef REG
  115. #define REG(x)    __ ## x
  116. #endif
  117. #elif __STORM__
  118. #ifndef SAVEDS
  119. #define SAVEDS    __saveds
  120. #endif
  121. #ifndef ASM
  122. #define ASM
  123. #endif
  124. #ifndef REG
  125. #define REG(x)    register __ ## x
  126. #endif
  127. #else
  128. #ifndef ASM
  129. #define ASM       __asm
  130. #endif
  131. #ifndef REG
  132. #define REG(x)    register __ ## x
  133. #endif
  134. #endif
  135.  
  136. /*
  137. **      An array of these structures must be passed at object-create time.
  138. **/
  139. typedef struct {
  140.         UBYTE                   *rc_Name;         /* Command name. */
  141.         UBYTE                   *rc_ArgTemplate;  /* DOS-style argument template. */
  142.         ASM VOID                (*rc_Func)( REG(a0) REXXARGS *, REG(a1) struct RexxMsg * );
  143. }       REXXCOMMAND;
  144.  
  145. /*
  146. **      Possible errors.
  147. **/
  148. #define RXERR_NO_COMMAND_LIST           (1L)
  149. #define RXERR_NO_PORT_NAME              (2L)
  150. #define RXERR_PORT_ALREADY_EXISTS       (3L)
  151. #define RXERR_OUT_OF_MEMORY             (4L)
  152.  
  153. /*
  154.  * Backwards compatibility.
  155.  */
  156. #define AC_HostName                     AREXX_HostName
  157. #define AC_FileExtention                AREXX_FileExtension
  158. #define AC_CommandList                  AREXX_CommandList
  159. #define AC_ErrorCode                    AREXX_ErrorCode
  160. #define AC_RexxPortMask                 AREXX_SignalMask
  161. #define ACM_HANDLE_EVENT                AREXXM_HANDLE_EVENT
  162. #define ACM_EXECUTE                     AREXXM_EXECUTE
  163.  
  164. #endif
  165.