diff -c libdtm/arch.h libdtm.new/arch.h *** libdtm/arch.h Fri Oct 22 15:58:42 1993 --- libdtm.new/arch.h Thu Oct 21 06:37:10 1993 *************** *** 233,239 **** # define _ARCH_BIG_ENDIAN # define _ARCH_68000 # define _ARCH_WORD_SIZE 32 ! #elif defined ( MS_DOS ) || defined(__TURBOC__) # define _ARCH_MSDOS # define _ARCH_8086 # define _ARCH_LITTLE_ENDIAN --- 233,239 ---- # define _ARCH_BIG_ENDIAN # define _ARCH_68000 # define _ARCH_WORD_SIZE 32 ! #elif defined ( MS_DOS ) || defined(__TURBOC__) || defined(DESQ) /* POHC */ # define _ARCH_MSDOS # define _ARCH_8086 # define _ARCH_LITTLE_ENDIAN diff -c libdtm/callback.c libdtm.new/callback.c *** libdtm/callback.c Fri Oct 22 15:58:42 1993 --- libdtm.new/callback.c Thu Oct 21 06:37:12 1993 *************** *** 25,30 **** --- 25,31 ---- #include #endif #include + #include "arch.h" /* POHC added */ #ifdef _ARCH_BSD #include #endif *************** *** 33,43 **** --- 34,49 ---- #else # include #endif + #if !defined(__HIGHC__) && !defined(__WATCOMC__) /* POHC */ #include + #endif #include #include "dtmint.h" #include "debug.h" + #ifdef __GO32__ /* POHC */ + static void DTMsigioHandler(int sig) + #else #ifdef DTM_PROTOTYPES static void DTMsigioHandler(int sig,int code,struct sigcontext *scp,char *addr ) #else *************** *** 47,52 **** --- 53,59 ---- struct sigcontext *scp; char *addr; #endif + #endif { /* Unfortunately, not one of the parameters listed above *************** *** 59,65 **** /* DBGMSG2( "DTMsigioHandler enter %X %X\n", code, addr); */ for ( i = 0 ; i < DTMptCount ; i++ ) { ! int port; int ready; if ( !DTMpt[i] ) continue; if ( !DTMpt[i]->callback ) continue; --- 66,72 ---- /* DBGMSG2( "DTMsigioHandler enter %X %X\n", code, addr); */ for ( i = 0 ; i < DTMptCount ; i++ ) { ! int32 port; /* POHC Was int */ int ready; if ( !DTMpt[i] ) continue; if ( !DTMpt[i]->callback ) continue; *************** *** 87,92 **** --- 94,100 ---- { int flags; DBGMSG1( "dtm_sigio on fd %d\n", fd ); + #ifndef DESQ /* POHC could this be done with ioctl? */ if (flags = fcntl( fd, F_SETOWN, getpid()) == -1 ) { DTMerrno = DTMSOCK; return DTMERROR; *************** *** 95,100 **** --- 103,111 ---- DTMerrno = DTMSOCK; return DTMERROR; } + #else + printf("rem'd out fcntl, was fd a socket? %d\n",issock(fd)); + #endif return DTM_OK; } diff -c libdtm/dtm.c libdtm.new/dtm.c *** libdtm/dtm.c Fri Oct 22 15:58:46 1993 --- libdtm.new/dtm.c Thu Oct 21 06:37:16 1993 *************** *** 255,261 **** #include #include #include "arch.h" ! #ifdef _ARCH_MSDOS #include #include #include "uio.h" --- 255,261 ---- #include #include #include "arch.h" ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #include #include "uio.h" *************** *** 270,275 **** --- 270,279 ---- #include #endif + #ifdef DESQ /* POHC */ + #include + #endif + #ifndef _ARCH_MACOS # if defined( _ARCH_CONVEX ) || defined( NEXT ) # include *************** *** 486,492 **** if( (pp->qservice == DTM_SYNC) || ((pp->qservice == DTM_ASYNC) && (dtm_select( pcur->connfd, &tmp, 0 ) == TRUE && tmp >= 4))) { do { ! int temp; if( dtm_recv_ack( pcur->connfd, &temp ) == DTMERROR) { DBGFLOW( "Incorrect ack for header\n" ); CHECK_ERR( destroy_out_port( pp, &pcur )); --- 490,496 ---- if( (pp->qservice == DTM_SYNC) || ((pp->qservice == DTM_ASYNC) && (dtm_select( pcur->connfd, &tmp, 0 ) == TRUE && tmp >= 4))) { do { ! int32 temp; /* POHC was int */ if( dtm_recv_ack( pcur->connfd, &temp ) == DTMERROR) { DBGFLOW( "Incorrect ack for header\n" ); CHECK_ERR( destroy_out_port( pp, &pcur )); *************** *** 759,765 **** { int p = (int) client_data; DTMPORT * pp = DTMpt[p]; ! int p_ext = p; dtm_map_port_external( &p_ext ); if ( DTMavailRead( p_ext ) == DTM_PORT_READY ) --- 763,769 ---- { int p = (int) client_data; DTMPORT * pp = DTMpt[p]; ! int32 p_ext = p; /* POHC was int */ dtm_map_port_external( &p_ext ); if ( DTMavailRead( p_ext ) == DTM_PORT_READY ) *************** *** 1176,1182 **** { Inport * inp = pp->nextToRead; int count; ! int ack ; if ( inp == NULL || !inp->fCTSsent || inp->fGotHeader ) { DTMerrno = DTMCALL; --- 1180,1186 ---- { Inport * inp = pp->nextToRead; int count; ! int32 ack ; /* POHC */ if ( inp == NULL || !inp->fCTSsent || inp->fGotHeader ) { DTMerrno = DTMCALL; *************** *** 1574,1580 **** if( !(pcur->availwrite) ) { ! int ack ; int nf ; if ( pp->qservice == DTM_SYNC && !(pcur->seqstart) ) { --- 1578,1584 ---- if( !(pcur->availwrite) ) { ! int32 ack ; /* POHC */ int nf ; if ( pp->qservice == DTM_SYNC && !(pcur->seqstart) ) { diff -c libdtm/dtm.h libdtm.new/dtm.h *** libdtm/dtm.h Fri Oct 22 15:58:46 1993 --- libdtm.new/dtm.h Thu Oct 21 06:37:16 1993 *************** *** 148,154 **** #include #ifndef ARCH_INC ! #include "arch.h" #endif #if defined( _ARCH_PROTO ) --- 148,158 ---- #include #ifndef ARCH_INC ! #include ! #endif ! ! #ifdef DESQ /* POHC */ ! #include /* caddr_t */ #endif #if defined( _ARCH_PROTO ) diff -c libdtm/dtminit.c libdtm.new/dtminit.c *** libdtm/dtminit.c Fri Oct 22 15:58:46 1993 --- libdtm.new/dtminit.c Thu Oct 21 06:37:18 1993 *************** *** 148,156 **** --- 148,160 ---- #include #include #ifndef _ARCH_MACOS + #if defined(__HIGHC__) || defined(__WATCOMC__) + # include + #else # include #endif #include + #endif #ifndef _ARCH_MACOS # if defined(CONVEX) || defined(NEXT) *************** *** 507,513 **** int qservice ; #endif { ! int port; int fLogicalName = FALSE; DBGFLOW("DTMmakeInPort called.\n"); --- 511,517 ---- int qservice ; #endif { ! int32 port; /* POHC */ int fLogicalName = FALSE; DBGFLOW("DTMmakeInPort called.\n"); *************** *** 548,554 **** int qservice ; #endif { ! int port; int fLogicalName = TRUE; S_ADDR addr; --- 552,558 ---- int qservice ; #endif { ! int32 port; /* POHC was int */ int fLogicalName = TRUE; S_ADDR addr; diff -c libdtm/dtmint.h libdtm.new/dtmint.h *** libdtm/dtmint.h Fri Oct 22 15:58:48 1993 --- libdtm.new/dtmint.h Thu Oct 21 06:37:20 1993 *************** *** 141,147 **** #include #endif #ifndef IPPROTO_IP ! #ifdef _ARCH_MSDOS # include #else # include --- 141,147 ---- #include #endif #ifndef IPPROTO_IP ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ # include #else # include *************** *** 393,399 **** global DTMerr DTMerrno INIT( DTM_OK ); global char * dtm_discard INIT( NULL ); ! extern int (*DTMconvertRtns[]) PROTO(( int, VOIDPTR, int )); /* global options */ --- 393,399 ---- global DTMerr DTMerrno INIT( DTM_OK ); global char * dtm_discard INIT( NULL ); ! global int (*DTMconvertRtns[]) PROTO(( int, VOIDPTR, int )); /* POHC Was extern */ /* global options */ *************** *** 448,455 **** int32 time )); extern int dtm_accept PROTO(( int fd, S_ADDR * sn, struct timeval * timeout )); ! extern int dtm_connect PROTO(( S_ADDR * sn, int * sockret )); ! extern int dtm_quick_connect PROTO(( S_ADDR * sn, int * sockret )); extern int dmt_end_connect PROTO(( int32 socket )); extern unsigned long dtm_get_ipaddr PROTO(( char * ipaddrstr )); extern int dtm_socket_init PROTO(( S_ADDR * sockaddr, int porttype, --- 448,455 ---- int32 time )); extern int dtm_accept PROTO(( int fd, S_ADDR * sn, struct timeval * timeout )); ! extern int dtm_connect PROTO(( S_ADDR * sn, int32 * sockret )); /* POHC */ ! extern int dtm_quick_connect PROTO(( S_ADDR * sn, int32 * sockret )); /* POHC */ extern int dmt_end_connect PROTO(( int32 socket )); extern unsigned long dtm_get_ipaddr PROTO(( char * ipaddrstr )); extern int dtm_socket_init PROTO(( S_ADDR * sockaddr, int porttype, diff -c libdtm/dtmmisc.c libdtm.new/dtmmisc.c *** libdtm/dtmmisc.c Fri Oct 22 15:58:48 1993 --- libdtm.new/dtmmisc.c Thu Oct 21 06:37:22 1993 *************** *** 67,73 **** #include #include #include ! #ifdef _ARCH_MSDOS #include #else #include --- 67,73 ---- #include #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #else #include diff -c libdtm/dtmnserv.c libdtm.new/dtmnserv.c *** libdtm/dtmnserv.c Fri Oct 22 15:58:48 1993 --- libdtm.new/dtmnserv.c Thu Oct 21 06:37:24 1993 *************** *** 48,54 **** #include #include #include ! #ifdef _ARCH_MSDOS #include #include "uio.h" #else --- 48,54 ---- #include #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #include "uio.h" #else diff -c libdtm/fatal.c libdtm.new/fatal.c *** libdtm/fatal.c Fri Oct 22 15:58:48 1993 --- libdtm.new/fatal.c Thu Oct 21 06:37:24 1993 *************** *** 68,74 **** #include #include ! #ifdef _ARCH_MSDOS #include #else #include --- 68,74 ---- #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #else #include Only in libdtm.new: libdtm.a diff -c libdtm/ninit.c libdtm.new/ninit.c *** libdtm/ninit.c Fri Oct 22 15:58:50 1993 --- libdtm.new/ninit.c Thu Oct 21 06:37:26 1993 *************** *** 48,54 **** #include #include ! #ifdef _ARCH_MSDOS #include #else #include --- 48,54 ---- #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #else #include diff -c libdtm/nmsg.c libdtm.new/nmsg.c *** libdtm/nmsg.c Fri Oct 22 15:58:50 1993 --- libdtm.new/nmsg.c Thu Oct 21 06:37:28 1993 *************** *** 56,62 **** #include #include #include ! #ifdef _ARCH_MSDOS #include #include #include "uio.h" --- 56,62 ---- #include #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #include #include "uio.h" *************** *** 270,276 **** /* Prepare MREG, send it */ inaddr.s_addr = sockaddr -> sin_addr.s_addr ; ! #ifdef _ARCH_MSDOS sprintf( mbuf, MREG, MREGID, refname, portname, inet_ntoa( inaddr.s_addr ), ntohs( sockaddr -> sin_port ) ); #else --- 270,276 ---- /* Prepare MREG, send it */ inaddr.s_addr = sockaddr -> sin_addr.s_addr ; ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ sprintf( mbuf, MREG, MREGID, refname, portname, inet_ntoa( inaddr.s_addr ), ntohs( sockaddr -> sin_port ) ); #else *************** *** 298,304 **** char *buffer; #endif { ! int count; if( dtm_quick_select(fd, &count) ) return dtm_recv_header(fd, buffer, len); --- 298,304 ---- char *buffer; #endif { ! int32 count; /* POHC was int */ if( dtm_quick_select(fd, &count) ) return dtm_recv_header(fd, buffer, len); diff -c libdtm/rwrtns.c libdtm.new/rwrtns.c *** libdtm/rwrtns.c Fri Oct 22 15:58:50 1993 --- libdtm.new/rwrtns.c Thu Oct 21 06:37:30 1993 *************** *** 100,106 **** #include #include ! #ifdef _ARCH_MSDOS #include #include #include "uio.h" --- 100,106 ---- #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #include #include "uio.h" *************** *** 107,117 **** --- 107,125 ---- #else #include #include + #ifdef DESQ /* POHC must fix this by adding msghdr et. al. */ + #include "uio.h" + #else #include + #endif #include #endif #include + #ifdef DESQ /* POHC socket errors are not a part of DOS compilers' s */ + #include + #else #include + #endif #include #ifdef RS6000 *************** *** 187,193 **** } else { ! ioctl(d, FIONREAD, &num); if (num < length) { DTMerrno = DTMTIMEOUT; return DTMERROR; --- 195,201 ---- } else { ! ioctl(d, FIONREAD, (long *)&num); /* POHC arg 3 is normally a (long *) */ if (num < length) { DTMerrno = DTMTIMEOUT; return DTMERROR; *************** *** 397,403 **** /* get header length */ ! if( (readcnt = recvfrom(d, &headerlen, 4, 0, ( struct sockaddr *)&from, ( int *)&fromlen)) != 4) { /* somehow hit EOF, return DTMEOF instead */ --- 405,411 ---- /* get header length */ ! if( (readcnt = recvfrom(d, (char *)&headerlen, 4, 0, ( struct sockaddr *)&from, /* POHC arg 2 is (char *) */ ( int *)&fromlen)) != 4) { /* somehow hit EOF, return DTMEOF instead */ *************** *** 475,485 **** say DTMFCONN ( DTM connection failed error ) */ #ifdef DTM_PROTOTYPES ! int dtm_recv_ack(int d,int *ack ) #else int dtm_recv_ack( d, ack ) int d; ! int *ack; #endif { int tmp ; --- 483,493 ---- say DTMFCONN ( DTM connection failed error ) */ #ifdef DTM_PROTOTYPES ! int dtm_recv_ack(int d,int32 *ack ) #else int dtm_recv_ack( d, ack ) int d; ! int32 *ack; /* POHC */ #endif { int tmp ; *************** *** 489,495 **** /* there should be no possibility of blocking after this call */ CHECK_ERR(ready_bytes(d, 4)); ! if( (tmp = recv( d, ack, 4, 0 )) != 4 ) { DBGINT( "Recv_ack errno = %d\n", errno ) ; if( tmp == 0 ) /* Courtesy Berkeley */ --- 497,503 ---- /* there should be no possibility of blocking after this call */ CHECK_ERR(ready_bytes(d, 4)); ! if( (tmp = recv( d, (char *)ack, 4, 0 )) != 4 ) { /* POHC arg 2 is (char *) */ DBGINT( "Recv_ack errno = %d\n", errno ) ; if( tmp == 0 ) /* Courtesy Berkeley */ *************** *** 622,628 **** --- 630,640 ---- msgbuf.msg_iovlen = iovlen ; msgbuf.msg_accrights = 0 ; + #ifdef DESQ /* POHC */ + printf("Need sendmsg()!!\n"); + #else if( (tmp = sendmsg( fd, &msgbuf, 0 )) != iovsize ) + #endif return dtm_writev_failed( fd, &msgbuf, tmp ); DBGINT( "dtm_writev_buffer tmp = %d\n", tmp ); diff -c libdtm/sds.c libdtm.new/sds.c *** libdtm/sds.c Fri Oct 22 15:58:52 1993 --- libdtm.new/sds.c Thu Oct 21 06:37:30 1993 *************** *** 83,89 **** #include #include #include ! #ifdef _ARCH_MSDOS #include #else #include --- 83,89 ---- #include #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #else #include diff -c libdtm/socket.c libdtm.new/socket.c *** libdtm/socket.c Fri Oct 22 15:58:52 1993 --- libdtm.new/socket.c Thu Oct 21 06:37:34 1993 *************** *** 136,142 **** #include #include #include ! #ifdef _ARCH_MSDOS #include #include #include --- 136,142 ---- #include #include #include ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #include #include *************** *** 157,172 **** #include #endif ! #ifdef _ARCH_MSDOS #include #else #include #include #include #include #endif #include ! #include "dtmint.h" --- 157,177 ---- #include #endif ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ #include #else #include + #ifndef DESQ /* POHC dvx has no tcp.h. */ #include + #endif #include #include #endif + #ifdef DESQ /* POHC dvx has it's sys\errno which includes errno.h */ + #include + #else #include ! #endif #include "dtmint.h" *************** *** 211,221 **** Check whether a socket (s) has count bytes ready. */ #ifdef DTM_PROTOTYPES ! int dtm_quick_select(int s,int *count) #else int dtm_quick_select(s, count) int s; ! int *count; #endif { fd_set filedes; --- 216,226 ---- Check whether a socket (s) has count bytes ready. */ #ifdef DTM_PROTOTYPES ! int dtm_quick_select(int s,int32 *count) #else int dtm_quick_select(s, count) int s; ! int32 *count; /* POHC */ #endif { fd_set filedes; *************** *** 335,345 **** returns DTMERROR on failure. DTM_OK on success. */ #ifdef DTM_PROTOTYPES ! int dtm_connect(S_ADDR *sn,int *s) #else int dtm_connect(sn, s) S_ADDR *sn; ! int *s; #endif { int d; --- 340,350 ---- returns DTMERROR on failure. DTM_OK on success. */ #ifdef DTM_PROTOTYPES ! int dtm_connect(S_ADDR *sn,int32 *s) #else int dtm_connect(sn, s) S_ADDR *sn; ! int32 *s; /* POHC */ #endif { int d; *************** *** 393,403 **** dtm_quick_connect() */ #ifdef DTM_PROTOTYPES ! int dtm_quick_connect(S_ADDR *sn,int *s) #else int dtm_quick_connect(sn, s) S_ADDR *sn; ! int *s; #endif { int d; --- 398,408 ---- dtm_quick_connect() */ #ifdef DTM_PROTOTYPES ! int dtm_quick_connect(S_ADDR *sn,int32 *s) /* POHC was int */ #else int dtm_quick_connect(sn, s) S_ADDR *sn; ! int32 *s; #endif { int d; *************** *** 446,453 **** int s; #endif { ! struct linger lbuf ; DBGFLOW("# dtm_end_connect called.\n"); DBGINT( "dtm_end_connect: sockfd %d\n", s ); --- 451,459 ---- int s; #endif { ! #if 0 /* POHC */ struct linger lbuf ; + #endif DBGFLOW("# dtm_end_connect called.\n"); DBGINT( "dtm_end_connect: sockfd %d\n", s ); *************** *** 513,519 **** { struct in_addr inaddr ; ! #ifdef _ARCH_MSDOS inaddr = *((struct in_addr *)( hp -> h_addr)) ; strcpy( ipaddrstr , inet_ntoa( inaddr.s_addr )); #else --- 519,525 ---- { struct in_addr inaddr ; ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ inaddr = *((struct in_addr *)( hp -> h_addr)) ; strcpy( ipaddrstr , inet_ntoa( inaddr.s_addr )); #else *************** *** 726,732 **** DTMerrno = DTMHOST ; return DTMERROR ; } else { ! #ifdef _ARCH_MSDOS saddr_temp = ((struct in_addr *)(hp->h_addr))->s_addr; #else saddr_temp = ((struct in_addr *)(hp->h_addr_list[0]))->s_addr; --- 732,738 ---- DTMerrno = DTMHOST ; return DTMERROR ; } else { ! #if defined(_ARCH_MSDOS) && !defined(DESQ) /* POHC */ saddr_temp = ((struct in_addr *)(hp->h_addr))->s_addr; #else saddr_temp = ((struct in_addr *)(hp->h_addr_list[0]))->s_addr; diff -c libdtm/uio.h libdtm.new/uio.h *** libdtm/uio.h Fri Oct 22 15:58:52 1993 --- libdtm.new/uio.h Thu Oct 21 06:37:34 1993 *************** *** 46,52 **** --- 46,56 ---- #include + #ifdef DESQ /* POHC should'nt be in this file anyway. */ + #include + #else typedef char far *caddr_t; + #endif struct iovec { caddr_t iov_base; .