#include <CarbonCore/CarbonCore.h>

 short OpenDeskAcc(ConstStr255Param deskAccName){
printf ("OpenDeskAcc",deskAccName);
};

OSErr PBOpenSync(ParmBlkPtr paramBlock){
printf ("PBOpenSync",paramBlock);
};

OSErr PBStatusSync(ParmBlkPtr paramBlock){
printf ("PBStatusSync",paramBlock);
};

 void CloseDeskAcc(short refNum){
printf ("CloseDeskAcc",refNum);
};

//work



/*PBWriteSync

Writes any number of bytes to an open file.

OSErr PBWriteSync (
   ParmBlkPtr paramBlock
);
Parameters
paramBlock

A pointer to a basic File Manager parameter block. 
Return Value

A result code. See “Device Manager Result Codes”.
Discussion

The relevant fields of the parameter block are:
ioCompletion On input, a pointer to a completion routine. 
ioResult On output, the result code of the function. 
ioRefNum On input, a file reference number for the open file to which to write. 
ioBuffer On input, a pointer to a data buffer containing the bytes to write. 
ioReqCount On input, the number of bytes requested. 
ioActCount On output, the number of bytes actually written. 
ioPosMode On input, the positioning mode. 
ioPosOffset On input, the positioning offset. On output, the new position of the mark. 

The PBWriteSync function takes ioReqCount bytes from the buffer pointed to by ioBuffer and attempts to write them to the open file whose access path is specified by ioRefNum. The position of the mark is specified by ioPosMode and ioPosOffset. If the write operation completes successfully, PBWriteSync moves the file mark to the byte following the last byte written and returns noErr.

If you try to write past the logical end-of-file, PBWriteSync moves the logical end-of-file. If you try to write past the physical end-of-file, PBWriteSync adds one or more clumps to the file and moves the physical end-of-file accordingly. 
Availability
Available in CarbonLib 1.0 and later when running Mac OS 8.1 or later.
Available in Mac OS X 10.0 and later.
Carbon Porting Notes

This function is only supported for writing to open files.
Declared In
Devices.h*/

OSErr PBWriteSync (
   ParmBlkPtr paramBlock
){};

/*PBWriteAsync

Writes any number of bytes to an open file.

OSErr PBWriteAsync (
   ParmBlkPtr paramBlock
);
Parameters
paramBlock

A pointer to a basic File Manager parameter block. 
Return Value

A result code. See “Device Manager Result Codes”.
Discussion

The relevant fields of the parameter block are:
ioCompletion On input, a pointer to a completion routine. 
ioResult On output, the result code of the function. 
ioRefNum On input, a file reference number for the open file to which to write. 
ioBuffer On input, a pointer to a data buffer containing the bytes to write. 
ioReqCount On input, the number of bytes requested. 
ioActCount On output, the number of bytes actually written. 
ioPosMode On input, the positioning mode. 
ioPosOffset On input, the positioning offset. On output, the new position of the mark. 

The PBWriteAsync function takes ioReqCount bytes from the buffer pointed to by ioBuffer and attempts to write them to the open file whose access path is specified by ioRefNum. The position of the mark is specified by ioPosMode and ioPosOffset. If the write operation completes successfully, PBWriteAsync moves the file mark to the byte following the last byte written and returns noErr.

If you try to write past the logical end-of-file, PBWriteAsync moves the logical end-of-file. If you try to write past the physical end-of-file, PBWriteAsync adds one or more clumps to the file and moves the physical end-of-file accordingly. 
Availability
Available in CarbonLib 1.0 and later when running Mac OS 8.1 or later.
Available in Mac OS X 10.0 and later.
Carbon Porting Notes

This function is only supported for writing to open files.
Declared In
Devices.h*/
OSErr PBWriteAsync (
   ParmBlkPtr paramBlock
){};


/*PBReadAsync

Reads any number of bytes from an open file.

OSErr PBReadAsync (
   ParmBlkPtr paramBlock
);
Parameters
paramBlock

A pointer to a basic File Manager parameter block. 
Return Value

A result code. See “Device Manager Result Codes”.
Discussion

The relevant fields of the parameter block are:
ioCompletion On input, a pointer to a completion routine. 
ioResult On output, the result code of the function. 
ioRefNum On input, a file reference number for an open file to be read. 
ioBuffer On input, a pointer to a data buffer into which the bytes are read. 
ioReqCount On input, the number of bytes requested. The value that you pass in this field should be greater than zero. 
ioActCount On output, the number of bytes actually read. 
ioPosMode On input, the positioning mode. 
ioPosOffset On input, the positioning offset. On output, the new position of the mark. 

This function attempts to read ioReqCount bytes from the open file whose access path is specified in the ioRefNum field and transfer them to the data buffer pointed to by the ioBuffer field. The position of the mark is specified by ioPosMode and ioPosOffset. If your application tries to read past the logical end-of-file, PBReadAsync reads the data, moves the mark to the end-of-file, and returns eofErr as its function result. Otherwise, PBReadAsync moves the file mark to the byte following the last byte read and returns noErr.

You can specify that PBReadAsync read the file data 1 byte at a time until the requested number of bytes have been read or until the end-of-file is reached. To do so, set bit 7 of the ioPosMode field. Similarly, you can specify that PBReadAsync should stop reading data when it reaches an application-defined newline character. To do so, place the ASCII code of that character into the high-order byte of the ioPosMode field; you must also set bit 7 of that field to enable newline mode.

When reading data in newline mode, PBReadAsync returns the newline character as part of the data read and sets ioActCount to the actual number of bytes placed into the buffer (which includes the newline character). 
Version Notes

Note that on Mac OS 8 and 9, it is possible to call PBReadAsync with a value of 0 in the ioReqCount field; however, this behavior is not supported on Mac OS X. On OS X, PBReadAsync returns a paramErr error if the value in the ioReqCount field is 0.
Availability
Available in CarbonLib 1.0 and later when running Mac OS 8.1 or later.
Available in Mac OS X 10.0 and later.
Declared In
Devices.h*/

OSErr PBReadAsync (
   ParmBlkPtr paramBlock
){};

/*PBReadSync

Reads any number of bytes from an open file.

OSErr PBReadSync (
   ParmBlkPtr paramBlock
);
Parameters
paramBlock

A pointer to a basic File Manager parameter block. 
Return Value

A result code. See “Device Manager Result Codes”.
Discussion

The relevant fields of the parameter block are:
ioCompletion On input, a pointer to a completion routine. 
ioResult On output, the result code of the function. 
ioRefNum On input, a file reference number for an open file to be read. 
ioBuffer On input, a pointer to a data buffer into which the bytes are read. 
ioReqCount On input, the number of bytes requested. The value that you pass in this field should be greater than zero. 
ioActCount On output, the number of bytes actually read. 
ioPosMode On input, the positioning mode. 
ioPosOffset On input, the positioning offset. On output, the new position of the mark. 

This function attempts to read ioReqCount bytes from the open file whose access path is specified in the ioRefNum field and transfer them to the data buffer pointed to by the ioBuffer field. The position of the mark is specified by ioPosMode and ioPosOffset. If your application tries to read past the logical end-of-file, PBReadSync reads the data, moves the mark to the end-of-file, and returns eofErr as its function result. Otherwise, PBReadSync moves the file mark to the byte following the last byte read and returns noErr.

You can specify that PBReadSync read the file data 1 byte at a time until the requested number of bytes have been read or until the end-of-file is reached. To do so, set bit 7 of the ioPosMode field. Similarly, you can specify that PBReadSync should stop reading data when it reaches an application-defined newline character. To do so, place the ASCII code of that character into the high-order byte of the ioPosMode field; you must also set bit 7 of that field to enable newline mode.

When reading data in newline mode, PBReadSync returns the newline character as part of the data read and sets ioActCount to the actual number of bytes placed into the buffer (which includes the newline character). 
Version Notes

Note that on Mac OS 8 and 9, it is possible to call PBReadSync with a value of 0 in the ioReqCount field; however, this behavior is not supported on Mac OS X. On OS X, PBReadSync returns a paramErr error if the value in the ioReqCount field is 0.
Availability
Available in CarbonLib 1.0 and later when running Mac OS 8.1 or later.
Available in Mac OS X 10.0 and later.
Carbon Porting Notes

This function is only supported for reading from open files.
Declared In
Devices.h*/

OSErr PBReadSync (
   ParmBlkPtr paramBlock
){};

/*Driver Support Functions
pascal OSErr DriverInstall              (Ptr drvrPtr, short refNum);
pascal OSErr DriverInstallReserveMem    (Ptr drvrPtr, short refNum);
pascal OSErr DriverRemove               (short refNum);
pascal DCtlHandle GetDCtlEntry          (short refNum);*/
pascal OSErr DriverRemove               (short refNum){};
pascal DCtlHandle GetDCtlEntry          (short refNum){};
pascal OSErr DriverInstallReserveMem    (Ptr drvrPtr, short refNum){};

/*Opening and Closing Device Drivers
pascal OSErr OpenDriver   (ConstStr255Param name, short *drvrRefNum);
pascal OSErr PBOpen       (ParmBlkPtr paramBlock, Boolean async);
pascal OSErr PBOpenSync   (ParmBlkPtr paramBlock);
pascal OSErr OpenSlot     (ParmBlkPtr paramBlock, Boolean async);
pascal short OpenDeskAcc  (ConstStr255Param deskAccName);
pascal OSErr CloseDriver  (short refNum);
pascal OSErr PBClose      (ParmBlkPtr paramBlock, Boolean async);
pascal OSErr PBCloseSync  (ParmBlkPtr paramBlock);
pascal void  CloseDeskAcc (short refNum);*/
pascal OSErr CloseDriver  (short refNum){};
pascal OSErr OpenDriver   (ConstStr255Param name, short *drvrRefNum){};

/*Status
You can use the Status function to obtain status information from a device driver.

pascal OSErr Status(short refNum, short csCode,
                    void *csParamPtr); 
refNum 
The driver reference number. 
csCode 
A driver-dependent code specifying the type of information requested. 
csParamPtr 
A pointer to a csParam array where the status information will be returned. 
DESCRIPTION
The Status function returns information about the device driver specified by the refNum parameter. The value you pass in the csCode parameter and the received information pointed to by the csParamPtr parameter are defined by the driver you are calling. For more information, see the appropriate chapters for the standard device drivers in this book and other books in the Inside Macintosh series.

The Status function is a high-level synchronous version of the low-level PBStatus function. Use the PBStatus function if you need to specify a drive number or if you want the status request to be asynchronous. 

Note 
The Device Manager interprets a csCode value of 1 as a special case. When the Device Manager receives a status request with a csCode value of 1, it returns a handle to the driver's device control entry. 
This type of status request is not passed to the device driver.  
SPECIAL CONSIDERATIONS
Do not call the Status function at interrupt time. Synchronous requests at interrupt time may block other pending I/O requests and cause the Device Manager to loop indefinitely while it waits for the device driver to complete the interrupted requests.

RESULT CODES noErr	0	No error
statusErr	-18	Driver does not respond to this status request
badUnitErr	-21	Driver reference number does not match unit table
unitEmptyErr	-22	Driver reference number specifies a nil handle in unit table
abortErr	-27	Request aborted by KillIO
notOpenErr	-28	Driver not open

SEE ALSO
For information about the low-level function for monitoring device drivers, see the next section, which describes the PBStatus function.*/
pascal OSErr Status(short refNum, short csCode,  void *csParamPtr){}; 

/*Controlling and Monitoring Device Drivers
pascal OSErr Control          (short refNum, short csCode, const void 
                               *csParamPtr);
pascal OSErr PBControl        (ParmBlkPtr paramBlock, Boolean async);
pascal OSErr PBControlSync    (ParmBlkPtr paramBlock);
pascal OSErr PBControlAsync   (ParmBlkPtr paramBlock);
pascal OSErr Status           (short refNum, short csCode, void *csParamPtr);
pascal OSErr PBStatus         (ParmBlkPtr paramBlock, Boolean async);
pascal OSErr PBStatusSync     (ParmBlkPtr paramBlock);
pascal OSErr PBStatusAsync    (ParmBlkPtr paramBlock);
pascal OSErr KillIO           (short refNum);
pascal OSErr PBKillIO         (ParmBlkPtr paramBlock, Boolean async);
pascal OSErr PBKillIOSync     (ParmBlkPtr paramBlock);
pascal OSErr PBKillIOAsync    (ParmBlkPtr paramBlock);*/
pascal OSErr PBControlSync    (ParmBlkPtr paramBlock){};
pascal OSErr Control          (short refNum, short csCode, const void 
                               *csParamPtr){};

