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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CFData.h
  3.  
  4.      Contains:   CoreFoundation block of bytes
  5.  
  6.      Version:    Technology: Mac OS X
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1999-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 __CFDATA__
  18. #define __CFDATA__
  19. #ifndef __CFBASE__
  20. #include "CFBase.h"
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32.     #pragma options align=mac68k
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34.     #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36.     #pragma pack(2)
  37. #endif
  38. typedef const struct __CFData * CFDataRef;
  39. typedef struct __CFData * CFMutableDataRef;
  40. EXTERN_API_C( CFTypeID )
  41. CFDataGetTypeID                 (void);
  42. EXTERN_API_C( CFDataRef )
  43. CFDataCreate                    (CFAllocatorRef         allocator,
  44.                                  const UInt8 *          bytes,
  45.                                  CFIndex                length);
  46. EXTERN_API_C( CFDataRef )
  47. CFDataCreateWithBytesNoCopy     (CFAllocatorRef         allocator,
  48.                                  const UInt8 *          bytes,
  49.                                  CFIndex                length,
  50.                                  CFAllocatorRef         bytesDeallocator);
  51. /* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */
  52. EXTERN_API_C( CFDataRef )
  53. CFDataCreateCopy                (CFAllocatorRef         allocator,
  54.                                  CFDataRef              data);
  55. EXTERN_API_C( CFMutableDataRef )
  56. CFDataCreateMutable             (CFAllocatorRef         allocator,
  57.                                  CFIndex                capacity);
  58. EXTERN_API_C( CFMutableDataRef )
  59. CFDataCreateMutableCopy         (CFAllocatorRef         allocator,
  60.                                  CFIndex                capacity,
  61.                                  CFDataRef              data);
  62. EXTERN_API_C( CFIndex )
  63. CFDataGetLength                 (CFDataRef              data);
  64. EXTERN_API_C( const UInt8 *)
  65. CFDataGetBytePtr                (CFDataRef              data);
  66. EXTERN_API_C( UInt8 *)
  67. CFDataGetMutableBytePtr         (CFMutableDataRef       data);
  68. EXTERN_API_C( void )
  69. CFDataGetBytes                  (CFDataRef              data,
  70.                                  CFRange                range,
  71.                                  UInt8 *                buffer);
  72. EXTERN_API_C( void )
  73. CFDataSetLength                 (CFMutableDataRef       data,
  74.                                  CFIndex                length);
  75. EXTERN_API_C( void )
  76. CFDataIncreaseLength            (CFMutableDataRef       data,
  77.                                  CFIndex                extraLength);
  78. EXTERN_API_C( void )
  79. CFDataAppendBytes               (CFMutableDataRef       data,
  80.                                  const UInt8 *          bytes,
  81.                                  CFIndex                length);
  82. EXTERN_API_C( void )
  83. CFDataReplaceBytes              (CFMutableDataRef       data,
  84.                                  CFRange                range,
  85.                                  const UInt8 *          newBytes,
  86.                                  CFIndex                newLength);
  87. EXTERN_API_C( void )
  88. CFDataDeleteBytes               (CFMutableDataRef       data,
  89.                                  CFRange                range);
  90. #if PRAGMA_STRUCT_ALIGN
  91.     #pragma options align=reset
  92. #elif PRAGMA_STRUCT_PACKPUSH
  93.     #pragma pack(pop)
  94. #elif PRAGMA_STRUCT_PACK
  95.     #pragma pack()
  96. #endif
  97. #ifdef PRAGMA_IMPORT_OFF
  98. #pragma import off
  99. #elif PRAGMA_IMPORT
  100. #pragma import reset
  101. #endif
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif /* __CFDATA__ */