home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / classes / arexx.h next >
Encoding:
C/C++ Source or Header  |  1999-10-30  |  3.2 KB  |  137 lines

  1. #ifndef CLASSES_AREXX_H
  2. #define CLASSES_AREXX_H
  3. /*
  4. **    $VER: arexx.h 44.1 (19.10.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    arexx.class definitions
  8. **
  9. **    (C) Copyright 1987-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_MEMORY_H
  14. #include <exec/memory.h>
  15. #endif
  16.  
  17. #ifndef DOS_DOS_H
  18. #include <dos/dos.h>
  19. #endif
  20.  
  21. #ifndef DOS_RDARGS_H
  22. #include <dos/rdargs.h>
  23. #endif
  24.  
  25. #ifndef REXX_STORAGE_H
  26. #include <rexx/storage.h>
  27. #endif
  28.  
  29. #ifndef REXX_RXSLIB_H
  30. #include <rexx/rxslib.h>
  31. #endif
  32.  
  33. #ifndef REXX_ERRORS_H
  34. #include <rexx/errors.h>
  35. #endif
  36.  
  37. #ifndef INTUITION_CLASSES_H
  38. #include <intuition/classes.h>
  39. #endif
  40.  
  41. #ifndef INTUITION_CLASSUSR_H
  42. #include <intuition/classusr.h>
  43. #endif
  44.  
  45. #ifndef UTILITY_HOOKS_H
  46. #include <utility/hooks.h>
  47. #endif
  48.  
  49. /*****************************************************************************/
  50.  
  51. /* Tags supported by the arexx class
  52.  */
  53. #define AREXX_Dummy                (REACTION_Dummy+0x30000)
  54.  
  55. #define AREXX_HostName            (AREXX_Dummy+1)
  56.     /* (STRPTR) */
  57. #define AREXX_DefExtension        (AREXX_Dummy+2)
  58.     /* (STRPTR) */
  59. #define AREXX_Commands            (AREXX_Dummy+3)
  60.     /* (struct ARexxCmd *) */
  61. #define AREXX_ErrorCode            (AREXX_Dummy+4)
  62.     /* (ULONG *) */
  63. #define AREXX_SigMask            (AREXX_Dummy+5)
  64.     /* (ULONG) */
  65. #define AREXX_NoSlot            (AREXX_Dummy+6)
  66.     /* (BOOL) */
  67. #define AREXX_ReplyHook            (AREXX_Dummy+7)
  68.     /* (struct Hook *) */
  69. #define AREXX_MsgPort            (AREXX_Dummy+8)
  70.     /* (struct MsgPort *) */
  71.  
  72. /* Possible error result codes
  73.  */
  74. #define RXERR_NO_COMMAND_LIST     (1L)
  75. #define RXERR_NO_PORT_NAME        (2L)
  76. #define RXERR_PORT_ALREADY_EXISTS (3L)
  77. #define RXERR_OUT_OF_MEMORY       (4L)
  78.  
  79. /* I can't spell, don't use this.
  80.  */
  81. #define AREXX_DefExtention    AREXX_DefExtension
  82.  
  83. /*****************************************************************************/
  84.  
  85. /* Methods Supported by the ARexx Class.
  86.  */
  87. #define AM_HANDLEEVENT                (0x590001)
  88.     /* ARexx class event-handler. */
  89.  
  90. #define AM_EXECUTE                    (0x590002)
  91.     /* Execute a host command. */
  92.  
  93. #define AM_FLUSH                      (0x590003)
  94.     /* Flush rexx port. */
  95.  
  96. /* AM_EXECUTE message.
  97.  */
  98. struct apExecute
  99. {
  100.     ULONG MethodID;                /* AM_EXECUTE */
  101.     STRPTR ape_CommandString;    /* Command string to execute */
  102.     STRPTR ape_PortName;        /* Port to send to (usually RXSDIR) */
  103.     LONG *ape_RC;                /* RC pointer */
  104.     LONG *ape_RC2;                /* RC2 pointer */
  105.     STRPTR *ape_Result;            /* Result pointer */
  106.     BPTR ape_IO;                /* I/O handle */
  107. };
  108.  
  109.  
  110. /*****************************************************************************/
  111.  
  112. /* An array of these structures must be passed at object-create time.
  113.  */
  114. struct ARexxCmd
  115. {
  116.     STRPTR ac_Name;            /* Command name */
  117.     UWORD ac_ID;            /* Unique ID */
  118.  
  119.     /* NOTE: The function pointed to by ac_Func() will be called
  120.      *       with parameters in CPU registers. Register usage
  121.      *       is as follows:
  122.      *
  123.      *       VOID ac_Func(struct ARexxCmd * cmd, struct RexxMsg * rm)
  124.      *                                       A0                   A1
  125.      */
  126.     VOID (*ac_Func)();
  127.  
  128.     STRPTR ac_ArgTemplate;    /* DOS-style argument template */
  129.     ULONG ac_Flags;            /* Unused, make NULL */
  130.     ULONG *ac_ArgList;        /* Result of ReadArgs() */
  131.     LONG ac_RC;                /* Primary result */
  132.     LONG ac_RC2;            /* Secondary result */
  133.     STRPTR ac_Result;        /* RESULT variable */
  134. };
  135.  
  136. #endif /* CLASSES_AREXX_H */
  137.