home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff355.lzh / RexxHostLib / rexxhostbase.h < prev    next >
C/C++ Source or Header  |  1990-06-12  |  5KB  |  167 lines

  1. /* $Revision Header * Header built automatically - do not edit! *************
  2.  *
  3.  *    (C) Copyright 1990 by MXM
  4.  *
  5.  *    Name .....: rexxhostbase.h
  6.  *    Created ..: Sunday 07-Jan-90 18:55
  7.  *    Revision .: 4
  8.  *
  9.  *    Date            Author          Comment
  10.  *    =========       ========        ====================
  11.  *    31-Mar-90       Olsen           General cleanup, added HOSTMASK
  12.  *    17-Mar-90       Olsen           Compatibility fixes
  13.  *    16-Mar-90       Olsen           Added protos & pragmas
  14.  *    07-Jan-90       Olsen           Created this file!
  15.  *
  16.  ****************************************************************************
  17.  *
  18.  *    This Amiga shared library is based on example source code
  19.  *    written by Gary Samad & Bill Hawes.
  20.  *
  21.  * $Revision Header ********************************************************/
  22.  
  23. #ifndef _REXXHOSTBASE_H
  24. #define _REXXHOSTBASE_H 1
  25.  
  26. #ifndef REXX_RXSLIB_H
  27. #include <rexx/rxslib.h>
  28. #endif    /* !REXX_RXSLIB_H */
  29.  
  30.     /* Main library structure (note: RexxSysBase can be reused
  31.      * by opening program).
  32.      */
  33.  
  34. struct RexxHostBase
  35. {
  36.     struct Library     LibNode;
  37.     struct RxsLib    *RexxSysBase;
  38.  
  39.     /* Everything below this point is considered PRIVATE and
  40.      * subject to change without notice (even though there isn't
  41.      * very much yet).
  42.      */
  43. };
  44.  
  45.     /* This is an extended MsgPort structure which includes
  46.      * a special ID CreateRexxHost/DeleteRexxHost/SendRexxCommand
  47.      * rely on.
  48.      */
  49.  
  50. struct RexxHost
  51. {
  52.     struct MsgPort    rh_Port;    /* Exec link. */
  53.  
  54.         /* Never touch the tags below,
  55.          * hands off - this may change
  56.          * soon.
  57.          */
  58.  
  59.     ULONG        rh_Private0;
  60.     ULONG        rh_Private1[4];
  61. };
  62.  
  63.     /* This macro can be used to turn the signal bit
  64.      * contained in a RexxHost into a Wait-mask.
  65.      * Note: Argument must be a pointer.
  66.      */
  67.  
  68. #define HOSTMASK(Host) (1L << ((struct RexxHost *)Host) -> rh_Port . mp_SigBit)
  69.  
  70.     /* Library name and current revision. */
  71.  
  72. #define REXXHOSTNAME    "rexxhost.library"
  73. #define REXXHOSTVERSION    34L
  74.  
  75.     /* Use this value rather than REXXHOSTVERSION to open
  76.      * rexxhost.library.
  77.      */
  78.  
  79. #define REXXHOSTMINIMUM    34L
  80.  
  81.     /* The compiler version differences require the
  82.      * following preprocessor 'orgy'.
  83.      */
  84.  
  85. #ifdef __NO_PROTOS
  86. #undef __NO_PROTOS
  87. #endif    /* __NO_PROTOS */
  88.  
  89. #ifdef AZTEC_C
  90.  
  91.     /* No version symbol? We'll redefine it. */
  92.  
  93. #ifndef __VERSION
  94. #define __VERSION 360
  95. #endif    /* __VERSION */
  96.  
  97.     /* Aztec 'C' 5.0 supports full prototype and
  98.      * pragma checking.
  99.      */
  100.  
  101. #if __VERSION < 500
  102. #define __NO_PROTOS    1
  103. #define __NO_PRAGMAS    1
  104. #endif    /* __VERSION */
  105.  
  106. #endif    /* AZTEC_C */
  107.  
  108.     /* Now for the prototype handling. */
  109.  
  110. #ifdef __NO_PROTOS
  111. #define __ARGS(x) ()
  112. #else
  113. #define __ARGS(x) x
  114. #endif    /* __NO_PROTOS */
  115.  
  116.     /* Prototypes for library functions. */
  117.  
  118. struct RexxHost *    CreateRexxHost __ARGS((STRPTR));
  119. VOID *            DeleteRexxHost __ARGS((struct RexxHost *));
  120. LONG            SendRexxCommand __ARGS((struct RexxHost *,STRPTR,STRPTR,STRPTR));
  121. VOID            FreeRexxCommand __ARGS((struct RexxMsg *));
  122. VOID            ReplyRexxCommand __ARGS((struct RexxMsg *,LONG,LONG,STRPTR));
  123. STRPTR            GetRexxCommand __ARGS((struct RexxMsg *));
  124. STRPTR            GetRexxArg __ARGS((struct RexxMsg *));
  125. LONG            GetRexxResult1 __ARGS((struct RexxMsg *));
  126. LONG            GetRexxResult2 __ARGS((struct RexxMsg *));
  127. STRPTR            GetToken __ARGS((STRPTR,LONG *,STRPTR,LONG));
  128. LONG            GetStringValue __ARGS((STRPTR));
  129. STRPTR            BuildValueString __ARGS((LONG,STRPTR));
  130. LONG            RexxStrCmp __ARGS((UBYTE *,UBYTE *));
  131.  
  132.     /* The pragmas, both for Manx & Lattice. */
  133.  
  134. #ifndef __NO_PRAGMAS
  135. #ifdef AZTEC_C
  136. #pragma amicall(RexxHostBase, 0x1e, CreateRexxHost(a0))
  137. #pragma amicall(RexxHostBase, 0x24, DeleteRexxHost(a0))
  138. #pragma amicall(RexxHostBase, 0x2a, SendRexxCommand(a0,a1,a2,a3))
  139. #pragma amicall(RexxHostBase, 0x30, FreeRexxCommand(a0))
  140. #pragma amicall(RexxHostBase, 0x36, ReplyRexxCommand(a0,d0,d1,a1))
  141. #pragma amicall(RexxHostBase, 0x3c, GetRexxCommand(a0))
  142. #pragma amicall(RexxHostBase, 0x42, GetRexxArg(a0))
  143. #pragma amicall(RexxHostBase, 0x48, GetRexxResult1(a0))
  144. #pragma amicall(RexxHostBase, 0x4e, GetRexxResult2(a0))
  145. #pragma amicall(RexxHostBase, 0x54, GetToken(a0,a1,a2,d0))
  146. #pragma amicall(RexxHostBase, 0x5a, GetStringValue(a0))
  147. #pragma amicall(RexxHostBase, 0x60, BuildValueString(d0,a0))
  148. #pragma amicall(RexxHostBase, 0x66, RexxStrCmp(a0,a1))
  149. #else    /* AZTEC_C */
  150. #pragma libcall RexxHostBase CreateRexxHost 1e 801
  151. #pragma libcall RexxHostBase DeleteRexxHost 24 801
  152. #pragma libcall RexxHostBase SendRexxCommand 2a ba9804
  153. #pragma libcall RexxHostBase FreeRexxCommand 30 801
  154. #pragma libcall RexxHostBase ReplyRexxCommand 36 910804
  155. #pragma libcall RexxHostBase GetRexxCommand 3c 801
  156. #pragma libcall RexxHostBase GetRexxArg 42 801
  157. #pragma libcall RexxHostBase GetRexxResult1 48 801
  158. #pragma libcall RexxHostBase GetRexxResult2 4e 801
  159. #pragma libcall RexxHostBase GetToken 54 a9804
  160. #pragma libcall RexxHostBase GetStringValue 5a 801
  161. #pragma libcall RexxHostBase BuildValueString 60 8002
  162. #pragma libcall RexxHostBase RexxStrCmp 66 9802
  163. #endif    /* AZTEC_C */
  164. #endif    /* __NO_PRAGMAS */
  165.  
  166. #endif    /* _REXXHOSTBASE_H */
  167.