home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / ENET.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  4.2 KB  |  162 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ENET.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __ENET__
  13. #define __ENET__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. #ifndef __OSUTILS__
  23. #include <OSUtils.h>
  24. #endif
  25.  
  26. #define EAddrRType 'eadr'
  27.  
  28. enum  {
  29.     ENetSetGeneral                = 253,                            /*Set "general" mode*/
  30.     ENetGetInfo                    = 252,                            /*Get info*/
  31.     ENetRdCancel                = 251,                            /*Cancel read*/
  32.     ENetRead                    = 250,                            /*Read*/
  33.     ENetWrite                    = 249,                            /*Write*/
  34.     ENetDetachPH                = 248,                            /*Detach protocol handler*/
  35.     ENetAttachPH                = 247,                            /*Attach protocol handler*/
  36.     ENetAddMulti                = 246,                            /*Add a multicast address*/
  37.     ENetDelMulti                = 245,                            /*Delete a multicast address*/
  38.     eLenErr                        = -92,                            /*Length error ddpLenErr*/
  39.     eMultiErr                    = -91                            /*Multicast address error ddpSktErr*/
  40. };
  41.  
  42. typedef union EParamBlock EParamBlock, *EParamBlkPtr;
  43.  
  44.  
  45. /*
  46.     ENETCompletionProcs cannot be written in or called from a high-level 
  47.     language without the help of mixed mode or assembly glue because they 
  48.     use the following parameter-passing convention:
  49.  
  50.     typedef pascal void (*ENETCompletionProcPtr)(EParamBlkPtr thePBPtr);
  51.  
  52.         In:
  53.             =>     thePBPtr                A0.L
  54.         Out:
  55.             none
  56. */
  57.  
  58. enum  {
  59.     uppENETCompletionProcInfo    = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
  60. };
  61.  
  62. #if USESROUTINEDESCRIPTORS
  63. typedef pascal void (*ENETCompletionProcPtr)(EParamBlkPtr thePBPtr);
  64.  
  65. typedef UniversalProcPtr ENETCompletionUPP;
  66.  
  67. #define CallENETCompletionProc(userRoutine, thePBPtr)  \
  68.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppENETCompletionProcInfo, (thePBPtr))
  69.  
  70. #define NewENETCompletionProc(userRoutine)  \
  71.     (ENETCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine),  \
  72.     uppENETCompletionProcInfo, GetCurrentISA())
  73.  
  74. #else
  75. typedef ProcPtr ENETCompletionUPP;
  76.  
  77. #define NewENETCompletionProc(userRoutine)  \
  78.     (ENETCompletionUPP)(userRoutine)
  79.  
  80. #endif
  81.  
  82. #define EParamHeader             \
  83.     QElem *qLink;                    \
  84.     short qType;                    \
  85.     short ioTrap;                    \
  86.     Ptr ioCmdAddr;                    \
  87.     ENETCompletionUPP ioCompletion;     \
  88.     OSErr ioResult;                \
  89.     StringPtr ioNamePtr;            \
  90.     short ioVRefNum;                \
  91.     short ioRefNum;                \
  92.     short csCode;
  93.  
  94. #if defined(powerc) || defined (__powerc)
  95. #pragma options align=mac68k
  96. #endif
  97. struct EParamMisc1 {
  98.     QElem                        *qLink;
  99.     short                        qType;
  100.     short                        ioTrap;
  101.     Ptr                            ioCmdAddr;
  102.     ENETCompletionUPP            ioCompletion;
  103.     OSErr                        ioResult;
  104.     StringPtr                    ioNamePtr;
  105.     short                        ioVRefNum;
  106.     short                        ioRefNum;
  107.     short                        csCode;                            /*General EParams*/
  108.     short                        eProtType;                        /*Ethernet protocol type*/
  109.     Ptr                            ePointer;                        /*No support for PowerPC code*/
  110.     short                        eBuffSize;                        /*buffer size*/
  111.     short                        eDataSize;                        /*number of bytes read*/
  112. };
  113. #if defined(powerc) || defined(__powerc)
  114. #pragma options align=reset
  115. #endif
  116.  
  117. typedef struct EParamMisc1 EParamMisc1;
  118.  
  119. #if defined(powerc) || defined (__powerc)
  120. #pragma options align=mac68k
  121. #endif
  122. struct EParamMisc2 {
  123.     EParamMisc1                    EParms1;
  124.     char                        eMultiAddr[6];                    /*Multicast Address*/
  125. };
  126. #if defined(powerc) || defined(__powerc)
  127. #pragma options align=reset
  128. #endif
  129.  
  130. typedef struct EParamMisc2 EParamMisc2;
  131.  
  132. #if defined(powerc) || defined (__powerc)
  133. #pragma options align=mac68k
  134. #endif
  135. union EParamBlock {
  136.     EParamMisc1                    EParms1;
  137.     EParamMisc2                    EParms2;
  138. };
  139. #if defined(powerc) || defined(__powerc)
  140. #pragma options align=reset
  141. #endif
  142.  
  143. #ifdef __cplusplus
  144. extern "C" {
  145. #endif
  146.  
  147. extern pascal OSErr EWrite(EParamBlkPtr thePBptr, Boolean async);
  148. extern pascal OSErr EAttachPH(EParamBlkPtr thePBptr, Boolean async);
  149. extern pascal OSErr EDetachPH(EParamBlkPtr thePBptr, Boolean async);
  150. extern pascal OSErr ERead(EParamBlkPtr thePBptr, Boolean async);
  151. extern pascal OSErr ERdCancel(EParamBlkPtr thePBptr, Boolean async);
  152. extern pascal OSErr EGetInfo(EParamBlkPtr thePBptr, Boolean async);
  153. extern pascal OSErr ESetGeneral(EParamBlkPtr thePBptr, Boolean async);
  154. extern pascal OSErr EAddMulti(EParamBlkPtr thePBptr, Boolean async);
  155. extern pascal OSErr EDelMulti(EParamBlkPtr thePBptr, Boolean async);
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159.  
  160. #endif
  161.  
  162.