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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CFDate.h
  3.  
  4.      Contains:   CoreFoundation date
  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 __CFDATE__
  18. #define __CFDATE__
  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 double                          CFTimeInterval;
  39. typedef CFTimeInterval                  CFAbsoluteTime;
  40. /* absolute time is the time interval since the reference date */
  41. /* the reference date (epoch) is 00:00:00 1 January 2001. */
  42. EXTERN_API_C( CFAbsoluteTime )
  43. CFAbsoluteTimeGetCurrent        (void);
  44. extern const CFAbsoluteTime kCFAbsoluteTimeIntervalSince1970;
  45. extern const CFAbsoluteTime kCFAbsoluteTimeIntervalSince1904;
  46. typedef const struct __CFDate * CFDateRef;
  47. EXTERN_API_C( CFTypeID )
  48. CFDateGetTypeID                 (void);
  49. EXTERN_API_C( CFDateRef )
  50. CFDateCreate                    (CFAllocatorRef         allocator,
  51.                                  CFAbsoluteTime         at);
  52. EXTERN_API_C( CFAbsoluteTime )
  53. CFDateGetAbsoluteTime           (CFDateRef              date);
  54. EXTERN_API_C( CFTimeInterval )
  55. CFDateGetTimeIntervalSinceDate  (CFDateRef              date,
  56.                                  CFDateRef              otherDate);
  57. EXTERN_API_C( CFComparisonResult )
  58. CFDateCompare                   (CFDateRef              date,
  59.                                  CFDateRef              otherDate,
  60.                                  void *                 context);
  61. #if !defined(__CFTIMEZONE_STRUCT__)
  62.     #define __CFTIMEZONE_STRUCT__ 1
  63.     typedef const struct __CFTimeZone * CFTimeZoneRef;
  64. #endif
  65. struct CFGregorianDate {
  66.     SInt32                          year;
  67.     SInt8                           month;
  68.     SInt8                           day;
  69.     SInt8                           hour;
  70.     SInt8                           minute;
  71.     double                          second;
  72. };
  73. typedef struct CFGregorianDate          CFGregorianDate;
  74. struct CFGregorianUnits {
  75.     SInt32                          years;
  76.     SInt32                          months;
  77.     SInt32                          days;
  78.     SInt32                          hours;
  79.     SInt32                          minutes;
  80.     double                          seconds;
  81. };
  82. typedef struct CFGregorianUnits         CFGregorianUnits;
  83. enum {
  84.     kCFGregorianUnitsYears      = (1 << 0),
  85.     kCFGregorianUnitsMonths     = (1 << 1),
  86.     kCFGregorianUnitsDays       = (1 << 2),
  87.     kCFGregorianUnitsHours      = (1 << 3),
  88.     kCFGregorianUnitsMinutes    = (1 << 4),
  89.     kCFGregorianUnitsSeconds    = (1 << 5),
  90.     kCFGregorianAllUnits        = 0x00FFFFFF
  91. };
  92. EXTERN_API_C( Boolean )
  93. CFGregorianDateIsValid          (CFGregorianDate        gdate,
  94.                                  CFOptionFlags          unitFlags);
  95. EXTERN_API_C( CFAbsoluteTime )
  96. CFGregorianDateGetAbsoluteTime  (CFGregorianDate        gdate,
  97.                                  CFTimeZoneRef          tz);
  98. EXTERN_API_C( CFGregorianDate )
  99. CFAbsoluteTimeGetGregorianDate  (CFAbsoluteTime         at,
  100.                                  CFTimeZoneRef          tz);
  101. EXTERN_API_C( SInt32 )
  102. CFAbsoluteTimeGetDayOfWeek      (CFAbsoluteTime         at,
  103.                                  CFTimeZoneRef          tz);
  104. EXTERN_API_C( SInt32 )
  105. CFAbsoluteTimeGetDayOfYear      (CFAbsoluteTime         at,
  106.                                  CFTimeZoneRef          tz);
  107. EXTERN_API_C( SInt32 )
  108. CFAbsoluteTimeGetWeekOfYear     (CFAbsoluteTime         at,
  109.                                  CFTimeZoneRef          tz);
  110. #if PRAGMA_STRUCT_ALIGN
  111.     #pragma options align=reset
  112. #elif PRAGMA_STRUCT_PACKPUSH
  113.     #pragma pack(pop)
  114. #elif PRAGMA_STRUCT_PACK
  115.     #pragma pack()
  116. #endif
  117. #ifdef PRAGMA_IMPORT_OFF
  118. #pragma import off
  119. #elif PRAGMA_IMPORT
  120. #pragma import reset
  121. #endif
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif /* __CFDATE__ */