~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/extra/univint/HostTime.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{==================================================================================================
2
 
     File:       CoreAudio/HostTime.h
3
 
 
4
 
     Contains:   Routines for accessing the host's time base
5
 
 
6
 
     Version:    Technology: Mac OS X
7
 
                 Release:    Mac OS X
8
 
 
9
 
     Copyright:  (c) 1985-2005 by Apple Computer, Inc., all rights reserved.
10
 
 
11
 
==================================================================================================}
12
 
 
13
 
{        Pascal Translation:  Gale R Paeper, <gpaeper@empirenet.com>, 2006 }
14
 
 
15
 
{
16
 
    Modified for use with Free Pascal
17
 
    Version 200
18
 
    Please report any bugs to <gpc@microbizz.nl>
19
 
}
20
 
 
21
 
{$mode macpas}
22
 
{$packenum 1}
23
 
{$macro on}
24
 
{$inline on}
25
 
{$CALLING MWPASCAL}
26
 
 
27
 
unit HostTime;
28
 
interface
29
 
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
30
 
{$setc GAP_INTERFACES_VERSION := $0200}
31
 
 
32
 
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
33
 
    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
34
 
{$endc}
35
 
 
36
 
{$ifc defined CPUPOWERPC and defined CPUI386}
37
 
        {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
38
 
{$endc}
39
 
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
40
 
        {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
41
 
{$endc}
42
 
 
43
 
{$ifc not defined __ppc__ and defined CPUPOWERPC}
44
 
        {$setc __ppc__ := 1}
45
 
{$elsec}
46
 
        {$setc __ppc__ := 0}
47
 
{$endc}
48
 
{$ifc not defined __i386__ and defined CPUI386}
49
 
        {$setc __i386__ := 1}
50
 
{$elsec}
51
 
        {$setc __i386__ := 0}
52
 
{$endc}
53
 
 
54
 
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
55
 
        {$error Conflicting definitions for __ppc__ and __i386__}
56
 
{$endc}
57
 
 
58
 
{$ifc defined __ppc__ and __ppc__}
59
 
        {$setc TARGET_CPU_PPC := TRUE}
60
 
        {$setc TARGET_CPU_X86 := FALSE}
61
 
{$elifc defined __i386__ and __i386__}
62
 
        {$setc TARGET_CPU_PPC := FALSE}
63
 
        {$setc TARGET_CPU_X86 := TRUE}
64
 
{$elsec}
65
 
        {$error Neither __ppc__ nor __i386__ is defined.}
66
 
{$endc}
67
 
{$setc TARGET_CPU_PPC_64 := FALSE}
68
 
 
69
 
{$ifc defined FPC_BIG_ENDIAN}
70
 
        {$setc TARGET_RT_BIG_ENDIAN := TRUE}
71
 
        {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
72
 
{$elifc defined FPC_LITTLE_ENDIAN}
73
 
        {$setc TARGET_RT_BIG_ENDIAN := FALSE}
74
 
        {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
75
 
{$elsec}
76
 
        {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
77
 
{$endc}
78
 
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
79
 
{$setc CALL_NOT_IN_CARBON := FALSE}
80
 
{$setc OLDROUTINENAMES := FALSE}
81
 
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
82
 
{$setc OPAQUE_UPP_TYPES := TRUE}
83
 
{$setc OTCARBONAPPLICATION := TRUE}
84
 
{$setc OTKERNEL := FALSE}
85
 
{$setc PM_USE_SESSION_APIS := TRUE}
86
 
{$setc TARGET_API_MAC_CARBON := TRUE}
87
 
{$setc TARGET_API_MAC_OS8 := FALSE}
88
 
{$setc TARGET_API_MAC_OSX := TRUE}
89
 
{$setc TARGET_CARBON := TRUE}
90
 
{$setc TARGET_CPU_68K := FALSE}
91
 
{$setc TARGET_CPU_MIPS := FALSE}
92
 
{$setc TARGET_CPU_SPARC := FALSE}
93
 
{$setc TARGET_OS_MAC := TRUE}
94
 
{$setc TARGET_OS_UNIX := FALSE}
95
 
{$setc TARGET_OS_WIN32 := FALSE}
96
 
{$setc TARGET_RT_MAC_68881 := FALSE}
97
 
{$setc TARGET_RT_MAC_CFM := FALSE}
98
 
{$setc TARGET_RT_MAC_MACHO := TRUE}
99
 
{$setc TYPED_FUNCTION_POINTERS := TRUE}
100
 
{$setc TYPE_BOOL := FALSE}
101
 
{$setc TYPE_EXTENDED := FALSE}
102
 
{$setc TYPE_LONGLONG := TRUE}
103
 
uses MacTypes,CoreAudioTypes;
104
 
{$ALIGN POWER}
105
 
 
106
 
 
107
 
//==================================================================================================
108
 
//#pragma mark    Theory of Operation
109
 
 
110
 
{!
111
 
    @header HostTime
112
 
    This collection of functions provides access to the host's time base. It also provides
113
 
    discriptive information about the time base and translations to and from nanoseconds.
114
 
}
115
 
 
116
 
 
117
 
{!
118
 
    @functiongroup  HostTime
119
 
}
120
 
 
121
 
{!
122
 
    @function       AudioGetCurrentHostTime
123
 
    @abstract       Gets the current host time.
124
 
    @result         A UInt64 containing the current host time.
125
 
}
126
 
function AudioGetCurrentHostTime: UInt64; external name '_AudioGetCurrentHostTime';
127
 
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
128
 
 
129
 
{!
130
 
    @function       AudioGetHostClockFrequency
131
 
    @abstract       Gets the number of ticks per second in the host time base.
132
 
    @result         A Float64 containing the number of ticks per second in the host time base.
133
 
}
134
 
function AudioGetHostClockFrequency: Float64; external name '_AudioGetHostClockFrequency';
135
 
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
136
 
 
137
 
{!
138
 
    @function       AudioGetHostClockMinimumTimeDelta
139
 
    @abstract       Gets the smallest number of ticks that two succeeding values will ever differ.
140
 
                    by.
141
 
    @result         A UInt32 containing the smallest number of ticks that two succeeding values will
142
 
                    ever differ.
143
 
}
144
 
function AudioGetHostClockMinimumTimeDelta: UInt32; external name '_AudioGetHostClockMinimumTimeDelta';
145
 
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
146
 
 
147
 
{!
148
 
    @function       AudioConvertHostTimeToNanos
149
 
    @abstract       Convert the given host time into a time in nanoseconds.
150
 
    @param          inHostTime
151
 
                        A UInt64 containing the host time to convert.
152
 
    @result         A UInt64 containining the converted host time.
153
 
}
154
 
function AudioConvertHostTimeToNanos( inHostTime: UInt64 ): UInt64; external name '_AudioConvertHostTimeToNanos';
155
 
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
156
 
 
157
 
{!
158
 
    @function       AudioConvertNanosToHostTime
159
 
    @abstract       Convert the given nanosecond time into a host time.
160
 
    @param          inNanos
161
 
                        A UInt64 containing the nanosecond time to convert.
162
 
    @result         A UInt64 containining the converted nanosecond time.
163
 
}
164
 
function AudioConvertNanosToHostTime( inNanos: UInt64 ): UInt64; external name '_AudioConvertNanosToHostTime';
165
 
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
166
 
 
167
 
 
168
 
end.