Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
CodeWarrior (OS 9)/AsyncPB.h
/* |
File: AsyncPB.h |
Description:AsyncPB is an example of how File System calls can be made |
in a chain from an interrupt handler like the Time Manager. |
Once you select DoIt from the menu give it a little time to actually |
process the input file. |
Author: JB |
Copyright: Copyright: © 1984-1999 by Apple Computer, Inc. |
all rights reserved. |
Disclaimer: You may incorporate this sample code into your applications without |
restriction, though the sample code has been provided "AS IS" and the |
responsibility for its operation is 100% yours. However, what you are |
not permitted to do is to redistribute the source as "DSC Sample Code" |
after having made changes. If you're going to re-distribute the source, |
we require that you make it clear in the source that the code was |
descended from Apple Sample Code, but that you've made changes. |
Change History (most recent first): |
6/25/99 Updated for Metrowerks Codewarror Pro 2.1(KG) |
*/ |
#define isStationary 2048 |
#define ApplicationMenuBar 128 |
#define AppleMenu 128 |
#define AboutItem 1 |
#define FileMenu 129 |
#define DoIt 1 |
#define QuitItem 2 |
#define AboutAlert 128 |
#define kWindowKind 'im' |
void DoMenu (short menu, short item); |
void EventLoop (void); |
int main (void); |
typedef struct MyParamBlockRec |
{ |
IOParam ioParam; |
IOCompletionUPP setFPosIOCompletion; |
IOCompletionUPP readIOCompletion; |
IOCompletionUPP writeIOCompletion; |
short readFileRefNum; |
short writeFileRefNum; |
TMTaskPtr tm; |
} MyParamBlockRec, *MyParamBlockPtr; |
typedef struct TaskRec |
{ |
TMTask theTMTask; |
MyParamBlockPtr pb; |
} MyTaskRec, *MyTaskPtr; |
#ifdef powerc |
pascal void PBReadIOCompletion(ParmBlkPtr parmblkptr); |
pascal void PBSetFPosIOCompletion(ParmBlkPtr parmblkptr); |
pascal void PBWriteIOCompletion(ParmBlkPtr parmblkptr); |
pascal void TMTaskProc(MyTaskPtr tm); |
#else |
pascal void PBReadIOCompletion(); |
pascal void PBSetFPosIOCompletion(); |
pascal void PBWriteIOCompletion(); |
pascal void TMTaskProc(); |
#endif |
MyTaskRec gTM; |
MyParamBlockRec gPB; |
char gBuffer; |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-10-27