head 1.6; access; symbols pkgsrc-2026Q1:1.6.0.94 pkgsrc-2026Q1-base:1.6 pkgsrc-2025Q4:1.6.0.92 pkgsrc-2025Q4-base:1.6 pkgsrc-2025Q3:1.6.0.90 pkgsrc-2025Q3-base:1.6 pkgsrc-2025Q2:1.6.0.88 pkgsrc-2025Q2-base:1.6 pkgsrc-2025Q1:1.6.0.86 pkgsrc-2025Q1-base:1.6 pkgsrc-2024Q4:1.6.0.84 pkgsrc-2024Q4-base:1.6 pkgsrc-2024Q3:1.6.0.82 pkgsrc-2024Q3-base:1.6 pkgsrc-2024Q2:1.6.0.80 pkgsrc-2024Q2-base:1.6 pkgsrc-2024Q1:1.6.0.78 pkgsrc-2024Q1-base:1.6 pkgsrc-2023Q4:1.6.0.76 pkgsrc-2023Q4-base:1.6 pkgsrc-2023Q3:1.6.0.74 pkgsrc-2023Q3-base:1.6 pkgsrc-2023Q2:1.6.0.72 pkgsrc-2023Q2-base:1.6 pkgsrc-2023Q1:1.6.0.70 pkgsrc-2023Q1-base:1.6 pkgsrc-2022Q4:1.6.0.68 pkgsrc-2022Q4-base:1.6 pkgsrc-2022Q3:1.6.0.66 pkgsrc-2022Q3-base:1.6 pkgsrc-2022Q2:1.6.0.64 pkgsrc-2022Q2-base:1.6 pkgsrc-2022Q1:1.6.0.62 pkgsrc-2022Q1-base:1.6 pkgsrc-2021Q4:1.6.0.60 pkgsrc-2021Q4-base:1.6 pkgsrc-2021Q3:1.6.0.58 pkgsrc-2021Q3-base:1.6 pkgsrc-2021Q2:1.6.0.56 pkgsrc-2021Q2-base:1.6 pkgsrc-2021Q1:1.6.0.54 pkgsrc-2021Q1-base:1.6 pkgsrc-2020Q4:1.6.0.52 pkgsrc-2020Q4-base:1.6 pkgsrc-2020Q3:1.6.0.50 pkgsrc-2020Q3-base:1.6 pkgsrc-2020Q2:1.6.0.46 pkgsrc-2020Q2-base:1.6 pkgsrc-2020Q1:1.6.0.26 pkgsrc-2020Q1-base:1.6 pkgsrc-2019Q4:1.6.0.48 pkgsrc-2019Q4-base:1.6 pkgsrc-2019Q3:1.6.0.44 pkgsrc-2019Q3-base:1.6 pkgsrc-2019Q2:1.6.0.42 pkgsrc-2019Q2-base:1.6 pkgsrc-2019Q1:1.6.0.40 pkgsrc-2019Q1-base:1.6 pkgsrc-2018Q4:1.6.0.38 pkgsrc-2018Q4-base:1.6 pkgsrc-2018Q3:1.6.0.36 pkgsrc-2018Q3-base:1.6 pkgsrc-2018Q2:1.6.0.34 pkgsrc-2018Q2-base:1.6 pkgsrc-2018Q1:1.6.0.32 pkgsrc-2018Q1-base:1.6 pkgsrc-2017Q4:1.6.0.30 pkgsrc-2017Q4-base:1.6 pkgsrc-2017Q3:1.6.0.28 pkgsrc-2017Q3-base:1.6 pkgsrc-2017Q2:1.6.0.24 pkgsrc-2017Q2-base:1.6 pkgsrc-2017Q1:1.6.0.22 pkgsrc-2017Q1-base:1.6 pkgsrc-2016Q4:1.6.0.20 pkgsrc-2016Q4-base:1.6 pkgsrc-2016Q3:1.6.0.18 pkgsrc-2016Q3-base:1.6 pkgsrc-2016Q2:1.6.0.16 pkgsrc-2016Q2-base:1.6 pkgsrc-2016Q1:1.6.0.14 pkgsrc-2016Q1-base:1.6 pkgsrc-2015Q4:1.6.0.12 pkgsrc-2015Q4-base:1.6 pkgsrc-2015Q3:1.6.0.10 pkgsrc-2015Q3-base:1.6 pkgsrc-2015Q2:1.6.0.8 pkgsrc-2015Q2-base:1.6 pkgsrc-2015Q1:1.6.0.6 pkgsrc-2015Q1-base:1.6 pkgsrc-2014Q4:1.6.0.4 pkgsrc-2014Q4-base:1.6 pkgsrc-2014Q3:1.6.0.2 pkgsrc-2014Q3-base:1.6 pkgsrc-2014Q2:1.5.0.18 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.16 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.14 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.12 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.5.0.10 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.5.0.8 pkgsrc-2013Q1-base:1.5 pkgsrc-2012Q4:1.5.0.6 pkgsrc-2012Q4-base:1.5 pkgsrc-2012Q3:1.5.0.4 pkgsrc-2012Q3-base:1.5 pkgsrc-2012Q2:1.5.0.2 pkgsrc-2012Q2-base:1.5 pkgsrc-2012Q1:1.2.0.80 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.78 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.2.0.76 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.74 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.72 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.70 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.2.0.68 pkgsrc-2010Q3-base:1.2 pkgsrc-2010Q2:1.2.0.66 pkgsrc-2010Q2-base:1.2 pkgsrc-2010Q1:1.2.0.64 pkgsrc-2010Q1-base:1.2 pkgsrc-2009Q4:1.2.0.62 pkgsrc-2009Q4-base:1.2 pkgsrc-2009Q3:1.2.0.60 pkgsrc-2009Q3-base:1.2 pkgsrc-2009Q2:1.2.0.58 pkgsrc-2009Q2-base:1.2 pkgsrc-2009Q1:1.2.0.56 pkgsrc-2009Q1-base:1.2 pkgsrc-2008Q4:1.2.0.54 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.52 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.50 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.48 pkgsrc-2008Q2-base:1.2 cwrapper:1.2.0.46 pkgsrc-2008Q1:1.2.0.44 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.42 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.40 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.38 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.36 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.34 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.32 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.30 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.28 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.26 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.24 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.22 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.20 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.18 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.16 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.14 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.12 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.10 pkgsrc-2003Q4-base:1.2 netbsd-1-6-1:1.2.0.6 netbsd-1-6-1-base:1.2 netbsd-1-6:1.2.0.8 netbsd-1-6-RELEASE-base:1.2 pkgviews:1.2.0.4 pkgviews-base:1.2 buildlink2:1.2.0.2 buildlink2-base:1.2 netbsd-1-5-PATCH003:1.2 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.2 netbsd-1-4-PATCH003:1.2 FreeBSD-current-2000-03-16:1.1.1.1 FREEBSD:1.1.1; locks; strict; comment @# @; 1.6 date 2014.09.23.22.40.27; author jperkin; state Exp; branches; next 1.5; commitid X0tFdM6VgeeEqwRx; 1.5 date 2012.05.14.07.07.41; author dholland; state Exp; branches; next 1.4; 1.4 date 2012.05.14.07.06.16; author dholland; state Exp; branches; next 1.3; 1.3 date 2012.05.10.20.53.30; author dholland; state Exp; branches; next 1.2; 1.2 date 2000.03.23.22.08.52; author tron; state Exp; branches; next 1.1; 1.1 date 2000.03.23.22.04.50; author tron; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.03.23.22.04.50; author tron; state Exp; branches; next ; desc @@ 1.6 log @Don't include termcap.h on SunOS. @ text @$NetBSD: patch-ag,v 1.5 2012/05/14 07:07:41 dholland Exp $ - needs term.h for termcap - get terminal size from termcap only if LINES and COLUMNS aren't set in the environment - return values from non-void functions (arguably these should be made void but it causes complications) - don't use implicit int - add missing conditionals around conditionally-used declaration - remove unused variables - use correct type signature for signal handler - use time_t for calling time() --- src/unix.c.orig 1995-11-18 16:36:58.000000000 +0000 +++ src/unix.c @@@@ -123,6 +123,9 @@@@ int scnothing() #include /* Curses screen output */ #undef WINDOW /* Oh no! */ #endif /* CURSES */ +#ifndef __sun +#include +#endif /** Completion include files **/ /** Directory accessing: Try and figure this out... if you can! **/ @@@@ -816,9 +819,19 @@@@ int scopen() exit(1); } - /* Get size from termcap */ - term.t_nrow = tgetnum("li") - 1; - term.t_ncol = tgetnum("co"); + /* + * If LINES and/or COLUMNS are set in the environment then use those + * values, otherwise get them from termcap. + */ + if ((cp = getenv("LINES")) == NULL || sscanf(cp, "%hd", + &term.t_nrow) != 1) + term.t_nrow = tgetnum("li"); + term.t_nrow -= 1; + + if ((cp = getenv("COLUMNS")) == NULL || sscanf(cp, "%hd", + &term.t_ncol) != 1) + term.t_ncol = tgetnum("co"); + if (term.t_nrow < 3 || term.t_ncol < 3) { puts("Screen size is too small!"); exit(1); @@@@ -956,6 +969,7 @@@@ int sckopen() dis_ufk(); #endif #endif + return 0; } /* close keyboard -hm */ @@@@ -968,6 +982,7 @@@@ int sckclose() dis_sfk(); #endif #endif + return 0; } /** Move cursor **/ @@@@ -1063,7 +1078,7 @@@@ int state; /* New state */ } /** Beep **/ -scbeep() +int scbeep() { #if TERMCAP || TERMIOS #if !NOISY @@@@ -1085,7 +1100,9 @@@@ scbeep() } #if COLOR +#if USG || AUX static char cmap[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; +#endif /** Set foreground color **/ int scfcol(color) @@@@ -1230,11 +1247,9 @@@@ int bktoshell(f, n) /** Get time of day **/ char * timeset() { - long int buf; /* Should be time_t */ + time_t buf; char * sp, * cp; - char * ctime(); - /* Get system time */ time(&buf); @@@@ -1553,7 +1568,6 @@@@ char *fspec; /* Filename specificatio /** Get next filename from pattern **/ char *getnfile() { - int index; struct DIRENTRY * dp; struct stat fstat; @@@@ -1706,15 +1720,15 @@@@ char *name; /* name of directory to dele /* * Window size changes handled via signals. */ -void winch_changed() +void winch_changed(int sig) { + (void)sig; signal(SIGWINCH,winch_changed); winch_flag = 1; } void winch_new_size() { - EWINDOW *wp; struct winsize win; winch_flag=0; @ 1.5 log @Use , not . Should fix build on netbsd-5. @ text @d1 1 a1 1 $NetBSD: patch-ag,v 1.4 2012/05/14 07:06:16 dholland Exp $ d14 1 a14 1 --- src/unix.c.orig 1995-11-18 21:36:58.000000000 +0000 d16 1 a16 1 @@@@ -123,6 +123,7 @@@@ int scnothing() d20 1 d22 1 d26 1 a26 1 @@@@ -816,9 +817,19 @@@@ int scopen() d49 1 a49 1 @@@@ -956,6 +967,7 @@@@ int sckopen() d57 1 a57 1 @@@@ -968,6 +980,7 @@@@ int sckclose() d65 1 a65 1 @@@@ -1063,7 +1076,7 @@@@ int state; /* New state */ d74 1 a74 1 @@@@ -1085,7 +1098,9 @@@@ scbeep() d84 1 a84 1 @@@@ -1230,11 +1245,9 @@@@ int bktoshell(f, n) d97 1 a97 1 @@@@ -1553,7 +1566,6 @@@@ char *fspec; /* Filename specificatio d105 1 a105 1 @@@@ -1706,15 +1718,15 @@@@ char *name; /* name of directory to dele @ 1.4 log @Use time_t to call time(), not "long int". @ text @d1 1 a1 1 $NetBSD: patch-ag,v 1.3 2012/05/10 20:53:30 dholland Exp $ d20 1 a20 1 +#include @ 1.3 log @Pass -Wall. Fix a number of minor bugs and possibly some major ones. Should also fix clang build. PKGREVISION++ @ text @d1 1 a1 1 $NetBSD: patch-ag,v 1.2 2000/03/23 22:08:52 tron Exp $ d12 1 d82 14 a95 1 @@@@ -1553,7 +1568,6 @@@@ char *fspec; /* Filename specificatio d103 1 a103 1 @@@@ -1706,15 +1720,15 @@@@ char *name; /* name of directory to dele @ 1.2 log @Adapt this package to NetBSD. @ text @d1 1 a1 1 $NetBSD$ d3 21 a23 3 --- src/unix.c.orig Sat Nov 13 14:57:12 1999 +++ src/unix.c Sat Nov 13 15:04:45 1999 @@@@ -816,9 +816,19 @@@@ d34 1 a34 1 + if ((cp = getenv("LINES")) == NULL || sscanf(cp, "%d", d39 1 a39 1 + if ((cp = getenv("COLUMNS")) == NULL || sscanf(cp, "%d", d46 61 @ 1.1 log @Initial revision @ text @d1 2 @ 1.1.1.1 log @Import "uemacs" port from FreeBSD ports collection: A full screen editor @ text @@