Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com X-Authentication-Warning: eskimo.com: ewu owned process doing -bs Date: Tue, 6 Mar 2001 21:37:43 -0800 (PST) From: Enoch Wu To: cygwin-apps AT cygwin DOT com Subject: Minicom 1.83.1 patch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, Here is a patch. The program should run well. Select() is a bit strange, requiring 2 calls on Cygwin where only one call is compiled under Linux. Well, I'm not complaining -- just puzzled. If any one can tell me why, please do so. --- cut here ----8<------------------------------------ diff -Naur orig/minicom-1.83.1/src/Makefile cygp/minicom-1.83.1/src/Makefile --- orig/minicom-1.83.1/src/Makefile Tue Apr 25 08:42:32 2000 +++ cygp/minicom-1.83.1/src/Makefile Tue Feb 27 08:15:00 2001 @@ -22,7 +22,7 @@ # enochw AT scn DOT org Oct 99: flags for UWIN 2.0 (Unix for Windows) # Where to install things for Linux sites (FSSTND) -BINDIR = /usr/bin +BINDIR = /usr/local/bin LIBDIR = /etc DOCDIR = /usr/doc/minicom MANDIR = /usr/man/man1 @@ -40,11 +40,12 @@ # -D_I18N_ - Internationalization and localized text strings # see file "../doc/Locales" # -OPFLAGS = -D_HISTORY -D_HAVE_MACROS -D_SEARCH_HISTORY -D_I18N_ +OPFLAGS = -D_HISTORY -D_HAVE_MACROS -D_SEARCH_HISTORY +# -D_I18N_ # Remove if you don't have gettext and don't want to install it and use # the localized strings -PO = po +# PO = po # Where to install things for FreeBSD sites. # BINDIR = /usr/local/bin @@ -60,11 +61,11 @@ # MANDIR = /usr/local/man/man1 # Take these compilation flags for Linux with libncurses. -FLAGS = -Wall -D_POSIX -D_SYSV -D_SELECT -pipe # -I/usr/include/ncurses -PROGS = minicom runscript ascii-xfr -LFLAGS = -s -LIBS = -lncurses #-lintl -CC = cc +# FLAGS = -g -Wall -D_POSIX -D_SYSV -D_SELECT -pipe # -I/usr/include/ncurses +# PROGS = minicom runscript ascii-xfr +# LFLAGS = -s +# LIBS = -lncurses #-lintl +# CC = gcc # Take these compilation flags for FreeBSD. #FLAGS = -Wall -D_POSIX -D_BSD43 -D_SELECT -D_DCDFLOW @@ -111,6 +112,13 @@ #LIBS = -lcurses #CC = gcc +# Take these compilation flags for Cygwin 1.x.x +FLAGS = -g -Wall -D_POSIX -D_SYSV -D_SELECT -pipe -DDEBUG_ME +PROGS = minicom runscript ascii-xfr +LFLAGS = +LIBS = -ltermcap -lm +CC = gcc + # ========== Everything below this line is not well-tested. =========== # Take these flags for DG/UX (Data General/UX). @@ -206,19 +214,19 @@ all: $(PROGS) $(PO) minicom: $(MOBJS) - $(CC) $(LFLAGS) -o minicom $(MOBJS) $(LIBS) + $(CC) $(CFLAGS) -o minicom $(MOBJS) $(LIBS) po: dummy $(MAKE) -C po keyserv: $(KOBJS) - $(CC) -o keyserv $(LFLAGS) $(KOBJS) $(LIBS) + $(CC) -o keyserv $(CFLAGS) $(KOBJS) $(LIBS) runscript: $(SOBJS) - $(CC) -o runscript $(LFLAGS) $(SOBJS) $(LIBS) + $(CC) -o runscript $(CFLAGS) $(SOBJS) $(LIBS) ascii-xfr: ascii-xfr.o - $(CC) -s -o ascii-xfr $(LFLAGS) ascii-xfr.o + $(CC) -s -o ascii-xfr $(CFLAGS) ascii-xfr.o script.o: script.c diff -Naur orig/minicom-1.83.1/src/config.h cygp/minicom-1.83.1/src/config.h --- orig/minicom-1.83.1/src/config.h Wed Mar 15 08:25:20 2000 +++ cygp/minicom-1.83.1/src/config.h Tue Mar 6 11:50:56 2001 @@ -39,6 +39,18 @@ # define KERMIT "/usr/bin/kermit -l %l -b %b" #endif +/* Operating system dependant parameters, per OS. A few samples are given. */ +#if defined(__CYGWIN__) +# define DFL_PORT "/dev/com1" /* Which tty to use */ +# define DEF_BAUD "57600" /* Default baud rate */ +# define CALLOUT "" /* Gets run to get into dial out mode */ +# define CALLIN "" /* Gets run to get into dial in mode */ +# undef UUCPLOCK +# define UUCPLOCK "/var/lock" /* FSSTND 1.2 */ +# undef KERMIT +# define KERMIT "/usr/bin/kermit -l %l -b %b" +#endif + #if defined (_COHERENT) # define DFL_PORT "/dev/modem" # define DEF_BAUD "9600" diff -Naur orig/minicom-1.83.1/src/ipc.c cygp/minicom-1.83.1/src/ipc.c --- orig/minicom-1.83.1/src/ipc.c Sun Oct 25 10:04:26 1998 +++ cygp/minicom-1.83.1/src/ipc.c Tue Feb 27 09:27:00 2001 @@ -254,7 +254,15 @@ if (fd2 == 0 && io_pending) n = 2; else if (select(i+1, &fds, NULL, NULL, &tv) > 0) +#ifdef DEBUG_ME + { + int idebug; + idebug = select(i+1, &fds, NULL, NULL, &tv); +#endif n = 1 * (FD_ISSET(fd1, &fds) > 0) + 2 * (FD_ISSET(fd2, &fds) > 0); +#ifdef DEBUG_ME + } +#endif /* If there is data put it in the buffer. */ if (buf) { diff -Naur orig/minicom-1.83.1/src/minicom.h cygp/minicom-1.83.1/src/minicom.h --- orig/minicom-1.83.1/src/minicom.h Fri Jan 7 10:52:02 2000 +++ cygp/minicom-1.83.1/src/minicom.h Thu Feb 22 08:18:24 2001 @@ -44,6 +44,11 @@ EXTERN int COLS; #endif +#ifdef __CYGWIN__ +EXTERN int LINES; +EXTERN int COLS; +#endif + EXTERN char stdattr; /* Standard attribute */ EXTERN WIN *us; /* User screen */ diff -Naur orig/minicom-1.83.1/src/window.c cygp/minicom-1.83.1/src/window.c --- orig/minicom-1.83.1/src/window.c Thu Mar 16 01:44:24 2000 +++ cygp/minicom-1.83.1/src/window.c Thu Feb 22 08:11:44 2001 @@ -331,7 +331,7 @@ * 0: only write to memory, not to screen * 1: write to both screen and memory */ -static void _write(c, doit, x, y,attr, color) +static void _uwrite(c, doit, x, y,attr, color) int c, doit; int x, y; char attr, color; @@ -550,27 +550,27 @@ /* And draw the window */ if (border) { - _write(border == BSINGLE ? S_UL : D_UL, w->direct, x1, y1, + _uwrite(border == BSINGLE ? S_UL : D_UL, w->direct, x1, y1, xattr, color); for(x = x1 + 1; x < x2; x++) - _write(border == BSINGLE ? S_HOR : D_HOR, w->direct, x, y1, + _uwrite(border == BSINGLE ? S_HOR : D_HOR, w->direct, x, y1, xattr, color); - _write(border == BSINGLE ? S_UR : D_UR, w->direct, x2, y1, + _uwrite(border == BSINGLE ? S_UR : D_UR, w->direct, x2, y1, xattr, color); for(y = y1 + 1; y < y2; y++) { - _write(border == BSINGLE ? S_VER : D_VER, w->direct, x1, y, + _uwrite(border == BSINGLE ? S_VER : D_VER, w->direct, x1, y, xattr, color); for(x = x1 + 1; x < x2; x++) - _write(' ', w->direct, x, y, attr, color); - _write(border == BSINGLE ? S_VER : D_VER, w->direct, x2, y, + _uwrite(' ', w->direct, x, y, attr, color); + _uwrite(border == BSINGLE ? S_VER : D_VER, w->direct, x2, y, xattr, color); } - _write(border == BSINGLE ? S_LL : D_LL, w->direct, x1, y2, + _uwrite(border == BSINGLE ? S_LL : D_LL, w->direct, x1, y2, xattr, color); for(x = x1 + 1; x < x2; x++) - _write(border == BSINGLE ? S_HOR : D_HOR, w->direct, + _uwrite(border == BSINGLE ? S_HOR : D_HOR, w->direct, x, y2, xattr, color); - _write(border == BSINGLE ? S_LR : D_LR, w->direct, x2, y2, + _uwrite(border == BSINGLE ? S_LR : D_LR, w->direct, x2, y2, xattr, color); if (w->direct) _gotoxy(x1 + 1, y1 + 1); } else @@ -615,12 +615,12 @@ ELM *g; g = gmap + (y * stdwin->xs); for(x = 0 ; x < win->x1; x++) { - _write(g->value, 1, x, y, g->attr, g->color); + _uwrite(g->value, 1, x, y, g->attr, g->color); g++; } /* to here */ for(x = win->x1; x <= win->x2; x++) { - _write(e->value, 1, x, y, e->attr, e->color); + _uwrite(e->value, 1, x, y, e->attr, e->color); e++; } } @@ -687,7 +687,7 @@ e = gmap; for(y = 0; y value, -1, x, y, e->attr, e->color); + _uwrite(e->value, -1, x, y, e->attr, e->color); e++; } } @@ -727,7 +727,7 @@ for(y = miny; y <= maxy; y++) { for(x = minx; x <= maxx; x++) { - _write(e->value, -1, x, y, e->attr, e->color); + _uwrite(e->value, -1, x, y, e->attr, e->color); e++; } e += addcnt; @@ -760,7 +760,7 @@ doit = 0; } for(x = w->curx + w->x1; x <= w->x2; x++) { - _write(' ', (w->direct && doit) ? 1 : 0, x, y, w->attr, w->color); + _uwrite(' ', (w->direct && doit) ? 1 : 0, x, y, w->attr, w->color); } return(doit); } @@ -853,7 +853,7 @@ */ if (sflag && win->sy2 == (LINES - 1) && win->sy1 != win->sy2) { if (dir == S_UP) { - _write(oldc.value, 1, COLS - 1, LINES - 2, + _uwrite(oldc.value, 1, COLS - 1, LINES - 2, oldc.attr, oldc.color); } sflag = 0; @@ -914,7 +914,7 @@ for(y = win->sy1 + 1; y <= win->sy2; y++) { e = gmap + y * COLS + win->x1; for(x = win->x1; x <= win->x2; x++) { - _write(e->value, win->direct && doit, + _uwrite(e->value, win->direct && doit, x, y - 1, e->attr, e->color); e++; } @@ -926,7 +926,7 @@ for(y = win->sy2 - 1; y >= win->sy1; y--) { e = gmap + y * COLS + win->x1; for(x = win->x1; x <= win->x2; x++) { - _write(e->value, win->direct && doit, + _uwrite(e->value, win->direct && doit, x, y + 1, e->attr, e->color); e++; } @@ -940,7 +940,7 @@ win->curx = ocurx; if (!doit) for(x = win->x1; x <= win->x2; x++) - _write(' ', 0, x, win->y1 + win->cury, win->attr, win->color); + _uwrite(' ', 0, x, win->y1 + win->cury, win->attr, win->color); if (!_intern && win->direct) _gotoxy(win->x1 + win->curx, win->y1 + win->cury); if (dirflush && !_intern && win->direct) wflush(); @@ -1015,7 +1015,7 @@ } /* Now write the character. */ if (c != '\n') { - _write(c, win->direct, win->curx + win->x1, + _uwrite(c, win->direct, win->curx + win->x1, win->cury + win->y1, win->attr, win->color); if (++win->curx >= win->xs && !win->wrap) { win->curx--; @@ -1042,7 +1042,7 @@ /* MARK updated 02/17/94 - Fixes bug, to do all 80 cols, not 79 cols */ for(x = w->x1; x <= w->x2; x++) { - _write(e->value, w->direct, x, y + w->y1, e->attr, e->color); + _uwrite(e->value, w->direct, x, y + w->y1, e->attr, e->color); /*y + w->y1, XA_NORMAL, e->color);*/ e++; } @@ -1087,20 +1087,20 @@ /* filipg 8/19/97: this will BOLD-up the line */ /* first position */ x = w->x1; - _write(e->value, w->direct, x, y + w->y1, XA_NORMAL, e->color); + _uwrite(e->value, w->direct, x, y + w->y1, XA_NORMAL, e->color); e++; /* everything in the middle will be BLINK */ for(x = (w->x1+1); x <= (w->x2-1); x++) { - _write(e->value, w->direct, x, y + w->y1, XA_BOLD, WHITE); + _uwrite(e->value, w->direct, x, y + w->y1, XA_BOLD, WHITE); e++; } /* last position */ x = w->x2; - _write(e->value, w->direct, x, y + w->y1, XA_NORMAL, e->color); + _uwrite(e->value, w->direct, x, y + w->y1, XA_NORMAL, e->color); } /* @@ -1186,10 +1186,10 @@ if (pos == TMID) x = w->x1 + (w->xs - strlen(s)) / 2 - 1; if (x < w->x1) x = w->x1; - if (x < w->x2) _write('[', w->direct, x++, w->y1 - 1, w->attr, w->color); - while(*s && x <= w->x2) _write(*s++, w->direct, x++, w->y1 - 1, + if (x < w->x2) _uwrite('[', w->direct, x++, w->y1 - 1, w->attr, w->color); + while(*s && x <= w->x2) _uwrite(*s++, w->direct, x++, w->y1 - 1, w->attr, w->color); - if (x <= w->x2) _write(']', w->direct, x++, w->y1 - 1, w->attr, w->color); + if (x <= w->x2) _uwrite(']', w->direct, x++, w->y1 - 1, w->attr, w->color); if (w->direct) { _gotoxy(w->x1 + w->curx, w->y1 + w->cury); @@ -1227,10 +1227,10 @@ x = '>'; else x = ' '; - _write(x, w->direct, w->x1, y, attr, e->color); + _uwrite(x, w->direct, w->x1, y, attr, e->color); } else { for(x = w->x1; x <= w->x2; x++) { - _write(e->value, w->direct, x, y, attr, e->color); + _uwrite(e->value, w->direct, x, y, attr, e->color); e++; } } @@ -1370,7 +1370,7 @@ n = w->x1 + w->curx; if( n > w->x2) n = w->x2; - for(x = w->x1; x <= n; x++) _write(' ', w->direct, x, y, + for(x = w->x1; x <= n; x++) _uwrite(' ', w->direct, x, y, w->attr, w->color); if (w->direct) { _gotoxy(n, y); @@ -1585,7 +1585,7 @@ /* Write buffer to screen */ e = buf; for(++x; x <= w->x2; x++) { - _write(e->value, doit && w->direct, x, y, e->attr, e->color); + _uwrite(e->value, doit && w->direct, x, y, e->attr, e->color); e++; } w->direct = odir; @@ -1625,10 +1625,10 @@ e = gmap + y * COLS + x + 1; for(; x < w->x2; x++) { - _write(e->value, doit && w->direct, x, y, e->attr, e->color); + _uwrite(e->value, doit && w->direct, x, y, e->attr, e->color); e++; } - _write(' ', doit && w->direct, x, y, w->attr, w->color); + _uwrite(' ', doit && w->direct, x, y, w->attr, w->color); wlocate(w, w->curx, w->cury); } ----8<----cut here -------------------- Enoch Wu