home *** CD-ROM | disk | FTP | other *** search
- /*
- File: FileTransfers.h
-
- Copyright: © 1984-1993 by Apple Computer, Inc., all rights reserved.
-
- WARNING
- This file was auto generated by the interfacer tool. Modifications
- must be made to the master file.
-
- */
-
- #ifndef __FILETRANSFERS__
- #define __FILETRANSFERS__
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- /* #include <Types.h> */
- /* #include <ConditionalMacros.h> */
- /* #include <MixedMode.h> */
- /* #include <Traps.h> */
- #endif
-
- #ifndef __CTBUTILITIES__
- #include <CTBUtilities.h>
- /* #include <Memory.h> */
- /* #include <StandardFile.h> */
- /* #include <Dialogs.h> */
- /* #include <Windows.h> */
- /* #include <Quickdraw.h> */
- /* #include <QuickdrawText.h> */
- /* #include <IntlResources.h> */
- /* #include <Events.h> */
- /* #include <OSUtils.h> */
- /* #include <Controls.h> */
- /* #include <Menus.h> */
- /* #include <TextEdit.h> */
- /* #include <Files.h> */
- /* #include <SegLoad.h> */
- /* #include <AppleTalk.h> */
- #endif
-
- #ifndef __CONNECTIONS__
- #include <Connections.h>
- #endif
-
- #ifndef __FILES__
- #endif
-
- #ifndef __TERMINALS__
- #include <Terminals.h>
- #endif
-
- enum {
- /* current file transfer manager version */
- curFTVersion = 2,
- /* FTErr */
- ftGenericError = -1,
- ftNoErr = 0,
- ftRejected = 1,
- ftFailed = 2,
- ftTimeOut = 3,
- ftTooManyRetry = 4,
- ftNotEnoughDSpace = 5,
- ftRemoteCancel = 6,
- ftWrongFormat = 7,
- ftNoTools = 8,
- ftUserCancel = 9,
- ftNotSupported = 10
- };
-
- typedef OSErr FTErr;
-
- enum {
- ftIsFTMode = 1 << 0,
- ftNoMenus = 1 << 1,
- ftQuiet = 1 << 2,
- ftConfigChanged = 1 << 4,
- ftSucc = 1 << 7
- };
-
- typedef unsigned long FTFlags;
-
- enum {
- ftSameCircuit = 1 << 0,
- ftSendDisable = 1 << 1,
- ftReceiveDisable = 1 << 2,
- ftTextOnly = 1 << 3,
- ftNoStdFile = 1 << 4,
- ftMultipleFileSend = 1 << 5
- };
-
- typedef unsigned short FTAttributes;
-
- enum {
- ftReceiving,
- ftTransmitting
- };
-
- typedef unsigned short FTDirection;
-
- typedef pascal long (*FileTransferDefProcPtr)(TermHandle hTerm, short msg, long p1, long p2, long p3);
-
- enum {
- uppFileTransferDefProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TermHandle)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferDefUPP;
-
- #define CallFileTransferDefProc(userRoutine, hTerm, msg, p1, p2, p3) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferDefProcInfo, (hTerm), (msg), (p1), (p2), (p3))
- #define NewFileTransferDefProc(userRoutine) \
- (FileTransferDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferDefProcInfo, GetCurrentISA())
- #else
- typedef FileTransferDefProcPtr FileTransferDefUPP;
-
- #define CallFileTransferDefProc(userRoutine, hTerm, msg, p1, p2, p3) \
- (*(userRoutine))((hTerm), (msg), (p1), (p2), (p3))
- #define NewFileTransferDefProc(userRoutine) \
- (FileTransferDefUPP)(userRoutine)
- #endif
-
-
- /* application routines type definitions */
-
- typedef struct FTRecord FTRecord, *FTPtr, **FTHandle;
-
- typedef pascal OSErr (*FileTransferReadProcPtr)(unsigned long *count, Ptr pData, long refCon, short fileMsg);
-
- enum {
- uppFileTransferReadProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned long*)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferReadUPP;
-
- #define CallFileTransferReadProc(userRoutine, count, pData, refCon, fileMsg) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferReadProcInfo, (count), (pData), (refCon), (fileMsg))
- #define NewFileTransferReadProc(userRoutine) \
- (FileTransferReadUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferReadProcInfo, GetCurrentISA())
- #else
- typedef FileTransferReadProcPtr FileTransferReadUPP;
-
- #define CallFileTransferReadProc(userRoutine, count, pData, refCon, fileMsg) \
- (*(userRoutine))((count), (pData), (refCon), (fileMsg))
- #define NewFileTransferReadProc(userRoutine) \
- (FileTransferReadUPP)(userRoutine)
- #endif
-
- typedef pascal OSErr (*FileTransferWriteProcPtr)(unsigned long *count, Ptr pData, long refCon, short fileMsg);
-
- enum {
- uppFileTransferWriteProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned long*)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Ptr)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferWriteUPP;
-
- #define CallFileTransferWriteProc(userRoutine, count, pData, refCon, fileMsg) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferWriteProcInfo, (count), (pData), (refCon), (fileMsg))
- #define NewFileTransferWriteProc(userRoutine) \
- (FileTransferWriteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferWriteProcInfo, GetCurrentISA())
- #else
- typedef FileTransferWriteProcPtr FileTransferWriteUPP;
-
- #define CallFileTransferWriteProc(userRoutine, count, pData, refCon, fileMsg) \
- (*(userRoutine))((count), (pData), (refCon), (fileMsg))
- #define NewFileTransferWriteProc(userRoutine) \
- (FileTransferWriteUPP)(userRoutine)
- #endif
-
- typedef pascal Size (*FileTransferSendProcPtr)(Ptr thePtr, long theSize, long refCon, CMChannel channel, CMFlags flag);
-
- enum {
- uppFileTransferSendProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Size)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(CMChannel)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(CMFlags)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferSendUPP;
-
- #define CallFileTransferSendProc(userRoutine, thePtr, theSize, refCon, channel, flag) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferSendProcInfo, (thePtr), (theSize), (refCon), (channel), (flag))
- #define NewFileTransferSendProc(userRoutine) \
- (FileTransferSendUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferSendProcInfo, GetCurrentISA())
- #else
- typedef FileTransferSendProcPtr FileTransferSendUPP;
-
- #define CallFileTransferSendProc(userRoutine, thePtr, theSize, refCon, channel, flag) \
- (*(userRoutine))((thePtr), (theSize), (refCon), (channel), (flag))
- #define NewFileTransferSendProc(userRoutine) \
- (FileTransferSendUPP)(userRoutine)
- #endif
-
- typedef pascal Size (*FileTransferReceiveProcPtr)(Ptr thePtr, long theSize, long refCon, CMChannel channel, CMFlags *flag);
-
- enum {
- uppFileTransferReceiveProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Size)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(CMChannel)))
- | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(CMFlags*)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferReceiveUPP;
-
- #define CallFileTransferReceiveProc(userRoutine, thePtr, theSize, refCon, channel, flag) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferReceiveProcInfo, (thePtr), (theSize), (refCon), (channel), (flag))
- #define NewFileTransferReceiveProc(userRoutine) \
- (FileTransferReceiveUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferReceiveProcInfo, GetCurrentISA())
- #else
- typedef FileTransferReceiveProcPtr FileTransferReceiveUPP;
-
- #define CallFileTransferReceiveProc(userRoutine, thePtr, theSize, refCon, channel, flag) \
- (*(userRoutine))((thePtr), (theSize), (refCon), (channel), (flag))
- #define NewFileTransferReceiveProc(userRoutine) \
- (FileTransferReceiveUPP)(userRoutine)
- #endif
-
- typedef pascal OSErr (*FileTransferEnvironsProcPtr)(long refCon, ConnEnvironRec *theEnvirons);
-
- enum {
- uppFileTransferEnvironsProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ConnEnvironRec*)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferEnvironsUPP;
-
- #define CallFileTransferEnvironsProc(userRoutine, refCon, theEnvirons) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferEnvironsProcInfo, (refCon), (theEnvirons))
- #define NewFileTransferEnvironsProc(userRoutine) \
- (FileTransferEnvironsUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferEnvironsProcInfo, GetCurrentISA())
- #else
- typedef FileTransferEnvironsProcPtr FileTransferEnvironsUPP;
-
- #define CallFileTransferEnvironsProc(userRoutine, refCon, theEnvirons) \
- (*(userRoutine))((refCon), (theEnvirons))
- #define NewFileTransferEnvironsProc(userRoutine) \
- (FileTransferEnvironsUPP)(userRoutine)
- #endif
-
- typedef pascal void (*FileTransferNotificationProcPtr)(FTHandle hFT, FSSpecPtr pFSSpec);
-
- enum {
- uppFileTransferNotificationProcInfo = kPascalStackBased
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FTHandle)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FSSpecPtr)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferNotificationUPP;
-
- #define CallFileTransferNotificationProc(userRoutine, hFT, pFSSpec) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferNotificationProcInfo, (hFT), (pFSSpec))
- #define NewFileTransferNotificationProc(userRoutine) \
- (FileTransferNotificationUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferNotificationProcInfo, GetCurrentISA())
- #else
- typedef FileTransferNotificationProcPtr FileTransferNotificationUPP;
-
- #define CallFileTransferNotificationProc(userRoutine, hFT, pFSSpec) \
- (*(userRoutine))((hFT), (pFSSpec))
- #define NewFileTransferNotificationProc(userRoutine) \
- (FileTransferNotificationUPP)(userRoutine)
- #endif
-
- typedef pascal void (*FileTransferChooseIdleProcPtr)(void);
-
- enum {
- uppFileTransferChooseIdleProcInfo = kPascalStackBased
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr FileTransferChooseIdleUPP;
-
- #define CallFileTransferChooseIdleProc(userRoutine) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppFileTransferChooseIdleProcInfo)
- #define NewFileTransferChooseIdleProc(userRoutine) \
- (FileTransferChooseIdleUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFileTransferChooseIdleProcInfo, GetCurrentISA())
- #else
- typedef FileTransferChooseIdleProcPtr FileTransferChooseIdleUPP;
-
- #define CallFileTransferChooseIdleProc(userRoutine) \
- (*(userRoutine))()
- #define NewFileTransferChooseIdleProc(userRoutine) \
- (FileTransferChooseIdleUPP)(userRoutine)
- #endif
-
- #if defined(powerc) || defined (__powerc)
- #pragma options align=mac68k
- #endif
- struct FTRecord {
- short procID;
- FTFlags flags;
- FTErr errCode;
- long refCon;
- long userData;
- FileTransferDefUPP defProc;
- Ptr config;
- Ptr oldConfig;
- FileTransferEnvironsUPP environsProc;
- long reserved1;
- long reserved2;
- Ptr ftPrivate;
- FileTransferSendUPP sendProc;
- FileTransferReceiveUPP recvProc;
- FileTransferWriteUPP writeProc;
- FileTransferReadUPP readProc;
- WindowPtr owner;
- FTDirection direction;
- SFReply theReply;
- long writePtr;
- long readPtr;
- char *theBuf;
- long bufSize;
- Str255 autoRec;
- FTAttributes attributes;
- };
- #if defined(powerc) || defined(__powerc)
- #pragma options align=reset
- #endif
-
- enum {
- /* FTReadProc messages */
- ftReadOpenFile = 0, /* count = forkFlags, buffer = pblock from PBGetFInfo */
- ftReadDataFork = 1,
- ftReadRsrcFork = 2,
- ftReadAbort = 3,
- ftReadComplete = 4,
- ftReadSetFPos = 6, /* count = forkFlags, buffer = pBlock same as PBSetFPos */
- ftReadGetFPos = 7, /* count = forkFlags, buffer = pBlock same as PBGetFPos */
- /* FTWriteProc messages */
- ftWriteOpenFile = 0, /* count = forkFlags, buffer = pblock from PBGetFInfo */
- ftWriteDataFork = 1,
- ftWriteRsrcFork = 2,
- ftWriteAbort = 3,
- ftWriteComplete = 4,
- ftWriteFileInfo = 5,
- ftWriteSetFPos = 6, /* count = forkFlags, buffer = pBlock same as PBSetFPos */
- ftWriteGetFPos = 7, /* count = forkFlags, buffer = pBlock same as PBGetFPos */
- /* fork flags */
- ftOpenDataFork = 1,
- ftOpenRsrcFork = 2
- };
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern pascal FTErr InitFT(void);
- extern pascal Handle FTGetVersion(FTHandle hFT);
- extern pascal short FTGetFTVersion(void);
- extern pascal FTHandle FTNew(short procID, FTFlags flags, FileTransferSendUPP sendProc, FileTransferReceiveUPP recvProc, FileTransferReadUPP readProc, FileTransferWriteUPP writeProc, FileTransferEnvironsUPP environsProc, WindowPtr owner, long refCon, long userData);
- extern pascal void FTDispose(FTHandle hFT);
- extern pascal FTErr FTStart(FTHandle hFT, FTDirection direction, const SFReply *fileInfo);
- extern pascal FTErr FTAbort(FTHandle hFT);
- extern pascal FTErr FTSend(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc);
- extern pascal FTErr FTReceive(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc);
- extern pascal void FTExec(FTHandle hFT);
- extern pascal void FTActivate(FTHandle hFT, Boolean activate);
- extern pascal void FTResume(FTHandle hFT, Boolean resume);
- extern pascal Boolean FTMenu(FTHandle hFT, short menuID, short item);
- extern pascal short FTChoose(FTHandle *hFT, Point where, FileTransferChooseIdleUPP idleProc);
- extern pascal void FTEvent(FTHandle hFT, const EventRecord *theEvent);
- extern pascal Boolean FTValidate(FTHandle hFT);
- extern pascal void FTDefault(Ptr *theConfig, short procID, Boolean allocate);
- extern pascal Handle FTSetupPreflight(short procID, long *magicCookie);
- extern pascal void FTSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie);
- extern pascal Boolean FTSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie);
- extern pascal void FTSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie);
- extern pascal void FTSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie);
- extern pascal void FTSetupPostflight(short procID);
- extern pascal Ptr FTGetConfig(FTHandle hFT);
- extern pascal short FTSetConfig(FTHandle hFT, const void *thePtr);
- extern pascal OSErr FTIntlToEnglish(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language);
- extern pascal OSErr FTEnglishToIntl(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language);
- extern pascal void FTGetToolName(short procID, Str255 name);
- extern pascal short FTGetProcID(ConstStr255Param name);
- extern pascal void FTSetRefCon(FTHandle hFT, long refCon);
- extern pascal long FTGetRefCon(FTHandle hFT);
- extern pascal void FTSetUserData(FTHandle hFT, long userData);
- extern pascal long FTGetUserData(FTHandle hFT);
- extern pascal void FTGetErrorString(FTHandle hFT, short id, Str255 errMsg);
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-
-