summaryrefslogtreecommitdiffstats
path: root/lib/libedit/sys.h
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2003-10-31 08:42:23 +0000
committerotto <otto@openbsd.org>2003-10-31 08:42:23 +0000
commitd484b7d03ace7dfad66bf1845501ed21cdb16b83 (patch)
tree7217919f9a70564b29131d02c66a64d9abcfe577 /lib/libedit/sys.h
parentregen. (diff)
downloadwireguard-openbsd-d484b7d03ace7dfad66bf1845501ed21cdb16b83.tar.xz
wireguard-openbsd-d484b7d03ace7dfad66bf1845501ed21cdb16b83.zip
Update to NetBSD libedit (from Oct 1, 2003), adding some string
cleaning and history bug fixes. The code includes GNU libreadline functionality, but the corresponding header files are not installed, since some libreadline functions are missing. There are some minor API changes, notably: old: EditLine *el_init(const char *, FILE *, FILE *); new: EditLine *el_init(const char *, FILE *, FILE *, FILE *); old: HistEvent *history(History *h, int op, ...); new: int history(History *h, HistEvent *ev, int op, ...); plus some changes in operation names. See editline(3) for details. Tested by djm@, mouring@, jmc@. ok deraadt@
Diffstat (limited to 'lib/libedit/sys.h')
-rw-r--r--lib/libedit/sys.h46
1 files changed, 35 insertions, 11 deletions
diff --git a/lib/libedit/sys.h b/lib/libedit/sys.h
index 2cbde136889..1335d61c12b 100644
--- a/lib/libedit/sys.h
+++ b/lib/libedit/sys.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: sys.h,v 1.7 2003/06/02 20:18:40 millert Exp $ */
-/* $NetBSD: sys.h,v 1.3 1997/01/11 06:48:12 lukem Exp $ */
+/* $OpenBSD: sys.h,v 1.8 2003/10/31 08:42:24 otto Exp $ */
+/* $NetBSD: sys.h,v 1.8 2003/08/07 16:44:33 agc Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -39,7 +39,15 @@
* sys.h: Put all the stupid compiler and system dependencies here...
*/
#ifndef _h_sys
-#define _h_sys
+#define _h_sys
+
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+# define __attribute__(A)
+#endif
#ifndef public
# define public /* Externally visible functions/variables */
@@ -54,37 +62,54 @@
/* When we want to hide everything */
#endif
-#include <sys/cdefs.h>
-
#ifndef _PTR_T
# define _PTR_T
-typedef void* ptr_t;
+typedef void *ptr_t;
#endif
#ifndef _IOCTL_T
# define _IOCTL_T
-typedef void* ioctl_t;
+typedef void *ioctl_t;
#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_FGETLN
+#define fgetln libedit_fgetln
+char *fgetln(FILE *fp, size_t *len);
+#endif
+
#define REGEX /* Use POSIX.2 regular expression functions */
#undef REGEXP /* Use UNIX V8 regular expression functions */
-#ifdef SUNOS
+#ifdef notdef
# undef REGEX
# undef REGEXP
# include <malloc.h>
-typedef void (*sig_t)(int);
# ifdef __GNUC__
/*
* Broken hdrs.
*/
+extern int tgetent(const char *bp, char *name);
+extern int tgetflag(const char *id);
+extern int tgetnum(const char *id);
+extern char *tgetstr(const char *id, char **area);
+extern char *tgoto(const char *cap, int col, int row);
+extern int tputs(const char *str, int affcnt, int (*putc)(int));
extern char *getenv(const char *);
extern int fprintf(FILE *, const char *, ...);
extern int sigsetmask(int);
extern int sigblock(int);
-extern int ioctl(int, int, void *);
extern int fputc(int, FILE *);
extern int fgetc(FILE *);
extern int fflush(FILE *);
@@ -93,7 +118,6 @@ extern int toupper(int);
extern int errno, sys_nerr;
extern char *sys_errlist[];
extern void perror(const char *);
-extern int read(int, const char*, int);
# include <string.h>
# define strerror(e) sys_errlist[e]
# endif