Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

775 lines
20 KiB

  1. /*
  2. File: OSUtils.h
  3. Contains: OS Utilities Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __OSUTILS__
  11. #define __OSUTILS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MIXEDMODE__
  16. #include <MixedMode.h>
  17. #endif
  18. /* HandToHand and other memory utilties were moved to MacMemory.h */
  19. #ifndef __MACMEMORY__
  20. #include <MacMemory.h>
  21. #endif
  22. /* GetTrapAddress and other trap table utilties were moved to Patches.h */
  23. #ifndef __PATCHES__
  24. #include <Patches.h>
  25. #endif
  26. /* Date and Time utilties were moved to DateTimeUtils.h */
  27. #ifndef __DATETIMEUTILS__
  28. #include <DateTimeUtils.h>
  29. #endif
  30. #ifndef __CFSTRING__
  31. #include <CFString.h>
  32. #endif
  33. #if !TARGET_OS_MAC
  34. #ifndef __ENDIAN__
  35. #include <Endian.h>
  36. #endif
  37. #endif /* !TARGET_OS_MAC */
  38. #if PRAGMA_ONCE
  39. #pragma once
  40. #endif
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47. #if PRAGMA_STRUCT_ALIGN
  48. #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50. #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52. #pragma pack(2)
  53. #endif
  54. enum {
  55. useFree = 0,
  56. useATalk = 1,
  57. useAsync = 2,
  58. useExtClk = 3, /*Externally clocked*/
  59. useMIDI = 4
  60. };
  61. enum {
  62. false32b = 0, /*24 bit addressing error*/
  63. true32b = 1 /*32 bit addressing error*/
  64. };
  65. enum {
  66. /* result types for RelString Call */
  67. sortsBefore = -1, /*first string < second string*/
  68. sortsEqual = 0, /*first string = second string*/
  69. sortsAfter = 1 /*first string > second string*/
  70. };
  71. enum {
  72. dummyType = 0,
  73. vType = 1,
  74. ioQType = 2,
  75. drvQType = 3,
  76. evType = 4,
  77. fsQType = 5,
  78. sIQType = 6,
  79. dtQType = 7,
  80. nmType = 8
  81. };
  82. typedef SignedByte QTypes;
  83. struct SysParmType {
  84. UInt8 valid;
  85. UInt8 aTalkA;
  86. UInt8 aTalkB;
  87. UInt8 config;
  88. short portA;
  89. short portB;
  90. long alarm;
  91. short font;
  92. short kbdPrint;
  93. short volClik;
  94. short misc;
  95. };
  96. typedef struct SysParmType SysParmType;
  97. typedef SysParmType * SysPPtr;
  98. struct QElem {
  99. struct QElem * qLink;
  100. short qType;
  101. short qData[1];
  102. };
  103. typedef struct QElem QElem;
  104. typedef QElem * QElemPtr;
  105. #if TARGET_OS_MAC
  106. struct QHdr {
  107. volatile short qFlags;
  108. volatile QElemPtr qHead;
  109. volatile QElemPtr qTail;
  110. };
  111. typedef struct QHdr QHdr;
  112. typedef QHdr * QHdrPtr;
  113. #else
  114. /*
  115. QuickTime 3.0
  116. this version of QHdr contains the Mutex necessary for
  117. non-mac non-interrupt code
  118. */
  119. struct QHdr {
  120. volatile short qFlags;
  121. short pad;
  122. long MutexID;
  123. volatile QElemPtr qHead;
  124. volatile QElemPtr qTail;
  125. };
  126. typedef struct QHdr QHdr;
  127. typedef QHdr * QHdrPtr;
  128. #endif /* TARGET_OS_MAC */
  129. typedef CALLBACK_API_REGISTER68K( void , DeferredTaskProcPtr, (long dtParam) );
  130. typedef REGISTER_UPP_TYPE(DeferredTaskProcPtr) DeferredTaskUPP;
  131. /*
  132. * NewDeferredTaskUPP()
  133. *
  134. * Availability:
  135. * Non-Carbon CFM: available as macro/inline
  136. * CarbonLib: in CarbonLib 1.0 and later
  137. * Mac OS X: in version 10.0 and later
  138. */
  139. EXTERN_API_C( DeferredTaskUPP )
  140. NewDeferredTaskUPP(DeferredTaskProcPtr userRoutine);
  141. #if !OPAQUE_UPP_TYPES
  142. enum { uppDeferredTaskProcInfo = 0x0000B802 }; /* register no_return_value Func(4_bytes:A1) */
  143. #ifdef __cplusplus
  144. inline DEFINE_API_C(DeferredTaskUPP) NewDeferredTaskUPP(DeferredTaskProcPtr userRoutine) { return (DeferredTaskUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeferredTaskProcInfo, GetCurrentArchitecture()); }
  145. #else
  146. #define NewDeferredTaskUPP(userRoutine) (DeferredTaskUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeferredTaskProcInfo, GetCurrentArchitecture())
  147. #endif
  148. #endif
  149. /*
  150. * DisposeDeferredTaskUPP()
  151. *
  152. * Availability:
  153. * Non-Carbon CFM: available as macro/inline
  154. * CarbonLib: in CarbonLib 1.0 and later
  155. * Mac OS X: in version 10.0 and later
  156. */
  157. EXTERN_API_C( void )
  158. DisposeDeferredTaskUPP(DeferredTaskUPP userUPP);
  159. #if !OPAQUE_UPP_TYPES
  160. #ifdef __cplusplus
  161. inline DEFINE_API_C(void) DisposeDeferredTaskUPP(DeferredTaskUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  162. #else
  163. #define DisposeDeferredTaskUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  164. #endif
  165. #endif
  166. /*
  167. * InvokeDeferredTaskUPP()
  168. *
  169. * Availability:
  170. * Non-Carbon CFM: available as macro/inline
  171. * CarbonLib: in CarbonLib 1.0 and later
  172. * Mac OS X: in version 10.0 and later
  173. */
  174. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  175. #pragma parameter InvokeDeferredTaskUPP(__A1, __A0)
  176. #endif
  177. EXTERN_API_C( void )
  178. InvokeDeferredTaskUPP(
  179. long dtParam,
  180. DeferredTaskUPP userUPP) ONEWORDINLINE(0x4E90);
  181. #if !OPAQUE_UPP_TYPES && (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
  182. #ifdef __cplusplus
  183. inline DEFINE_API_C(void) InvokeDeferredTaskUPP(long dtParam, DeferredTaskUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppDeferredTaskProcInfo, dtParam); }
  184. #else
  185. #define InvokeDeferredTaskUPP(dtParam, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppDeferredTaskProcInfo, (dtParam))
  186. #endif
  187. #endif
  188. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  189. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  190. #define NewDeferredTaskProc(userRoutine) NewDeferredTaskUPP(userRoutine)
  191. #define CallDeferredTaskProc(userRoutine, dtParam) InvokeDeferredTaskUPP(dtParam, userRoutine)
  192. #endif /* CALL_NOT_IN_CARBON */
  193. struct DeferredTask {
  194. volatile QElemPtr qLink;
  195. short qType;
  196. volatile short dtFlags;
  197. DeferredTaskUPP dtAddr;
  198. long dtParam;
  199. long dtReserved;
  200. };
  201. typedef struct DeferredTask DeferredTask;
  202. typedef DeferredTask * DeferredTaskPtr;
  203. /*
  204. In order for MachineLocation to be endian-safe, a new member
  205. has been added to the 'u' union in the structure. You are
  206. encouraged to use the new member instead of the old one.
  207. If your code looked like this:
  208. MachineLocation.u.dlsDelta = 1;
  209. you should change it to this:
  210. MachineLocation.u.dls.Delta = 1;
  211. to be endian safe. The gmtDelta remains the same; the low 24-bits
  212. are used. Remember that order of assignment DOES matter:
  213. This will overwrite results:
  214. MachineLocation.u.dls.Delta = 0xAA; // u = 0xAAGGGGGG; G=Garbage
  215. MachineLocation.u.gmtDelta = 0xBBBBBB; // u = 0x00BBBBBB;
  216. when in fact reversing the assignment would have preserved the values:
  217. MachineLocation.u.gmtDelta = 0xBBBBBB; // u = 0x00BBBBBB;
  218. MachineLocation.u.dls.Delta = 0xAA; // u = 0xAABBBBBB;
  219. */
  220. #if TARGET_OS_MAC
  221. struct MachineLocation {
  222. Fract latitude;
  223. Fract longitude;
  224. union {
  225. #if TARGET_RT_BIG_ENDIAN
  226. SInt8 dlsDelta;
  227. #endif
  228. long gmtDelta; /* use low 24-bits only */
  229. struct {
  230. #if TARGET_RT_LITTLE_ENDIAN
  231. SInt8 pad[3];
  232. #endif
  233. SInt8 Delta; /* signed byte; daylight savings delta */
  234. } dls;
  235. } u;
  236. };
  237. typedef struct MachineLocation MachineLocation;
  238. #else
  239. /*
  240. QuickTime 3.0:
  241. Alignment of MachineLocation is weird. The union above used for delta
  242. tends not to work on non-Mac compilers.
  243. */
  244. struct MachineLocation {
  245. Fract latitude;
  246. Fract longitude;
  247. BigEndianLong delta; /* high byte is daylight savings delta, low 24-bits is GMT delta */
  248. };
  249. typedef struct MachineLocation MachineLocation;
  250. #endif /* TARGET_OS_MAC */
  251. /*
  252. * IsMetric()
  253. *
  254. * Availability:
  255. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  256. * CarbonLib: in CarbonLib 1.0 and later
  257. * Mac OS X: in version 10.0 and later
  258. */
  259. EXTERN_API( Boolean )
  260. IsMetric(void) THREEWORDINLINE(0x3F3C, 0x0004, 0xA9ED);
  261. /*
  262. * GetSysPPtr()
  263. *
  264. * Availability:
  265. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  266. * CarbonLib: in CarbonLib 1.0 and later
  267. * Mac OS X: in version 10.0 and later
  268. */
  269. EXTERN_API( SysPPtr )
  270. GetSysPPtr(void) THREEWORDINLINE(0x2EBC, 0x0000, 0x01F8);
  271. /*
  272. NOTE: SysBeep() has been moved to Sound.h.
  273. We could not automatically #include Sound.h in this file
  274. because Sound.h indirectly #include's OSUtils.h which
  275. would make a circular include.
  276. */
  277. /*
  278. * DTInstall()
  279. *
  280. * Availability:
  281. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  282. * CarbonLib: in CarbonLib 1.0 and later
  283. * Mac OS X: in version 10.0 and later
  284. */
  285. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  286. #pragma parameter __D0 DTInstall(__A0)
  287. #endif
  288. EXTERN_API( OSErr )
  289. DTInstall(DeferredTaskPtr dtTaskPtr) ONEWORDINLINE(0xA082);
  290. #if TARGET_CPU_PPC || !TARGET_OS_MAC
  291. #define GetMMUMode() ((SInt8)true32b)
  292. #define SwapMMUMode(x) (*(SInt8*)(x) = true32b)
  293. #else
  294. #if CALL_NOT_IN_CARBON
  295. /*
  296. * GetMMUMode()
  297. *
  298. * Availability:
  299. * Non-Carbon CFM: not available
  300. * CarbonLib: not available
  301. * Mac OS X: not available
  302. */
  303. EXTERN_API( SInt8 )
  304. GetMMUMode(void) TWOWORDINLINE(0x1EB8, 0x0CB2);
  305. #endif /* CALL_NOT_IN_CARBON */
  306. #if CALL_NOT_IN_CARBON
  307. /*
  308. * SwapMMUMode()
  309. *
  310. * Availability:
  311. * Non-Carbon CFM: not available
  312. * CarbonLib: not available
  313. * Mac OS X: not available
  314. */
  315. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  316. #pragma parameter SwapMMUMode(__A0)
  317. #endif
  318. EXTERN_API( void )
  319. SwapMMUMode(SInt8 * mode) THREEWORDINLINE(0x1010, 0xA05D, 0x1080);
  320. #endif /* CALL_NOT_IN_CARBON */
  321. #endif
  322. /*
  323. * Delay()
  324. *
  325. * Availability:
  326. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  327. * CarbonLib: in CarbonLib 1.0 and later
  328. * Mac OS X: in version 10.0 and later
  329. */
  330. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  331. #pragma parameter Delay(__A0, __A1)
  332. #endif
  333. EXTERN_API( void )
  334. Delay(
  335. unsigned long numTicks,
  336. unsigned long * finalTicks) TWOWORDINLINE(0xA03B, 0x2280);
  337. /*
  338. * WriteParam()
  339. *
  340. * Availability:
  341. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  342. * CarbonLib: in CarbonLib 1.0 and later
  343. * Mac OS X: in version 10.0 and later
  344. */
  345. EXTERN_API( OSErr )
  346. WriteParam(void);
  347. /*
  348. * Enqueue()
  349. *
  350. * Availability:
  351. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  352. * CarbonLib: in CarbonLib 1.0 and later
  353. * Mac OS X: in version 10.0 and later
  354. */
  355. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  356. #pragma parameter Enqueue(__A0, __A1)
  357. #endif
  358. EXTERN_API( void )
  359. Enqueue(
  360. QElemPtr qElement,
  361. QHdrPtr qHeader) ONEWORDINLINE(0xA96F);
  362. /*
  363. * Dequeue()
  364. *
  365. * Availability:
  366. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Mac OS X: in version 10.0 and later
  369. */
  370. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  371. #pragma parameter __D0 Dequeue(__A0, __A1)
  372. #endif
  373. EXTERN_API( OSErr )
  374. Dequeue(
  375. QElemPtr qElement,
  376. QHdrPtr qHeader) ONEWORDINLINE(0xA96E);
  377. /*
  378. * SetCurrentA5()
  379. *
  380. * Availability:
  381. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  382. * CarbonLib: in CarbonLib 1.0 and later
  383. * Mac OS X: in version 10.0 and later
  384. */
  385. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  386. #pragma parameter __D0 SetCurrentA5
  387. #endif
  388. EXTERN_API( long )
  389. SetCurrentA5(void) THREEWORDINLINE(0x200D, 0x2A78, 0x0904);
  390. /*
  391. * SetA5()
  392. *
  393. * Availability:
  394. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  395. * CarbonLib: in CarbonLib 1.0 and later
  396. * Mac OS X: in version 10.0 and later
  397. */
  398. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  399. #pragma parameter __D0 SetA5(__D0)
  400. #endif
  401. EXTERN_API( long )
  402. SetA5(long newA5) ONEWORDINLINE(0xC18D);
  403. /*
  404. * InitUtil()
  405. *
  406. * Availability:
  407. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  408. * CarbonLib: in CarbonLib 1.0 and later
  409. * Mac OS X: in version 10.0 and later
  410. */
  411. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  412. #pragma parameter __D0 InitUtil
  413. #endif
  414. EXTERN_API( OSErr )
  415. InitUtil(void) ONEWORDINLINE(0xA03F);
  416. #if !TARGET_CPU_68K
  417. /*
  418. * MakeDataExecutable()
  419. *
  420. * Availability:
  421. * Non-Carbon CFM: in InterfaceLib 7.5 and later
  422. * CarbonLib: in CarbonLib 1.0 and later
  423. * Mac OS X: in version 10.0 and later
  424. */
  425. EXTERN_API( void )
  426. MakeDataExecutable(
  427. void * baseAddress,
  428. unsigned long length);
  429. #endif /* !TARGET_CPU_68K */
  430. #if TARGET_CPU_68K
  431. #if CALL_NOT_IN_CARBON
  432. /*
  433. * SwapInstructionCache()
  434. *
  435. * Availability:
  436. * Non-Carbon CFM: not available
  437. * CarbonLib: not available
  438. * Mac OS X: not available
  439. */
  440. EXTERN_API( Boolean )
  441. SwapInstructionCache(Boolean cacheEnable);
  442. /*
  443. * SwapDataCache()
  444. *
  445. * Availability:
  446. * Non-Carbon CFM: not available
  447. * CarbonLib: not available
  448. * Mac OS X: not available
  449. */
  450. EXTERN_API( Boolean )
  451. SwapDataCache(Boolean cacheEnable);
  452. #endif /* CALL_NOT_IN_CARBON */
  453. #if CALL_NOT_IN_CARBON
  454. /*
  455. * FlushInstructionCache()
  456. *
  457. * Availability:
  458. * Non-Carbon CFM: not available
  459. * CarbonLib: not available
  460. * Mac OS X: not available
  461. */
  462. EXTERN_API( void )
  463. FlushInstructionCache(void) TWOWORDINLINE(0x7001, 0xA098);
  464. /*
  465. * FlushDataCache()
  466. *
  467. * Availability:
  468. * Non-Carbon CFM: not available
  469. * CarbonLib: not available
  470. * Mac OS X: not available
  471. */
  472. EXTERN_API( void )
  473. FlushDataCache(void) TWOWORDINLINE(0x7003, 0xA098);
  474. /*
  475. * FlushCodeCache()
  476. *
  477. * Availability:
  478. * Non-Carbon CFM: not available
  479. * CarbonLib: not available
  480. * Mac OS X: not available
  481. */
  482. EXTERN_API( void )
  483. FlushCodeCache(void) ONEWORDINLINE(0xA0BD);
  484. #endif /* CALL_NOT_IN_CARBON */
  485. #endif /* TARGET_CPU_68K */
  486. #if CALL_NOT_IN_CARBON
  487. /*
  488. * FlushCodeCacheRange()
  489. *
  490. * Availability:
  491. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  492. * CarbonLib: not available
  493. * Mac OS X: not available
  494. */
  495. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  496. #pragma parameter __D0 FlushCodeCacheRange(__A0, __A1)
  497. #endif
  498. EXTERN_API( OSErr )
  499. FlushCodeCacheRange(
  500. void * address,
  501. unsigned long count) TWOWORDINLINE(0x7009, 0xA098);
  502. #endif /* CALL_NOT_IN_CARBON */
  503. /*
  504. * ReadLocation()
  505. *
  506. * Availability:
  507. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  508. * CarbonLib: in CarbonLib 1.0 and later
  509. * Mac OS X: in version 10.0 and later
  510. */
  511. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  512. #pragma parameter ReadLocation(__A0)
  513. #endif
  514. EXTERN_API( void )
  515. ReadLocation(MachineLocation * loc) FOURWORDINLINE(0x203C, 0x000C, 0x00E4, 0xA051);
  516. /*
  517. * WriteLocation()
  518. *
  519. * Availability:
  520. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  521. * CarbonLib: in CarbonLib 1.0 and later
  522. * Mac OS X: in version 10.0 and later
  523. */
  524. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  525. #pragma parameter WriteLocation(__A0)
  526. #endif
  527. EXTERN_API( void )
  528. WriteLocation(const MachineLocation * loc) FOURWORDINLINE(0x203C, 0x000C, 0x00E4, 0xA052);
  529. /*
  530. * TickCount()
  531. *
  532. * Availability:
  533. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  534. * CarbonLib: in CarbonLib 1.0 and later
  535. * Mac OS X: in version 10.0 and later
  536. */
  537. EXTERN_API( UInt32 )
  538. TickCount(void) ONEWORDINLINE(0xA975);
  539. /*
  540. * CSCopyUserName()
  541. *
  542. * Availability:
  543. * Non-Carbon CFM: not available
  544. * CarbonLib: in CarbonLib 1.5 and later
  545. * Mac OS X: in version 10.0 and later
  546. */
  547. EXTERN_API_C( CFStringRef )
  548. CSCopyUserName(Boolean useShortName);
  549. /*
  550. * CSCopyMachineName()
  551. *
  552. * Availability:
  553. * Non-Carbon CFM: not available
  554. * CarbonLib: in CarbonLib 1.5 and later
  555. * Mac OS X: in version 10.0 and later
  556. */
  557. EXTERN_API_C( CFStringRef )
  558. CSCopyMachineName(void);
  559. #if OLDROUTINENAMES
  560. #define IUMetric() IsMetric()
  561. #endif /* OLDROUTINENAMES */
  562. /*
  563. NOTE: SysEnvirons is obsolete. You should be using Gestalt.
  564. */
  565. /* Environs Equates */
  566. enum {
  567. curSysEnvVers = 2 /*Updated to equal latest SysEnvirons version*/
  568. };
  569. struct SysEnvRec {
  570. short environsVersion;
  571. short machineType;
  572. short systemVersion;
  573. short processor;
  574. Boolean hasFPU;
  575. Boolean hasColorQD;
  576. short keyBoardType;
  577. short atDrvrVersNum;
  578. short sysVRefNum;
  579. };
  580. typedef struct SysEnvRec SysEnvRec;
  581. enum {
  582. /* Machine Types */
  583. envMac = -1,
  584. envXL = -2,
  585. envMachUnknown = 0,
  586. env512KE = 1,
  587. envMacPlus = 2,
  588. envSE = 3,
  589. envMacII = 4,
  590. envMacIIx = 5,
  591. envMacIIcx = 6,
  592. envSE30 = 7,
  593. envPortable = 8,
  594. envMacIIci = 9,
  595. envMacIIfx = 11
  596. };
  597. enum {
  598. /* CPU types */
  599. envCPUUnknown = 0,
  600. env68000 = 1,
  601. env68010 = 2,
  602. env68020 = 3,
  603. env68030 = 4,
  604. env68040 = 5
  605. };
  606. enum {
  607. /* Keyboard types */
  608. envUnknownKbd = 0,
  609. envMacKbd = 1,
  610. envMacAndPad = 2,
  611. envMacPlusKbd = 3,
  612. envAExtendKbd = 4,
  613. envStandADBKbd = 5,
  614. envPrtblADBKbd = 6,
  615. envPrtblISOKbd = 7,
  616. envStdISOADBKbd = 8,
  617. envExtISOADBKbd = 9
  618. };
  619. #if CALL_NOT_IN_CARBON
  620. /*
  621. * SysEnvirons()
  622. *
  623. * Availability:
  624. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  625. * CarbonLib: not available
  626. * Mac OS X: not available
  627. */
  628. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  629. #pragma parameter __D0 SysEnvirons(__D0, __A0)
  630. #endif
  631. EXTERN_API( OSErr )
  632. SysEnvirons(
  633. short versionRequested,
  634. SysEnvRec * theWorld) ONEWORDINLINE(0xA090);
  635. #endif /* CALL_NOT_IN_CARBON */
  636. #if PRAGMA_STRUCT_ALIGN
  637. #pragma options align=reset
  638. #elif PRAGMA_STRUCT_PACKPUSH
  639. #pragma pack(pop)
  640. #elif PRAGMA_STRUCT_PACK
  641. #pragma pack()
  642. #endif
  643. #ifdef PRAGMA_IMPORT_OFF
  644. #pragma import off
  645. #elif PRAGMA_IMPORT
  646. #pragma import reset
  647. #endif
  648. #ifdef __cplusplus
  649. }
  650. #endif
  651. #endif /* __OSUTILS__ */