📄 tinytc3.sha
字号:
13 casyncms.h
/* CASYNCMS.H - entry points in casycms
|===================================================================|
| My changes can be considered public domain. Geof's statement |
| will cover everything. |
| - Rick Rodman 09/02/97 |
|===================================================================|
930811 rr orig file
941009 rr change types from char to int
*/
int Far inp_status P(( void ));
void Far inp_flush P(( void ));
void Far init_comm P(( void ));
void Far uninit_comm P(( void ));
int Far inp_char P(( void ));
void Far outp_char P(( int c ));
/* end of casyncms.h */
19 fileio.h
/* FILEIO.H - definitions for simple file I/O
940513 rr initial file
*/
#define MY_OPEN_READ 0
#define MY_OPEN_WRITE 1
/* watch the syntax on this one */
#define FH Void *
FH my_open P(( char *p_filename, int open_mode ));
Void my_close P(( FH fh ));
unsigned short my_read
P(( FH fh, unsigned char *p_buffer, unsigned short u_bytes ));
unsigned short my_write
P(( FH fh, unsigned char *p_buffer, unsigned short u_bytes ));
/* end of fileio.h */
94 options.h
/* OPTIONS.H - Compiling options
940807 rr orig file
940925 rr add Far
Eco-C: 6 character limit; does not have 'unsigned long' or 'unsigned short'.
No typedef.
Function predeclarations cause the compiler to crash, even if they
are ifdef'd out.
Function calls thru pointers apparently don't work ("illegal
function call").
BDS C (1.42): Conditional compilation doesn't appear to work; at least, it
doesn't disable #include directives.
*/
/* ----- Machine type ----------------------------------------------- */
/* This is used in a few places, e.g. for selecting real-time
clock logic */
/* #define PC */
#define XEROX820
/* #define KAYPRO */
/* #define ECO */ /* Eco-C Z-80 compiler */
#define Z80
/* ----- configuration ---------------------------------------------- */
/* define ETHERNET if using Ethernet */
/* #define ETHERNET */
/* define BIG_ENDIAN if using Motorola CPU */
/* #define BIG_ENDIAN */
/* this end's internet address */
#ifdef PC
#define MY_ADDR ADDR( 192, 9, 201, 2 )
#endif
#ifdef XEROX820
#define MY_ADDR ADDR( 192, 9, 201, 3 )
#endif
#ifdef KAYPRO
#define MY_ADDR ADDR( 192, 9, 201, 4 )
#endif
#define HOST_ADDR ADDR( 192, 9, 201, 2 )
/* ----- S8 --------------------------------------------------------- */
#ifdef Z80
#define S8 static
#else
#define S8
#endif
/* ----- Prototype -------------------------------------------------- */
/* uncomment following for compilers allowing prototypes */
#define P(x) x
/* uncomment following for compilers not allowing prototypes */
/* #define P(x) () */
/* ----- Void ------------------------------------------------------- */
/* uncomment following for compilers supporting void datatype */
#define Void void
/* uncomment following for compilers not supporting void datatype */
/* #define Void */
/* ----- Far -------------------------------------------------------- */
#ifdef PC
#define Far far
#else
#define Far
#endif
/* ----- Use typedefs? ---------------------------------------------- */
#define USE_TYPEDEFS
/* end of options.h */
110 proto.h
/* PROTO.H - function prototypes for tiny-tcp
931208 rr orig file
940424 rr minor changes
Notes:
Eco-C doesn't like Void, and having functions predeclared with no type
makes the compiler lock up.
Personally, I'd rather have all the functions return success/failure
anyway. (941010 rr)
*/
/* in arp.c */
int sar_CheckPacket P(( struct arp_Header *ap ));
int sar_MapIn2Eth P(( Longword ina, struct Ethernet_Address *ethap ));
/* in sed.c or sedslip.c */
int sed_Init P(( Void ));
int sed_Deinit P(( Void ));
Byte * sed_FormatPacket P(( Byte *destEAddr, int ethType ));
int sed_Send P(( int pkLengthInOctets ));
int sed_Receive P(( Byte *recBufLocation ));
Byte * sed_IsPacket P(( Void ));
int sed_CheckPacket P(( Word *recBufLocation, Word expectedType ));
/* in tinytcp.c */
Void tcp_Init P(( Void ));
#ifdef USE_TYPEDEFS
Void tcp_Open P(( struct tcp_Socket *s, Word lport, IP_Address ina,
Word port, Procref datahandler ));
#else
Void tcp_Open P(( struct tcp_Socket *s, Word lport, IP_Address ina,
Word port, int ( *datahandler )( void *s, Byte *dp, int len ) ));
#endif
#ifdef USE_TYPEDEFS
Void tcp_Listen P(( struct tcp_Socket *s, Word port, Procref datahandler,
Longword timeout ));
#else
Void tcp_Listen P(( struct tcp_Socket *s, Word port,
int ( *datahandler )( void *s, Byte *dp, int len ),
Longword timeout ));
#endif
Void tcp_Close P(( struct tcp_Socket *s ));
Void tcp_Abort P(( struct tcp_Socket *s ));
#ifdef USE_TYPEDEFS
int tcp P(( Procrefv application ));
#else
int tcp P(( void ( *application )( void ) ));
#endif
int tcp_Write P(( struct tcp_Socket *s, Byte *dp, int len ));
#ifndef ECO
Void tcp_Flush P(( struct tcp_Socket *s ));
#endif
#ifndef BIG_ENDIAN
Word rev_word P(( Word w ));
Longword rev_longword P(( Longword l ));
#endif
/* redefine move as memcpy */
#define Move(s,d,n) memcpy(d,s,n)
/* the following are internal to TCP, but because it was broken
into chunks, they had to become global */
Void tcp_Unthread P(( struct tcp_Socket *ds ));
Void tcp_Retransmitter P(( Void ));
Void tcp_ProcessData P(( struct tcp_Socket *s,
struct tcp_Header *tp, int len ));
Void tcp_Send P(( struct tcp_Socket *s ));
Void tcp_DumpHeader P(( struct in_Header *ip,
struct tcp_Header *tp, char *mesg ));
Void tcp_Handler P(( struct in_Header *ip ));
Word checksum P(( Word *dp, int length ));
Longword lchecksum P(( Word *dp, int length ));
/* in tinyftp.c */
Void ftp_ctlHandler P(( struct tcp_Socket *s, Byte *dp, int len ));
Void ftp_dataHandler P(( struct tcp_Socket *s, Byte *dp, int len ));
Void ftp_commandLine P(( Void ));
Void ftp_Abort P(( Void ));
Void ftp_application P(( Void ));
Void ftp P(( IP_Address host ));
/* in tinyft2.c */
Void ftp_server_handler P(( struct tcp_Socket *s, Byte *dp, int len ));
/* in tinyft4.c */
Void ftp_local_command P(( char *s ));
/* in main.c */
Void main P(( int argc, char **argv ));
Longword MsecClock P(( Void ));
/* end of proto.h */
74 sed.h
/*
* Header file for very simple ethernet driver, based on 3Com Multibus
* board.
*
* Copyright (C) 1986, IMAGEN Corporation
* "This code may be duplicated in whole or in part provided that [1] there
* is no commercial gain involved in the duplication, and [2] that this
* copyright notice is preserved on all copies. Any other duplication
* requires written notice of the author."
*/
#define en10size (8*1024) /* size of interface memory */
#define en10pages ((en10size) >> pageshift)
#define E10P_MIN 60 /* Minimum Ethernet packet size */
/*
* The position of the 3Com interface in virtual memory. If we're
* Running the bootloader function, then it must be in the last 8k
* of virtual addresses.
*/
#ifdef BOOTLOADER
#define SED3CVA vm_3ComAdr /* hack, only need pb68.h if bootloader */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -