1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
|
/*
File: DateTimeUtils.h
Contains: International Date and Time Interfaces (previously in TextUtils)
Version: QuickTime 7.3
Copyright: (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __DATETIMEUTILS__
#define __DATETIMEUTILS__
#ifndef __CONDITIONALMACROS__
#include <ConditionalMacros.h>
#endif
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif
#ifndef __UTCUTILS__
#include <UTCUtils.h>
#endif
#ifndef __CFDATE__
#include <CFDate.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
/*
Here are the current routine names and the translations to the older forms.
Please use the newer forms in all new code and migrate the older names out of existing
code as maintainance permits.
New Name Old Name(s)
DateString IUDatePString IUDateString
InitDateCache
LongDateString IULDateString
LongTimeString IULTimeString
StringToDate String2Date
StringToTime
TimeString IUTimeString IUTimePString
LongDateToSeconds LongDate2Secs
LongSecondsToDate LongSecs2Date
DateToSeconds Date2Secs
SecondsToDate Secs2Date
Carbon only supports the new names. The old names are undefined for Carbon targets.
This is true for C, Assembly and Pascal.
InterfaceLib always has exported the old names. For C macros have been defined to allow
the use of the new names. For Pascal and Assembly using the new names will result
in link errors.
*/
typedef SInt16 ToggleResults;
enum {
/* Toggle results */
toggleUndefined = 0,
toggleOK = 1,
toggleBadField = 2,
toggleBadDelta = 3,
toggleBadChar = 4,
toggleUnknown = 5,
toggleBadNum = 6,
toggleOutOfRange = 7, /*synonym for toggleErr3*/
toggleErr3 = 7,
toggleErr4 = 8,
toggleErr5 = 9
};
enum {
/* Date equates */
smallDateBit = 31, /*Restrict valid date/time to range of Time global*/
togChar12HourBit = 30, /*If toggling hour by char, accept hours 1..12 only*/
togCharZCycleBit = 29, /*Modifier for togChar12HourBit: accept hours 0..11 only*/
togDelta12HourBit = 28, /*If toggling hour up/down, restrict to 12-hour range (am/pm)*/
genCdevRangeBit = 27, /*Restrict date/time to range used by genl CDEV*/
validDateFields = -1,
maxDateField = 10
};
enum {
eraMask = 0x0001,
yearMask = 0x0002,
monthMask = 0x0004,
dayMask = 0x0008,
hourMask = 0x0010,
minuteMask = 0x0020,
secondMask = 0x0040,
dayOfWeekMask = 0x0080,
dayOfYearMask = 0x0100,
weekOfYearMask = 0x0200,
pmMask = 0x0400,
dateStdMask = 0x007F /*default for ValidDate flags and ToggleDate TogglePB.togFlags*/
};
typedef SInt8 LongDateField;
enum {
eraField = 0,
yearField = 1,
monthField = 2,
dayField = 3,
hourField = 4,
minuteField = 5,
secondField = 6,
dayOfWeekField = 7,
dayOfYearField = 8,
weekOfYearField = 9,
pmField = 10,
res1Field = 11,
res2Field = 12,
res3Field = 13
};
typedef SInt8 DateForm;
enum {
shortDate = 0,
longDate = 1,
abbrevDate = 2
};
enum {
/* StringToDate status values */
fatalDateTime = 0x8000, /* StringToDate and String2Time mask to a fatal error */
longDateFound = 1, /* StringToDate mask to long date found */
leftOverChars = 2, /* StringToDate & Time mask to warn of left over characters */
sepNotIntlSep = 4, /* StringToDate & Time mask to warn of non-standard separators */
fieldOrderNotIntl = 8, /* StringToDate & Time mask to warn of non-standard field order */
extraneousStrings = 16, /* StringToDate & Time mask to warn of unparsable strings in text */
tooManySeps = 32, /* StringToDate & Time mask to warn of too many separators */
sepNotConsistent = 64, /* StringToDate & Time mask to warn of inconsistent separators */
tokenErr = 0x8100, /* StringToDate & Time mask for 'tokenizer err encountered' */
cantReadUtilities = 0x8200,
dateTimeNotFound = 0x8400,
dateTimeInvalid = 0x8800
};
typedef short StringToDateStatus;
typedef StringToDateStatus String2DateStatus;
struct DateCacheRecord {
short hidden[256]; /* only for temporary use */
};
typedef struct DateCacheRecord DateCacheRecord;
typedef DateCacheRecord * DateCachePtr;
struct DateTimeRec {
short year;
short month;
short day;
short hour;
short minute;
short second;
short dayOfWeek;
};
typedef struct DateTimeRec DateTimeRec;
typedef SInt64 LongDateTime;
#if TARGET_RT_BIG_ENDIAN
union LongDateCvt {
SInt64 c;
struct {
UInt32 lHigh;
UInt32 lLow;
} hl;
};
typedef union LongDateCvt LongDateCvt;
#else
union LongDateCvt {
SInt64 c;
struct {
UInt32 lLow;
UInt32 lHigh;
} hl;
};
typedef union LongDateCvt LongDateCvt;
#endif /* TARGET_RT_BIG_ENDIAN */
union LongDateRec {
struct {
short era;
short year;
short month;
short day;
short hour;
short minute;
short second;
short dayOfWeek;
short dayOfYear;
short weekOfYear;
short pm;
short res1;
short res2;
short res3;
} ld;
short list[14]; /*Index by LongDateField!*/
struct {
short eraAlt;
DateTimeRec oldDate;
} od;
};
typedef union LongDateRec LongDateRec;
typedef SInt8 DateDelta;
struct TogglePB {
long togFlags; /*caller normally sets low word to dateStdMask=$7F*/
ResType amChars; /*from 'itl0', but uppercased*/
ResType pmChars; /*from 'itl0', but uppercased*/
long reserved[4];
};
typedef struct TogglePB TogglePB;
/*
Conversion utilities between CF and Carbon time types.
*/
/*
* UCConvertUTCDateTimeToCFAbsoluteTime()
*
* Discussion:
* Use UCConvertUTCDateTimeToCFAbsoluteTime to convert from a
* UTCDDateTime to a CFAbsoluteTime. Remember that the epoch for
* UTCDateTime is January 1, 1904 while the epoch for CFAbsoluteTime
* is January 1, 2001.
*
* Parameters:
*
* iUTCDate:
* A pointer to a UTCDateTime struct that represents the time you
* wish to convert from.
*
* oCFTime:
* A pointer to a CFAbsoluteTime. On successful return, this will
* contain the converted time from the input time type.
*
* Result:
* A result code indicating whether or not conversion was successful.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API_C( OSStatus )
UCConvertUTCDateTimeToCFAbsoluteTime(
const UTCDateTime * iUTCDate,
CFAbsoluteTime * oCFTime);
/*
* UCConvertSecondsToCFAbsoluteTime()
*
* Discussion:
* Use UCConvertSecondsToCFAbsoluteTime to convert from the normal
* seconds representation of time to a CFAbsoluteTime. Remember that
* the epoch for seconds is January 1, 1904 while the epoch for
* CFAbsoluteTime is January 1, 2001.
*
* Parameters:
*
* iSeconds:
* A UInt32 value that represents the time you wish to convert
* from.
*
* oCFTime:
* A pointer to a CFAbsoluteTime. On successful return, this will
* contain the converted time from the input time type.
*
* Result:
* A result code indicating whether or not conversion was successful.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API_C( OSStatus )
UCConvertSecondsToCFAbsoluteTime(
UInt32 iSeconds,
CFAbsoluteTime * oCFTime);
/*
* UCConvertLongDateTimeToCFAbsoluteTime()
*
* Discussion:
* Use UCConvertLongDateTimeToCFAbsoluteTime to convert from a
* LongDateTime to a CFAbsoluteTime. Remember that the epoch for
* LongDateTime is January 1, 1904 while the epoch for
* CFAbsoluteTime is January 1, 2001.
*
* Parameters:
*
* iLongTime:
* A LongDateTime value that represents the time you wish to
* convert from.
*
* oCFTime:
* A pointer to a CFAbsoluteTime. On successful return, this will
* contain the converted time from the input time type.
*
* Result:
* A result code indicating whether or not conversion was successful.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API_C( OSStatus )
UCConvertLongDateTimeToCFAbsoluteTime(
LongDateTime iLongTime,
CFAbsoluteTime * oCFTime);
/*
* UCConvertCFAbsoluteTimeToUTCDateTime()
*
* Discussion:
* Use UCConvertCFAbsoluteTimeToUTCDateTime to convert from a
* CFAbsoluteTime to a UTCDateTime. Remember that the epoch for
* UTCDateTime is January 1, 1904 while the epoch for CFAbsoluteTime
* is January 1, 2001.
*
* Parameters:
*
* iCFTime:
* A CFAbsoluteTime value that represents the time you wish to
* convert from.
*
* oUTCDate:
* A pointer to a UTCDateTime. On successful return, this will
* contain the converted time from the CFAbsoluteTime input.
*
* Result:
* A result code indicating whether or not conversion was successful.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API_C( OSStatus )
UCConvertCFAbsoluteTimeToUTCDateTime(
CFAbsoluteTime iCFTime,
UTCDateTime * oUTCDate);
/*
* UCConvertCFAbsoluteTimeToSeconds()
*
* Discussion:
* Use UCConvertCFAbsoluteTimeToSeconds to convert from a
* CFAbsoluteTime to a UInt32 representation of seconds. Remember
* that the epoch for seconds is January 1, 1904 while the epoch for
* CFAbsoluteTime is January 1, 2001.
*
* Parameters:
*
* iCFTime:
* A CFAbsoluteTime value that represents the time you wish to
* convert from.
*
* oSeconds:
* A pointer to a UInt32. On successful return, this will contain
* the converted time from the CFAbsoluteTime input.
*
* Result:
* A result code indicating whether or not conversion was successful.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API_C( OSStatus )
UCConvertCFAbsoluteTimeToSeconds(
CFAbsoluteTime iCFTime,
UInt32 * oSeconds);
/*
* UCConvertCFAbsoluteTimeToLongDateTime()
*
* Discussion:
* Use UCConvertCFAbsoluteTimeToLongDateTime to convert from a
* CFAbsoluteTime to a LongDateTime. Remember that the epoch for
* LongDateTime is January 1, 1904 while the epoch for
* CFAbsoluteTime is January 1, 2001.
*
* Parameters:
*
* iCFTime:
* A CFAbsoluteTime value that represents the time you wish to
* convert from.
*
* oLongDate:
* A pointer to a LongDateTime. On successful return, this will
* contain the converted time from the CFAbsoluteTime input.
*
* Result:
* A result code indicating whether or not conversion was successful.
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: not available in CarbonLib 1.x
* Mac OS X: in version 10.2 and later
*/
EXTERN_API_C( OSStatus )
UCConvertCFAbsoluteTimeToLongDateTime(
CFAbsoluteTime iCFTime,
LongDateTime * oLongDate);
/*
These routine are available in Carbon with their new name
*/
/*
* DateString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
DateString(
long dateTime,
DateForm longFlag,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x000E, 0xA9ED);
/*
* TimeString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
TimeString(
long dateTime,
Boolean wantSeconds,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0010, 0xA9ED);
/*
* LongDateString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
LongDateString(
const LongDateTime * dateTime,
DateForm longFlag,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0014, 0xA9ED);
/*
* LongTimeString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
LongTimeString(
const LongDateTime * dateTime,
Boolean wantSeconds,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0016, 0xA9ED);
/*
These routine are available in Carbon and InterfaceLib with their new name
*/
/*
* InitDateCache()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( OSErr )
InitDateCache(DateCachePtr theCache) FOURWORDINLINE(0x2F3C, 0x8204, 0xFFF8, 0xA8B5);
/*
* StringToDate()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( StringToDateStatus )
StringToDate(
Ptr textPtr,
long textLen,
DateCachePtr theCache,
long * lengthUsed,
LongDateRec * dateTime) FOURWORDINLINE(0x2F3C, 0x8214, 0xFFF6, 0xA8B5);
/*
* StringToTime()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( StringToDateStatus )
StringToTime(
Ptr textPtr,
long textLen,
DateCachePtr theCache,
long * lengthUsed,
LongDateRec * dateTime) FOURWORDINLINE(0x2F3C, 0x8214, 0xFFF4, 0xA8B5);
/*
* LongDateToSeconds()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
LongDateToSeconds(
const LongDateRec * lDate,
LongDateTime * lSecs) FOURWORDINLINE(0x2F3C, 0x8008, 0xFFF2, 0xA8B5);
/*
* LongSecondsToDate()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
LongSecondsToDate(
const LongDateTime * lSecs,
LongDateRec * lDate) FOURWORDINLINE(0x2F3C, 0x8008, 0xFFF0, 0xA8B5);
/*
* ToggleDate()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( ToggleResults )
ToggleDate(
LongDateTime * lSecs,
LongDateField field,
DateDelta delta,
short ch,
const TogglePB * params) FOURWORDINLINE(0x2F3C, 0x820E, 0xFFEE, 0xA8B5);
/*
* ValidDate()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( short )
ValidDate(
const LongDateRec * vDate,
long flags,
LongDateTime * newSecs) FOURWORDINLINE(0x2F3C, 0x820C, 0xFFE4, 0xA8B5);
/*
* ReadDateTime()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
#pragma parameter __D0 ReadDateTime(__A0)
#endif
EXTERN_API( OSErr )
ReadDateTime(unsigned long * time) ONEWORDINLINE(0xA039);
/*
* GetDateTime()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
#pragma parameter GetDateTime(__A0)
#endif
EXTERN_API( void )
GetDateTime(unsigned long * secs) TWOWORDINLINE(0x20B8, 0x020C);
/*
* SetDateTime()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
#pragma parameter __D0 SetDateTime(__D0)
#endif
EXTERN_API( OSErr )
SetDateTime(unsigned long time) ONEWORDINLINE(0xA03A);
/*
* SetTime()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
#pragma parameter SetTime(__A0)
#endif
EXTERN_API( void )
SetTime(const DateTimeRec * d) TWOWORDINLINE(0xA9C7, 0xA03A);
/*
* GetTime()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
#pragma parameter GetTime(__A0)
#endif
EXTERN_API( void )
GetTime(DateTimeRec * d) THREEWORDINLINE(0x2038, 0x020C, 0xA9C6);
/*
* DateToSeconds()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
EXTERN_API( void )
DateToSeconds(
const DateTimeRec * d,
unsigned long * secs);
/*
* SecondsToDate()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
*/
#if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
#pragma parameter SecondsToDate(__D0, __A0)
#endif
EXTERN_API( void )
SecondsToDate(
unsigned long secs,
DateTimeRec * d) ONEWORDINLINE(0xA9C6);
/*
These routine are available in InterfaceLib using their old name.
Macros allow using the new names in all source code.
*/
#if CALL_NOT_IN_CARBON
/*
* IUDateString()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
IUDateString(
long dateTime,
DateForm longFlag,
Str255 result) TWOWORDINLINE(0x4267, 0xA9ED);
/*
* IUTimeString()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
IUTimeString(
long dateTime,
Boolean wantSeconds,
Str255 result) THREEWORDINLINE(0x3F3C, 0x0002, 0xA9ED);
/*
* IUDatePString()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
IUDatePString(
long dateTime,
DateForm longFlag,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x000E, 0xA9ED);
/*
* IUTimePString()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
IUTimePString(
long dateTime,
Boolean wantSeconds,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0010, 0xA9ED);
/*
* IULDateString()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
IULDateString(
LongDateTime * dateTime,
DateForm longFlag,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0014, 0xA9ED);
/*
* IULTimeString()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API( void )
IULTimeString(
LongDateTime * dateTime,
Boolean wantSeconds,
Str255 result,
Handle intlHandle) THREEWORDINLINE(0x3F3C, 0x0016, 0xA9ED);
#endif /* CALL_NOT_IN_CARBON */
#if CALL_NOT_IN_CARBON
#define DateString(dateTime, longFlag, result, intlHandle) \
IUDatePString( dateTime, longFlag, result, intlHandle)
#define TimeString(dateTime, wantSeconds, result, intlHandle) \
IUTimePString(dateTime, wantSeconds, result, intlHandle)
#define LongDateString(dateTime, longFlag, result, intlHandle) \
IULDateString(dateTime, longFlag, result, intlHandle)
#define LongTimeString(dateTime, wantSeconds, result, intlHandle) \
IULTimeString(dateTime, wantSeconds, result, intlHandle)
#endif /* CALL_NOT_IN_CARBON */
#if OLDROUTINENAMES
#define String2Date(textPtr, textLen, theCache, lengthUsed, dateTime) \
StringToDate(textPtr, textLen, theCache, lengthUsed, dateTime)
#define String2Time(textPtr, textLen, theCache, lengthUsed, dateTime) \
StringToTime(textPtr, textLen, theCache, lengthUsed, dateTime)
#define LongDate2Secs(lDate, lSecs) LongDateToSeconds(lDate, lSecs)
#define LongSecs2Date(lSecs, lDate) LongSecondsToDate(lSecs, lDate)
#define Date2Secs(d, secs) DateToSeconds(d, secs)
#define Secs2Date(secs, d) SecondsToDate(secs, d)
#endif /* OLDROUTINENAMES */
#if CALL_NOT_IN_CARBON
/*
* iudatestring()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
iudatestring(
long dateTime,
DateForm longFlag,
char * result);
/*
* iudatepstring()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
iudatepstring(
long dateTime,
DateForm longFlag,
char * result,
Handle intlHandle);
/*
* iutimestring()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
iutimestring(
long dateTime,
Boolean wantSeconds,
char * result);
/*
* iutimepstring()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
iutimepstring(
long dateTime,
Boolean wantSeconds,
char * result,
Handle intlHandle);
/*
* iuldatestring()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
iuldatestring(
LongDateTime * dateTime,
DateForm longFlag,
char * result,
Handle intlHandle);
/*
* iultimestring()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 7.1 and later
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( void )
iultimestring(
LongDateTime * dateTime,
Boolean wantSeconds,
char * result,
Handle intlHandle);
#endif /* CALL_NOT_IN_CARBON */
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __DATETIMEUTILS__ */
|