|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: File: Devices.h
27:
28: Contains: Device Manager Interfaces.
29:
30: Version: Technology: PowerSurge 1.0.2.
31: Package: Universal Interfaces 2.1.2 on ETO #20
32:
33: Copyright: � 1984-1995 by Apple Computer, Inc.
34: All rights reserved.
35:
36: Bugs?: If you find a problem with this file, use the Apple Bug Reporter
37: stack. Include the file and version information (from above)
38: in the problem description and send to:
39: Internet: [email protected]
40: AppleLink: APPLE.BUGS
41:
42: */
43:
44: #ifndef __DEVICES__
45: #define __DEVICES__
46:
47:
48: #ifndef __OSUTILS__
49: //naga#include <OSUtils.h>
50: #endif
51: /* #include <Types.h> */
52: /* #include <ConditionalMacros.h> */
53: /* #include <MixedMode.h> */
54: /* #include <Memory.h> */
55:
56: #ifndef __FILES__
57: //naga#include <Files.h>
58: #endif
59: /* #include <Finder.h> */
60:
61: #ifndef __QUICKDRAW__
62: //naga#include <Quickdraw.h>
63: #endif
64: /* #include <QuickdrawText.h> */
65:
66: #ifndef __EVENTS__
67: //naga#include <Events.h>
68: #endif
69:
70: #ifndef __DIALOGS__
71: //#include <Dialogs.h>
72: #endif
73: /* #include <Errors.h> */
74: /* #include <Menus.h> */
75: /* #include <Controls.h> */
76: /* #include <Windows.h> */
77: /* #include <TextEdit.h> */
78:
79: #ifndef __KERNEL__
80: //naga#include <Kernel.h>
81: #endif
82:
83: #ifndef __NAMEREGISTRY__
84: //naga#include <NameRegistry.h>
85: #endif
86: /*naga
87: #ifndef __CODEFRAGMENTS__
88: #include <CodeFragments.h>
89: #endif
90:
91: #ifdef __cplusplus
92: extern "C" {
93: #endif
94:
95: #if PRAGMA_ALIGN_SUPPORTED
96: #pragma options align=mac68k
97: #endif
98:
99: #if PRAGMA_IMPORT_SUPPORTED
100: #pragma import on
101: #endif
102: naga*/
103:
104: enum {
105: chooserInitMsg = 11, /* the user selected this device package */
106: newSelMsg = 12, /* the user made new device selections */
107: fillListMsg = 13, /* fill the device list with choices */
108: getSelMsg = 14, /* mark one or more choices as selected */
109: selectMsg = 15, /* the user made a selection */
110: deselectMsg = 16, /* the user canceled a selection */
111: terminateMsg = 17, /* allows device package to clean up */
112: buttonMsg = 19 /* the user selected a button */
113: };
114:
115: /* Values of the 'caller' parameter to a Chooser device package */
116: enum {
117: chooserID = 1
118: };
119:
120: /* Values of the 'message' parameter to a Control Panel 'cdev' */
121: enum {
122: initDev = 0, /*Time for cdev to initialize itself*/
123: hitDev = 1, /*Hit on one of my items*/
124: closeDev = 2, /*Close yourself*/
125: nulDev = 3, /*Null event*/
126: updateDev = 4, /*Update event*/
127: activDev = 5, /*Activate event*/
128: deactivDev = 6, /*Deactivate event*/
129: keyEvtDev = 7, /*Key down/auto key*/
130: macDev = 8, /*Decide whether or not to show up*/
131: undoDev = 9,
132: cutDev = 10,
133: copyDev = 11,
134: pasteDev = 12,
135: clearDev = 13,
136: cursorDev = 14
137: };
138:
139: /* Special values a Control Panel 'cdev' can return */
140: enum {
141: cdevGenErr = -1, /*General error; gray cdev w/o alert*/
142: cdevMemErr = 0, /*Memory shortfall; alert user please*/
143: cdevResErr = 1, /*Couldn't get a needed resource; alert*/
144: cdevUnset = 3 /* cdevValue is initialized to this*/
145: };
146:
147: /* Values of the 'message' parameter to a Monitor 'mntr' */
148: enum {
149: initMsg = 1, /*initialization*/
150: okMsg = 2, /*user clicked OK button*/
151: cancelMsg = 3, /*user clicked Cancel button*/
152: hitMsg = 4, /*user clicked control in Options dialog*/
153: nulMsg = 5, /*periodic event*/
154: updateMsg = 6, /*update event*/
155: activateMsg = 7, /*not used*/
156: deactivateMsg = 8, /*not used*/
157: keyEvtMsg = 9, /*keyboard event*/
158: superMsg = 10, /*show superuser controls*/
159: normalMsg = 11, /*show only normal controls*/
160: startupMsg = 12 /*code has been loaded*/
161: };
162:
163: /* control codes for DeskAccessories */
164: enum {
165: goodbye = -1, /* heap being reinitialized */
166: killCode = 1, /* KillIO requested */
167: accEvent = 64, /* handle an event */
168: accRun = 65, /* time for periodic action */
169: accCursor = 66, /* change cursor shape */
170: accMenu = 67, /* handle menu item */
171: accUndo = 68, /* handle undo command */
172: accCut = 70, /* handle cut command */
173: accCopy = 71, /* handle copy command */
174: accPaste = 72, /* handle paste command */
175: accClear = 73 /* handle clear command */
176: };
177:
178: /* Control/Status Call Codes */
179: enum {
180: drvStsCode = 8, /* status call code for drive status */
181: ejectCode = 7, /* control call eject code */
182: tgBuffCode = 8 /* set tag buffer code */
183: };
184:
185: /* miscellaneous Device Manager constants */
186: enum {
187: ioInProgress = 1, /* predefined value of ioResult while I/O is pending */
188: aRdCmd = 2, /* low byte of ioTrap for Read calls */
189: aWrCmd = 3, /* low byte of ioTrap for Write calls */
190: asyncTrpBit = 10, /* trap word modifier */
191: noQueueBit = 9 /* trap word modifier */
192: };
193:
194: /* flags used in the driver header and device control entry */
195: enum {
196: dReadEnable = 0, /* set if driver responds to read requests */
197: dWritEnable = 1, /* set if driver responds to write requests */
198: dCtlEnable = 2, /* set if driver responds to control requests */
199: dStatEnable = 3, /* set if driver responds to status requests */
200: dNeedGoodBye = 4, /* set if driver needs time for performing periodic tasks */
201: dNeedTime = 5, /* set if driver needs time for performing periodic tasks */
202: dNeedLock = 6, /* set if driver must be locked in memory as soon as it is opened */
203: dNeedLockMask = 0x4000, /* set if driver must be locked in memory as soon as it is opened */
204: dNeedTimeMask = 0x2000, /* set if driver needs time for performing periodic tasks */
205: dNeedGoodByeMask = 0x1000, /* set if driver needs to be called before the application heap is initialized */
206: dStatEnableMask = 0x0800, /* set if driver responds to status requests */
207: dCtlEnableMask = 0x0400, /* set if driver responds to control requests */
208: dWritEnableMask = 0x0200, /* set if driver responds to write requests */
209: dReadEnableMask = 0x0100 /* set if driver responds to read requests */
210: };
211:
212: /* run-time flags used in the device control entry */
213: enum {
214: dOpened = 5, /* driver is open */
215: dRAMBased = 6, /* dCtlDriver is a handle (1) or pointer (0) */
216: drvrActive = 7, /* driver is currently processing a request */
217: drvrActiveMask = 0x0080, /* driver is currently processing a request */
218: dRAMBasedMask = 0x0040, /* dCtlDriver is a handle (1) or pointer (0) */
219: dOpenedMask = 0x0020 /* driver is open */
220: };
221:
222: struct DRVRHeader {
223: short drvrFlags;
224: short drvrDelay;
225: short drvrEMask;
226: short drvrMenu;
227: short drvrOpen;
228: short drvrPrime;
229: short drvrCtl;
230: short drvrStatus;
231: short drvrClose;
232: unsigned char drvrName[1];
233: };
234: typedef struct DRVRHeader DRVRHeader;
235:
236: typedef DRVRHeader *DRVRHeaderPtr, **DRVRHeaderHandle;
237:
238: struct DCtlEntry {
239: Ptr dCtlDriver;
240: short dCtlFlags;
241: QHdr dCtlQHdr;
242: long dCtlPosition;
243: Handle dCtlStorage;
244: short dCtlRefNum;
245: long dCtlCurTicks;
246: //naga WindowPtr dCtlWindow;
247: short dCtlDelay;
248: short dCtlEMask;
249: short dCtlMenu;
250: };
251: typedef struct DCtlEntry DCtlEntry;
252:
253: typedef DCtlEntry *DCtlPtr, **DCtlHandle;
254:
255: struct AuxDCE {
256: Ptr dCtlDriver;
257: short dCtlFlags;
258: QHdr dCtlQHdr;
259: long dCtlPosition;
260: Handle dCtlStorage;
261: short dCtlRefNum;
262: long dCtlCurTicks;
263: //nagaGrafPtr dCtlWindow;
264: short dCtlDelay;
265: short dCtlEMask;
266: short dCtlMenu;
267: SInt8 dCtlSlot;
268: SInt8 dCtlSlotId;
269: long dCtlDevBase;
270: Ptr dCtlOwner;
271: SInt8 dCtlExtDev;
272: SInt8 fillByte;
273: UInt32 dCtlNodeID;
274: };
275: typedef struct AuxDCE AuxDCE;
276:
277: typedef AuxDCE *AuxDCEPtr, **AuxDCEHandle;
278:
279: typedef UInt16 UnitNumber;
280:
281: typedef UInt32 DriverOpenCount;
282:
283: typedef SInt16 DriverRefNum;
284:
285: typedef SInt16 DriverFlags;
286:
287: typedef UInt32 IOCommandCode;
288:
289:
290: enum {
291: kOpenCommand = 0,
292: kCloseCommand = 1,
293: kReadCommand = 2,
294: kWriteCommand = 3,
295: kControlCommand = 4,
296: kStatusCommand = 5,
297: kKillIOCommand = 6,
298: kInitializeCommand = 7, /* init driver and device*/
299: kFinalizeCommand = 8, /* shutdown driver and device*/
300: kReplaceCommand = 9, /* replace an old driver*/
301: kSupersededCommand = 10 /* prepare to be replaced by a new driver*/
302: };
303: //naga
304: //typedef KernelID IOCommandID;
305:
306: typedef UInt32 IOCommandKind;
307: //naga
308: typedef int RegEntryID;
309:
310: enum {
311: kSynchronousIOCommandKind = 0x00000001,
312: kAsynchronousIOCommandKind = 0x00000002,
313: kImmediateIOCommandKind = 0x00000004
314: };
315:
316: struct DriverInitInfo {
317: DriverRefNum refNum;
318: RegEntryID deviceEntry;
319: };
320: struct DriverFinalInfo {
321: DriverRefNum refNum;
322: RegEntryID deviceEntry;
323: };
324: typedef struct DriverInitInfo DriverInitInfo, *DriverInitInfoPtr;
325:
326: typedef struct DriverInitInfo DriverReplaceInfo, *DriverReplaceInfoPtr;
327:
328: typedef struct DriverFinalInfo DriverFinalInfo, *DriverFinalInfoPtr;
329:
330: typedef struct DriverFinalInfo DriverSupersededInfo, *DriverSupersededInfoPtr;
331:
332: /* Contents are command specific*/
333: union IOCommandContents {
334: ParmBlkPtr pb;
335: DriverInitInfoPtr initialInfo;
336: DriverFinalInfoPtr finalInfo;
337: DriverReplaceInfoPtr replaceInfo;
338: DriverSupersededInfoPtr supersededInfo;
339: };
340: typedef union IOCommandContents IOCommandContents;
341:
342: typedef OSErr (DriverEntryPoint)(AddressSpaceID SpaceID, IOCommandID CommandID, IOCommandContents Contents, IOCommandCode Code, IOCommandKind Kind);
343: typedef DriverEntryPoint *DriverEntryPointPtr;
344:
345: /* Driver Typing Information Used to Match Drivers With Devices */
346: struct DriverType {
347: Str31 nameInfoStr; /* Driver Name/Info String*/
348: NumVersion version; /* Driver Version Number*/
349: };
350: typedef struct DriverType DriverType, *DriverTypePtr;
351:
352: /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
353: typedef OptionBits RuntimeOptions;
354:
355:
356: enum {
357: kDriverIsLoadedUponDiscovery = 0x00000001, /* auto-load driver when discovered*/
358: kDriverIsOpenedUponLoad = 0x00000002, /* auto-open driver when loaded*/
359: kDriverIsUnderExpertControl = 0x00000004, /* I/O expert handles loads/opens*/
360: kDriverIsConcurrent = 0x00000008, /* supports concurrent requests*/
361: kDriverQueuesIOPB = 0x00000010 /* device manager doesn't queue IOPB*/
362: };
363:
364: struct DriverOSRuntime {
365: RuntimeOptions driverRuntime; /* Options for OS Runtime*/
366: Str31 driverName; /* Driver's name to the OS*/
367: UInt32 driverDescReserved[8]; /* Reserved area*/
368: };
369: typedef struct DriverOSRuntime DriverOSRuntime, *DriverOSRuntimePtr;
370:
371: /* OS Service Information Used To Declare What APIs a Driver Supports */
372: typedef UInt32 ServiceCount;
373:
374: struct DriverServiceInfo {
375: OSType serviceCategory; /* Service Category Name*/
376: OSType serviceType; /* Type within Category*/
377: NumVersion serviceVersion; /* Version of service*/
378: };
379: typedef struct DriverServiceInfo DriverServiceInfo, *DriverServiceInfoPtr;
380:
381: struct DriverOSService {
382: ServiceCount nServices; /* Number of Services Supported*/
383: DriverServiceInfo service[1]; /* The List of Services (at least one)*/
384: };
385: typedef struct DriverOSService DriverOSService, *DriverOSServicePtr;
386:
387: /* Categories */
388:
389: enum {
390: kServiceCategoryDisplay = 'disp', /* Display Manager*/
391: kServiceCategoryOpenTransport = 'otan', /* Open Transport*/
392: kServiceCategoryBlockStorage = 'blok', /* Block Storage*/
393: kServiceCategoryNdrvDriver = 'ndrv', /* Generic Native Driver*/
394: kServiceCategoryScsiSIM = 'scsi'
395: };
396:
397: /* Ndrv ServiceCategory Types */
398: enum {
399: kNdrvTypeIsGeneric = 'genr', /* generic*/
400: kNdrvTypeIsVideo = 'vido', /* video*/
401: kNdrvTypeIsBlockStorage = 'blok', /* block storage*/
402: kNdrvTypeIsNetworking = 'netw', /* networking*/
403: kNdrvTypeIsSerial = 'serl', /* serial*/
404: kNdrvTypeIsSound = 'sond', /* sound*/
405: kNdrvTypeIsBusBridge = 'brdg'
406: };
407:
408: /* The Driver Description */
409: enum {
410: kTheDescriptionSignature = 'mtej'
411: };
412:
413: typedef UInt32 DriverDescVersion;
414:
415:
416: enum {
417: kInitialDriverDescriptor = 0
418: };
419:
420: struct DriverDescription {
421: OSType driverDescSignature; /* Signature field of this structure*/
422: DriverDescVersion driverDescVersion; /* Version of this data structure*/
423: DriverType driverType; /* Type of Driver*/
424: DriverOSRuntime driverOSRuntimeInfo; /* OS Runtime Requirements of Driver*/
425: DriverOSService driverServices; /* Apple Service API Membership*/
426: };
427: typedef struct DriverDescription DriverDescription, *DriverDescriptionPtr;
428:
429: /* Record to describe a file-based driver candidate */
430: struct FileBasedDriverRecord {
431: FSSpec theSpec; /* file specification*/
432: DriverType theType; /* nameInfoStr + version number*/
433: Boolean compatibleProp; /* true if matched using a compatible name*/
434: UInt8 pad[3]; /* alignment*/
435: };
436: typedef struct FileBasedDriverRecord FileBasedDriverRecord, *FileBasedDriverRecordPtr;
437:
438: /* Driver Loader API */
439: #define DECLARE_DRIVERDESCRIPTION(N_ADDITIONAL_SERVICES) \
440: struct { \
441: DriverDescription fixed; \
442: DriverServiceInfo additional_service[N_ADDITIONAL_SERVICES-1]; \
443: };
444: extern SInt16 HigherDriverVersion(NumVersion *driverVersion1, NumVersion *driverVersion2);
445: extern OSErr VerifyFragmentAsDriver(CFragConnectionID fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc);
446: extern OSErr GetDriverMemoryFragment(Ptr memAddr, long length, ConstStr63Param fragName, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc);
447: extern OSErr GetDriverDiskFragment(FSSpecPtr fragmentSpec, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc);
448: extern OSErr InstallDriverFromFragment(CFragConnectionID fragmentConnID, RegEntryIDPtr device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum);
449: extern OSErr InstallDriverFromFile(FSSpecPtr fragmentSpec, RegEntryIDPtr device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum);
450: extern OSErr InstallDriverFromMemory(Ptr memory, long length, ConstStr63Param fragName, RegEntryIDPtr device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum);
451: extern OSErr InstallDriverFromDisk(Ptr theDriverName, RegEntryIDPtr theDevice, UnitNumber theBeginningUnit, UnitNumber theEndingUnit, DriverRefNum *theRefNum);
452: extern OSErr FindDriversForDevice(RegEntryIDPtr device, FSSpec *fragmentSpec, DriverDescription *fileDriverDesc, Ptr *memAddr, long *length, StringPtr fragName, DriverDescription *memDriverDesc);
453: extern OSErr FindDriverCandidates(RegEntryIDPtr deviceID, Ptr *propBasedDriver, RegPropertyValueSize *propBasedDriverSize, StringPtr deviceName, DriverType *propBasedDriverType, Boolean *gotPropBasedDriver, FileBasedDriverRecordPtr fileBasedDrivers, ItemCount *nFileBasedDrivers);
454: extern OSErr ScanDriverCandidates(RegEntryIDPtr deviceID, FileBasedDriverRecordPtr fileBasedDrivers, ItemCount nFileBasedDrivers, FileBasedDriverRecordPtr matchingDrivers, ItemCount *nMatchingDrivers);
455: extern OSErr GetDriverForDevice(RegEntryIDPtr device, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescriptionPtr *driverDesc);
456: extern OSErr InstallDriverForDevice(RegEntryIDPtr device, UnitNumber beginningUnit, UnitNumber endingUnit, DriverRefNum *refNum);
457: extern OSErr SetDriverClosureMemory(CFragConnectionID fragmentConnID, Boolean holdDriverMemory);
458: extern OSErr ReplaceDriverWithFragment(DriverRefNum theRefNum, CFragConnectionID fragmentConnID);
459: extern OSErr GetDriverInformation(DriverRefNum refNum, UnitNumber *unitNum, DriverFlags *flags, DriverOpenCount *count, StringPtr name, RegEntryID *device, CFragHFSLocator *driverLoadLocation, CFragConnectionID *fragmentConnID, DriverEntryPointPtr *fragmentMain, DriverDescription *driverDesc);
460: extern OSErr OpenInstalledDriver(DriverRefNum refNum, SInt8 ioPermission);
461: extern OSErr RenameDriver(DriverRefNum refNum, StringPtr newDriverName);
462: extern OSErr RemoveDriver(DriverRefNum refNum, Boolean immediate);
463: extern OSErr LookupDrivers(UnitNumber beginningUnit, UnitNumber endingUnit, Boolean emptyUnits, ItemCount *returnedRefNums, DriverRefNum *refNums);
464: extern UnitNumber HighestUnitNumber(void);
465: extern OSErr DriverGestaltOn(DriverRefNum refNum);
466: extern OSErr DriverGestaltOff(DriverRefNum refNum);
467: extern Boolean DriverGestaltIsOn(DriverFlags flags);
468:
469: #if !OLDROUTINELOCATIONS
470:
471: #if !GENERATINGCFM
472: #pragma parameter __D0 PBOpenSync(__A0)
473: #endif
474: extern pascal OSErr PBOpenSync(ParmBlkPtr paramBlock)
475: ONEWORDINLINE(0xA000);
476:
477: #if !GENERATINGCFM
478: #pragma parameter __D0 PBOpenAsync(__A0)
479: #endif
480: extern pascal OSErr PBOpenAsync(ParmBlkPtr paramBlock)
481: ONEWORDINLINE(0xA400);
482:
483: #if !GENERATINGCFM
484: #pragma parameter __D0 PBOpenImmed(__A0)
485: #endif
486: extern pascal OSErr PBOpenImmed(ParmBlkPtr paramBlock)
487: ONEWORDINLINE(0xA200);
488:
489: #if !GENERATINGCFM
490: #pragma parameter __D0 PBCloseSync(__A0)
491: #endif
492: extern pascal OSErr PBCloseSync(ParmBlkPtr paramBlock)
493: ONEWORDINLINE(0xA001);
494:
495: #if !GENERATINGCFM
496: #pragma parameter __D0 PBCloseAsync(__A0)
497: #endif
498: extern pascal OSErr PBCloseAsync(ParmBlkPtr paramBlock)
499: ONEWORDINLINE(0xA401);
500:
501: #if !GENERATINGCFM
502: #pragma parameter __D0 PBCloseImmed(__A0)
503: #endif
504: extern pascal OSErr PBCloseImmed(ParmBlkPtr paramBlock)
505: ONEWORDINLINE(0xA201);
506:
507: #if !GENERATINGCFM
508: #pragma parameter __D0 PBReadSync(__A0)
509: #endif
510: extern pascal OSErr PBReadSync(ParmBlkPtr paramBlock)
511: ONEWORDINLINE(0xA002);
512:
513: #if !GENERATINGCFM
514: #pragma parameter __D0 PBReadAsync(__A0)
515: #endif
516: extern pascal OSErr PBReadAsync(ParmBlkPtr paramBlock)
517: ONEWORDINLINE(0xA402);
518:
519: #if !GENERATINGCFM
520: #pragma parameter __D0 PBReadImmed(__A0)
521: #endif
522: extern pascal OSErr PBReadImmed(ParmBlkPtr paramBlock)
523: ONEWORDINLINE(0xA202);
524:
525: #if !GENERATINGCFM
526: #pragma parameter __D0 PBWriteSync(__A0)
527: #endif
528: extern pascal OSErr PBWriteSync(ParmBlkPtr paramBlock)
529: ONEWORDINLINE(0xA003);
530:
531: #if !GENERATINGCFM
532: #pragma parameter __D0 PBWriteAsync(__A0)
533: #endif
534: extern pascal OSErr PBWriteAsync(ParmBlkPtr paramBlock)
535: ONEWORDINLINE(0xA403);
536:
537: #if !GENERATINGCFM
538: #pragma parameter __D0 PBWriteImmed(__A0)
539: #endif
540: extern pascal OSErr PBWriteImmed(ParmBlkPtr paramBlock)
541: ONEWORDINLINE(0xA203);
542: extern pascal void AddDrive(short drvrRefNum, short drvNum, DrvQElPtr qEl);
543: extern pascal QHdrPtr GetDrvQHdr(void)
544: THREEWORDINLINE(0x2EBC, 0x0000, 0x0308);
545: #endif
546: /* Control Panel Default Proc */
547: typedef pascal long (*ControlPanelDefProcPtr)(short message, short item, short numItems, short cPanelID, EventRecord *theEvent, long cdevValue, DialogPtr cpDialog);
548:
549: #if GENERATINGCFM
550: typedef UniversalProcPtr ControlPanelDefUPP;
551: #else
552: typedef ControlPanelDefProcPtr ControlPanelDefUPP;
553: #endif
554:
555: enum {
556: uppControlPanelDefProcInfo = kPascalStackBased
557: | RESULT_SIZE(SIZE_CODE(sizeof(long)))
558: | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
559: | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
560: | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
561: | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
562: | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(EventRecord*)))
563: | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long)))
564: | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(DialogPtr)))
565: };
566:
567: #if GENERATINGCFM
568: #define NewControlPanelDefProc(userRoutine) \
569: (ControlPanelDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlPanelDefProcInfo, GetCurrentArchitecture())
570: #else
571: #define NewControlPanelDefProc(userRoutine) \
572: ((ControlPanelDefUPP) (userRoutine))
573: #endif
574:
575: #if GENERATINGCFM
576: #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog) \
577: CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlPanelDefProcInfo, (message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
578: #else
579: #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog) \
580: (*(userRoutine))((message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
581: #endif
582:
583: extern pascal DCtlHandle GetDCtlEntry(short refNum);
584: /*
585: SetChooserAlert used to simply set a bit in a low-mem global
586: to tell the Chooser not to display its warning message when
587: the printer is changed. However, under MultiFinder and System 7,
588: this low-mem is swapped out when a layer change occurs, and the
589: Chooser never sees the change. It is obsolete, and completely
590: unsupported on the PowerPC. 68K apps can still call it if they
591: wish.
592: */
593: #if OLDROUTINENAMES && !GENERATINGCFM
594: extern pascal Boolean SetChooserAlert(Boolean f);
595: #endif
596:
597: #if !GENERATINGCFM
598: #pragma parameter __D0 DriverInstall(__A0, __D0)
599: #endif
600: extern pascal OSErr DriverInstall(DRVRHeaderPtr drvrPtr, short refNum)
601: ONEWORDINLINE(0xA03D);
602:
603: #if !GENERATINGCFM
604: #pragma parameter __D0 DriverInstallReserveMem(__A0, __D0)
605: #endif
606: extern pascal OSErr DriverInstallReserveMem(DRVRHeaderPtr drvrPtr, short refNum)
607: ONEWORDINLINE(0xA43D);
608:
609: #if !GENERATINGCFM
610: #pragma parameter __D0 DrvrRemove(__D0)
611: #endif
612: extern pascal OSErr DrvrRemove(short refNum)
613: ONEWORDINLINE(0xA03E);
614: #define DriverRemove(refNum) DrvrRemove(refNum)
615: extern pascal OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum);
616: extern pascal OSErr CloseDriver(short refNum);
617: extern pascal OSErr Control(short refNum, short csCode, const void *csParamPtr);
618: extern pascal OSErr Status(short refNum, short csCode, void *csParamPtr);
619: extern pascal OSErr KillIO(short refNum);
620:
621: #if !GENERATINGCFM
622: #pragma parameter __D0 PBControlSync(__A0)
623: #endif
624: extern pascal OSErr PBControlSync(ParmBlkPtr paramBlock)
625: ONEWORDINLINE(0xA004);
626:
627: #if !GENERATINGCFM
628: #pragma parameter __D0 PBControlAsync(__A0)
629: #endif
630: extern pascal OSErr PBControlAsync(ParmBlkPtr paramBlock)
631: ONEWORDINLINE(0xA404);
632:
633: #if !GENERATINGCFM
634: #pragma parameter __D0 PBControlImmed(__A0)
635: #endif
636: extern pascal OSErr PBControlImmed(ParmBlkPtr paramBlock)
637: ONEWORDINLINE(0xA204);
638:
639: #if !GENERATINGCFM
640: #pragma parameter __D0 PBStatusSync(__A0)
641: #endif
642: extern pascal OSErr PBStatusSync(ParmBlkPtr paramBlock)
643: ONEWORDINLINE(0xA005);
644:
645: #if !GENERATINGCFM
646: #pragma parameter __D0 PBStatusAsync(__A0)
647: #endif
648: extern pascal OSErr PBStatusAsync(ParmBlkPtr paramBlock)
649: ONEWORDINLINE(0xA405);
650:
651: #if !GENERATINGCFM
652: #pragma parameter __D0 PBStatusImmed(__A0)
653: #endif
654: extern pascal OSErr PBStatusImmed(ParmBlkPtr paramBlock)
655: ONEWORDINLINE(0xA205);
656:
657: #if !GENERATINGCFM
658: #pragma parameter __D0 PBKillIOSync(__A0)
659: #endif
660: extern pascal OSErr PBKillIOSync(ParmBlkPtr paramBlock)
661: ONEWORDINLINE(0xA006);
662:
663: #if !GENERATINGCFM
664: #pragma parameter __D0 PBKillIOAsync(__A0)
665: #endif
666: extern pascal OSErr PBKillIOAsync(ParmBlkPtr paramBlock)
667: ONEWORDINLINE(0xA406);
668:
669: #if !GENERATINGCFM
670: #pragma parameter __D0 PBKillIOImmed(__A0)
671: #endif
672: extern pascal OSErr PBKillIOImmed(ParmBlkPtr paramBlock)
673: ONEWORDINLINE(0xA206);
674: extern pascal short OpenDeskAcc(ConstStr255Param deskAccName)
675: ONEWORDINLINE(0xA9B6);
676: extern pascal void CloseDeskAcc(short refNum)
677: ONEWORDINLINE(0xA9B7);
678: #if CGLUESUPPORTED
679: extern short opendeskacc(const char *deskAccName);
680: extern OSErr opendriver(const char *driverName, short *refNum);
681: #endif
682: #if OLDROUTINENAMES
683: /*
684: The PBxxx() routines are obsolete.
685:
686: Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
687: */
688: #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
689: #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
690: #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
691: #if !OLDROUTINELOCATIONS
692: #define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
693: #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
694: #define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
695: #define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))
696: #endif
697: #endif
698:
699: #if PRAGMA_IMPORT_SUPPORTED
700: #pragma import off
701: #endif
702:
703: #if PRAGMA_ALIGN_SUPPORTED
704: #pragma options align=reset
705: #endif
706:
707: #ifdef __cplusplus
708: }
709: #endif
710:
711: #endif /* __DEVICES__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.