Index: Makefile =================================================================== RCS file: /cvsroot/src/lib/libcurses/Makefile,v retrieving revision 1.90 diff -u -r1.90 Makefile --- Makefile 22 Nov 2018 22:00:49 -0000 1.90 +++ Makefile 28 Aug 2019 18:22:03 -0000 @@ -25,7 +25,7 @@ mvwin.c newwin.c nodelay.c notimeout.c overlay.c overwrite.c pause.c \ printw.c putchar.c refresh.c resize.c ripoffline.c scanw.c screen.c \ scroll.c scrollok.c setterm.c slk.c standout.c syncok.c timeout.c \ - toucholap.c touchwin.c tstp.c tty.c unctrl.c underscore.c + toucholap.c touchwin.c tstp.c tty.c unctrl.c underscore.c version.c MAN= curses.3 curses_addch.3 curses_addchstr.3 curses_addstr.3 \ curses_attributes.3 curses_background.3 curses_border.3 \ @@ -209,5 +209,8 @@ fileio.h: shlib_version genfileioh.awk ${TOOL_AWK} -f ${.CURDIR}/genfileioh.awk < ${.CURDIR}/shlib_version > ${.CURDIR}/fileio.h +version.h: genversionh.awk .PHONY + TZ=UTC ${TOOL_AWK} -f ${.CURDIR}/genversionh.awk > ${.CURDIR}/version.h + .include .include Index: curses.h =================================================================== RCS file: /cvsroot/src/lib/libcurses/curses.h,v retrieving revision 1.123 diff -u -r1.123 curses.h --- curses.h 30 Sep 2018 10:55:00 -0000 1.123 +++ curses.h 28 Aug 2019 18:22:03 -0000 @@ -980,6 +980,9 @@ bool is_leaveok(const WINDOW *); bool is_pad(const WINDOW *); +/* ncurses misc */ +char *curses_version(void); + /* Private functions that are needed for user programs prototypes. */ int __cputchar(int); int __waddbytes(WINDOW *, const char *, int, attr_t); Index: genversionh.awk =================================================================== RCS file: genversionh.awk diff -N genversionh.awk --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ genversionh.awk 28 Aug 2019 18:22:03 -0000 @@ -0,0 +1,51 @@ +#!/usr/bin/awk -F +# +# $NetBSD$ +# +# Copyright (c) 2019 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Kamil Rytarowski. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +function mangle_vers(vers) { + sub("^.*\\$NetBSD", "NetBSD", vers); + sub("\\$[^$]*$", "", vers); + return vers; +} + +BEGIN { + MYVER="$NetBSD$"; + MYVER=mangle_vers(MYVER); + DATE=strftime("%F %T", systime()); + printf("/*\n"); + printf(" * Do not edit! Automatically generated file:\n"); + printf(" * by : %s\n", MYVER); + printf(" */\n"); + printf("\n"); + printf("#define CURSES_VERSION_DATE \"%s\"\n", DATE); + + exit; +} Index: shlib_version =================================================================== RCS file: /cvsroot/src/lib/libcurses/shlib_version,v retrieving revision 1.44 diff -u -r1.44 shlib_version --- shlib_version 30 Jun 2019 22:16:20 -0000 1.44 +++ shlib_version 28 Aug 2019 18:22:03 -0000 @@ -1,6 +1,6 @@ # $NetBSD: shlib_version,v 1.44 2019/06/30 22:16:20 blymn Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing -# Remember to run `make fileio.h` when changing +# Remember to run `make fileio.h` and `make version.h` when changing # Remember to increment the major numbers of libform, libmenu and # libpanel when the libcurses major number increments. # Index: version.c =================================================================== RCS file: version.c diff -N version.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ version.c 28 Aug 2019 18:22:03 -0000 @@ -0,0 +1,47 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#ifndef lint +__RCSID("$NetBSD$"); +#endif /* not lint */ + +#include "curses.h" +#include "version.h" + +/* + * curses_version -- + * Return a string of characters with curses version. + */ +char * +curses_version(void) +{ + + return "NetBSD curses " CURSES_VERSION_DATE; +} Index: version.h =================================================================== RCS file: version.h diff -N version.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ version.h 28 Aug 2019 18:22:03 -0000 @@ -0,0 +1,6 @@ +/* + * Do not edit! Automatically generated file: + * by : NetBSD: genfileioh.awk,v 1.2 2008/05/02 11:13:02 martin Exp + */ + +#define CURSES_VERSION_DATE "2019-08-28 18:28:17"