|
|
1.1 root 1: #ifndef COMMLIB_DOT_H
2: #define COMMLIB_DOT_H
3:
4: /*
5: * COMMLIB.H 5.20A June 8, 1995
6: *
7: * The Greenleaf Comm Library
8: *
9: * Copyright (C) 1985-1995 Greenleaf Software Inc. All Rights Reserved.
10: *
11: * NOTES
12: *
13: * This is the master include file for CommLib Level 2 functions. You
14: * pretty much have to include this file. It has all the prototypes,
15: * macros, and structures needed to use CommLib Level 2.
16: *
17: * MODIFICATIONS
18: *
19: * December 12, 1992 4.00A : Initial release
20: *
21: * December 13, 1994 5.10A : Updated to include 5.00D patch.
22: */
23:
24: /*
25: * If you have a custom header file that you want to include in every
26: * source module in CommLib, you can automatically add it to all of the
27: * library modules by simply replacing the bland GFCUSTOM.H supplied with
28: * our libraries. This will always be the first file included by any
29: * of our source files, so you are guaranteed specific behavior. See
30: * header file memchk.h for an example of how to build a version of
31: * commlib that is linked to memcheck.
32: */
33:
34: #include "gfcustom.h"
35:
36: #include "compiler.h"
37: #if defined( GF_WATCOM_C ) || defined( GF_WATCOM_C_386 )
38: # if defined( GF_WATCOM_S )
39: # include "wat3s.h"
40: # endif
41: #endif
42:
43: /*
44: * _DEFS386.H and _DEFS286.H are both similar to COMPILER.H, but for
45: * 16 and 32 bit DOS Extenders
46: */
47:
48: #include "_defs286.h"
49: #include "_defs386.h"
50:
51: #if defined( GF_WINDOWS ) || defined( GF_WIN32 )
52: #include <windows.h>
53: #if defined( GF_WIN32 )
54: #define HTASK HANDLE
55: #endif
56: #endif
57:
58: #define COMLIBVERSION 0x520 /* Comm library Version */
59:
60: /*
61: * 16550 trigger definitions are used across more than one driver.
62: */
63: typedef enum trigger_level{
64: TRIGGER_DISABLE = 0x00,
65: TRIGGER_01 = 0x01,
66: TRIGGER_04 = 0x41,
67: TRIGGER_08 = 0x81,
68: TRIGGER_14 = 0xc1
69: } TRIGGER_LEVEL;
70:
71: /*
72: * People wonder why COM1 is an int instead of a macro. The reason goes back
73: * to the cutover to Commlib 3.2. Lots of functions that used to take an
74: * int port number in 3.1 changed to taking a PORT structure pointer in
75: * 3.2. Normally, if you try to pass an int as a pointer you will get an
76: * error, so users that didn't update their code properly could count on
77: * getting an error from the compiler. However, COM1 is defined as 0, and
78: * 0 is a special value that can be passed as a pointer. So defining it
79: * as an extern int avoids that particular problem, and will cause an
80: * error if somebody tries to pass COM1 as an argument to ZmodemSend().
81: */
82:
83: #define COM1 (int)0
84: #define COM2 1
85: #define COM3 2
86: #define COM4 3
87: #define COM5 4
88: #define COM6 5
89: #define COM7 6
90: #define COM8 7
91: #define COM9 8
92: #define COM10 9
93: #define COM11 10
94: #define COM12 11
95: #define COM13 12
96: #define COM14 13
97: #define COM15 14
98: #define COM16 15
99: #define COM17 16
100: #define COM18 17
101: #define COM19 18
102: #define COM20 19
103: #define COM21 20
104: #define COM22 21
105: #define COM23 22
106: #define COM24 23
107: #define COM25 24
108: #define COM26 25
109: #define COM27 26
110: #define COM28 27
111: #define COM29 28
112: #define COM30 29
113: #define COM31 30
114: #define COM32 31
115: #define COM33 32
116: #define COM34 33
117: #define COM35 34
118:
119: /*
120: * Macro's and constants to ease the reading of Micro Channel POS
121: * registers.
122: */
123: #define POSCHNLSELECT 0x96 /* POS Channel Select */
124: #define POSLOWIDPORT 0x100 /* POS I.D. Low byte */
125: #define POSHIGHIDPORT 0x101 /* POS I.D. High byte */
126: #define POS2PORT 0x102 /* POS Adapter info ports 2-5*/
127: #define POS3PORT 0x103
128: #define POS4PORT 0x104
129: #define POS5PORT 0x105
130: #define POSCHMIN 0x08 /* Minimum channel */
131: #define POSCHMAX 0x0f /* Maximum channel */
132: #define POSCHNLDISABLE 0x00 /* Disable channel access */
133:
134: #define POSSELECTCHANNEL( p ) _asoutb( POSCHNLSELECT, p ) /* Tag: L1 private */
135: #define POSDESELECTCHANNEL( p ) _asoutb( POSCHNLSELECT, POSCHNLDISABLE ) /* Tag: L1 private */
136: #define POSID() /* Tag: L1 private */ \
137: ( ( _asinb( POSHIGHIDPORT ) << 8 ) + \
138: _asinb( POSLOWIDPORT ) )
139: #define POS2INFO() _asinb(POS2PORT) /* Tag: L1 private */
140: #define POS3INFO() _asinb(POS3PORT) /* Tag: L1 private */
141: #define POS4INFO() _asinb(POS4PORT) /* Tag: L1 private */
142: #define POS5INFO() _asinb(POS5PORT) /* Tag: L1 private */
143:
144: #define TICKS_PER_SECOND 18
145: #define MILLISECONDS_PER_TICK 55
146:
147: #ifndef TRUE
148: #define TRUE 1
149: #endif
150:
151: #ifndef FALSE
152: #define FALSE 0
153: #endif
154:
155: #define GF_MKFP( seg, offset ) /* Tag: Misc private */ \
156: ( void GF_FAR *) ( ( (unsigned long) \
157: ( seg ) << 16 ) + ( offset ) )
158: #define GF_MKFFP( seg, offset ) /* Tag: Misc private */ \
159: (void (GF_FAR * )()) ( ( (unsigned long) \
160: ( seg ) << 16 ) + ( offset ) )
161:
162: #define IRQ0 0
163: #define IRQ1 1
164: #define IRQ2 2
165: #define IRQ3 3
166: #define IRQ4 4
167: #define IRQ5 5
168: #define IRQ6 6
169: #define IRQ7 7
170: #define IRQ8 8
171: #define IRQ9 9
172: #define IRQ10 10
173: #define IRQ11 11
174: #define IRQ12 12
175: #define IRQ13 13
176: #define IRQ14 14
177: #define IRQ15 15
178:
179: /*
180: * Line Status
181: */
182: #define OVERRUN 2
183: #define PARERR 4
184: #define FRAMERR 8
185: #define BREAKDET 16
186: #define THRE 32
187: #define TEMT 64
188:
189: /*
190: * Modem Status
191: */
192: #define CTSCHG 1
193: #define DSRCHG 2
194: #define RITRAIL 4
195: #define CDCHG 8
196: #define CTS 16
197: #define DSR 32
198: #define RI 64
199: #define CD 128
200:
201: /*
202: * Error codes returned by all functions OR in _aserror.
203: */
204: #define ASSUCCESS 0
205: #define ASGENERALERROR -1
206: #define ASINVPORT -2
207: #define ASINUSE -3
208: #define ASINVBUFSIZE -4
209: #define ASNOMEMORY -5
210: #define ASNOTSETUP -6
211: #define ASINVPAR -7
212: #define ASBUFREMPTY -8
213: #define ASBUFRFULL -9
214: #define ASTIMEOUT -10
215: #define ASNOCTS -11
216: #define ASNOCD -12
217: #define ASNODSR -13
218: #define ASNO8250 -14
219: #define ASXMSTATUS -15
220: #define ASUSERABORT -16
221: #define ASFILERR -17
222: #define ASXMERROR -18
223: #define ASNOWIDERX -19
224: #define ASCONFLICT -20
225: #define ASCRCMODE -21
226: #define ASNOHAYESOK -22
227: #define ASNOHAYESRESPONSE -23
228: #define ASNOTSUPPORTED -24
229: #define ASILLEGALBAUDRATE -25
230: #define ASILLEGALPARITY -26
231: #define ASILLEGALWORDLENGTH -27
232: #define ASILLEGALSTOPBITS -28
233: #define ASNOCOPYRIGHTNOTICE -29
234: #define ASDRIVERNOTINSTALLED -30
235: #define ASOVERFLOW -31
236: #define ASCONNECTFAILURE -32
237: #define ASDOSEXTENDERERROR -33
238: #define ASILLEGALBOARDNUMBER -34
239: #define ASBOARDINUSE -35
240: #define ASHANDSHAKEBLOCK -36
241: #define ASMAXPORTSEXCEEDED -37
242: #define ASILLEGALIRQ -38
243: #define ASIRQINUSE -39
244: #define AS_THUNK_SETUP_FAILED -40
245: #define AS_NASI_ERROR -41
246: #define AS_PACKING_ERROR -42
247: #define ASUSERDEFINEDERROR -75
248: /*
249: * Number of ports supported by Windows
250: */
251: #define MAXWINPORTS 9
252:
253: #ifdef __cplusplus
254: extern "C" {
255: #endif
256: extern char ParityLetter[ 5 ];
257: #ifdef __cplusplus
258: }
259: #endif
260:
261: typedef enum { OUT_OF_MEMORY = -1,
262: GREENLEAF,
263: BIOS,
264: EXTENDED_BIOS,
265: FOSSIL,
266: DIGIBOARD_COMXI,
267: DIGIBOARD_PCXE,
268: DIGIBOARD_UNIVERSAL,
269: GREENLEAF_FAST,
270: MODEM_ASSIST,
271: PHAR_LAP_286,
272: RATIONAL_SYSTEMS_DOS_16M,
273: SPARKLE,
274: ARNET,
275: STARGATE,
276: MICROSOFT_WINDOWS,
277: MICROSOFT_WIN32,
278: MICROSOFT_WIN32S,
279: NASI,
280: OTHER
281: } DRIVER_TYPE;
282:
283: typedef enum { OVERRUN_ERROR = 2,
284: PARITY_ERROR = 4,
285: FRAMING_ERROR = 8,
286: BREAK_DETECTED = 16
287: } LINE_STATUS_CODES;
288:
289: typedef enum { CTS_SET = 0x10,
290: DSR_SET = 0x20,
291: RI_SET = 0x40,
292: CD_SET = 0x80
293: } MODEM_STATUS_CODES;
294:
295: typedef enum { RX_CHAR = 0x0001,
296: RX_EVENT_FLAG = 0x0002,
297: TX_EMPTY = 0x0004,
298: CTS_STATE_CHANGE = 0x0008,
299: DSR_STATE_CHANGE = 0x0010,
300: RLSD_STATE_CHANGE = 0x0020,
301: BREAK_STATE = 0x0040,
302: LINE_STATUS_ERR = 0x0080,
303: RI_STATE = 0x0100,
304: CTS_STATE = 0x0400,
305: DSR_STATE = 0x0800,
306: RLSD_STATE = 0x1000,
307: TERI_STATE = 0x2000
308: } EVENT_CODES;
309:
310:
311: typedef void ( GF_DLL_FAR GF_CONV *PORT_DUMPER )( char GF_DLL_FAR *data );
312:
313:
314:
315: /*
316: * This is the PORT structure that everything else in Level 2 revolves
317: * around. All driver routines operate on PORT structures.
318: */
319:
320: struct GFINSTANCEDATAtag;
321:
322: #define PORT struct _tag_port
323:
324: struct _tag_port {
325: #if defined( GF_X32 )
326: GF_FARPTR32 driver;
327: #elif defined( GF_X16 )
328: void far *driver;
329: #else
330: void GF_DLL_FAR *driver;
331: #endif
332: PORT GF_DLL_FAR *next_port;
333: int handle;
334: int status;
335: DRIVER_TYPE driver_type;
336: int dialing_method;
337: unsigned int count;
338: int ( GF_CONV * read_char )( PORT GF_DLL_FAR *port );
339: int ( GF_CONV * peek_char )( PORT GF_DLL_FAR *port );
340: int ( GF_CONV * write_char )( PORT GF_DLL_FAR *port, int c );
341: int ( GF_CONV * port_close )( PORT GF_DLL_FAR *port );
342: int ( GF_CONV * port_set )( PORT GF_DLL_FAR *port,
343: long baud_rate,
344: char parity,
345: int word_length,
346: int stop_bits );
347: int ( GF_CONV * use_xon_xoff)( PORT GF_DLL_FAR *port, int control );
348: int ( GF_CONV * use_rts_cts )( PORT GF_DLL_FAR *port, int control );
349: int ( GF_CONV * use_dtr_dsr )( PORT GF_DLL_FAR *port, int control );
350: int ( GF_CONV * set_dtr )( PORT GF_DLL_FAR *port, int control );
351: int ( GF_CONV * set_rts )( PORT GF_DLL_FAR *port, int control );
352: long ( GF_CONV * space_free_in_TX_buffer )( PORT GF_DLL_FAR *port );
353: long ( GF_CONV * space_used_in_TX_buffer )( PORT GF_DLL_FAR *port );
354: long ( GF_CONV * space_free_in_RX_buffer )( PORT GF_DLL_FAR *port );
355: long ( GF_CONV * space_used_in_RX_buffer )( PORT GF_DLL_FAR *port );
356: int ( GF_CONV * clear_TX_buffer )( PORT GF_DLL_FAR *port );
357: int ( GF_CONV * write_buffer )( PORT GF_DLL_FAR *port,
358: char GF_DLL_FAR *buffer,
359: unsigned int count );
360: int ( GF_CONV * read_buffer )( PORT GF_DLL_FAR *port,
361: char GF_DLL_FAR *buffer,
362: unsigned int count );
363: int ( GF_CONV * dump_port_status )( PORT GF_DLL_FAR *port,
364: PORT_DUMPER printer );
365: int ( GF_CONV * send_break )( PORT GF_DLL_FAR *port,
366: int milliseconds );
367: int ( GF_CONV * get_modem_status )( PORT GF_DLL_FAR *port );
368: int ( GF_CONV * get_line_status )( PORT GF_DLL_FAR *port );
369: int ( GF_CONV * clear_line_status)( PORT GF_DLL_FAR *port );
370: int ( GF_CONV * block )( PORT GF_DLL_FAR *port, int control );
371: void ( GF_CONV * clear_error )( PORT GF_DLL_FAR *port );
372: void GF_FAR *user_data;
373: struct GFINSTANCEDATAtag GF_FAR *lpThis;
374: };
375:
376: #undef PORT
377:
378: typedef struct _tag_port PORT;
379:
380: /* The GFINSTANCEDATAtag structure below is used for PowerComm only.
381: * A pointer to this structure has been added to the PORT structure
382: * for internal use.
383: */
384:
385: struct GFINSTANCEDATAtag {
386: int ( GF_CONV * _PortIdleFunctionPtr )( PORT GF_DLL_FAR *port );
387: int ( GF_CONV * _AbortModemFunctionPtr )( PORT GF_DLL_FAR *port );
388: void * ( GF_CONV GF_DLL_FAR * _XferFileOpenFunctionPtr )(
389: void GF_DLL_FAR *status,
390: char GF_DLL_FAR *name,
391: char GF_DLL_FAR *mode );
392: int ( GF_CONV * _AbortXferFunctionPtr )( void GF_DLL_FAR *status );
393: int _AbortedTransfer;
394: void GF_DLL_FAR *_xfer_last_status;
395: int _DefaultAbortKey;
396: char GF_DLL_FAR * ( GF_CONV *_UserErrorNameFunctionPtr )(
397: int error_code );
398: TRIGGER_LEVEL Default16550TriggerLevel;
399: TRIGGER_LEVEL DefaultFast16550TriggerLevel;
400: long hm_delay_value;
401: char GF_FAR *hm_match_string;
402: void ( GF_CONV *hm_character_printer )( char c );
403: int _hm_abort_key;
404: int _aserror;
405: unsigned int _DefaultRXBufferSize;
406: unsigned int _DefaultTXBufferSize;
407: #if defined( GF_WINDOWS ) || defined( GF_WIN32 )
408: HTASK hTask;
409: #else
410: int hTask;
411: #endif
412: int nRefCount;
413: };
414:
415: typedef struct GFINSTANCEDATAtag GFINSTANCEDATA;
416: typedef GFINSTANCEDATA GF_FAR * LPGFINSTANCEDATA;
417: LPGFINSTANCEDATA GF_CONV GetGFInstanceDataPtr( void );
418: LPGFINSTANCEDATA GF_CONV AddOrGetGFInstanceData( void );
419:
420: /*
421: * This function pointer is set up as a typedef so we can set up the
422: * prototypes for idle and abort functions with a type that won't cause
423: * problems with certain C++ compilers.
424: */
425: typedef int ( GF_DLL_FAR GF_CONV *PORT_HOOK )( PORT GF_DLL_FAR *port );
426:
427: /*
428: * The following macros define pseudo-functions. These are all the
429: * virtual functions defined in the PORT structure. The macros just
430: * make it easier to access the functions without worrying about the
431: * port structure.
432: */
433: #define ReadChar( p ) p->read_char( p ) /* Tag: L2 public */
434: #define PeekChar( p ) p->peek_char( p ) /* Tag: L2 public */
435: #define WriteChar( p, c ) p->write_char( p, c ) /* Tag: L2 public */
436: #define PortClose( p ) p->port_close( p ) /* Tag: L2 public */
437: #define PortSet( p, b, py, wl, sb ) p->port_set( p, b, py, wl, sb ) /* Tag: L2 public */
438: #define UseXonXoff( p, c ) p->use_xon_xoff( p, c ) /* Tag: L2 public */
439: #define UseRtsCts( p, c ) p->use_rts_cts( p, c ) /* Tag: L2 public */
440: #define UseDtrDsr( p, c ) p->use_dtr_dsr( p, c ) /* Tag: L2 public */
441: #define DumpPortStatus( p, f ) p->dump_port_status( p, f ) /* Tag: L2 public */
442: #define SetDtr( p, c ) p->set_dtr( p, c ) /* Tag: L2 public */
443: #define SetRts( p, c ) p->set_rts( p, c ) /* Tag: L2 public */
444: #define SpaceFreeInTXBuffer( p ) p->space_free_in_TX_buffer( p ) /* Tag: L2 public */
445: #define SpaceFreeInRXBuffer( p ) p->space_free_in_RX_buffer( p ) /* Tag: L2 public */
446: #define SpaceUsedInTXBuffer( p ) p->space_used_in_TX_buffer( p ) /* Tag: L2 public */
447: #define SpaceUsedInRXBuffer( p ) p->space_used_in_RX_buffer( p ) /* Tag: L2 public */
448: #define ClearTXBuffer( p ) p->clear_TX_buffer( p ) /* Tag: L2 public */
449: #define WriteBuffer( p, b, i ) p->write_buffer( p, b, i ) /* Tag: L2 public */
450: #define ReadBuffer( p, b, i ) p->read_buffer( p, b, i ) /* Tag: L2 public */
451: #define SendBreak( p, t ) p->send_break( p, t ) /* Tag: L2 public */
452: #define GetModemStatus( p ) p->get_modem_status( p ) /* Tag: L2 public */
453: #define GetLineStatus( p ) p->get_line_status( p ) /* Tag: L2 public */
454: #define ClearLineStatus( p ) p->clear_line_status( p ) /* Tag: L2 public */
455: #define Block( p, c ) p->block( p, c ) /* Tag: L2 public */
456: #define ClearError( p ) p->clear_error( p ) /* Tag: L2 public */
457:
458: #ifdef __cplusplus
459: extern "C" {
460: #endif
461:
462: unsigned short int GF_CONV CalculateBlockCRC16( unsigned int count,
463: unsigned short int startvalue,
464: void GF_DLL_FAR *buffer );
465: unsigned short int GF_CONV CalculateCharacterCRC16( unsigned short int crc,
466: unsigned char c );
467: unsigned short int GF_CONV CalculateCharacterCRC16m( unsigned short int crc,
468: unsigned char c );
469: unsigned long GF_CONV CalculateBlockCRC32( unsigned int count,
470: unsigned long startvalue,
471: void GF_DLL_FAR *buffer );
472: unsigned long GF_CONV CalculateCharacterCRC32( unsigned long crc,
473: unsigned char c );
474: void GF_CDECL _assti( void );
475: void GF_CDECL _ascli( void );
476: int GF_CDECL _asinb( unsigned io_address );
477: int GF_CDECL _asoutb( unsigned io_address, int value );
478: int GF_CONV asitime( void );
479: long GF_CONV _asgetdivisor( unsigned io_address, int ier_mask );
480:
481: /*
482: * This function is also used in Data Windows. We don't define it
483: * twice so as to not get a compiler error.
484: */
485: #if !defined( DW_DOT_H )
486: unsigned GF_CDECL machine( void );
487: #endif
488:
489: void GF_CONV timer( unsigned ticks );
490: int GF_CONV submodel( void );
491:
492: char GF_DLL_FAR * GF_CONV CommErrorName( int error_code );
493: char GF_DLL_FAR * GF_CONV AsciiControlCharacterName( int c );
494: int GF_CONV Change8259Priority( int irq );
495: int GF_CONV IsMicroChannel( void );
496: /*
497: * Removed in 5.10B
498: *
499: unsigned int GF_CONV get_bios_segment( void );
500: *
501: */
502: long GF_CONV ElapsedTime( void );
503: int GF_CONV PortKillTime( PORT GF_DLL_FAR *port,
504: long milliseconds );
505: int GF_CONV DESQViewRunning( void );
506: int GF_CONV WindowsEnhancedMode( void );
507: void GF_CONV YieldWindowsTimeSlice( void );
508: void GF_CONV YieldDESQViewTimeSlice( void );
509: void GF_CONV SetDefaultBufferSize( unsigned int rx_buffer_size,
510: unsigned int tx_buffer_size );
511:
512:
513:
514: int GF_CONV GetDsr( PORT GF_DLL_FAR *p );
515: int GF_CONV GetCd( PORT GF_DLL_FAR *p );
516: int GF_CONV GetRi( PORT GF_DLL_FAR *p );
517: int GF_CONV GetCts( PORT GF_DLL_FAR *p );
518: int GF_CONV GetParityError( PORT GF_DLL_FAR *p );
519: int GF_CONV GetOverrunError( PORT GF_DLL_FAR *p );
520: int GF_CONV GetFramingError( PORT GF_DLL_FAR *p );
521: int GF_CONV GetBreakDetect( PORT GF_DLL_FAR *p );
522: int GF_CONV WriteString( PORT GF_DLL_FAR *p, char GF_DLL_FAR *string,
523: int termination_sequence );
524: int GF_CONV WriteStringTimed( PORT GF_DLL_FAR *p, char GF_DLL_FAR *string,
525: int termination_sequence,
526: long milliseconds );
527: int GF_CONV WriteBufferTimed( PORT GF_DLL_FAR *p, char GF_DLL_FAR *buffer,
528: unsigned int count, long milliseconds );
529: int GF_CONV ReadCharTimed( PORT GF_DLL_FAR *p, long milliseconds );
530: int GF_CONV WriteCharTimed( PORT GF_DLL_FAR *port, int c, long milliseconds );
531: int GF_CONV ReadBufferTimed( PORT GF_DLL_FAR *port, char GF_DLL_FAR *buffer,
532: unsigned int count, long milliseconds );
533: int GF_CONV ReadString( PORT GF_DLL_FAR *port, char GF_DLL_FAR *buffer,
534: unsigned int size, int termination_sequence );
535: int GF_CONV ReadStringTimed( PORT GF_DLL_FAR *port, char GF_DLL_FAR *buffer,
536: unsigned int size,
537: int termination_sequence,
538: long milliseconds );
539: int GF_CONV ClearRXBuffer( PORT GF_DLL_FAR *port );
540: int GF_CONV IsTXEmpty( PORT GF_DLL_FAR *port );
541: int GF_CONV IsRXEmpty( PORT GF_DLL_FAR *port );
542: int GF_CONV IsTXFull( PORT GF_DLL_FAR *port );
543: int GF_CONV IsRXFull( PORT GF_DLL_FAR *port );
544:
545: PORT * GF_CONV PortOpenFossil( int port_number, long baud_rate, char parity,
546: int word_length, int stop_bits );
547:
548: PORT * GF_CONV PortOpenSmartDigiboard( int port_number, long baud_rate,
549: char parity, int word_length,
550: int stop_bits );
551:
552: PORT GF_DLL_FAR * GF_CONV GF_DLL_FAR PortOpenGreenleaf( int port_number, long baud_rate,
553: char parity, int word_length,
554: int stop_bits );
555:
556: PORT * GF_CONV PortOpenGreenleafPolled( int port_number, long baud_rate,
557: char parity, int word_length,
558: int stop_bits );
559:
560: PORT * GF_CONV PortOpenModemAssist( int port_number, long baud_rate,
561: char parity, int word_length,
562: int stop_bits );
563:
564: PORT * GF_CONV PortOpenGreenleafFast( int port_number, long baud_rate,
565: char parity, int word_length,
566: int stop_bits );
567: PORT * GF_CONV PortOpenBIOS( int port_number, long baud_rate,
568: char parity, int word_length,
569: int stop_bits );
570:
571: PORT * GF_CONV PortOpenExtendedBIOS( int port_number, long baud_rate,
572: char parity, int word_length,
573: int stop_bits );
574:
575: PORT * GF_CONV PortOpenSparkle( int port_number, long baud_rate,
576: char parity, int word_length,
577: int stop_bits );
578:
579: PORT * GF_CONV PortOpenSmartArnet( int port_number, long baud_rate,
580: char parity, int word_length,
581: int stop_bits );
582:
583: PORT * GF_CONV PortOpenSmartStarGate( int port_number, long baud_rate,
584: char parity, int word_length,
585: int stop_bits );
586:
587: PORT * GF_CONV PortOpenNasi( char GF_DLL_FAR *name, long baud_rate,
588: char parity, int word_length,
589: int stop_bits );
590:
591: #if defined( GF_WINDOWS ) && !defined( GF_WIN32 )
592: PORT GF_DLL_FAR * GF_CONV PortOpenMSWindows( int port_number, long baud_rate,
593: char parity, int word_length,
594: int stop_bits
595: );
596: unsigned int GF_CONV PortMSWindowsGetEventMask( PORT GF_DLL_FAR *port );
597: unsigned int GF_CONV PortMSWindowsGetMaskedEvents( PORT GF_DLL_FAR *port );
598: int GF_CONV PortEnableCommNotification( PORT GF_DLL_FAR *port,
599: HWND hwnd,
600: int in_notify,
601: int out_notify,
602: unsigned int event_mask );
603: #elif defined( GF_WIN32 )
604: PORT * GF_CONV PortOpenMSWin32( int port_number, long baud_rate,
605: char parity, int word_length,
606: int stop_bits );
607: unsigned int GF_CONV PortMSWin32GetEventMask( PORT *port );
608: HANDLE GF_CONV PortMSWin32GetCommHandle( PORT *port );
609: #endif
610:
611: void GF_CONV SetPortIdleFunctionPtr( PORT_HOOK idle_fn );
612: /* void GF_CONV SetPortIdleFunctionPtr( int (GF_CONV GF_DLL_FAR *f)( PORT GF_DLL_FAR *port) );
613: */
614: void GF_CONV SetUserErrorNameFunctionPtr( char *(GF_CONV GF_DLL_FAR *f)( int error ) );
615: void GF_CONV SetAbortModemFunctionPtr( PORT_HOOK abort_fn );
616: #ifdef VGFD
617: int GF_CONV InitGreenleaf( void );
618: int GF_CONV Get_COM1( void );
619: #endif
620:
621: #ifdef __cplusplus
622: }
623: #endif
624:
625: /*
626: * Things after this point are all in place in order to have compatibility
627: * with earlier versions of the CommLib. Feel free to delete everything
628: * from here down if you are not using any of the old function names.
629: */
630:
631: #define OFF 0
632: #define ON 1
633:
634: #define glcrc( l, c, b ) CalculateBlockCRC16( l, c, b ) /* Tag: Misc private */
635: #ifdef COMPAT32
636: #if COMPAT32 > 0
637: #error Compatibility with the 3.x versions of CommLib are no longer supported!
638: #endif
639: #endif
640:
641: /*
642: * _debug.h has macros and prototypes for the heap debugger. This will only
643: * be invoked for certain configurations when the _DEBUG macro is
644: * turned on. If memory debugging gets turned on, we set the macro
645: * GF_HEAP_DEBUGGER. If you want to build a debug library, but don't want
646: * to use our debugger, define GF_DISABLE_HEAP_DEBUGGER, and none of the
647: * stuff in _DEBUG.H will get turned on. You can define that constant
648: * in either your project, or the appropriate place in BUILD.INI.
649: */
650:
651: #include "_debug.h"
652:
653: #endif /* #ifndef COMMLIB_DOT_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.