Module Name:    src
Committed By:   christos
Date:           Sat Feb  4 14:34:28 UTC 2023

Modified Files:
        src/lib/libedit: config.h sys.h terminal.c

Log Message:
Remove unused stuff, and limit the scope of some of the used ones.
(from des@freebsd)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libedit/config.h
cvs rdiff -u -r1.27 -r1.28 src/lib/libedit/sys.h
cvs rdiff -u -r1.45 -r1.46 src/lib/libedit/terminal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/config.h
diff -u src/lib/libedit/config.h:1.9 src/lib/libedit/config.h:1.10
--- src/lib/libedit/config.h:1.9	Wed Mar 23 18:27:48 2016
+++ src/lib/libedit/config.h	Sat Feb  4 09:34:28 2023
@@ -1,31 +1,6 @@
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if the `closedir' function returns void instead of `int'. */
-/* #undef CLOSEDIR_VOID */
-
 /* Define to 1 if you have the <curses.h> header file. */
 #define HAVE_CURSES_H 1
 
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#define HAVE_DIRENT_H 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `endpwent' function. */
-#define HAVE_ENDPWENT 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `getline' function. */
-#define HAVE_GETLINE 1
-
-/* Define to 1 if you have the `fork' function. */
-#define HAVE_FORK 1
-
 /* Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1
    versions. */
 /* #undef HAVE_GETPW_R_DRAFT */
@@ -34,253 +9,23 @@
    compatible. */
 #define HAVE_GETPW_R_POSIX 1
 
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `isascii' function. */
-#define HAVE_ISASCII 1
-
 /* Define to 1 if you have the `issetugid' function. */
 #define HAVE_ISSETUGID 1
 
-/* Define to 1 if you have the `curses' library (-lcurses). */
-/* #undef HAVE_LIBCURSES */
-
-/* Define to 1 if you have the `ncurses' library (-lncurses). */
-/* #undef HAVE_LIBNCURSES */
-
-/* Define to 1 if you have the `termcap' library (-ltermcap). */
-/* #undef HAVE_LIBTERMCAP */
-
-/* Define to 1 if you have the `terminfo' library (-lterminfo). */
-#define HAVE_LIBTERMINFO 1
-
-/* Define to 1 if you have the `termlib' library (-ltermlib). */
-/* #undef HAVE_LIBTERMLIB */
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#define HAVE_MALLOC_H 1
-
-/* Define to 1 if you have the `memchr' function. */
-#define HAVE_MEMCHR 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
 /* Define to 1 if you have the <ncurses.h> header file. */
 /* #undef HAVE_NCURSES_H */
 
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-/* #undef HAVE_NDIR_H */
-
-/* Define to 1 if you have the `regcomp' function. */
-#define HAVE_REGCOMP 1
-
-/* Define to 1 if you have the `re_comp' function. */
-/* #undef HAVE_RE_COMP */
-
-/* Define to 1 if `stat' has the bug that it succeeds when given the
-   zero-length file name argument. */
-/* #undef HAVE_STAT_EMPTY_STRING_BUG */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#define HAVE_STRCASECMP 1
-
-/* Define to 1 if you have the `strchr' function. */
-#define HAVE_STRCHR 1
-
-/* Define to 1 if you have the `strcspn' function. */
-#define HAVE_STRCSPN 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strlcat' function. */
-#define HAVE_STRLCAT 1
-
-/* Define to 1 if you have the `strlcpy' function. */
-#define HAVE_STRLCPY 1
-
-/* Define to 1 if you have the `strrchr' function. */
-#define HAVE_STRRCHR 1
-
-/* Define to 1 if you have the `strstr' function. */
-#define HAVE_STRSTR 1
-
-/* Define to 1 if you have the `strtol' function. */
-#define HAVE_STRTOL 1
-
 /* Define to 1 if struct dirent has member d_namlen */
 #define HAVE_STRUCT_DIRENT_D_NAMLEN 1
 
-/* Define to 1 if you have the `strunvis' function. */
-#define HAVE_STRUNVIS 1
-
-/* Define to 1 if you have the `strvis' function. */
-#define HAVE_STRVIS 1
-
 /* Define to 1 if you have the <sys/cdefs.h> header file. */
 #define HAVE_SYS_CDEFS_H 1
 
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
 /* Define to 1 if you have the <termcap.h> header file. */
 #define HAVE_TERMCAP_H 1
 
 /* Define to 1 if you have the <term.h> header file. */
 #define HAVE_TERM_H 1
 
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if the system has the type `u_int32_t'. */
-#define HAVE_U_INT32_T 1
-
-/* Define to 1 if you have the `vfork' function. */
-#define HAVE_VFORK 1
-
-/* Define to 1 if you have the <vfork.h> header file. */
-/* #undef HAVE_VFORK_H */
-
-/* Define to 1 if you have the `vis' function. */
-#define HAVE_VIS 1
-
-/* Define to 1 if `fork' works. */
-#define HAVE_WORKING_FORK 1
-
-/* Define to 1 if `vfork' works. */
-#define HAVE_WORKING_VFORK 1
-
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
-   slash. */
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "libedit-20110729"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "libedit"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libedit 3.0"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "libedit-20110729"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.0"
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#define RETSIGTYPE void
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# define _ALL_SOURCE 1
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# define _POSIX_PTHREAD_SEMANTICS 1
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# define _TANDEM_SOURCE 1
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__ 1
-#endif
-
-
-/* Version number of package */
-#define VERSION "3.0"
-
-/* Define to 1 if the system provides the SIZE_MAX constant */
-#define HAVE_SIZE_MAX	1
-
-/* Define to 1 if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define as `fork' if `vfork' does not work. */
-/* #undef vfork */
-
-
 #include "sys.h"
-/* #undef SCCSID */
-/* #undef LIBC_SCCS */
-/* #undef lint */
 

Index: src/lib/libedit/sys.h
diff -u src/lib/libedit/sys.h:1.27 src/lib/libedit/sys.h:1.28
--- src/lib/libedit/sys.h:1.27	Mon May  9 17:46:56 2016
+++ src/lib/libedit/sys.h	Sat Feb  4 09:34:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys.h,v 1.27 2016/05/09 21:46:56 christos Exp $	*/
+/*	$NetBSD: sys.h,v 1.28 2023/02/04 14:34:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -65,49 +65,11 @@
 # define __arraycount(a) (sizeof(a) / sizeof(*(a)))
 #endif
 
-#include <stdio.h>
-
-#ifndef HAVE_STRLCAT
-#define	strlcat libedit_strlcat
-size_t	strlcat(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_STRLCPY
-#define	strlcpy libedit_strlcpy
-size_t	strlcpy(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_GETLINE
-#define	getline libedit_getline
-ssize_t	getline(char **line, size_t *len, FILE *fp);
-#endif
-
-#ifndef _DIAGASSERT
-#define _DIAGASSERT(x)
-#endif
-
 #ifndef __RCSID
 #define __RCSID(x)
 #endif
 
-#ifndef HAVE_U_INT32_T
-typedef unsigned int	u_int32_t;
-#endif
-
-#ifndef HAVE_SIZE_MAX
-#define SIZE_MAX	((size_t)-1)
-#endif
-
 #define	REGEX		/* Use POSIX.2 regular expression functions */
 #undef	REGEXP		/* Use UNIX V8 regular expression functions */
 
-#if defined(__sun)
-extern int tgetent(char *, const char *);
-extern int tgetflag(char *);
-extern int tgetnum(char *);
-extern int tputs(const char *, int, int (*)(int));
-extern char* tgoto(const char*, int, int);
-extern char* tgetstr(char*, char**);
-#endif
-
 #endif /* _h_sys */

Index: src/lib/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.45 src/lib/libedit/terminal.c:1.46
--- src/lib/libedit/terminal.c:1.45	Sun Oct 30 15:11:31 2022
+++ src/lib/libedit/terminal.c	Sat Feb  4 09:34:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.45 2022/10/30 19:11:31 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.46 2023/02/04 14:34:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c	8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.45 2022/10/30 19:11:31 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.46 2023/02/04 14:34:28 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -68,6 +68,15 @@ __RCSID("$NetBSD: terminal.c,v 1.45 2022
 #include <term.h>
 #endif
 
+#if defined(__sun)
+extern int tgetent(char *, const char *);
+extern int tgetflag(char *);
+extern int tgetnum(char *);
+extern int tputs(const char *, int, int (*)(int));
+extern char* tgoto(const char*, int, int);
+extern char* tgetstr(char*, char**);
+#endif
+
 #ifdef _REENTRANT
 #include <pthread.h>
 #endif

Reply via email to