SocketServices.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:35k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       SocketServices.h
  3.  
  4.      Contains:   This file contains constants and data structures that
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1994-2001 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __SOCKETSERVICES__
  18. #define __SOCKETSERVICES__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MIXEDMODE__
  23. #include "MixedMode.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. /*
  42.   ///////////////////////////////////////////////////////////////////////////////////////
  43.     TypeDefs for the Socket Services function codes
  44. */
  45. typedef Byte                            SS_BYTE;
  46. typedef Byte                            SS_FLAGS8;
  47. typedef Byte                            SS_IRQ;
  48. typedef Byte                            SS_PWRLEVEL;
  49. typedef UInt16                          SS_ADAPTER;
  50. typedef UInt16                          SS_BCD;
  51. typedef UInt16                          SS_COUNT;
  52. typedef UInt16                          SS_EDC;
  53. typedef UInt16                          SS_FLAGS16;
  54. typedef UInt16                          SS_PAGE;
  55. typedef UInt16                          SS_PWRINDEX;
  56. typedef UInt16                          SS_SIGNATURE;
  57. typedef UInt16                          SS_SKTBITS;
  58. typedef UInt16                          SS_SOCKET;
  59. typedef UInt16                          SS_SPEED;
  60. typedef UInt16                          SS_WINDOW;
  61. typedef UInt16                          SS_WORD;
  62. typedef UInt32                          SS_BASE;
  63. typedef UInt32                          SS_FLAGS32;
  64. typedef UInt32                          SS_OFFSET;
  65. typedef UInt32                          SS_SIZE;
  66. typedef Ptr                             SS_PTR;
  67. typedef OSErr                           SS_RETCODE;
  68. struct SS_SCHARTBL {
  69.     UInt16                          sktCaps;                    /*    SS_FLAGS16*/
  70.     UInt32                          activeHigh;                 /*    SS_FLAGS32*/
  71.     UInt32                          activeLow;                  /*    SS_FLAGS32*/
  72. };
  73. typedef struct SS_SCHARTBL              SS_SCHARTBL;
  74. struct SS_SISTRUCT {
  75.     UInt16                          bufferLength;               /*    SS_WORD*/
  76.     UInt16                          dataLength;                 /*    SS_WORD*/
  77.     SS_SCHARTBL                     charTable;                  /*    SS_FLAGS16*/
  78. };
  79. typedef struct SS_SISTRUCT              SS_SISTRUCT;
  80. enum {
  81.     STR_SIZE                    = 24
  82. };
  83. /* minimum string length*/
  84. struct SS_VISTRUCT {
  85.     UInt16                          bufferLength;               /*    SS_WORD*/
  86.     UInt16                          dataLength;                 /*    SS_WORD*/
  87.     char                            szImplementor[1];           /*    SS_WORD*/
  88.     Byte                            padding[1];                 /*    */
  89. };
  90. typedef struct SS_VISTRUCT              SS_VISTRUCT;
  91. struct SS_ACHARTBL {
  92.     UInt16                          adpCaps;                    /*    SS_FLAGS16*/
  93.     UInt32                          activeHigh;                 /*    SS_FLAGS32*/
  94.     UInt32                          activeLow;                  /*    SS_FLAGS32*/
  95. };
  96. typedef struct SS_ACHARTBL              SS_ACHARTBL;
  97. struct SS_PWRENTRY {
  98.     Byte                            powerLevel;                 /*    SS_PWRLEVEL*/
  99.     Byte                            validSignals;               /*    SS_FLAGS8*/
  100. };
  101. typedef struct SS_PWRENTRY              SS_PWRENTRY;
  102. struct SS_AISTRUCT {
  103.     UInt16                          bufferLength;               /*    SS_WORD*/
  104.     UInt16                          dataLength;                 /*    SS_WORD*/
  105.     SS_ACHARTBL                     charTable;
  106.     UInt16                          numPwrEntries;              /*    SS_WORD*/
  107.     SS_PWRENTRY *                   pwrEntryPtr;
  108. };
  109. typedef struct SS_AISTRUCT              SS_AISTRUCT;
  110. struct SS_MEMWINTBL {
  111.     UInt16                          memWndCaps;                 /*    SS_FLAGS16*/
  112.     UInt32                          firstByte;                  /*    SS_BASE*/
  113.     UInt32                          lastByte;                   /*    SS_BASE*/
  114.     UInt32                          minSize;                    /*    SS_SIZE*/
  115.     UInt32                          maxSize;                    /*    SS_SIZE*/
  116.     UInt32                          reqGran;                    /*    SS_SIZE*/
  117.     UInt32                          reqBase;                    /*    SS_SIZE*/
  118.     UInt32                          reqOffset;                  /*    SS_SIZE*/
  119.     UInt16                          slowest;                    /*    SS_SPEED*/
  120.     UInt16                          fastest;                    /*    SS_SPEED*/
  121. };
  122. typedef struct SS_MEMWINTBL             SS_MEMWINTBL;
  123. struct SS_IOWINTBL {
  124.     UInt16                          ioWndCaps;                  /*    SS_FLAGS16*/
  125.     UInt32                          firstByte;                  /*    SS_BASE*/
  126.     UInt32                          lastByte;                   /*    SS_BASE*/
  127.     UInt32                          minSize;                    /*    SS_SIZE*/
  128.     UInt32                          maxSize;                    /*    SS_SIZE*/
  129.     UInt32                          reqGran;                    /*    SS_SIZE*/
  130.     UInt16                          addrLines;                  /*    SS_COUNT*/
  131.     Byte                            eisaSlot;                   /*    SS_FLAGS8*/
  132.     Byte                            padding[1];                 /*    */
  133. };
  134. typedef struct SS_IOWINTBL              SS_IOWINTBL;
  135. struct SS_WISTRUCT {
  136.     UInt16                          bufferLength;               /*    SS_WORD*/
  137.     UInt16                          dataLength;                 /*    SS_WORD*/
  138.     UInt16                          numTblEntries;              /*    SS_WORD*/
  139.     SS_MEMWINTBL                    memWinTbl;
  140.     SS_IOWINTBL                     ioWinTbl;
  141. };
  142. typedef struct SS_WISTRUCT              SS_WISTRUCT;
  143. /*------------------------------------------------------------------------
  144.     function selectors passed to Socket Service entry point
  145. ------------------------------------------------------------------------*/
  146. enum {
  147.     fnSSGetAdapterCount         = 0x80,
  148.     fnSSUnsupported81           = 0x81,
  149.     fnSSUnsupported82           = 0x82,
  150.     fnSSGetSSInfo               = 0x83,
  151.     fnSSInquireAdapter          = 0x84,
  152.     fnSSGetAdapter              = 0x85,
  153.     fnSSSetAdapter              = 0x86,
  154.     fnSSInquireWindow           = 0x87,
  155.     fnSSGetWindow               = 0x88,
  156.     fnSSSetWindow               = 0x89,
  157.     fnSSGetPage                 = 0x8A,
  158.     fnSSSetPage                 = 0x8B,
  159.     fnSSInquireSocket           = 0x8C,
  160.     fnSSGetSocket               = 0x8D,
  161.     fnSSSetSocket               = 0x8E,
  162.     fnSSGetStatus               = 0x8F,
  163.     fnSSResetSocket             = 0x90,
  164.     fnSSUnsupported91           = 0x91,
  165.     fnSSUnsupported92           = 0x92,
  166.     fnSSUnsupported93           = 0x93,
  167.     fnSSUnsupported94           = 0x94,
  168.     fnSSInquireEDC              = 0x95,
  169.     fnSSGetEDC                  = 0x96,
  170.     fnSSSetEDC                  = 0x97,
  171.     fnSSStartEDC                = 0x98,
  172.     fnSSPauseEDC                = 0x99,
  173.     fnSSResumeEDC               = 0x9A,
  174.     fnSSStopEDC                 = 0x9B,
  175.     fnSSReadEDC                 = 0x9C,
  176.     fnSSGetVendorInfo           = 0x9D,
  177.     fnSSAcknowledgeInterrupt    = 0x9E,
  178.     fnSSGetSetPriorHandler      = 0x9F,
  179.     fnSSGetSetSSAddr            = 0xA0,
  180.     fnSSGetAccessOffsets        = 0xA1,
  181.     fnSSUnsupportedA2           = 0xA2,
  182.     fnSSUnsupportedA3           = 0xA3,
  183.     fnSSUnsupportedA4           = 0xA4,
  184.     fnSSUnsupportedA5           = 0xA5,
  185.     fnSSUnsupportedA6           = 0xA6,
  186.     fnSSUnsupportedA7           = 0xA7,
  187.     fnSSUnsupportedA8           = 0xA8,
  188.     fnSSUnsupportedA9           = 0xA9,
  189.     fnSSUnsupportedAA           = 0xAA,
  190.     fnSSUnsupportedAB           = 0xAB,
  191.     fnSSUnsupportedAC           = 0xAC,
  192.     fnSSUnsupportedAD           = 0xAD,
  193.     fnSSVendorSpecific          = 0xAE
  194. };
  195. /*  SSVendorSpecificPB.function values*/
  196. enum {
  197.     fnVSReserved                = 0x00,
  198.     fnVSGetSocketLocationIcon   = 0x01,
  199.     fnVSGetSocketLocationText   = 0x02,
  200.     fnVSDoSocketLocalization    = 0x03,
  201.     fnVSAppleSocketCapabilities = 0x04,
  202.     fnVSSleepWakeNotification   = 0x05
  203. };
  204. /*------------------------------------------------------------------------
  205.     defines for the Socket Services function codes
  206. ------------------------------------------------------------------------*/
  207. enum {
  208.     AC_IND                      = 1,                            /* adapter characteristics*/
  209.     AC_PWR                      = 2,
  210.     AC_DBW                      = 4
  211. };
  212. enum {
  213.     AS_POWERDOWN                = 1,
  214.     AS_MAINTAIN                 = 2
  215. };
  216. enum {
  217.     EC_UNI                      = 1,
  218.     EC_BI                       = 2,
  219.     EC_REGISTER                 = 4,
  220.     EC_MEMORY                   = 8,
  221.     EC_PAUSABLE                 = 16,
  222.     EC_WRITE                    = 16
  223. };
  224. enum {
  225.     ET_CHECK8                   = 1,
  226.     ET_SDLC16                   = 2
  227. };
  228. enum {
  229.     IF_MEMORY                   = 1,
  230.     IF_IO                       = 2
  231. };
  232. enum {
  233.     IRQ_HIGH                    = 64,
  234.     IRQ_ENABLE                  = 128
  235. };
  236. enum {
  237.     IRQ_MEMORY                  = 4,
  238.     IRQ_IO                      = 4
  239. };
  240. enum {
  241.     PS_ATTRIBUTE                = 0x01,
  242.     PS_ENABLED                  = 0x02,
  243.     PS_WP                       = 0x04
  244. };
  245. enum {
  246.     PWR_VCC                     = 128,                          /* Power pins in PwrEntry elements*/
  247.     PWR_VPP1                    = 64,
  248.     PWR_VPP2                    = 32
  249. };
  250. enum {
  251.     SBM_WP                      = 1,
  252.     SBM_LOCKED                  = 2,
  253.     SBM_EJECT                   = 4,
  254.     SBM_INSERT                  = 8,
  255.     SBM_BVD1                    = 16,
  256.     SBM_BVD2                    = 32,
  257.     SBM_RDYBSY                  = 64,
  258.     SBM_CD                      = 128
  259. };
  260. enum {
  261.     SBM_LOCK                    = 16,
  262.     SBM_BATT                    = 32,
  263.     SBM_BUSY                    = 64,
  264.     SBM_XIP                     = 128
  265. };
  266. /* Vendor Specific Apple Socket Capabilities */
  267. enum {
  268.     SBM_SLEEP_PWR               = 1
  269. };
  270. enum {
  271.     WC_COMMON                   = 1,
  272.     WC_IO                       = 2,
  273.     WC_ATTRIBUTE                = 4,
  274.     WC_TYPE_MASK                = 7,
  275.     WC_WAIT                     = 128
  276. };
  277. enum {
  278.     WC_BASE                     = 1,
  279.     WC_SIZE                     = 2,
  280.     WC_WENABLE                  = 4,
  281.     WC_8BIT                     = 8,
  282.     WC_16BIT                    = 16,
  283.     WC_BALIGN                   = 32,
  284.     WC_POW2                     = 64,
  285.     WC_CALIGN                   = 128,
  286.     WC_PAVAIL                   = 256,
  287.     WC_PSHARED                  = 512,
  288.     WC_PENABLE                  = 1024,
  289.     WC_WP                       = 2048
  290. };
  291. enum {
  292.     WC_INPACK                   = 128,
  293.     WC_EISA                     = 256,
  294.     WC_CENABLE                  = 512
  295. };
  296. enum {
  297.     WS_IO                       = 1,
  298.     WS_ENABLED                  = 2,
  299.     WS_16BIT                    = 4
  300. };
  301. enum {
  302.     WS_PAGED                    = 8,
  303.     WS_EISA                     = 16,
  304.     WS_CENABLE                  = 32,
  305.     WS_SWAP_LITTLE_TO_BIG_ENDIAN = 64
  306. };
  307. enum {
  308.     SS_SIG_VALUE                = 0x5353                        /* 'SS'*/
  309. };
  310. enum {
  311.     SS_CMPL_1_00                = 0x0100,                       /* compliant with rev 1.0 of SS standard*/
  312.     SS_CMPL_1_01                = 0x0101,                       /* compliant with rev 1.01 of SS standard*/
  313.     SS_CMPL_2_00                = 0x0200,                       /* compliant with rev 2.0 of SS standard*/
  314.     SS_CMPL_2_10                = 0x0210                        /* compliant with rev 2.1 of SS standard*/
  315. };
  316. /*------------------------------------------------------------------------
  317.     Universal ProcPtr for Socket Service entry point
  318. ------------------------------------------------------------------------*/
  319. typedef CALLBACK_API( short , PCCardSSEntryProcPtr )(UInt16 fnCode, Ptr callPB, Ptr dataPtr);
  320. typedef STACK_UPP_TYPE(PCCardSSEntryProcPtr)                    PCCardSSEntryUPP;
  321. #if OPAQUE_UPP_TYPES
  322. #if CALL_NOT_IN_CARBON
  323.     EXTERN_API(PCCardSSEntryUPP)
  324.     NewPCCardSSEntryUPP            (PCCardSSEntryProcPtr    userRoutine);
  325.     EXTERN_API(void)
  326.     DisposePCCardSSEntryUPP        (PCCardSSEntryUPP        userUPP);
  327.     EXTERN_API(short)
  328.     InvokePCCardSSEntryUPP         (UInt16                  fnCode,
  329.                                     Ptr                     callPB,
  330.                                     Ptr                     dataPtr,
  331.                                     PCCardSSEntryUPP        userUPP);
  332. #endif  /* CALL_NOT_IN_CARBON */
  333. #else
  334.     enum { uppPCCardSSEntryProcInfo = 0x00000FA0 };                 /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes) */
  335.     #define NewPCCardSSEntryUPP(userRoutine)                        (PCCardSSEntryUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPCCardSSEntryProcInfo, GetCurrentArchitecture())
  336.     #define DisposePCCardSSEntryUPP(userUPP)                        DisposeRoutineDescriptor(userUPP)
  337.     #define InvokePCCardSSEntryUPP(fnCode, callPB, dataPtr, userUPP)  (short)CALL_THREE_PARAMETER_UPP((userUPP), uppPCCardSSEntryProcInfo, (fnCode), (callPB), (dataPtr))
  338. #endif
  339. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  340. #define NewPCCardSSEntryProc(userRoutine)                       NewPCCardSSEntryUPP(userRoutine)
  341. #define CallPCCardSSEntryProc(userRoutine, fnCode, callPB, dataPtr) InvokePCCardSSEntryUPP(fnCode, callPB, dataPtr, userRoutine)
  342. /*------------------------------------------------------------------------
  343.     Card Services calls used by a Socket Service
  344. ------------------------------------------------------------------------*/
  345. struct CSEventEntryPB {
  346.     UInt32                          ssHandlerID;
  347.     UInt16                          adapter;
  348.     UInt16                          socket;
  349.     UInt16                          message;
  350.     Byte                            intrpBits;
  351.     Byte                            padding;
  352. };
  353. typedef struct CSEventEntryPB           CSEventEntryPB;
  354. typedef CALLBACK_API( void , PCCardCSEntryProcPtr )(CSEventEntryPB *pb);
  355. typedef STACK_UPP_TYPE(PCCardCSEntryProcPtr)                    PCCardCSEntryUPP;
  356. #if OPAQUE_UPP_TYPES
  357. #if CALL_NOT_IN_CARBON
  358.     EXTERN_API(PCCardCSEntryUPP)
  359.     NewPCCardCSEntryUPP            (PCCardCSEntryProcPtr    userRoutine);
  360.     EXTERN_API(void)
  361.     DisposePCCardCSEntryUPP        (PCCardCSEntryUPP        userUPP);
  362.     EXTERN_API(void)
  363.     InvokePCCardCSEntryUPP         (CSEventEntryPB *        pb,
  364.                                     PCCardCSEntryUPP        userUPP);
  365. #endif  /* CALL_NOT_IN_CARBON */
  366. #else
  367.     enum { uppPCCardCSEntryProcInfo = 0x000000C0 };                 /* pascal no_return_value Func(4_bytes) */
  368.     #define NewPCCardCSEntryUPP(userRoutine)                        (PCCardCSEntryUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPCCardCSEntryProcInfo, GetCurrentArchitecture())
  369.     #define DisposePCCardCSEntryUPP(userUPP)                        DisposeRoutineDescriptor(userUPP)
  370.     #define InvokePCCardCSEntryUPP(pb, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppPCCardCSEntryProcInfo, (pb))
  371. #endif
  372. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  373. #define NewPCCardCSEntryProc(userRoutine)                       NewPCCardCSEntryUPP(userRoutine)
  374. #define CallPCCardCSEntryProc(userRoutine, pb)                  InvokePCCardCSEntryUPP(pb, userRoutine)
  375. /*------------      AddSocketServices       ------------                            */
  376. struct AddSocketServicesPB {
  377.     PCCardSSEntryUPP                ssEntry;                    /* -> given to CS for its use*/
  378.     PCCardCSEntryUPP                csEntry;                    /* <- taken from CS so we know where to enter*/
  379.     UInt32                          dataPtr;
  380.     UInt32                          attributes;
  381.     UInt16                          numAdapters;
  382.     UInt16                          numSockets;
  383. };
  384. typedef struct AddSocketServicesPB      AddSocketServicesPB;
  385. /*------------      ReplaceSocketServices   ------------                            */
  386. struct ReplaceSocketServicesPB {
  387.     PCCardSSEntryUPP                ssEntry;
  388.     PCCardSSEntryUPP                oldSSEntry;
  389.     UInt32                          dataPtr;
  390.     UInt16                          socket;
  391.     UInt16                          numSockets;
  392.     UInt16                          attributes;
  393. };
  394. typedef struct ReplaceSocketServicesPB  ReplaceSocketServicesPB;
  395. #if CALL_NOT_IN_CARBON
  396. EXTERN_API( OSErr )
  397. CSAddSocketServices             (AddSocketServicesPB *  pb)                                 TWOWORDINLINE(0x7050, 0xAAF0);
  398. EXTERN_API( OSErr )
  399. CSReplaceSocketServices         (ReplaceSocketServicesPB * pb)                              TWOWORDINLINE(0x7051, 0xAAF0);
  400. /*------------------------------------------------------------------------
  401.     parameter blocks for each Socket Service function
  402. ------------------------------------------------------------------------*/
  403. #endif  /* CALL_NOT_IN_CARBON */
  404. struct SSAcknowledgeInterruptPB {
  405.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  406.     UInt16                          sockets;                    /*    SS_SKTBITS*/
  407. };
  408. typedef struct SSAcknowledgeInterruptPB SSAcknowledgeInterruptPB;
  409. struct SSGetAccessOffsetsPB {
  410.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  411.     Byte                            mode;                       /*    SS_BYTE*/
  412.     Byte                            reserved;                   /*    padding*/
  413.     UInt16                          count;                      /*    SS_COUNT*/
  414.     Ptr                             buffer;                     /*    SS_PTR*/
  415.     UInt16                          numAvail;                   /*    SS_COUNT*/
  416. };
  417. typedef struct SSGetAccessOffsetsPB     SSGetAccessOffsetsPB;
  418. struct SSGetAdapterCountPB {
  419.     UInt16                          totalAdapters;              /*    SS_COUNT*/
  420.     UInt16                          sig;                        /*    SS_SIGNATURE*/
  421. };
  422. typedef struct SSGetAdapterCountPB      SSGetAdapterCountPB;
  423. struct SSGetSetAdapterPB {
  424.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  425.     Byte                            state;                      /*    SS_FLAGS8*/
  426.     Byte                            irqStatus;                  /*    SS_IRQ*/
  427. };
  428. typedef struct SSGetSetAdapterPB        SSGetSetAdapterPB;
  429. struct SSGetSetEDCPB {
  430.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  431.     UInt16                          edc;                        /*    SS_EDC*/
  432.     UInt16                          socket;                     /*    SS_SOCKET*/
  433.     Byte                            state;                      /*    SS_FLAGS8*/
  434.     Byte                            edcType;                    /*    SS_FLAGS8*/
  435. };
  436. typedef struct SSGetSetEDCPB            SSGetSetEDCPB;
  437. struct SSGetSetPagePB {
  438.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  439.     UInt16                          window;                     /*    SS_WINDOW*/
  440.     UInt16                          page;                       /*    SS_PAGE*/
  441.     Byte                            state;                      /*    SS_FLAGS8*/
  442.     Byte                            reserved;                   /*    padding*/
  443.     UInt32                          offset;                     /*    SS_OFFSET*/
  444. };
  445. typedef struct SSGetSetPagePB           SSGetSetPagePB;
  446. struct SSGetSetPriorHandlerPB {
  447.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  448.     Byte                            mode;                       /*    SS_FLAGS8*/
  449.     Byte                            reserved;                   /*    padding*/
  450.     Ptr                             handler;                    /*    SS_PTR*/
  451. };
  452. typedef struct SSGetSetPriorHandlerPB   SSGetSetPriorHandlerPB;
  453. struct SSGetSetSocketPB {
  454.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  455.     UInt16                          socket;                     /*    SS_SOCKET*/
  456.     UInt16                          vccIndex;                   /*    SS_PWRINDEX*/
  457.     UInt16                          vpp1Index;                  /*    SS_PWRINDEX*/
  458.     UInt16                          vpp2Index;                  /*    SS_PWRINDEX*/
  459.     Byte                            scIntMask;                  /*    SS_FLAGS8*/
  460.     Byte                            state;                      /*    SS_FLAGS8*/
  461.     Byte                            ctlInd;                     /*    SS_FLAGS8*/
  462.     Byte                            ireqRouting;                /*    SS_IRQ*/
  463.     Byte                            ifType;                     /*    SS_FLAGS8*/
  464.     Byte                            padding[1];                 /*    */
  465. };
  466. typedef struct SSGetSetSocketPB         SSGetSetSocketPB;
  467. struct SSGetSetSSAddrPB {
  468.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  469.     Byte                            mode;                       /*    SS_BYTE*/
  470.     Byte                            subfunc;                    /*    SS_BYTE*/
  471.     UInt16                          numAddData;                 /*    SS_COUNT*/
  472.     Ptr                             buffer;                     /*    SS_PTR*/
  473. };
  474. typedef struct SSGetSetSSAddrPB         SSGetSetSSAddrPB;
  475. struct SSGetSetWindowPB {
  476.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  477.     UInt16                          window;                     /*    SS_WINDOW*/
  478.     UInt16                          socket;                     /*    SS_SOCKET*/
  479.     UInt32                          size;                       /*    SS_SIZE*/
  480.     Byte                            state;                      /*    SS_FLAGS8*/
  481.     Byte                            reserved;                   /*    padding*/
  482.     UInt16                          speed;                      /*    SS_SPEED*/
  483.     UInt32                          base;                       /*    SS_BASE*/
  484. };
  485. typedef struct SSGetSetWindowPB         SSGetSetWindowPB;
  486. struct SSGetSSInfoPB {
  487.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  488.     UInt16                          compliance;                 /*    SS_BCD*/
  489.     UInt16                          numAdapters;                /*    SS_COUNT*/
  490.     UInt16                          firstAdapter;               /*    SS_ADAPTER*/
  491. };
  492. typedef struct SSGetSSInfoPB            SSGetSSInfoPB;
  493. struct SSGetStatusPB {
  494.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  495.     UInt16                          socket;                     /*    SS_SOCKET*/
  496.     Byte                            cardState;                  /*    SS_FLAGS8*/
  497.     Byte                            socketState;                /*    SS_FLAGS8*/
  498.     Byte                            ctlInd;                     /*    SS_FLAGS8*/
  499.     Byte                            ireqRouting;                /*    SS_IRQ*/
  500.     Byte                            ifType;                     /*    SS_FLAGS8*/
  501.     Byte                            padding[1];                 /*    */
  502. };
  503. typedef struct SSGetStatusPB            SSGetStatusPB;
  504. struct SSGetVendorInfoPB {
  505.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  506.     Byte                            vendorInfoType;             /*    SS_BYTE*/
  507.     Byte                            reserved;                   /*    padding*/
  508.     Ptr                             buffer;                     /*    SS_PTR*/
  509.     UInt16                          release;                    /*    SS_BCD*/
  510. };
  511. typedef struct SSGetVendorInfoPB        SSGetVendorInfoPB;
  512. struct SSInquireAdapterPB {
  513.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  514.     Ptr                             buffer;                     /*    SS_PTR*/
  515.     UInt16                          numSockets;                 /*    SS_COUNT*/
  516.     UInt16                          numWindows;                 /*    SS_COUNT*/
  517.     UInt16                          numEDCs;                    /*    SS_COUNT*/
  518. };
  519. typedef struct SSInquireAdapterPB       SSInquireAdapterPB;
  520. struct SSInquireEDCPB {
  521.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  522.     UInt16                          edc;                        /*    SS_EDC*/
  523.     UInt16                          sockets;                    /*    SS_SKTBITS*/
  524.     Byte                            caps;                       /*    SS_FLAGS8*/
  525.     Byte                            types;                      /*    SS_FLAGS8*/
  526. };
  527. typedef struct SSInquireEDCPB           SSInquireEDCPB;
  528. struct SSInquireSocketPB {
  529.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  530.     UInt16                          socket;                     /*    SS_SOCKET*/
  531.     Ptr                             buffer;                     /*    SS_PTR*/
  532.     Byte                            scIntCaps;                  /*    SS_FLAGS8*/
  533.     Byte                            scRptCaps;                  /*    SS_FLAGS8*/
  534.     Byte                            ctlIndCaps;                 /*    SS_FLAGS8*/
  535.     Byte                            padding[1];                 /*    */
  536. };
  537. typedef struct SSInquireSocketPB        SSInquireSocketPB;
  538. struct SSInquireWindowPB {
  539.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  540.     UInt16                          window;                     /*    SS_WINDOW*/
  541.     Ptr                             buffer;                     /*    SS_PTR*/
  542.     Byte                            wndCaps;                    /*    SS_FLAGS8*/
  543.     Byte                            reserved;                   /*    padding*/
  544.     UInt16                          sockets;                    /*    SS_SKTBITS*/
  545. };
  546. typedef struct SSInquireWindowPB        SSInquireWindowPB;
  547. struct SSPauseEDCPB {
  548.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  549.     UInt16                          edc;                        /*    SS_EDC*/
  550. };
  551. typedef struct SSPauseEDCPB             SSPauseEDCPB;
  552. struct SSReadEDCPB {
  553.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  554.     UInt16                          edc;                        /*    SS_EDC*/
  555.     UInt16                          value;                      /*    SS_WORD*/
  556. };
  557. typedef struct SSReadEDCPB              SSReadEDCPB;
  558. struct SSResetSocketPB {
  559.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  560.     UInt16                          socket;                     /*    SS_SOCKET*/
  561. };
  562. typedef struct SSResetSocketPB          SSResetSocketPB;
  563. struct SSResumeEDCPB {
  564.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  565.     UInt16                          edc;                        /*    SS_EDC*/
  566. };
  567. typedef struct SSResumeEDCPB            SSResumeEDCPB;
  568. struct SSStartEDCPB {
  569.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  570.     UInt16                          edc;                        /*    SS_EDC*/
  571. };
  572. typedef struct SSStartEDCPB             SSStartEDCPB;
  573. struct SSStopEDCPB {
  574.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  575.     UInt16                          edc;                        /*    SS_EDC*/
  576. };
  577. typedef struct SSStopEDCPB              SSStopEDCPB;
  578. struct SSVendorSpecificPB {
  579.     UInt16                          vsFunction;                 /*    SS_WORD*/
  580.     UInt16                          adapter;                    /*    SS_ADAPTER*/
  581.     UInt16                          socket;                     /*    SS_SOCKET*/
  582.     UInt16                          bufferSize;                 /*    SS_WORD*/
  583.     Ptr                             buffer;                     /*    SS_PTR*/
  584.     UInt32                          attributes;                 /*    SS_LONG*/
  585. };
  586. typedef struct SSVendorSpecificPB       SSVendorSpecificPB;
  587. /*  'attributes' constants */
  588. enum {
  589.     kSSGoingToSleep             = 0x00000001,
  590.     kSSWakingFromSleep          = 0x00000002
  591. };
  592. /*------------------------------------------------------------------------
  593.     Non-specific Socket Services Functions
  594. ------------------------------------------------------------------------*/
  595. #if CALL_NOT_IN_CARBON
  596. EXTERN_API( SS_RETCODE )
  597. SSGetAdapterCount               (SSGetAdapterCountPB *  pb,
  598.                                  Ptr                    dataPtr);
  599. /*------------------------------------------------------------------------
  600.     Adapter Functions
  601. ------------------------------------------------------------------------*/
  602. EXTERN_API( SS_RETCODE )
  603. SSAcknowledgeInterrupt          (SSAcknowledgeInterruptPB * pb,
  604.                                  Ptr                    dataPtr);
  605. EXTERN_API( SS_RETCODE )
  606. SSGetSetPriorHandler            (SSGetSetPriorHandlerPB * pb,
  607.                                  Ptr                    dataPtr);
  608. EXTERN_API( SS_RETCODE )
  609. SSGetSetSSAddr                  (SSGetSetSSAddrPB *     pb,
  610.                                  Ptr                    dataPtr);
  611. EXTERN_API( SS_RETCODE )
  612. SSGetAccessOffsets              (SSGetAccessOffsetsPB * pb,
  613.                                  Ptr                    dataPtr);
  614. EXTERN_API( SS_RETCODE )
  615. SSGetAdapter                    (SSGetSetAdapterPB *    pb,
  616.                                  Ptr                    dataPtr);
  617. EXTERN_API( SS_RETCODE )
  618. SSGetSSInfo                     (SSGetSSInfoPB *        pb,
  619.                                  Ptr                    dataPtr);
  620. EXTERN_API( SS_RETCODE )
  621. SSGetVendorInfo                 (SSGetVendorInfoPB *    pb,
  622.                                  Ptr                    dataPtr);
  623. EXTERN_API( SS_RETCODE )
  624. SSInquireAdapter                (SSInquireAdapterPB *   pb,
  625.                                  Ptr                    dataPtr);
  626. EXTERN_API( SS_RETCODE )
  627. SSSetAdapter                    (SSGetSetAdapterPB *    pb,
  628.                                  Ptr                    dataPtr);
  629. EXTERN_API( SS_RETCODE )
  630. SSVendorSpecific                (SSVendorSpecificPB *   pb,
  631.                                  Ptr                    dataPtr);
  632. /*------------------------------------------------------------------------
  633.     Socket Functions
  634. ------------------------------------------------------------------------*/
  635. EXTERN_API( SS_RETCODE )
  636. SSGetSocket                     (SSGetSetSocketPB *     pb,
  637.                                  Ptr                    dataPtr);
  638. EXTERN_API( SS_RETCODE )
  639. SSGetStatus                     (SSGetStatusPB *        pb,
  640.                                  Ptr                    dataPtr);
  641. EXTERN_API( SS_RETCODE )
  642. SSInquireSocket                 (SSInquireSocketPB *    pb,
  643.                                  Ptr                    dataPtr);
  644. EXTERN_API( SS_RETCODE )
  645. SSResetSocket                   (SSResetSocketPB *      pb,
  646.                                  Ptr                    dataPtr);
  647. EXTERN_API( SS_RETCODE )
  648. SSSetSocket                     (SSGetSetSocketPB *     pb,
  649.                                  Ptr                    dataPtr);
  650. /*------------------------------------------------------------------------
  651.     Window Functions
  652. ------------------------------------------------------------------------*/
  653. EXTERN_API( SS_RETCODE )
  654. SSGetPage                       (SSGetSetPagePB *       pb,
  655.                                  Ptr                    dataPtr);
  656. EXTERN_API( SS_RETCODE )
  657. SSGetWindow                     (SSGetSetWindowPB *     pb,
  658.                                  Ptr                    dataPtr);
  659. EXTERN_API( SS_RETCODE )
  660. SSInquireWindow                 (SSInquireWindowPB *    pb,
  661.                                  Ptr                    dataPtr);
  662. EXTERN_API( SS_RETCODE )
  663. SSSetPage                       (SSGetSetPagePB *       pb,
  664.                                  Ptr                    dataPtr);
  665. EXTERN_API( SS_RETCODE )
  666. SSSetWindow                     (SSGetSetWindowPB *     pb,
  667.                                  Ptr                    dataPtr);
  668. /*------------------------------------------------------------------------
  669.     Error Detection Functions
  670. ------------------------------------------------------------------------*/
  671. EXTERN_API( SS_RETCODE )
  672. SSGetEDC                        (SSGetSetEDCPB *        pb,
  673.                                  Ptr                    dataPtr);
  674. EXTERN_API( SS_RETCODE )
  675. SSInquireEDC                    (SSInquireEDCPB *       pb,
  676.                                  Ptr                    dataPtr);
  677. EXTERN_API( SS_RETCODE )
  678. SSPauseEDC                      (SSPauseEDCPB *         pb,
  679.                                  Ptr                    dataPtr);
  680. EXTERN_API( SS_RETCODE )
  681. SSReadEDC                       (SSReadEDCPB *          pb,
  682.                                  Ptr                    dataPtr);
  683. EXTERN_API( SS_RETCODE )
  684. SSResumeEDC                     (SSResumeEDCPB *        pb,
  685.                                  Ptr                    dataPtr);
  686. EXTERN_API( SS_RETCODE )
  687. SSSetEDC                        (SSGetSetEDCPB *        pb,
  688.                                  Ptr                    dataPtr);
  689. EXTERN_API( SS_RETCODE )
  690. SSStartEDC                      (SSStartEDCPB *         pb,
  691.                                  Ptr                    dataPtr);
  692. EXTERN_API( SS_RETCODE )
  693. SSStopEDC                       (SSStopEDCPB *          pb,
  694.                                  Ptr                    dataPtr);
  695. #endif  /* CALL_NOT_IN_CARBON */
  696. #if PRAGMA_STRUCT_ALIGN
  697.     #pragma options align=reset
  698. #elif PRAGMA_STRUCT_PACKPUSH
  699.     #pragma pack(pop)
  700. #elif PRAGMA_STRUCT_PACK
  701.     #pragma pack()
  702. #endif
  703. #ifdef PRAGMA_IMPORT_OFF
  704. #pragma import off
  705. #elif PRAGMA_IMPORT
  706. #pragma import reset
  707. #endif
  708. #ifdef __cplusplus
  709. }
  710. #endif
  711. #endif /* __SOCKETSERVICES__ */