summaryrefslogtreecommitdiff
path: root/bin/sh/var.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-10-20 00:55:12 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-10-20 00:55:12 +0000
commit8414ed88be8de5352141730c176d30301d6700b4 (patch)
tree44a7f767c70131fb1d09f8a151860fee4e22ae5f /bin/sh/var.h
parent78d30b21a3fa6e2f7d7fb077246e1e015a2dafdf (diff)
Sync with NetBSD. Adds better POSIX compliance amongst others.
Diffstat (limited to 'bin/sh/var.h')
-rw-r--r--bin/sh/var.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/bin/sh/var.h b/bin/sh/var.h
index a7cd07bd712..00ed16c3983 100644
--- a/bin/sh/var.h
+++ b/bin/sh/var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.h,v 1.2 1996/06/23 14:21:37 deraadt Exp $ */
+/* $OpenBSD: var.h,v 1.3 1996/10/20 00:55:09 millert Exp $ */
/* $NetBSD: var.h,v 1.9 1995/05/11 21:30:44 christos Exp $ */
/*-
@@ -44,18 +44,22 @@
*/
/* flags */
-#define VEXPORT 01 /* variable is exported */
-#define VREADONLY 02 /* variable cannot be modified */
-#define VSTRFIXED 04 /* variable struct is staticly allocated */
-#define VTEXTFIXED 010 /* text is staticly allocated */
-#define VSTACK 020 /* text is allocated on the stack */
-#define VUNSET 040 /* the variable is not set */
+#define VEXPORT 0x01 /* variable is exported */
+#define VREADONLY 0x02 /* variable cannot be modified */
+#define VSTRFIXED 0x04 /* variable struct is staticly allocated */
+#define VTEXTFIXED 0x08 /* text is staticly allocated */
+#define VSTACK 0x10 /* text is allocated on the stack */
+#define VUNSET 0x20 /* the variable is not set */
+#define VNOFUNC 0x40 /* don't call the callback function */
struct var {
struct var *next; /* next entry in hash list */
int flags; /* flags are defined above */
char *text; /* name=value */
+ void (*func) __P((const char *));
+ /* function to be called when */
+ /* the variable gets set/unset */
};
@@ -81,6 +85,9 @@ extern struct var vps2;
#if ATTY
extern struct var vterm;
#endif
+#ifndef NO_HISTORY
+extern struct var vhistsize;
+#endif
/*
* The following macros access the values of the above variables.
@@ -97,6 +104,10 @@ extern struct var vterm;
#if ATTY
#define termval() (vterm.text + 5)
#endif
+#define optindval() (voptind.text + 7)
+#ifndef NO_HISTORY
+#define histsizeval() (vhistsize.text + 9)
+#endif
#if ATTY
#define attyset() ((vatty.flags & VUNSET) == 0)
@@ -119,3 +130,4 @@ void mklocal __P((char *));
void poplocalvars __P((void));
int setvarcmd __P((int, char **));
int unsetcmd __P((int, char **));
+int unsetvar __P((char *));