diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-06-27 08:16:03 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-06-27 08:16:03 +0000 |
commit | e0ad93e853d892132bbc9100f6e57a437528aae5 (patch) | |
tree | 624083c53414e0fda6fe6cf29ce84eae83d57ef0 /lib/libcurses | |
parent | c1da0c612ee213cbca9ce22e3e9ccc39fe62e5cc (diff) |
ncurses-5.0-990626
Diffstat (limited to 'lib/libcurses')
-rw-r--r-- | lib/libcurses/SigAction.h | 12 | ||||
-rw-r--r-- | lib/libcurses/base/sigaction.c | 12 | ||||
-rw-r--r-- | lib/libcurses/curses.h | 8 | ||||
-rw-r--r-- | lib/libcurses/curses.priv.h | 9 | ||||
-rw-r--r-- | lib/libcurses/ncurses_cfg.h | 3 | ||||
-rw-r--r-- | lib/libcurses/tinfo/MKfallback.sh | 11 | ||||
-rw-r--r-- | lib/libcurses/tinfo/comp_hash.c | 7 | ||||
-rw-r--r-- | lib/libcurses/tty/lib_mvcur.c | 22 | ||||
-rw-r--r-- | lib/libcurses/tty/lib_tstp.c | 24 |
9 files changed, 78 insertions, 30 deletions
diff --git a/lib/libcurses/SigAction.h b/lib/libcurses/SigAction.h index 3e8e38376a5..1f06fc2c3b6 100644 --- a/lib/libcurses/SigAction.h +++ b/lib/libcurses/SigAction.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SigAction.h,v 1.1 1998/07/23 21:17:25 millert Exp $ */ +/* $OpenBSD: SigAction.h,v 1.2 1999/06/27 08:15:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $From: SigAction.h,v 1.4 1998/02/11 12:13:55 tom Exp $ + * $From: SigAction.h,v 1.5 1999/06/19 23:00:54 tom Exp $ * * This file exists to handle non-POSIX systems which don't have <unistd.h>, * and usually no sigaction() nor <termios.h> @@ -43,6 +43,14 @@ #ifndef _SIGACTION_H #define _SIGACTION_H +#ifndef HAVE_SIGACTION +#define HAVE_SIGACTION 0 +#endif + +#ifndef HAVE_SIGVEC +#define HAVE_SIGVEC 0 +#endif + #if HAVE_SIGACTION #if !HAVE_TYPE_SIGACTION diff --git a/lib/libcurses/base/sigaction.c b/lib/libcurses/base/sigaction.c index b07ee1c333d..71ab97bbaf7 100644 --- a/lib/libcurses/base/sigaction.c +++ b/lib/libcurses/base/sigaction.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sigaction.c,v 1.2 1999/03/18 16:46:58 millert Exp $ */ +/* $OpenBSD: sigaction.c,v 1.3 1999/06/27 08:14:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,14 +35,15 @@ #include <curses.priv.h> +#include <signal.h> +#include <SigAction.h> + /* This file provides sigaction() emulation using sigvec() */ /* Use only if this is non POSIX system */ -#if !HAVE_SIGACTION -#include <signal.h> -#include <SigAction.h> +#if !HAVE_SIGACTION && HAVE_SIGVEC -MODULE_ID("$From: sigaction.c,v 1.8 1999/03/18 02:12:04 tom Exp $") +MODULE_ID("$From: sigaction.c,v 1.9 1999/06/19 23:05:16 tom Exp $") int sigaction (int sig, sigaction_t * sigact, sigaction_t * osigact) @@ -100,6 +101,7 @@ sigismember (sigset_t * mask, int sig) { return (*mask & sigmask (sig)) != 0; } + #else extern void _nc_sigaction(void); /* quiet's gcc warning */ void _nc_sigaction(void) { } /* nonempty for strict ANSI compilers */ diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index d28dc650c06..cd69f07907a 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.h,v 1.32 1999/06/15 03:07:48 millert Exp $ */ +/* $OpenBSD: curses.h,v 1.33 1999/06/27 08:15:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ -/* $From: curses.h.in,v 1.82 1999/06/06 00:38:49 tom Exp $ */ +/* $From: curses.h.in,v 1.83 1999/06/16 00:25:26 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -50,7 +50,7 @@ /* These are defined only in curses.h, and are used for conditional compiles */ #define NCURSES_VERSION_MAJOR 5 #define NCURSES_VERSION_MINOR 0 -#define NCURSES_VERSION_PATCH 990614 +#define NCURSES_VERSION_PATCH 990626 /* This is defined in more than one ncurses header, for identification */ #undef NCURSES_VERSION @@ -87,7 +87,7 @@ typedef unsigned long chtype; #undef FALSE #define FALSE 0 -#if !defined(__cplusplus) || !1 +#if !defined(__cplusplus) #undef bool typedef char bool; #endif diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h index e73eef31890..0d88a7ad442 100644 --- a/lib/libcurses/curses.priv.h +++ b/lib/libcurses/curses.priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.priv.h,v 1.18 1999/06/14 17:26:04 millert Exp $ */ +/* $OpenBSD: curses.priv.h,v 1.19 1999/06/27 08:15:19 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ /* - * $From: curses.priv.h,v 1.140 1999/06/12 21:19:47 tom Exp $ + * $From: curses.priv.h,v 1.141 1999/06/26 22:00:49 tom Exp $ * * curses.priv.h * @@ -671,6 +671,11 @@ extern void _nc_screen_init(void); extern void _nc_screen_resume(void); extern void _nc_screen_wrap(void); +#if !HAVE_STRSTR +#define strstr _nc_strstr +extern char *_nc_strstr(const char *, const char *); +#endif + /* lib_mouse.c */ extern int _nc_has_mouse(void); diff --git a/lib/libcurses/ncurses_cfg.h b/lib/libcurses/ncurses_cfg.h index cf253af5a83..f9ce6be4980 100644 --- a/lib/libcurses/ncurses_cfg.h +++ b/lib/libcurses/ncurses_cfg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ncurses_cfg.h,v 1.13 1999/05/29 18:27:36 millert Exp $ */ +/* $OpenBSD: ncurses_cfg.h,v 1.14 1999/06/27 08:15:19 millert Exp $ */ /* include/ncurses_cfg.h. Generated automatically by configure. */ /**************************************************************************** @@ -86,6 +86,7 @@ #define HAVE_SIGVEC 1 #define HAVE_SIZECHANGE 1 #define HAVE_STRDUP 1 +#define HAVE_STRSTR 1 #define HAVE_SYMLINK 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_PARAM_H 1 diff --git a/lib/libcurses/tinfo/MKfallback.sh b/lib/libcurses/tinfo/MKfallback.sh index d6631b2ca8a..0c1eaef70c7 100644 --- a/lib/libcurses/tinfo/MKfallback.sh +++ b/lib/libcurses/tinfo/MKfallback.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $OpenBSD: MKfallback.sh,v 1.1 1999/01/18 19:10:12 millert Exp $ -# $From: MKfallback.sh,v 1.8 1996/09/15 01:44:13 tom Exp $ +# $OpenBSD: MKfallback.sh,v 1.2 1999/06/27 08:14:21 millert Exp $ +# $From: MKfallback.sh,v 1.9 1999/06/15 22:57:45 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -25,7 +25,14 @@ then #include <tic.h> /* fallback entries for: $* */ +EOF + for x in $* + do + echo "/* $x */" + infocmp -E $x + done + cat <<EOF static const TERMTYPE fallbacks[$#] = { EOF diff --git a/lib/libcurses/tinfo/comp_hash.c b/lib/libcurses/tinfo/comp_hash.c index 862dd21fb3e..be52efa37ab 100644 --- a/lib/libcurses/tinfo/comp_hash.c +++ b/lib/libcurses/tinfo/comp_hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_hash.c,v 1.3 1999/03/15 19:12:22 millert Exp $ */ +/* $OpenBSD: comp_hash.c,v 1.4 1999/06/27 08:14:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -51,7 +51,7 @@ #define DEBUG(level, params) /*nothing*/ #endif -MODULE_ID("$From: comp_hash.c,v 1.20 1999/03/14 12:23:26 tom Exp $") +MODULE_ID("$From: comp_hash.c,v 1.21 1999/06/26 21:25:11 tom Exp $") static int hash_function(const char *); @@ -66,7 +66,8 @@ static int hash_function(const char *); #ifdef MAIN_PROGRAM -#undef USE_RCS_IDS +#undef MODULE_ID +#define MODULE_ID(id) /*nothing*/ #include <tinfo/doalloc.c> static void _nc_make_hash_table(struct name_table_entry *table, diff --git a/lib/libcurses/tty/lib_mvcur.c b/lib/libcurses/tty/lib_mvcur.c index a096cb6b16d..29e9f89d266 100644 --- a/lib/libcurses/tty/lib_mvcur.c +++ b/lib/libcurses/tty/lib_mvcur.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mvcur.c,v 1.2 1999/02/11 00:09:37 millert Exp $ */ +/* $OpenBSD: lib_mvcur.c,v 1.3 1999/06/27 08:14:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -155,7 +155,7 @@ #include <term.h> #include <ctype.h> -MODULE_ID("$From: lib_mvcur.c,v 1.56 1999/02/01 12:04:15 tom Exp $") +MODULE_ID("$From: lib_mvcur.c,v 1.57 1999/06/26 22:16:04 tom Exp $") #define STRLEN(s) (s != 0) ? strlen(s) : 0 @@ -177,6 +177,24 @@ static float diff; static int normalized_cost(const char *const cap, int affcnt); +#if !HAVE_STRSTR +char * _nc_strstr(const char *haystack, const char *needle) +{ + size_t len1 = strlen(haystack); + size_t len2 = strlen(needle); + char *result = 0; + + while ((len1 != 0) && (len1-- >= len2)) { + if (!strncmp(haystack, needle, len2)) { + result = haystack; + break; + } + haystack++; + } + return result; +} +#endif + /**************************************************************************** * * Initialization/wrapup (including cost pre-computation) diff --git a/lib/libcurses/tty/lib_tstp.c b/lib/libcurses/tty/lib_tstp.c index 11455deff2c..6941f460f21 100644 --- a/lib/libcurses/tty/lib_tstp.c +++ b/lib/libcurses/tty/lib_tstp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tstp.c,v 1.2 1999/01/31 20:17:10 millert Exp $ */ +/* $OpenBSD: lib_tstp.c,v 1.3 1999/06/27 08:14:21 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999 Free Software Foundation, Inc. * @@ -50,7 +50,13 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$From: lib_tstp.c,v 1.17 1999/01/31 01:06:14 tom Exp $") +MODULE_ID("$From: lib_tstp.c,v 1.18 1999/06/19 23:00:06 tom Exp $") + +#if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) +#define USE_SIGTSTP 1 +#else +#define USE_SIGTSTP 0 +#endif /* * Note: This code is fragile! Its problem is that different OSs @@ -95,7 +101,7 @@ MODULE_ID("$From: lib_tstp.c,v 1.17 1999/01/31 01:06:14 tom Exp $") * the future. If nothing else, it's simpler... */ -#ifdef SIGTSTP +#if USE_SIGTSTP static void tstp(int dummy GCC_UNUSED) { sigset_t mask, omask; @@ -190,7 +196,7 @@ static void tstp(int dummy GCC_UNUSED) /* Reset the signals. */ (void)sigprocmask(SIG_SETMASK, &omask, NULL); } -#endif /* defined(SIGTSTP) */ +#endif /* USE_SIGTSTP */ static void cleanup(int sig) { @@ -257,9 +263,9 @@ static int CatchIfDefault(int sig, sigaction_t *act) return FALSE; } #else -static int CatchIfDefault(int sig, RETSIGTYPE (*handler)()) +static int CatchIfDefault(int sig, RETSIGTYPE (*handler)(int)) { - void (*ohandler)(); + void (*ohandler)(int); ohandler = signal(sig, SIG_IGN); if (ohandler == SIG_DFL @@ -289,7 +295,7 @@ static int CatchIfDefault(int sig, RETSIGTYPE (*handler)()) */ void _nc_signal_handler(bool enable) { -#ifdef SIGTSTP /* Xenix 2.x doesn't have this */ +#if USE_SIGTSTP /* Xenix 2.x doesn't have SIGTSTP, for example */ static sigaction_t act, oact; static int ignore; @@ -325,7 +331,7 @@ static int ignore; ignore = TRUE; } } -#else /* !SIGTSTP */ +#else /* !USE_SIGTSTP */ if (enable) { #if HAVE_SIGACTION || HAVE_SIGVEC @@ -351,5 +357,5 @@ static int ignore; #endif #endif /* !(HAVE_SIGACTION || HAVE_SIGVEC) */ } -#endif /* !SIGTSTP */ +#endif /* !USE_SIGTSTP */ } |