egray@fthood.UUCP (01/15/90)
This is patch #7 to the Pcomm v1.2 distribution package. This patch will fix a few portability problems with Berkeley boxes, and will fix a few other odds and ends. Pcomm v1.2 appeared in comp.sources.unix as v20i067 thru v20i075 around the 27th of October 1989. Since then, patches #5 and #6 were posted to comp.sources.bugs. Both the "posted version" of Pcomm (version 1.2.4) and the 2 addititional patches are available via anonymous ftp from cerl.cecer.army.mil (129.229.1.101). Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV fthood!egray@uxc.cso.uiuc.edu Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057 ------------------------------------------------------------------------------ Prereq: "1.2.6" *** old/info.c Mon Dec 11 09:23:27 1989 --- info.c Wed Jan 3 09:55:43 1990 *************** *** 4,9 */ ! #define VERSION "1.2.6" ! #define DATE "8 Nov 89" #include <stdio.h> --- 4,9 ----- */ ! #define VERSION "1.2.7" ! #define DATE "13 Jan 90" #include <stdio.h> *** old/Makefile Wed Jan 10 08:12:02 1990 --- Makefile Wed Jan 10 08:11:02 1990 *************** *** 8,11 #TERMLIB = -ltinfo -lx #for 80286 versions of Microsoft Xenix 3.0/3.5 #CFLAGS = -O -Mme2 -Dresetterm=xresetterm -DXENIX_3 --- 8,17 ----- #TERMLIB = -ltinfo -lx + #for 80386 versions of SCO Xenix + #CFLAGS = -O -DM_TERMINFO + #LDFLAGS = -s + #CURSES = -ltinfo -lx + #TERMLIB = -ltinfo -lx + #for 80286 versions of Microsoft Xenix 3.0/3.5 #CFLAGS = -O -Mme2 -Dresetterm=xresetterm -DXENIX_3 *************** *** 14,17 CFLAGS = -O LDFLAGS = -s SHAR = shar -a BIN = /usr/local/bin --- 20,24 ----- CFLAGS = -O LDFLAGS = -s + #SHLIB = -lc_s SHAR = shar -a BIN = /usr/local/bin *************** *** 47,51 pcomm: $(PCOMM) ! $(CC) $(LDFLAGS) $(PCOMM) -o pcomm $(CURSES) pcomm_input: $(INPUT) --- 54,58 ----- pcomm: $(PCOMM) ! $(CC) $(LDFLAGS) $(PCOMM) -o pcomm $(CURSES) $(SHLIB) pcomm_input: $(INPUT) *************** *** 50,54 pcomm_input: $(INPUT) ! $(CC) $(LDFLAGS) $(INPUT) -o pcomm_input $(TERMLIB) waitfor: --- 57,61 ----- pcomm_input: $(INPUT) ! $(CC) $(LDFLAGS) $(INPUT) -o pcomm_input $(TERMLIB) $(SHLIB) waitfor: *************** *** 53,57 waitfor: ! $(CC) $(CFLAGS) $(BSD) $(LDFLAGS) waitfor.c -o waitfor matches: --- 60,64 ----- waitfor: ! $(CC) $(CFLAGS) $(BSD) $(LDFLAGS) waitfor.c -o waitfor $(SHLIB) matches: *************** *** 56,60 matches: ! $(CC) $(CFLAGS) $(LDFLAGS) matches.c -o matches modem_break: --- 63,67 ----- matches: ! $(CC) $(CFLAGS) $(LDFLAGS) matches.c -o matches $(SHLIB) modem_break: *************** *** 59,63 modem_break: ! $(CC) $(CFLAGS) $(BSD) $(LDFLAGS) modem_break.c -o modem_break install: --- 66,70 ----- modem_break: ! $(CC) $(CFLAGS) $(BSD) $(LDFLAGS) modem_break.c -o modem_break $(SHLIB) install: *************** *** 128,131 e_lib.o: extrnl.h expand.o: config.h help.o: config.h misc.h init.o: config.h misc.h status.h --- 135,139 ----- e_lib.o: extrnl.h expand.o: config.h + getopt.o: config.h help.o: config.h misc.h init.o: config.h misc.h status.h *************** *** 131,134 init.o: config.h misc.h status.h input.o: config.h misc.h status.h vcs.h ls_menu.o: config.h dial_dir.h misc.h param.h m_lib.o: modem.h --- 139,143 ----- init.o: config.h misc.h status.h input.o: config.h misc.h status.h vcs.h + list_dir.o: config.h misc.h ls_menu.o: config.h dial_dir.h misc.h param.h m_lib.o: modem.h *************** *** 147,151 s_modem.o: config.h misc.h modem.h s_prompt.o: config.h misc.h ! s_term.o: config.h misc.h param.h status.h s_tty.o: config.h misc.h modem.h screen.o: config.h param.h status.h --- 156,160 ----- s_modem.o: config.h misc.h modem.h s_prompt.o: config.h misc.h ! s_term.o: config.h dial_dir.h misc.h param.h status.h s_tty.o: config.h misc.h modem.h screen.o: config.h param.h status.h *** old/Readme Fri Jan 12 12:49:29 1990 --- Readme Fri Jan 12 12:54:19 1990 *************** *** 12,19 go. A good location might be /usr/local/lib/pcomm. ! 3) Copy the sample support files Pcomm.dial_dir, Pcomm.extrnl, ! Pcomm.modem, and Pcomm.param to the default directory and rename ! them to change the upper case "P" to a lower case "p". The files ! should *not* have write permission to all. 4) Copy (and rename as appropriate) the Pcomm.1, Waitfor.1, --- 12,20 ----- go. A good location might be /usr/local/lib/pcomm. ! 3) Copy (and rename to change the upper case 'P' to lower case) ! the four sample support files Pcomm.dial_dir, Pcomm.extrnl, ! Pcomm.modem, and Pcomm.param to the default directory. The ! files should *not* have write permission to all. Please ! remember these are just sample files... 4) Copy (and rename to change the upper case letters to lower *************** *** 17,23 should *not* have write permission to all. ! 4) Copy (and rename as appropriate) the Pcomm.1, Waitfor.1, ! Matches.1, and Modem_break.1 nroff manuals to the proper /usr/man ! directory. 5) Print the Doc file by piping the output of the Unix "pr" --- 18,24 ----- remember these are just sample files... ! 4) Copy (and rename to change the upper case letters to lower ! case) the on-line manual pages Pcomm.1, Waitfor.1, Matches.1, ! and Modem_break.1 to the proper /usr/man directory. 5) Print the Doc file by piping the output of the Unix "pr" *************** *** 210,213 return value. Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV --- 211,258 ----- return value. + Notes for Sun users... There are several problems that apparently only + surface with SunOS. Here are some notes to help out. + + 1) Pcomm was really designed to work in an AT&T world. If you + compile the code with the /usr/5bin/cc compiler, you'll end up + with a better product. To do so, you'll need to use default + config.h parameters (undef OLDCURSES and undef BSD) plus the + default Makefile parameters (CURSES, TERMLIB, and TTY). + + 2) Patch #5 introduced a new pre-processor definition in dial.c + called USLEEP. SunOS no longer supports the AT&T version of the + times() system call, so usleep() should be used to generate the + delay. + + 3) Some Sun users report that their version of curses (perhaps + limited to the sys5 version?) has a bug that henders the quick + transition between the "curses mode" and "terminal mode". If + you have troubles with Pcomm getting out-of-sync after a file + transfer here is hack to bludgeon the code into submission. I + have no idea why this works... + + change line 53 in terminal.c: + while (1) { + read(0, &c, 1); + c &= 0x7f; + to read: + while (1) { + c = getch(); + c &= 0x7f; + + Please don't use this unless you're having a problem! + + Note for some 4.2BSD and Ultrix 1.2 systems: + + Apparently, there is a bug in the /usr/include/curses.h file on + some systems that does not define the nl() and nonl() macros + correctly. If this is the case with your system, edit + /usr/include/curses.h to include the following: + + #undef nl + #undef nonl + #define nl() (_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty)) + #define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty)) + Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV *************** *** 212,216 Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV ! Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057 --- 257,261 ----- Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV ! fthood!egray@uxc.cso.uiuc.edu Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057 *** old/dial.c Mon Dec 11 09:23:28 1989 --- dial.c Fri Dec 22 12:32:46 1989 *************** *** 7,14 #include <stdio.h> - #ifndef USLEEP - #include <sys/types.h> - #include <sys/times.h> - #endif /* USLEEP */ #include "config.h" #include "dial_dir.h" --- 7,10 ----- #include <stdio.h> #include "config.h" #include "dial_dir.h" *************** *** 17,20 #include "param.h" #ifdef UNIXPC #include <sys/phone.h> --- 13,23 ----- #include "param.h" + #ifdef BSD + #include <sys/time.h> + #else /* BSD */ + #include <sys/types.h> + #include <sys/times.h> + #endif /* BSD */ + #ifdef UNIXPC #include <sys/phone.h> *************** *** 397,400 usleep(100000); #else /* USLEEP */ struct tms t; long t1; --- 400,415 ----- usleep(100000); #else /* USLEEP */ + /* Hey! I know these routines are a hack */ + #ifdef BSD + struct timeval tv; + struct timezone tz; + double t1; + + gettimeofday(&tv, &tz); + t1 = tv.tv_sec + (tv.tv_usec / 1000000.0); + do + gettimeofday(&tv, &tz); + while ((tv.tv_sec + (tv.tv_usec / 1000000.0) - t1) < 0.1); + #else /* BSD */ struct tms t; long t1; *************** *** 403,406 while ((times(&t) - t1) < HZ/10) ; #endif /* USLEEP */ return; --- 418,422 ----- while ((times(&t) - t1) < HZ/10) ; + #endif /* BSD */ #endif /* USLEEP */ return; *** old/e_lib.c Sun Dec 31 12:51:52 1989 --- e_lib.c Wed Jan 3 09:10:17 1990 *************** *** 141,144 char buf[200]; void error_win(); /* open for write */ if (!(fp = my_fopen(extrnl->e_path, "w"))) { --- 141,154 ----- char buf[200]; void error_win(); + + /* + * I don't remember why I made this file optional. For the next + * release, it will be mandatory! The following is kludge to tell + * the user that there is no file to save anything to. + */ + if (extrnl->e_path == NULL) { + error_win(0, "No \"pcomm.extrnl\" file in use", ""); + return(1); + } /* open for write */ if (!(fp = my_fopen(extrnl->e_path, "w"))) { *************** *** 144,148 if (!(fp = my_fopen(extrnl->e_path, "w"))) { sprintf(buf, "\"%s\"", extrnl->e_path); ! error_win(0, "No write permission on externl program file", buf); return(1); } --- 154,158 ----- if (!(fp = my_fopen(extrnl->e_path, "w"))) { sprintf(buf, "\"%s\"", extrnl->e_path); ! error_win(0, "No write permission on external program file", buf); return(1); } *** old/init.c Thu Dec 21 11:16:08 1989 --- init.c Thu Dec 21 11:16:25 1989 *************** *** 29,33 int mode; extern int shm_id; ! char *shmat(), *memset(); void perror(), exit(); --- 29,33 ----- int mode; extern int shm_id; ! char *memset(); void perror(), exit(); *** old/input.c Thu Dec 21 11:16:08 1989 --- input.c Thu Dec 21 11:16:44 1989 *************** *** 56,60 #ifdef SHAREDMEM int shm_id; - char *shmat(); void perror(); #endif /* SHAREDMEM */ --- 56,59 ----- #ifdef SHAREDMEM int shm_id; void perror(); #endif /* SHAREDMEM */ *** old/main.c Mon Dec 11 09:23:27 1989 --- main.c Wed Jan 3 09:55:30 1990 *************** *** 19,22 * Patch #5 30 Oct 89 * Patch #6 8 Nov 89 */ --- 19,23 ----- * Patch #5 30 Oct 89 * Patch #6 8 Nov 89 + * Patch #7 13 Jan 90 */ *** old/terminal.c Thu Dec 21 12:01:08 1989 --- terminal.c Fri Dec 22 11:57:58 1989 *************** *** 16,19 #ifdef BSD #include <sys/file.h> #else /* BSD */ --- 16,22 ----- #ifdef BSD + #ifndef SIGCLD + #define SIGCLD SIGCHLD + #endif /* SIGCLD */ #include <sys/file.h> #else /* BSD */ *************** *** 328,332 write(fd, &lf, 1); /* ! * Since you don't type it... it doesn't get echoed * by the driver. */ --- 331,335 ----- write(fd, &lf, 1); /* ! * Since you didn't type it... it doesn't get echoed * by the driver. */ *** old/tty_ucb.c Fri Dec 22 08:35:00 1989 --- tty_ucb.c Wed Jan 3 09:36:07 1990 *************** *** 104,109 ioctl(0, TIOCGETP, &tbuf); ! tbuf.sg_flags |= CBREAK; ! tbuf.sg_flags &= ~(RAW|CRMOD|ECHO); if (dir->duplex[dir->d_cur] == 'H') --- 104,109 ----- ioctl(0, TIOCGETP, &tbuf); ! tbuf.sg_flags |= RAW; ! tbuf.sg_flags &= ~(CRMOD|ECHO); if (dir->duplex[dir->d_cur] == 'H') *************** *** 171,175 /* * Flush the file descriptor. Very messy... flushing the input causes a ! * wait for the ouput to drain, and there is no output flushing. */ --- 171,175 ----- /* * Flush the file descriptor. Very messy... flushing the input causes a ! * wait for the output to drain, and there is no output flushing. */ *** old/vcs.c Mon Dec 11 09:23:28 1989 --- vcs.c Wed Jan 3 09:37:11 1990 *************** *** 175,179 * Notice that the "%p1" and "%p2" parameters get translated to 2000 and * 2001. This is to signify that the parameters are multiple digit ASCII ! * encoded numbers. The "%i" and "%d" codes are imbedded into the vcs_opt[] * array in somewhat of a loose manner. In other words, there is no set * format for the vcs_opt[] array. The padding info "$<5>" is ignored. --- 175,179 ----- * Notice that the "%p1" and "%p2" parameters get translated to 2000 and * 2001. This is to signify that the parameters are multiple digit ASCII ! * encoded numbers. The "%i" and "%d" codes are embedded into the vcs_opt[] * array in somewhat of a loose manner. In other words, there is no set * format for the vcs_opt[] array. The padding info "$<5>" is ignored. *************** *** 294,298 fake_it(tgoto(cursor_address, 12, 34)); #else /* OLDCURSES */ ! fake_it(tparm(cursor_address, 12, 34)); #endif /* OLDCURSES */ --- 294,298 ----- fake_it(tgoto(cursor_address, 12, 34)); #else /* OLDCURSES */ ! fake_it((char *)tparm(cursor_address, 12, 34)); #endif /* OLDCURSES */ *************** *** 340,344 fake_it(tgoto(cursor_address, 13, 34)); #else /* OLDCURSES */ ! fake_it(tparm(cursor_address, 13, 34)); #endif /* OLDCURSES */ /* where are they different */ --- 340,344 ----- fake_it(tgoto(cursor_address, 13, 34)); #else /* OLDCURSES */ ! fake_it((char *)tparm(cursor_address, 13, 34)); #endif /* OLDCURSES */ /* where are they different */ *************** *** 365,369 fake_it(tgoto(cursor_address, 12, 35)); #else /* OLDCURSES */ ! fake_it(tparm(cursor_address, 12, 35)); #endif /* OLDCURSES */ /* where are they different */ --- 365,369 ----- fake_it(tgoto(cursor_address, 12, 35)); #else /* OLDCURSES */ ! fake_it((char *)tparm(cursor_address, 12, 35)); #endif /* OLDCURSES */ /* where are they different */ End Of Patch