mirror of
https://github.com/ctm/executor.git
synced 2026-03-13 09:41:42 +00:00
All the Executor source as-is from the subversion tree it was last worked on.
This commit is contained in:
130
src/include/Serial.h
Normal file
130
src/include/Serial.h
Normal file
@@ -0,0 +1,130 @@
|
||||
#if !defined (__SERIAL__)
|
||||
#define __SERIAL__
|
||||
|
||||
/*
|
||||
* Copyright 1986, 1989, 1990 by Abacus Research and Development, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* $Id: Serial.h 63 2004-12-24 18:19:43Z ctm $
|
||||
*/
|
||||
|
||||
#if defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES)
|
||||
#define __Byte uint8
|
||||
#define __SignedByte int8
|
||||
#define __OSErr int32
|
||||
#define __Ptr void *
|
||||
#else
|
||||
#define __Byte Byte
|
||||
#define __SignedByte SignedByte
|
||||
#define __OSErr OSErr
|
||||
#define __Ptr Ptr
|
||||
#endif
|
||||
|
||||
#define baud300 380
|
||||
#define baud600 189
|
||||
#define baud1200 94
|
||||
#define baud1800 62
|
||||
#define baud2400 46
|
||||
#define baud3600 30
|
||||
#define baud4800 22
|
||||
#define baud7200 14
|
||||
#define baud9600 10
|
||||
#define baud19200 4
|
||||
#define baud57600 0
|
||||
|
||||
#define stop10 16384
|
||||
#define stop15 (-32768)
|
||||
#define stop20 (-16384)
|
||||
|
||||
#define noParity 0
|
||||
#define oddParity 4096
|
||||
#define evenParity 12288
|
||||
|
||||
#define data5 0
|
||||
#define data6 2048
|
||||
#define data7 1024
|
||||
#define data8 3072
|
||||
|
||||
#define swOverrunErr 1
|
||||
#define parityErr 16
|
||||
#define hwOverrunErr 32
|
||||
#define framingErr 64
|
||||
|
||||
#define ctsEvent 32
|
||||
#define breakEvent 128
|
||||
|
||||
#define xOffWasSent 0x80
|
||||
|
||||
#if !defined (BINCOMPAT)
|
||||
|
||||
typedef enum { sPortA, sPortB } SPortSel;
|
||||
|
||||
#else /* BINCOMPAT */
|
||||
|
||||
typedef __SignedByte SPortSel;
|
||||
#define sPortA 0
|
||||
#define sPortB 1
|
||||
|
||||
#endif /* BINCOMPAT */
|
||||
|
||||
typedef struct {
|
||||
__Byte fXOn PACKED;
|
||||
__Byte fCTS PACKED;
|
||||
__Byte xOn PACKED;
|
||||
__Byte xOff PACKED;
|
||||
__Byte errs PACKED;
|
||||
__Byte evts PACKED;
|
||||
__Byte fInX PACKED;
|
||||
__Byte null PACKED;
|
||||
} SerShk;
|
||||
|
||||
typedef struct {
|
||||
__Byte cumErrs PACKED;
|
||||
__Byte xOffSent PACKED;
|
||||
__Byte rdPend PACKED;
|
||||
__Byte wrPend PACKED;
|
||||
__Byte ctsHold PACKED;
|
||||
__Byte xOffHold PACKED;
|
||||
} SerStaRec;
|
||||
|
||||
#define MODEMINAME ".AIn"
|
||||
#define MODEMONAME ".AOut"
|
||||
#define PRNTRINAME ".AIn"
|
||||
#define PRNTRONAME ".AOut"
|
||||
#define MODEMIRNUM (-6)
|
||||
#define MODEMORNUM (-7)
|
||||
#define PRNTRIRNUM (-8)
|
||||
#define PRNTRORNUM (-9)
|
||||
|
||||
|
||||
/* DO NOT DELETE THIS LINE */
|
||||
#if !defined (__STDC__)
|
||||
extern __OSErr RAMSDOpen();
|
||||
extern void RAMSDClose();
|
||||
extern __OSErr SerReset();
|
||||
extern __OSErr SerSetBuf();
|
||||
extern __OSErr SerHShake();
|
||||
extern __OSErr SerSetBrk();
|
||||
extern __OSErr SerClrBrk();
|
||||
extern __OSErr SerGetBuf();
|
||||
extern __OSErr SerStatus();
|
||||
#else /* __STDC__ */
|
||||
extern __OSErr RAMSDOpen( SPortSel port );
|
||||
extern void RAMSDClose( SPortSel port );
|
||||
extern __OSErr SerReset( INTEGER rn, INTEGER config );
|
||||
extern __OSErr SerSetBuf( INTEGER rn, __Ptr p, INTEGER len );
|
||||
extern __OSErr SerHShake( INTEGER rn, SerShk flags );
|
||||
extern __OSErr SerSetBrk( INTEGER rn );
|
||||
extern __OSErr SerClrBrk( INTEGER rn );
|
||||
extern __OSErr SerGetBuf( INTEGER rn, LONGINT *lp );
|
||||
extern __OSErr SerStatus( INTEGER rn, SerStaRec *serstap );
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#if defined (USE_WINDOWS_NOT_MAC_TYPEDEFS_AND_DEFINES)
|
||||
#undef __Byte
|
||||
#undef __SignedByte
|
||||
#undef __OSErr
|
||||
#undef __Ptr
|
||||
#endif
|
||||
|
||||
#endif /* __SERIAL__ */
|
||||
Reference in New Issue
Block a user