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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CommResources.h
  3.  
  4.      Contains:   Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1988-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 __COMMRESOURCES__
  18. #define __COMMRESOURCES__
  19. #ifndef __OSUTILS__
  20. #include "OSUtils.h"
  21. #endif
  22. #ifndef __CONDITIONALMACROS__
  23. #include "ConditionalMacros.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. #if CALL_NOT_IN_CARBON
  42. enum {
  43.                                                                 /*    tool classes (also the tool file types)    */
  44.     classCM                     = FOUR_CHAR_CODE('cbnd'),
  45.     classFT                     = FOUR_CHAR_CODE('fbnd'),
  46.     classTM                     = FOUR_CHAR_CODE('tbnd')
  47. };
  48. enum {
  49.                                                                 /*    version of the Comm Resource Manager   */
  50.     curCRMVersion               = 2,                            /* constants general to the use of the Communications Resource Manager */
  51.     crmType                     = 9,                            /* queue type */
  52.     crmRecVersion               = 1,                            /* version of queue structure */
  53.                                                                 /*    error codes */
  54.     crmGenericError             = -1,
  55.     crmNoErr                    = 0
  56. };
  57. /* data structures general to the use of the Communications Resource Manager */
  58. typedef OSErr                           CRMErr;
  59. struct CRMRec {
  60.     QElemPtr                        qLink;                      /*reserved*/
  61.     short                           qType;                      /*queue type -- ORD(crmType) = 9*/
  62.     short                           crmVersion;                 /*version of queue element data structure*/
  63.     long                            crmPrivate;                 /*reserved*/
  64.     short                           crmReserved;                /*reserved*/
  65.     long                            crmDeviceType;              /*type of device, assigned by DTS*/
  66.     long                            crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  67.     long                            crmAttributes;              /*pointer to attribute block*/
  68.     long                            crmStatus;                  /*status variable - device specific*/
  69.     long                            crmRefCon;                  /*for device private use*/
  70. };
  71. typedef struct CRMRec                   CRMRec;
  72. typedef CRMRec *                        CRMRecPtr;
  73. #if CALL_NOT_IN_CARBON
  74. EXTERN_API( CRMErr )
  75. InitCRM                         (void);
  76. EXTERN_API( QHdrPtr )
  77. CRMGetHeader                    (void);
  78. EXTERN_API( void )
  79. CRMInstall                      (CRMRecPtr              crmReqPtr);
  80. EXTERN_API( OSErr )
  81. CRMRemove                       (CRMRecPtr              crmReqPtr);
  82. EXTERN_API( CRMRecPtr )
  83. CRMSearch                       (CRMRecPtr              crmReqPtr);
  84. EXTERN_API( short )
  85. CRMGetCRMVersion                (void);
  86. EXTERN_API( Handle )
  87. CRMGetResource                  (ResType                theType,
  88.                                  short                  theID);
  89. EXTERN_API( Handle )
  90. CRMGet1Resource                 (ResType                theType,
  91.                                  short                  theID);
  92. EXTERN_API( Handle )
  93. CRMGetIndResource               (ResType                theType,
  94.                                  short                  index);
  95. EXTERN_API( Handle )
  96. CRMGet1IndResource              (ResType                theType,
  97.                                  short                  index);
  98. EXTERN_API( Handle )
  99. CRMGetNamedResource             (ResType                theType,
  100.                                  ConstStr255Param       name);
  101. EXTERN_API( Handle )
  102. CRMGet1NamedResource            (ResType                theType,
  103.                                  ConstStr255Param       name);
  104. EXTERN_API( void )
  105. CRMReleaseResource              (Handle                 theHandle);
  106. EXTERN_API( Handle )
  107. CRMGetToolResource              (short                  procID,
  108.                                  ResType                theType,
  109.                                  short                  theID);
  110. EXTERN_API( Handle )
  111. CRMGetToolNamedResource         (short                  procID,
  112.                                  ResType                theType,
  113.                                  ConstStr255Param       name);
  114. EXTERN_API( void )
  115. CRMReleaseToolResource          (short                  procID,
  116.                                  Handle                 theHandle);
  117. EXTERN_API( long )
  118. CRMGetIndex                     (Handle                 theHandle);
  119. EXTERN_API( short )
  120. CRMLocalToRealID                (ResType                bundleType,
  121.                                  short                  toolID,
  122.                                  ResType                theType,
  123.                                  short                  localID);
  124. EXTERN_API( short )
  125. CRMRealToLocalID                (ResType                bundleType,
  126.                                  short                  toolID,
  127.                                  ResType                theType,
  128.                                  short                  realID);
  129. EXTERN_API( OSErr )
  130. CRMGetIndToolName               (OSType                 bundleType,
  131.                                  short                  index,
  132.                                  Str255                 toolName);
  133. EXTERN_API( OSErr )
  134. CRMFindCommunications           (short *                vRefNum,
  135.                                  long *                 dirID);
  136. EXTERN_API( Boolean )
  137. CRMIsDriverOpen                 (ConstStr255Param       driverName);
  138. EXTERN_API( CRMErr )
  139. CRMParseCAPSResource            (Handle                 theHandle,
  140.                                  ResType                selector,
  141.                                  unsigned long *        value);
  142. EXTERN_API( OSErr )
  143. CRMReserveRF                    (short                  refNum);
  144. EXTERN_API( OSErr )
  145. CRMReleaseRF                    (short                  refNum);
  146. #endif  /* CALL_NOT_IN_CARBON */
  147. #endif  /* CALL_NOT_IN_CARBON */
  148. #if PRAGMA_STRUCT_ALIGN
  149.     #pragma options align=reset
  150. #elif PRAGMA_STRUCT_PACKPUSH
  151.     #pragma pack(pop)
  152. #elif PRAGMA_STRUCT_PACK
  153.     #pragma pack()
  154. #endif
  155. #ifdef PRAGMA_IMPORT_OFF
  156. #pragma import off
  157. #elif PRAGMA_IMPORT
  158. #pragma import reset
  159. #endif
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163. #endif /* __COMMRESOURCES__ */