head 1.6; access; symbols pkgsrc-2026Q1:1.6.0.46 pkgsrc-2026Q1-base:1.6 pkgsrc-2025Q4:1.6.0.44 pkgsrc-2025Q4-base:1.6 pkgsrc-2025Q3:1.6.0.42 pkgsrc-2025Q3-base:1.6 pkgsrc-2025Q2:1.6.0.40 pkgsrc-2025Q2-base:1.6 pkgsrc-2025Q1:1.6.0.38 pkgsrc-2025Q1-base:1.6 pkgsrc-2024Q4:1.6.0.36 pkgsrc-2024Q4-base:1.6 pkgsrc-2024Q3:1.6.0.34 pkgsrc-2024Q3-base:1.6 pkgsrc-2024Q2:1.6.0.32 pkgsrc-2024Q2-base:1.6 pkgsrc-2024Q1:1.6.0.30 pkgsrc-2024Q1-base:1.6 pkgsrc-2023Q4:1.6.0.28 pkgsrc-2023Q4-base:1.6 pkgsrc-2023Q3:1.6.0.26 pkgsrc-2023Q3-base:1.6 pkgsrc-2023Q2:1.6.0.24 pkgsrc-2023Q2-base:1.6 pkgsrc-2023Q1:1.6.0.22 pkgsrc-2023Q1-base:1.6 pkgsrc-2022Q4:1.6.0.20 pkgsrc-2022Q4-base:1.6 pkgsrc-2022Q3:1.6.0.18 pkgsrc-2022Q3-base:1.6 pkgsrc-2022Q2:1.6.0.16 pkgsrc-2022Q2-base:1.6 pkgsrc-2022Q1:1.6.0.14 pkgsrc-2022Q1-base:1.6 pkgsrc-2021Q4:1.6.0.12 pkgsrc-2021Q4-base:1.6 pkgsrc-2021Q3:1.6.0.10 pkgsrc-2021Q3-base:1.6 pkgsrc-2021Q2:1.6.0.8 pkgsrc-2021Q2-base:1.6 pkgsrc-2021Q1:1.6.0.6 pkgsrc-2021Q1-base:1.6 pkgsrc-2020Q4:1.6.0.4 pkgsrc-2020Q4-base:1.6 pkgsrc-2020Q3:1.6.0.2 pkgsrc-2020Q3-base:1.6 pkgsrc-2020Q2:1.5.0.58 pkgsrc-2020Q2-base:1.5 pkgsrc-2020Q1:1.5.0.38 pkgsrc-2020Q1-base:1.5 pkgsrc-2019Q4:1.5.0.60 pkgsrc-2019Q4-base:1.5 pkgsrc-2019Q3:1.5.0.56 pkgsrc-2019Q3-base:1.5 pkgsrc-2019Q2:1.5.0.54 pkgsrc-2019Q2-base:1.5 pkgsrc-2019Q1:1.5.0.52 pkgsrc-2019Q1-base:1.5 pkgsrc-2018Q4:1.5.0.50 pkgsrc-2018Q4-base:1.5 pkgsrc-2018Q3:1.5.0.48 pkgsrc-2018Q3-base:1.5 pkgsrc-2018Q2:1.5.0.46 pkgsrc-2018Q2-base:1.5 pkgsrc-2018Q1:1.5.0.44 pkgsrc-2018Q1-base:1.5 pkgsrc-2017Q4:1.5.0.42 pkgsrc-2017Q4-base:1.5 pkgsrc-2017Q3:1.5.0.40 pkgsrc-2017Q3-base:1.5 pkgsrc-2017Q2:1.5.0.36 pkgsrc-2017Q2-base:1.5 pkgsrc-2017Q1:1.5.0.34 pkgsrc-2017Q1-base:1.5 pkgsrc-2016Q4:1.5.0.32 pkgsrc-2016Q4-base:1.5 pkgsrc-2016Q3:1.5.0.30 pkgsrc-2016Q3-base:1.5 pkgsrc-2016Q2:1.5.0.28 pkgsrc-2016Q2-base:1.5 pkgsrc-2016Q1:1.5.0.26 pkgsrc-2016Q1-base:1.5 pkgsrc-2015Q4:1.5.0.24 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.22 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.20 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.18 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.5.0.16 pkgsrc-2014Q4-base:1.5 pkgsrc-2014Q3:1.5.0.14 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.5.0.12 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.10 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.8 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.6 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.5.0.4 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.5.0.2 pkgsrc-2013Q1-base:1.5 pkgsrc-2012Q4:1.4.0.8 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.6 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.4 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.2 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.3.0.20 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.18 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.16 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.14 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.12 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.10 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.8 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.6 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.4 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.2 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.2.0.6 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.4 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.2.0.2 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.1.0.28 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.26 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.24 pkgsrc-2008Q2-base:1.1 cwrapper:1.1.0.22 pkgsrc-2008Q1:1.1.0.20 pkgsrc-2008Q1-base:1.1 pkgsrc-2007Q4:1.1.0.18 pkgsrc-2007Q4-base:1.1 pkgsrc-2007Q3:1.1.0.16 pkgsrc-2007Q3-base:1.1 pkgsrc-2007Q2:1.1.0.14 pkgsrc-2007Q2-base:1.1 pkgsrc-2007Q1:1.1.0.12 pkgsrc-2007Q1-base:1.1 pkgsrc-2006Q4:1.1.0.10 pkgsrc-2006Q4-base:1.1 pkgsrc-2006Q3:1.1.0.8 pkgsrc-2006Q3-base:1.1 pkgsrc-2006Q2:1.1.0.6 pkgsrc-2006Q2-base:1.1 pkgsrc-2006Q1:1.1.0.4 pkgsrc-2006Q1-base:1.1 pkgsrc-2005Q4:1.1.0.2 pkgsrc-2005Q4-base:1.1; locks; strict; comment @# @; 1.6 date 2020.08.18.02.17.26; author gutteridge; state Exp; branches; next 1.5; commitid 3JJhYuzadi5ZkukC; 1.5 date 2013.01.11.13.24.32; author joerg; state Exp; branches; next 1.4; 1.4 date 2012.02.16.14.13.15; author hans; state Exp; branches; next 1.3; 1.3 date 2009.07.24.01.24.39; author christos; state Exp; branches; next 1.2; 1.2 date 2008.12.17.02.19.59; author christos; state Exp; branches; next 1.1; 1.1 date 2005.12.14.13.53.24; author joerg; state Exp; branches; next ; desc @@ 1.6 log @icb: fix building on modern mainstream Linux distros Committed on the off chance someone else may want to run this on modern Linux. Tested on Debian 9 and Fedora 29 through 32. @ text @$NetBSD: patch-av,v 1.5 2013/01/11 13:24:32 joerg Exp $ --- icb/unix.c.orig 1995-02-24 21:20:31.000000000 +0000 +++ icb/unix.c @@@@ -7,20 +7,23 @@@@ #include #include "icb.h" #include "externs.h" +#include #include -#include +#include +#include #undef stty #undef gtty -#ifndef SYSV - -#ifdef linux -#include -#else #include -#endif +#if defined(__linux__) || defined(__NetBSD__) || defined(__sun) +#include +#define TTYSTRUCT termios +#define stty(fd,buf) tcsetattr((fd),TCSANOW,(buf)) +#define gtty(fd,buf) tcgetattr((fd),(buf)) +#else +#ifndef SYSV #define TTYSTRUCT sgttyb #define stty(fd,buf) ioctl((fd),TIOCSETN,(buf)) #define gtty(fd,buf) ioctl((fd),TIOCGETP,(buf)) @@@@ -30,6 +33,7 @@@@ #define stty(fd,buf) ioctl((fd),TCSETA,(buf)) #define gtty(fd,buf) ioctl((fd),TCGETA,(buf)) #endif /* SYSV */ +#endif /* TIOCSETA */ char *getlogin(); @@@@ -65,13 +69,16 @@@@ gettime() /* set line buffering for an open file pointer */ /* output will be flushed every newline */ +static char buf[1024]; linebuffer(fp) FILE *fp; { -#ifndef SYSV +#ifndef _IOLBF + setvbuf(fp, buf, _IOLBF, sizeof(buf)); +#else setlinebuf(fp); -#endif /* SYSV */ +#endif } @@@@ -79,13 +86,13 @@@@ FILE *fp; pushback(c) char c; { -#ifndef SYSV +#ifdef TIOCSTI if (ioctl(0, TIOCSTI, &c) < 0) perror("TIOCSTI ioctl failed"); -#else /* SYSV */ +#else if (ungetc(c,stdin) == EOF) perror("ungetc() failed"); -#endif /* SYSV */ +#endif } @@@@ -94,25 +101,25 @@@@ char c; getterm() { -#ifndef SYSV +#if !defined(TCSETA) && !defined(TCSANOW) struct ltchars lt; -#endif /* SYSV */ +#endif /* get tty settings */ if (gtty(0,&origtty) < 0) { badttyinfo++; ttyinfo.erase = '\b'; /* ^H */ ttyinfo.kill = '\025'; /* ^U */ } else { -#ifndef SYSV - ttyinfo.erase = origtty.sg_erase; - ttyinfo.kill = origtty.sg_kill; -#else /* SYSV */ +#if defined(TCSETA) || defined(TCSANOW) ttyinfo.erase = origtty.c_cc[VERASE]; ttyinfo.kill = origtty.c_cc[VKILL]; -#endif /* SYSV */ +#else + ttyinfo.erase = origtty.sg_erase; + ttyinfo.kill = origtty.sg_kill; +#endif } -#ifndef SYSV +#if !defined(TCSETA) && !defined(TCSANOW) /* get local special chars */ if (ioctl(0, TIOCGLTC, <) < 0) { ttyinfo.redraw = '\022'; /* ^R */ @@@@ -121,10 +128,10 @@@@ getterm() ttyinfo.redraw = lt.t_rprntc; ttyinfo.werase = lt.t_werasc; } -#else /* SYSV */ +#else ttyinfo.redraw = '\022'; /* ^R */ ttyinfo.werase = '\027'; /* ^W */ -#endif /* SYSV */ +#endif /* get the current window size */ getwinsize(); @@@@ -134,7 +141,7 @@@@ getterm() /* set up terminal modes optimal for icb */ -icbterm() +void icbterm(void) { struct TTYSTRUCT tty; @@@@ -145,14 +152,14 @@@@ icbterm() bcopy((char *)&origtty, (char *)&tty, (unsigned)sizeof(struct TTYSTRUCT)); /* turn on cbreak - turn off echo */ -#ifndef SYSV - tty.sg_flags |= CBREAK; - tty.sg_flags &= ~ECHO; -#else /* SYSV */ +#if defined(TCSETA) || defined(TCSANOW) tty.c_lflag &= ~ICANON; tty.c_cc[VEOF] = 1; tty.c_lflag &= ~ECHO; -#endif /* SYSV */ +#else + tty.sg_flags |= CBREAK; + tty.sg_flags &= ~ECHO; +#endif echomode = 0; /* set the new flags */ @@@@ -165,7 +172,7 @@@@ icbterm() /* restore term to original settings */ -restoreterm() +void restoreterm(void) { if (badttyinfo) return; @@@@ -206,7 +213,11 @@@@ char *s; struct passwd *pw; char login[17]; char *p = login; +#ifdef NAME_MAX + static char path[NAME_MAX + 1]; +#else static char path[MAXNAMLEN+1]; +#endif /* has to start with a tilde */ if (*s++ != '~') @@@@ -258,11 +269,11 @@@@ echo() } /* turn on echo */ -#ifndef SYSV - tty.sg_flags |= ECHO; -#else /* SYSV */ +#if defined(TCSETA) || defined(TCSANOW) tty.c_lflag |= ECHO; -#endif /* SYSV */ +#else + tty.sg_flags |= ECHO; +#endif echomode = 1; @@@@ -287,11 +298,11 @@@@ noecho() } /* turn off echo */ -#ifndef SYSV - tty.sg_flags &= ~ECHO; -#else /* SYSV */ +#if defined(TCSETA) || defined(TCSANOW) tty.c_lflag &= ~ECHO; -#endif /* SYSV */ +#else + tty.sg_flags &= ~ECHO; +#endif echomode = 0; @ 1.5 log @Fix build with clang by using more void and proper return values. @ text @d1 1 a1 1 $NetBSD: patch-av,v 1.4 2012/02/16 14:13:15 hans Exp $ d5 1 a5 1 @@@@ -7,20 +7,27 @@@@ d20 3 a22 3 #ifdef linux #include #else d24 1 a24 1 #endif d36 1 a36 1 @@@@ -30,6 +37,7 @@@@ d44 1 a44 1 @@@@ -65,13 +73,16 @@@@ gettime() d63 1 a63 1 @@@@ -79,13 +90,13 @@@@ FILE *fp; d80 1 a80 1 @@@@ -94,25 +105,25 @@@@ char c; d114 1 a114 1 @@@@ -121,10 +132,10 @@@@ getterm() d127 1 a127 1 @@@@ -134,7 +145,7 @@@@ getterm() d136 1 a136 1 @@@@ -145,14 +156,14 @@@@ icbterm() d156 1 a156 1 @@@@ -165,7 +176,7 @@@@ icbterm() d165 1 a165 1 @@@@ -206,7 +217,11 @@@@ char *s; d177 1 a177 1 @@@@ -258,11 +273,11 @@@@ echo() d193 1 a193 1 @@@@ -287,11 +302,11 @@@@ noecho() @ 1.4 log @Fix build on SunOS. @ text @d1 1 a1 1 $NetBSD: patch-av,v 1.3 2009/07/24 01:24:39 christos Exp $ d3 2 a4 2 --- icb/unix.c.orig 1995-02-24 16:20:31.000000000 -0500 +++ icb/unix.c 2009-07-23 21:22:34.000000000 -0400 d127 9 d156 9 @ 1.3 log @fix time.h issues @ text @d1 1 a1 1 $NetBSD: patch-av,v 1.2 2008/12/17 02:19:59 christos Exp $ d11 1 d13 1 a13 1 #include d26 1 a26 1 +#if defined(__linux__) || defined(__NetBSD__) d44 1 a44 1 @@@@ -65,13 +73,16 @@@@ d63 1 a63 1 @@@@ -79,13 +90,13 @@@@ d80 1 a80 1 @@@@ -94,25 +105,25 @@@@ d114 1 a114 1 @@@@ -121,10 +132,10 @@@@ d127 1 a127 1 @@@@ -145,14 +156,14 @@@@ d147 1 a147 1 @@@@ -206,7 +217,11 @@@@ d159 1 a159 1 @@@@ -258,11 +273,11 @@@@ d175 1 a175 1 @@@@ -287,11 +302,11 @@@@ @ 1.2 log @make this work on 64 bit platforms: - fix warnings for missing prototypes - use termios instead of sgtty (why doesn't this work on amd64?) @ text @d1 1 a1 1 $NetBSD$ d4 2 a5 2 +++ icb/unix.c 2008-12-16 21:16:10.000000000 -0500 @@@@ -7,20 +7,26 @@@@ d11 1 d35 1 a35 1 @@@@ -30,6 +36,7 @@@@ d43 1 a43 1 @@@@ -65,13 +72,16 @@@@ d62 1 a62 1 @@@@ -79,13 +89,13 @@@@ d79 1 a79 1 @@@@ -94,25 +104,25 @@@@ d113 1 a113 1 @@@@ -121,10 +131,10 @@@@ d126 1 a126 1 @@@@ -145,14 +155,14 @@@@ d146 1 a146 1 @@@@ -206,7 +216,11 @@@@ d158 1 a158 1 @@@@ -258,11 +272,11 @@@@ d174 1 a174 1 @@@@ -287,11 +301,11 @@@@ @ 1.1 log @Teach the backbone of NetBSD communication some ISO C tricks. - no errno, use errno.h - no redefinition of function parameters as local variables [how did this ever work?!] - malloc comes from stdlib.h - NAME_MAX is prefered when available, it is POSIX - strchr, strpbrk, strspn, strstr, strtol and strtoul can and should be used from libc. - remove tcl version of string.h, system header is good enough (and if it doesn't have index, it would have been broken anyway) @ text @d3 78 a80 5 --- icb/history.c.orig 2005-12-13 16:25:41.000000000 +0000 +++ icb/history.c @@@@ -19,7 +19,6 @@@@ static STRLIST *hp = (STRLIST *) 0; /* u histput(nick) char *nick; d82 106 a187 2 - char *malloc(); STRLIST *sp; a188 1 /* hunt for user within list */ @