中根さんが作成された、パッチをマージしました -- 山口大学総合情報処理センター 久長 穣 hisa@yamaguchi-u.ac.jp -----ここから、 diff -r -c okphone-1.2.orig/client/Makefile okphone-1.2/client/Makefile *** okphone-1.2.orig/client/Makefile Tue Feb 27 17:09:03 1990 --- okphone-1.2/client/Makefile Sat May 4 09:37:50 1996 *************** *** 64,69 **** --- 64,72 ---- kanaconv.l: jtox kanaconv.j -./jtox < kanaconv.j > kanaconv.l + kanaconv.c: kanaconv.l + lex -t8 kanaconv.l > kanaconv.c + install: ${DEST} /bin/rm -f ${RDEST} cp ${DEST} ${RDEST} Only in okphone-1.2/client: Makefile.orig diff -r -c okphone-1.2.orig/client/defs.h okphone-1.2/client/defs.h *** okphone-1.2.orig/client/defs.h Fri Dec 15 18:30:08 1989 --- okphone-1.2/client/defs.h Sat May 4 09:39:32 1996 *************** *** 6,12 **** --- 6,14 ---- #define BUFFER 512 /* internal character buffer size */ + #ifndef __FreeBSD__ char *sprintf(); + #endif char *index(); char *strsave(); char *malloc(); *************** *** 39,45 **** #define PROMPT "Command> " ! #define ctrl(C) ('C'-'@') #define equal(a,b) (strcmp (a,b) == 0) #define iswordch(ch) ((ch) & 0x80 || isalpha(ch) || (ch) == '-' || (ch) == '\'') --- 41,47 ---- #define PROMPT "Command> " ! #define ctrl(C) (C-'@') #define equal(a,b) (strcmp (a,b) == 0) #define iswordch(ch) ((ch) & 0x80 || isalpha(ch) || (ch) == '-' || (ch) == '\'') Only in okphone-1.2/client: defs.h.orig diff -r -c okphone-1.2.orig/client/kanaconv.j okphone-1.2/client/kanaconv.j *** okphone-1.2.orig/client/kanaconv.j Fri Dec 15 18:30:11 1989 --- okphone-1.2/client/kanaconv.j Sat May 4 09:37:51 1996 *************** *** 1,4 **** --- 1,9 ---- %{ + #undef YY_INPUT + #define YY_INPUT(b,r,s) (r = input1(b, s)) + #ifdef __FreeBSD__ + char *yysptr, yysbuf[BUFSIZ], yytchar; + #endif static char *ibegp, *iendp ; /* pointer to input buffer */ static char *cendp ; /* pointer to output buffer */ static int complete ; /* the word was fixed */ *************** *** 180,185 **** --- 185,191 ---- complete = c ; failcount = 0 ; yysptr = yysbuf ; + return yylex() ; } *************** *** 187,192 **** --- 193,201 ---- char *ip, *op ; { register char *p ; + + char *op1; + op1 = op; for ( p = ip ; *p ; ) { while ( iswordch(*p) ) *************** *** 248,256 **** *cendp = 0 ; } #undef input static ! input() { char ch ; --- 257,267 ---- *cendp = 0 ; } + #ifndef __FreeBSD__ #undef input + #endif static ! input1(char *buf, int s) { char ch ; *************** *** 266,270 **** --- 277,287 ---- ibegp++ ; } + if (yytchar != 0) { + buf[0] = yytchar; + return 1; + } else { + return 0; + } return yytchar ; } Only in okphone-1.2/client: kanaconv.j.orig diff -r -c okphone-1.2.orig/client/kb.c okphone-1.2/client/kb.c *** okphone-1.2.orig/client/kb.c Fri Dec 15 18:30:09 1989 --- okphone-1.2/client/kb.c Sat May 4 09:39:32 1996 *************** *** 15,24 **** int his; /* his key */ int std; /* what we'll map it to */ } keys [] = { ! { ctrl(M), ctrl(J) }, /* -> newline */ ! { 0, ctrl(H) }, /* backspace */ ! { 0, ctrl(W) }, /* word erase */ ! { 0, ctrl(X) }, /* line kill */ { 0, 0 } }; --- 15,24 ---- int his; /* his key */ int std; /* what we'll map it to */ } keys [] = { ! { 'M'-'@', 'J'-'@' }, /* -> newline */ ! { 0, 'H'-'@' }, /* backspace */ ! { 0, 'W'-'@' }, /* word erase */ ! { 0, 'X'-'@' }, /* line kill */ { 0, 0 } }; *************** *** 47,53 **** } } ! if (c == ctrl(L) || c == ctrl(R)) { w_redraw_screen() ; return; } --- 47,53 ---- } } ! if (c == ctrl('L' ) || c == ctrl('R' ) ) { w_redraw_screen() ; return; } *************** *** 84,90 **** if (command == 0) { /* not in command mode */ extern Win *outwin ; ! if ((c == ctrl(D)) && childpid) /* send eof to child */ close (tochild); if (childpid == 0 || Echo) { /* send char to the socket */ #ifdef LOCAL_ECHO --- 84,90 ---- if (command == 0) { /* not in command mode */ extern Win *outwin ; ! if ((c == ctrl('D' ) ) && childpid) /* send eof to child */ close (tochild); if (childpid == 0 || Echo) { /* send char to the socket */ #ifdef LOCAL_ECHO *************** *** 106,112 **** * should move to a separate routine somewhere. */ ! if (c == ctrl(J)) { /* execute the buffer */ cbuf[cpos] = '\0'; /* null-terminate it */ w_clear (msgwin); /* clear line to end */ --- 106,112 ---- * should move to a separate routine somewhere. */ ! if (c == ctrl('J' ) ) { /* execute the buffer */ cbuf[cpos] = '\0'; /* null-terminate it */ w_clear (msgwin); /* clear line to end */ *************** *** 145,158 **** */ switch (c) { ! case ctrl(H): /* backspace */ if (cpos) { cpos--; w_deletech(msgwin); } break; ! case ctrl(W): /* word erase */ while (--cpos >= 0) { if (cbuf[cpos] != ' ') { cpos++; --- 145,158 ---- */ switch (c) { ! case 'H'-'@': /* backspace */ if (cpos) { cpos--; w_deletech(msgwin); } break; ! case 'W'-'@': /* word erase */ while (--cpos >= 0) { if (cbuf[cpos] != ' ') { cpos++; *************** *** 169,181 **** } break; ! case ctrl(U): /* line kill */ ! case ctrl(X): w_setpos (msgwin, 0, strlen (PROMPT)); w_clrtoeol (msgwin); cpos = 0; break; ! case ctrl(I): /* tab */ c = ' '; /* fall through ... */ default: cbuf[cpos++] = c; w_putstr (msgwin, &c,0); --- 169,181 ---- } break; ! case 'U'-'@': /* line kill */ ! case 'X'-'@': w_setpos (msgwin, 0, strlen (PROMPT)); w_clrtoeol (msgwin); cpos = 0; break; ! case 'I'-'@': /* tab */ c = ' '; /* fall through ... */ default: cbuf[cpos++] = c; w_putstr (msgwin, &c,0); Only in okphone-1.2/client: kb.c.orig diff -r -c okphone-1.2.orig/client/main.c okphone-1.2/client/main.c *** okphone-1.2.orig/client/main.c Fri Jun 15 16:35:35 1990 --- okphone-1.2/client/main.c Sat May 4 09:37:51 1996 *************** *** 134,149 **** * open datagram control socket. */ ! if ((ctl = socket (AF_INET, SOCK_DGRAM, 0)) < 0) error (1, "Can't get control socket"); sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = 0; sin.sin_family = AF_INET; ! if (bind (ctl, &sin, sizeof (sin)) < 0) error (1, "Can't bind control socket"); - setup (); /* initialize all the screen stuff */ /* Have we been invited ??? */ --- 134,152 ---- * open datagram control socket. */ ! if ((ctl = socket (AF_INET, SOCK_DGRAM, 17)) < 0) error (1, "Can't get control socket"); + + #ifdef __FreeBSD__ + /* printf(" ctl = %d\n", ctl);*/ + #endif sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = 0; sin.sin_family = AF_INET; ! if (bind (ctl, (struct sockaddr *)&sin, sizeof (sin)) < 0) error (1, "Can't bind control socket"); setup (); /* initialize all the screen stuff */ /* Have we been invited ??? */ Only in okphone-1.2/client: main.c.orig diff -r -c okphone-1.2.orig/client/misc.c okphone-1.2/client/misc.c *** okphone-1.2.orig/client/misc.c Fri Dec 15 18:30:09 1989 --- okphone-1.2/client/misc.c Sat May 4 09:37:51 1996 *************** *** 28,34 **** --- 28,36 ---- char *mesg; { extern int errno; + #ifndef __FreeBSD__ extern char *sys_errlist[]; + #endif extern int sys_nerr; char buf[80]; *************** *** 92,97 **** --- 94,100 ---- if ( wc_attr(wch) & A_KANJI ) { switch ( kanji_code ) { case K_EUC : + printf("kanji\n"); putc(wc_char(wch), fp); break ; case K_SJIS : Only in okphone-1.2/client: misc.c.orig diff -r -c okphone-1.2.orig/client/sendit.c okphone-1.2/client/sendit.c *** okphone-1.2.orig/client/sendit.c Fri Dec 15 18:30:10 1989 --- okphone-1.2/client/sendit.c Sat May 4 09:37:51 1996 *************** *** 1,6 **** --- 1,11 ---- #include "defs.h" #include /* fix */ #include + #ifdef __FreeBSD__ + #include + #include + #include + #endif #define WAIT 2 /* wait this long before re-sending */ *************** *** 28,34 **** timeout.tv_usec = 0; for (tries = 0; tries < 5; tries++) { ! if (sendto (ctl, str, len, 0, &sin, sizeof (sin)) < 0) { error (0, "sendit: sendto"); return (-1); } --- 33,39 ---- timeout.tv_usec = 0; for (tries = 0; tries < 5; tries++) { ! if (sendto (ctl, str, len, 0, (struct sockaddr *)&sin, sizeof (sin)) < 0) { error (0, "sendit: sendto"); return (-1); } *************** *** 40,46 **** --- 45,55 ---- #endif DEBUG FD_ZERO (&readfds); /* fix */ FD_SET (ctl, &readfds); /* fix */ + #ifdef __FreeBSD__ + if (select (32, &readfds, 0, 0, 0) <= 0) { /* nothing to read on */ /* fix */ + #else if (select (32, &readfds, 0, 0, &timeout) <= 0) { /* nothing to read on */ /* fix */ + #endif if (Debug) printf ("\r\nsendit: no response on try #%d.\r\n", tries); continue; Only in okphone-1.2/client: sendit.c.orig diff -r -c okphone-1.2.orig/client/sw/win.h okphone-1.2/client/sw/win.h *** okphone-1.2.orig/client/sw/win.h Fri Dec 15 18:30:12 1989 --- okphone-1.2/client/sw/win.h Sat May 4 09:37:51 1996 *************** *** 68,73 **** --- 68,74 ---- #define w_redraw(w) w_redraw_it(w, 1) #define w_update(w) w_redraw_it(w, 0) + #include struct sgttyb sgttyb ; /* user options */ Only in okphone-1.2/client/sw: win.h.orig diff -r -c okphone-1.2.orig/client/windows.c okphone-1.2/client/windows.c *** okphone-1.2.orig/client/windows.c Fri Dec 15 18:30:10 1989 --- okphone-1.2/client/windows.c Sat May 4 09:39:32 1996 *************** *** 251,271 **** switch (ch) { case '\0177': /* delete */ ! case ctrl(H): /* backspace */ if (x > 0) { addstr ("\b \b"); x--; } break; ! case ctrl(I): /* tab */ addch (' '); x++; while (x++ % 8) addch (' '); break; ! case ctrl(J): /* newline */ x = 0; if ((++y + upper_y) > lower_y) y = 1; --- 251,271 ---- switch (ch) { case '\0177': /* delete */ ! case ctrl('H' ) : /* backspace */ if (x > 0) { addstr ("\b \b"); x--; } break; ! case ctrl('I' ) : /* tab */ addch (' '); x++; while (x++ % 8) addch (' '); break; ! case ctrl('J' ) : /* newline */ x = 0; if ((++y + upper_y) > lower_y) y = 1; *************** *** 273,288 **** clrtoeol (); break; ! case ctrl(L): /* clear to end of current line */ clrtoeol (); break; ! case ctrl(M): /* carriage return */ x = 0; move (y + upper_y, 0); break; ! case ctrl(N): /* clear window */ for (y = 1; (y+upper_y) <= lower_y; y++) { move (y + upper_y, 0); clrtoeol (); --- 273,288 ---- clrtoeol (); break; ! case ctrl('L' ) : /* clear to end of current line */ clrtoeol (); break; ! case ctrl('M' ) : /* carriage return */ x = 0; move (y + upper_y, 0); break; ! case ctrl('N' ) : /* clear window */ for (y = 1; (y+upper_y) <= lower_y; y++) { move (y + upper_y, 0); clrtoeol (); *************** *** 291,303 **** move (y + upper_y, 0); break; ! case ctrl(U): /* line kill */ ! case ctrl(X): x = 0; move (y + upper_y, 0); clrtoeol (); break; ! case ctrl(W): /* word erase */ while (x >= 0) { /* nuke the spaces */ if (inch () != ' ') break; --- 291,303 ---- move (y + upper_y, 0); break; ! case ctrl('U' ) : /* line kill */ ! case ctrl('X' ) : x = 0; move (y + upper_y, 0); clrtoeol (); break; ! case ctrl('W' ) : /* word erase */ while (x >= 0) { /* nuke the spaces */ if (inch () != ' ') break; *************** *** 326,332 **** move (y + upper_y, 0); break; ! case ctrl(G): /* bell - switchable */ if (Bells) { (void) write (1, "\007", 1); break; --- 326,332 ---- move (y + upper_y, 0); break; ! case ctrl('G' ) : /* bell - switchable */ if (Bells) { (void) write (1, "\007", 1); break; Only in okphone-1.2/client: windows.c.orig diff -r -c okphone-1.2.orig/client/windows_sw.c okphone-1.2/client/windows_sw.c *** okphone-1.2.orig/client/windows_sw.c Fri Dec 15 18:30:11 1989 --- okphone-1.2/client/windows_sw.c Sat May 4 09:37:51 1996 *************** *** 278,292 **** } switch (ch) { ! case '\033': if ( kanji_code >= 0 ) { w->escape = ch ; return ; } break ; ! case '\0177': /* delete */ ! case ctrl(H): /* backspace */ if (x > 0) { if ( w->wordend > w->wordbeg ) { /* in a word */ --- 278,292 ---- } switch (ch) { ! case 033: if ( kanji_code >= 0 ) { w->escape = ch ; return ; } break ; ! case 0177: /* delete */ ! case 'H'-'@': /* backspace */ if (x > 0) { if ( w->wordend > w->wordbeg ) { /* in a word */ *************** *** 314,348 **** } break; ! case ctrl(I): /* tab */ add_ch(w, ' ') ; while (x & 7) add_ch(w, ' ') ; break; ! case ctrl(J): /* newline */ if ( w->wordend > w->wordbeg ) show_word(w, 1) ; new_line(w) ; break; ! case ctrl(L): /* clear to end of current line */ w_clrtoeol (w->win); break; ! case ctrl(M): /* carriage return */ w_setpos (w->win, y, x = 0); reset_line(w) ; break; ! case ctrl(N): /* clear window */ w_clear(w->win) ; w_setpos (w->win, y = 0, x = 0); reset_line(w) ; break; ! case ctrl(U): /* line kill */ ! case ctrl(X): w_setpos (w->win, y, x = 0); w_clrtoeol (w->win); while ( w->wordend > w->linebuf ) { --- 314,348 ---- } break; ! case 'I'-'@': /* tab */ add_ch(w, ' ') ; while (x & 7) add_ch(w, ' ') ; break; ! case 'J'-'@': /* newline */ if ( w->wordend > w->wordbeg ) show_word(w, 1) ; new_line(w) ; break; ! case 'L'-'@': /* clear to end of current line */ w_clrtoeol (w->win); break; ! case 'M'-'@': /* carriage return */ w_setpos (w->win, y, x = 0); reset_line(w) ; break; ! case 'N'-'@': /* clear window */ w_clear(w->win) ; w_setpos (w->win, y = 0, x = 0); reset_line(w) ; break; ! case 'U'-'@': /* line kill */ ! case 'X'-'@': w_setpos (w->win, y, x = 0); w_clrtoeol (w->win); while ( w->wordend > w->linebuf ) { *************** *** 352,358 **** reset_line(w) ; break; ! case ctrl(W): /* word erase */ while (x > 0) { /* nuke the spaces */ if (*--w->wordend != ' ') { ++w->wordend ; --- 352,358 ---- reset_line(w) ; break; ! case 'W'-'@': /* word erase */ while (x > 0) { /* nuke the spaces */ if (*--w->wordend != ' ') { ++w->wordend ; *************** *** 379,390 **** } break; ! case ctrl(^): /* home cursor */ w_setpos (w->win, y = 0, x = 0); reset_line(w) ; break; ! case ctrl(G): /* bell - switchable */ if (Bells) { w_bell() ; break; --- 379,390 ---- } break; ! case '^'-'@': /* home cursor */ w_setpos (w->win, y = 0, x = 0); reset_line(w) ; break; ! case 'G'-'@': /* bell - switchable */ if (Bells) { w_bell() ; break; Only in okphone-1.2/client: windows_sw.c.orig diff -r -c okphone-1.2.orig/conv/Makefile okphone-1.2/conv/Makefile *** okphone-1.2.orig/conv/Makefile Fri Dec 15 18:30:07 1989 --- okphone-1.2/conv/Makefile Sat May 4 09:37:52 1996 *************** *** 8,14 **** CFLAGS = -O SRCS = convd.c DEST = convd ! RDEST = /usr/etc/convd #RDEST = /usr/local/lib/convd all: ${DEST} --- 8,14 ---- CFLAGS = -O SRCS = convd.c DEST = convd ! RDEST = /usr/local/etc/convd #RDEST = /usr/local/lib/convd all: ${DEST} Only in okphone-1.2/conv: Makefile.orig diff -r -c okphone-1.2.orig/conv/convd.c okphone-1.2/conv/convd.c *** okphone-1.2.orig/conv/convd.c Fri Dec 15 18:30:07 1989 --- okphone-1.2/conv/convd.c Sat May 4 09:37:52 1996 *************** *** 404,410 **** --- 404,412 ---- fatal (err) int err; { + #ifndef __FreeBSD__ extern char *sys_errlist[]; + #endif extern int sys_nerr; char buf[128]; char mesg[256]; Only in okphone-1.2/conv: convd.c.orig diff -r -c okphone-1.2.orig/master/Makefile okphone-1.2/master/Makefile *** okphone-1.2.orig/master/Makefile Fri Dec 15 18:30:13 1989 --- okphone-1.2/master/Makefile Sat May 4 09:37:52 1996 *************** *** 29,35 **** #CFLAGS = -O -DSERVICES -DDPATH=\"$(CONVD)\" -DFORK #CFLAGS = -O -DINETD -DDPATH=\"$(CONVD)\" #CFLAGS = -O -DINETD -DDPATH=\"$(CONVD)\" -DSERVICES ! CFLAGS = $(OFLAG) $(INETD) -DFORK -DSERVICES -DDPATH=\"/usr/etc/convd\" LPR = lpr -Psony CC = cc --- 29,35 ---- #CFLAGS = -O -DSERVICES -DDPATH=\"$(CONVD)\" -DFORK #CFLAGS = -O -DINETD -DDPATH=\"$(CONVD)\" #CFLAGS = -O -DINETD -DDPATH=\"$(CONVD)\" -DSERVICES ! CFLAGS = $(OFLAG) $(INETD) -DFORK -DSERVICES -DDPATH=\"/usr/local/etc/convd\" LPR = lpr -Psony CC = cc *************** *** 44,50 **** reinvite.o strsave.o utmp.o DEST = phoned ! RDEST = /usr/etc/in.phoned #RDEST = /etc/phoned --- 44,50 ---- reinvite.o strsave.o utmp.o DEST = phoned ! RDEST = /usr/local/etc/in.phoned #RDEST = /etc/phoned Only in okphone-1.2/master: Makefile.orig diff -r -c okphone-1.2.orig/master/daemon.c okphone-1.2/master/daemon.c *** okphone-1.2.orig/master/daemon.c Fri Dec 15 18:30:13 1989 --- okphone-1.2/master/daemon.c Sat May 4 09:37:52 1996 *************** *** 112,118 **** --- 112,120 ---- error () { extern int errno; + #ifndef __FreeBSD__ extern char *sys_errlist[]; + #endif extern int sys_nerr; if (errno > sys_nerr) Only in okphone-1.2/master: daemon.c.orig diff -r -c okphone-1.2.orig/master/utmp.c okphone-1.2/master/utmp.c *** okphone-1.2.orig/master/utmp.c Fri Dec 15 18:30:15 1989 --- okphone-1.2/master/utmp.c Sat May 4 09:37:52 1996 *************** *** 46,52 **** --- 46,56 ---- register int i; struct stat statb; + #ifdef __FreeBSD__ + if ((utfd = open (_PATH_UTMP, O_RDONLY)) < 0) { + #else if ((utfd = open ("/etc/utmp", O_RDONLY)) < 0) { + #endif perror ("can't open utmp"); return; /* exit?? */ } Only in okphone-1.2/master: utmp.c.orig