summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/datetime.c4
-rw-r--r--Src/Modules/langinfo.c16
-rw-r--r--Src/Modules/mapfile.c34
-rw-r--r--Src/Modules/parameter.c322
-rw-r--r--Src/Modules/system.c2
-rw-r--r--Src/Modules/termcap.c49
-rw-r--r--Src/Modules/terminfo.c45
-rw-r--r--Src/Modules/zftp.c8
8 files changed, 236 insertions, 244 deletions
diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c
index f01a54ea1..80090a65b 100644
--- a/Src/Modules/datetime.c
+++ b/Src/Modules/datetime.c
@@ -118,8 +118,8 @@ cleanup_(Module m)
 
     deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
     pm = (Param) paramtab->getnode(paramtab, "EPOCHSECONDS");
-    if (pm && (pm->flags & PM_SPECIAL)) {
-	pm->flags &= ~PM_READONLY;
+    if (pm && (pm->node.flags & PM_SPECIAL)) {
+	pm->node.flags &= ~PM_READONLY;
 	unsetparam_pm(pm, 0, 1);
     }
     return 0;
diff --git a/Src/Modules/langinfo.c b/Src/Modules/langinfo.c
index 10754e36c..d927358ed 100644
--- a/Src/Modules/langinfo.c
+++ b/Src/Modules/langinfo.c
@@ -446,8 +446,8 @@ getlanginfo(UNUSED(HashTable ht), char *name)
     unmetafy(name, &len);
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_READONLY | PM_SCALAR;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_READONLY | PM_SCALAR;
     pm->gsu.s = &nullsetscalar_gsu;
 
     if(name)
@@ -462,9 +462,9 @@ getlanginfo(UNUSED(HashTable ht), char *name)
     {
 	/* zwarn("no such lang info: %s", name, 0); */
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -477,14 +477,14 @@ scanlanginfo(UNUSED(HashTable ht), ScanFunc func, int flags)
 
     pm = (Param) hcalloc(sizeof(struct param));
     pm->gsu.s = &nullsetscalar_gsu;
-    pm->flags = PM_READONLY | PM_SCALAR;
+    pm->node.flags = PM_READONLY | PM_SCALAR;
 
     nlcode = &nl_vals[0];
     for (element = (char **)nl_names; *element; element++, nlcode++) {
 	if ((langstr = nl_langinfo(*nlcode)) != NULL) {
 	    pm->u.str = dupstring(langstr);
-	    pm->nam = dupstring(*element);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*element);
+	    func(&pm->node, flags);
 	}
     }
     
@@ -522,7 +522,7 @@ cleanup_(UNUSED(Module m))
 
     if ((pm = (Param) paramtab->getnode(paramtab, langinfo_nam)) &&
 	pm == langinfo_pm) {
-	pm->flags &= ~PM_READONLY;
+	pm->node.flags &= ~PM_READONLY;
 	unsetparam_pm(pm, 0, 1);
     }
 #endif
diff --git a/Src/Modules/mapfile.c b/Src/Modules/mapfile.c
index 0ba7e6fd9..9f3ca2612 100644
--- a/Src/Modules/mapfile.c
+++ b/Src/Modules/mapfile.c
@@ -119,7 +119,7 @@ static void
 setpmmapfile(Param pm, char *value)
 {
     int fd = -1, len;
-    char *name = ztrdup(pm->nam);
+    char *name = ztrdup(pm->node.nam);
 #ifdef USE_MMAP
     caddr_t mmptr;
 #else
@@ -135,7 +135,7 @@ setpmmapfile(Param pm, char *value)
 
     /* Open the file for writing */
 #ifdef USE_MMAP
-    if (!(pm->flags & PM_READONLY) &&
+    if (!(pm->node.flags & PM_READONLY) &&
 	(fd = open(name, O_RDWR|O_CREAT|O_NOCTTY, 0666)) >= 0 &&
 	(mmptr = (caddr_t)mmap((caddr_t)0, len, PROT_READ | PROT_WRITE,
 			       MMAP_ARGS, fd, (off_t)0)) != (caddr_t)-1) {
@@ -175,11 +175,11 @@ static void
 unsetpmmapfile(Param pm, UNUSED(int exp))
 {
     /* Unlink the file given by pm->nam */
-    char *fname = ztrdup(pm->nam);
+    char *fname = ztrdup(pm->node.nam);
     int dummy;
     unmetafy(fname, &dummy);
 
-    if (!(pm->flags & PM_READONLY))
+    if (!(pm->node.flags & PM_READONLY))
 	unlink(fname);
 
     free(fname);
@@ -198,7 +198,7 @@ setpmmapfiles(Param pm, HashTable ht)
     if (!ht)
 	return;
 
-    if (!(pm->flags & PM_READONLY))
+    if (!(pm->node.flags & PM_READONLY))
 	for (i = 0; i < ht->hsize; i++)
 	    for (hn = ht->nodes[i]; hn; hn = hn->next) {
 		struct value v;
@@ -269,19 +269,19 @@ getpmmapfile(UNUSED(HashTable ht), char *name)
     Param pm = NULL;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR;
     pm->gsu.s = &mapfile_gsu;
-    pm->flags |= (mapfile_pm->flags & PM_READONLY);
+    pm->node.flags |= (mapfile_pm->node.flags & PM_READONLY);
 
     /* Set u.str to contents of file given by name */
-    if ((contents = get_contents(pm->nam)))
+    if ((contents = get_contents(pm->node.nam)))
 	pm->u.str = contents;
     else {
 	pm->u.str = "";
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 
@@ -296,21 +296,21 @@ scanpmmapfile(UNUSED(HashTable ht), ScanFunc func, int flags)
 	return;
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR;
+    pm.node.flags = PM_SCALAR;
     pm.gsu.s = &mapfile_gsu;
-    pm.flags |= (mapfile_pm->flags & PM_READONLY);
+    pm.node.flags |= (mapfile_pm->node.flags & PM_READONLY);
 
     /* Here we scan the current directory, calling func() for each file */
-    while ((pm.nam = zreaddir(dir, 1))) {
+    while ((pm.node.nam = zreaddir(dir, 1))) {
 	/*
 	 * Hmmm, it's rather wasteful always to read the contents.
 	 * In fact, it's grotesequely wasteful, since that would mean
 	 * we always read the entire contents of every single file
 	 * in the directory into memory.  Hence just leave it empty.
 	 */
-	pm.nam = dupstring(pm.nam);
+	pm.node.nam = dupstring(pm.node.nam);
 	pm.u.str = "";
-	func((HashNode) &pm, flags);
+	func(&pm.node, flags);
     }
     closedir(dir);
 }
@@ -344,7 +344,7 @@ cleanup_(UNUSED(Module m))
 
     if ((pm = (Param) paramtab->getnode(paramtab, mapfile_nam)) &&
 	pm == mapfile_pm) {
-	pm->flags &= ~PM_READONLY;
+	pm->node.flags &= ~PM_READONLY;
 	unsetparam_pm(pm, 0, 1);
     }
     return 0;
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index faa18a92d..2f9f574e0 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -83,10 +83,10 @@ static char *
 paramtypestr(Param pm)
 {
     char *val = NULL;
-    int f = pm->flags;
+    int f = pm->node.flags;
 
     if (!(f & PM_UNSET)) {
-	if (pm->flags & PM_AUTOLOAD)
+	if (pm->node.flags & PM_AUTOLOAD)
 	    return dupstring("undefined");
 
 	switch (PM_TYPE(f)) {
@@ -138,17 +138,17 @@ getpmparameter(UNUSED(HashTable ht), char *name)
     Param rpm, pm = NULL;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
     if ((rpm = (Param) realparamtab->getnode(realparamtab, name)) &&
-	!(rpm->flags & PM_UNSET))
+	!(rpm->node.flags & PM_UNSET))
 	pm->u.str = paramtypestr(rpm);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -160,19 +160,19 @@ scanpmparameters(UNUSED(HashTable ht), ScanFunc func, int flags)
     HashNode hn;
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (i = 0; i < realparamtab->hsize; i++)
 	for (hn = realparamtab->nodes[i]; hn; hn = hn->next) {
-	    if (((Param)hn)->flags & PM_UNSET)
+	    if (((Param)hn)->node.flags & PM_UNSET)
 		continue;
-	    pm.nam = hn->nam;
+	    pm.node.nam = hn->nam;
 	    if (func != scancountparams &&
 		((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		 !(flags & SCANPM_WANTKEYS)))
 		pm.u.str = paramtypestr((Param) hn);
-	    func((HashNode) &pm, flags);
+	    func(&pm.node, flags);
 	}
 }
 
@@ -188,10 +188,10 @@ setpmcommand(Param pm, char *value)
     } else {
 	Cmdnam cn = zshcalloc(sizeof(*cn));
 
-	cn->flags = HASHED;
+	cn->node.flags = HASHED;
 	cn->u.cmd = value;
 
-	cmdnamtab->addnode(cmdnamtab, ztrdup(pm->nam), (HashNode) cn);
+	cmdnamtab->addnode(cmdnamtab, ztrdup(pm->node.nam), &cn->node);
     }
 }
 
@@ -199,7 +199,7 @@ setpmcommand(Param pm, char *value)
 static void
 unsetpmcommand(Param pm, UNUSED(int exp))
 {
-    HashNode hn = cmdnamtab->removenode(cmdnamtab, pm->nam);
+    HashNode hn = cmdnamtab->removenode(cmdnamtab, pm->node.nam);
 
     if (hn)
 	cmdnamtab->freenode(hn);
@@ -225,10 +225,10 @@ setpmcommands(UNUSED(Param pm), HashTable ht)
 	    v.arr = NULL;
 	    v.pm = (Param) hn;
 
-	    cn->flags = HASHED;
+	    cn->node.flags = HASHED;
 	    cn->u.cmd = ztrdup(getstrvalue(&v));
 
-	    cmdnamtab->addnode(cmdnamtab, ztrdup(hn->nam), (HashNode) cn);
+	    cmdnamtab->addnode(cmdnamtab, ztrdup(hn->nam), &cn->node);
 	}
     deleteparamtable(ht);
 }
@@ -250,11 +250,11 @@ getpmcommand(UNUSED(HashTable ht), char *name)
 	cmd = (Cmdnam) cmdnamtab->getnode(cmdnamtab, name);
     }
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR;
     pm->gsu.s = &pmcommand_gsu;
     if (cmd) {
-	if (cmd->flags & HASHED)
+	if (cmd->node.flags & HASHED)
 	    pm->u.str = cmd->u.cmd;
 	else {
 	    pm->u.str = zhalloc(strlen(*(cmd->u.name)) + strlen(name) + 2);
@@ -264,9 +264,9 @@ getpmcommand(UNUSED(HashTable ht), char *name)
 	}
     } else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -282,27 +282,27 @@ scanpmcommands(UNUSED(HashTable ht), ScanFunc func, int flags)
 	cmdnamtab->filltable(cmdnamtab);
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR;
+    pm.node.flags = PM_SCALAR;
     pm.gsu.s = &pmcommand_gsu;
 
     for (i = 0; i < cmdnamtab->hsize; i++)
 	for (hn = cmdnamtab->nodes[i]; hn; hn = hn->next) {
-	    pm.nam = hn->nam;
+	    pm.node.nam = hn->nam;
 	    cmd = (Cmdnam) hn;
 	    if (func != scancountparams &&
 		((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		 !(flags & SCANPM_WANTKEYS))) {
-		if (cmd->flags & HASHED)
+		if (cmd->node.flags & HASHED)
 		    pm.u.str = cmd->u.cmd;
 		else {
 		    pm.u.str = zhalloc(strlen(*(cmd->u.name)) +
-				       strlen(cmd->nam) + 2);
+				       strlen(cmd->node.nam) + 2);
 		    strcpy(pm.u.str, *(cmd->u.name));
 		    strcat(pm.u.str, "/");
-		    strcat(pm.u.str, cmd->nam);
+		    strcat(pm.u.str, cmd->node.nam);
 		}
 	    }
-	    func((HashNode) &pm, flags);
+	    func(&pm.node, flags);
 	}
 }
 
@@ -328,7 +328,7 @@ setfunction(char *name, char *val, int dis)
     }
     shf = (Shfunc) zalloc(sizeof(*shf));
     shf->funcdef = dupeprog(prog, 0);
-    shf->flags = dis;
+    shf->node.flags = dis;
 
     if (!strncmp(name, "TRAP", 4) &&
 	(sn = getsignum(name + 4)) != -1) {
@@ -347,21 +347,21 @@ setfunction(char *name, char *val, int dis)
 static void
 setpmfunction(Param pm, char *value)
 {
-    setfunction(pm->nam, value, 0);
+    setfunction(pm->node.nam, value, 0);
 }
 
 /**/
 static void
 setpmdisfunction(Param pm, char *value)
 {
-    setfunction(pm->nam, value, DISABLED);
+    setfunction(pm->node.nam, value, DISABLED);
 }
 
 /**/
 static void
 unsetpmfunction(Param pm, UNUSED(int exp))
 {
-    HashNode hn = shfunctab->removenode(shfunctab, pm->nam);
+    HashNode hn = shfunctab->removenode(shfunctab, pm->node.nam);
 
     if (hn)
 	shfunctab->freenode(hn);
@@ -418,17 +418,17 @@ getfunction(UNUSED(HashTable ht), char *name, int dis)
     Param pm = NULL;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR;
     pm->gsu.s = dis ? &pmdisfunction_gsu :  &pmfunction_gsu;
 
     if ((shf = (Shfunc) shfunctab->getnode2(shfunctab, name)) &&
-	(dis ? (shf->flags & DISABLED) : !(shf->flags & DISABLED))) {
-	if (shf->flags & PM_UNDEFINED) {
+	(dis ? (shf->node.flags & DISABLED) : !(shf->node.flags & DISABLED))) {
+	if (shf->node.flags & PM_UNDEFINED) {
 	    pm->u.str = dyncat("builtin autoload -X",
-			       ((shf->flags & PM_UNALIASED) ?
-				((shf->flags & PM_TAGGED) ? "Ut" : "U") :
-				((shf->flags & PM_TAGGED) ? "t" : "")));
+			       ((shf->node.flags & PM_UNALIASED) ?
+				((shf->node.flags & PM_TAGGED) ? "Ut" : "U") :
+				((shf->node.flags & PM_TAGGED) ? "t" : "")));
 	} else {
 	    char *t = getpermtext(shf->funcdef, NULL), *n, *h;
 
@@ -449,9 +449,9 @@ getfunction(UNUSED(HashTable ht), char *name, int dis)
 	}
     } else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -477,23 +477,23 @@ scanfunctions(UNUSED(HashTable ht), ScanFunc func, int flags, int dis)
     HashNode hn;
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR;
+    pm.node.flags = PM_SCALAR;
     pm.gsu.s = dis ? &pmdisfunction_gsu : &pmfunction_gsu;
 
     for (i = 0; i < shfunctab->hsize; i++)
 	for (hn = shfunctab->nodes[i]; hn; hn = hn->next) {
 	    if (dis ? (hn->flags & DISABLED) : !(hn->flags & DISABLED)) {
-		pm.nam = hn->nam;
+		pm.node.nam = hn->nam;
 		if (func != scancountparams &&
 		    ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		     !(flags & SCANPM_WANTKEYS))) {
-		    if (((Shfunc) hn)->flags & PM_UNDEFINED) {
+		    if (((Shfunc) hn)->node.flags & PM_UNDEFINED) {
 			Shfunc shf = (Shfunc) hn;
 			pm.u.str =
 			    dyncat("builtin autoload -X",
-				   ((shf->flags & PM_UNALIASED) ?
-				    ((shf->flags & PM_TAGGED) ? "Ut" : "U") :
-				    ((shf->flags & PM_TAGGED) ? "t" : "")));
+				   ((shf->node.flags & PM_UNALIASED) ?
+				    ((shf->node.flags & PM_TAGGED) ? "Ut" : "U") :
+				    ((shf->node.flags & PM_TAGGED) ? "t" : "")));
 		    } else {
 			char *t = getpermtext(((Shfunc) hn)->funcdef, NULL), *n;
 
@@ -511,7 +511,7 @@ scanfunctions(UNUSED(HashTable ht), ScanFunc func, int flags, int dis)
 			zsfree(t);
 		    }
 		}
-		func((HashNode) &pm, flags);
+		func(&pm.node, flags);
 	    }
 	}
 }
@@ -561,20 +561,20 @@ getbuiltin(UNUSED(HashTable ht), char *name, int dis)
     Builtin bn;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
     if ((bn = (Builtin) builtintab->getnode2(builtintab, name)) &&
-	(dis ? (bn->flags & DISABLED) : !(bn->flags & DISABLED))) {
-	char *t = ((bn->handlerfunc || (bn->flags & BINF_PREFIX)) ?
+	(dis ? (bn->node.flags & DISABLED) : !(bn->node.flags & DISABLED))) {
+	char *t = ((bn->handlerfunc || (bn->node.flags & BINF_PREFIX)) ?
 		   "defined" : "undefined");
 
 	pm->u.str = dupstring(t);
     } else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -600,13 +600,13 @@ scanbuiltins(UNUSED(HashTable ht), ScanFunc func, int flags, int dis)
     HashNode hn;
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (i = 0; i < builtintab->hsize; i++)
 	for (hn = builtintab->nodes[i]; hn; hn = hn->next) {
 	    if (dis ? (hn->flags & DISABLED) : !(hn->flags & DISABLED)) {
-		pm.nam = hn->nam;
+		pm.node.nam = hn->nam;
 		if (func != scancountparams &&
 		    ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		     !(flags & SCANPM_WANTKEYS))) {
@@ -616,7 +616,7 @@ scanbuiltins(UNUSED(HashTable ht), ScanFunc func, int flags, int dis)
 
 		    pm.u.str = dupstring(t);
 		}
-		func((HashNode) &pm, flags);
+		func(&pm.node, flags);
 	    }
 	}
 }
@@ -680,10 +680,10 @@ setpmoption(Param pm, char *value)
 
     if (!value || (strcmp(value, "on") && strcmp(value, "off")))
 	zwarn("invalid value: %s", value, 0);
-    else if (!(n = optlookup(pm->nam)))
-	zwarn("no such option: %s", pm->nam, 0);
+    else if (!(n = optlookup(pm->node.nam)))
+	zwarn("no such option: %s", pm->node.nam, 0);
     else if (dosetopt(n, (value && strcmp(value, "off")), 0))
-	zwarn("can't change option: %s", pm->nam, 0);
+	zwarn("can't change option: %s", pm->node.nam, 0);
     zsfree(value);
 }
 
@@ -693,10 +693,10 @@ unsetpmoption(Param pm, UNUSED(int exp))
 {
     int n;
 
-    if (!(n = optlookup(pm->nam)))
-	zwarn("no such option: %s", pm->nam, 0);
+    if (!(n = optlookup(pm->node.nam)))
+	zwarn("no such option: %s", pm->node.nam, 0);
     else if (dosetopt(n, 0, 0))
-	zwarn("can't change option: %s", pm->nam, 0);
+	zwarn("can't change option: %s", pm->node.nam, 0);
 }
 
 /**/
@@ -740,8 +740,8 @@ getpmoption(UNUSED(HashTable ht), char *name)
     int n;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR;
     pm->gsu.s = &pmoption_gsu;
 
     if ((n = optlookup(name)))
@@ -755,9 +755,9 @@ getpmoption(UNUSED(HashTable ht), char *name)
     }
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -769,16 +769,16 @@ scanpmoptions(UNUSED(HashTable ht), ScanFunc func, int flags)
     HashNode hn;
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR;
+    pm.node.flags = PM_SCALAR;
     pm.gsu.s = &pmoption_gsu;
 
     for (i = 0; i < optiontab->hsize; i++)
 	for (hn = optiontab->nodes[i]; hn; hn = hn->next) {
 	    int optno = ((Optname) hn)->optno, ison;
-	    pm.nam = hn->nam;
+	    pm.node.nam = hn->nam;
 	    ison = optno < 0 ? !opts[-optno] : opts[optno];
 	    pm.u.str = dupstring(ison ? "on" : "off");
-	    func((HashNode) &pm, flags);
+	    func(&pm.node, flags);
 	}
 }
 
@@ -791,7 +791,7 @@ static int modpmfound;
 static void
 modpmbuiltinscan(HashNode hn, UNUSED(int dummy))
 {
-    if (!(((Builtin) hn)->flags & BINF_ADDED) &&
+    if (!(((Builtin) hn)->node.flags & BINF_ADDED) &&
 	!strcmp(((Builtin) hn)->optstr, modpmname))
 	modpmfound = 1;
 }
@@ -800,7 +800,7 @@ modpmbuiltinscan(HashNode hn, UNUSED(int dummy))
 static void
 modpmparamscan(HashNode hn, UNUSED(int dummy))
 {
-    if ((((Param) hn)->flags & PM_AUTOLOAD) &&
+    if ((((Param) hn)->node.flags & PM_AUTOLOAD) &&
 	!strcmp(((Param) hn)->u.str, modpmname))
 	modpmfound = 1;
 }
@@ -827,8 +827,8 @@ getpmmodule(UNUSED(HashTable ht), char *name)
     LinkNode node;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
 
     if (!type) {
@@ -866,9 +866,9 @@ getpmmodule(UNUSED(HashTable ht), char *name)
 	pm->u.str = dupstring(type);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -885,42 +885,42 @@ scanpmmodules(UNUSED(HashTable ht), ScanFunc func, int flags)
     char *loaded = dupstring("loaded");
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (node = firstnode(modules); node; incnode(node)) {
 	m = (Module) getdata(node);
 	if (m->u.handle && !(m->flags & MOD_UNLOAD)) {
-	    pm.nam = m->nam;
+	    pm.node.nam = m->nam;
 	    pm.u.str = ((m->flags & MOD_ALIAS) ?
 			dyncat("alias:", m->u.alias) : loaded);
-	    addlinknode(done, pm.nam);
-	    func((HashNode) &pm, flags);
+	    addlinknode(done, pm.node.nam);
+	    func(&pm.node, flags);
 	}
     }
     pm.u.str = dupstring("autoloaded");
     for (i = 0; i < builtintab->hsize; i++)
 	for (hn = builtintab->nodes[i]; hn; hn = hn->next) {
-	    if (!(((Builtin) hn)->flags & BINF_ADDED) &&
+	    if (!(((Builtin) hn)->node.flags & BINF_ADDED) &&
 		!findmodnode(done, ((Builtin) hn)->optstr)) {
-		pm.nam = ((Builtin) hn)->optstr;
-		addlinknode(done, pm.nam);
-		func((HashNode) &pm, flags);
+		pm.node.nam = ((Builtin) hn)->optstr;
+		addlinknode(done, pm.node.nam);
+		func(&pm.node, flags);
 	    }
 	}
     for (p = condtab; p; p = p->next)
 	if (p->module && !findmodnode(done, p->module)) {
-	    pm.nam = p->module;
-	    addlinknode(done, pm.nam);
-	    func((HashNode) &pm, flags);
+	    pm.node.nam = p->module;
+	    addlinknode(done, pm.node.nam);
+	    func(&pm.node, flags);
 	}
     for (i = 0; i < realparamtab->hsize; i++)
 	for (hn = realparamtab->nodes[i]; hn; hn = hn->next) {
-	    if ((((Param) hn)->flags & PM_AUTOLOAD) &&
+	    if ((((Param) hn)->node.flags & PM_AUTOLOAD) &&
 		!findmodnode(done, ((Param) hn)->u.str)) {
-		pm.nam = ((Param) hn)->u.str;
-		addlinknode(done, pm.nam);
-		func((HashNode) &pm, flags);
+		pm.node.nam = ((Param) hn)->u.str;
+		addlinknode(done, pm.node.nam);
+		func(&pm.node, flags);
 	    }
 	}
 }
@@ -970,8 +970,8 @@ getpmhistory(UNUSED(HashTable ht), char *name)
     int ok = 1;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
 
     if (*name != '0' || name[1]) {
@@ -984,12 +984,12 @@ getpmhistory(UNUSED(HashTable ht), char *name)
 	}
     }
     if (ok && (he = quietgethist(atoi(name))))
-	pm->u.str = dupstring(he->text);
+	pm->u.str = dupstring(he->node.nam);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1002,18 +1002,18 @@ scanpmhistory(UNUSED(HashTable ht), ScanFunc func, int flags)
     char buf[40];
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     while (he) {
 	if (func != scancountparams) {
 	    convbase(buf, he->histnum, 10);
-	    pm.nam = dupstring(buf);
+	    pm.node.nam = dupstring(buf);
 	    if ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		!(flags & SCANPM_WANTKEYS))
-		pm.u.str = dupstring(he->text);
+		pm.u.str = dupstring(he->node.nam);
 	}
-	func((HashNode) &pm, flags);
+	func(&pm.node, flags);
 
 	he = up_histent(he);
     }
@@ -1037,8 +1037,8 @@ histwgetfn(UNUSED(Param pm))
 
     while (he) {
 	for (iw = he->nwords - 1; iw >= 0; iw--) {
-	    h = he->text + he->words[iw * 2];
-	    e = he->text + he->words[iw * 2 + 1];
+	    h = he->node.nam + he->words[iw * 2];
+	    e = he->node.nam + he->words[iw * 2 + 1];
 	    sav = *e;
 	    *e = '\0';
 	    addlinknode(l, dupstring(h));
@@ -1087,8 +1087,8 @@ getpmjobtext(UNUSED(HashTable ht), char *name)
     int job;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
 
     if ((job = atoi(name)) >= 1 && job <= maxjob &&
@@ -1097,9 +1097,9 @@ getpmjobtext(UNUSED(HashTable ht), char *name)
 	pm->u.str = pmjobtext(job);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1111,7 +1111,7 @@ scanpmjobtexts(UNUSED(HashTable ht), ScanFunc func, int flags)
     char buf[40];
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (job = 1; job <= maxjob; job++) {
@@ -1119,12 +1119,12 @@ scanpmjobtexts(UNUSED(HashTable ht), ScanFunc func, int flags)
 	    !(jobtab[job].stat & STAT_NOPRINT)) {
 	    if (func != scancountparams) {
 		sprintf(buf, "%d", job);
-		pm.nam = dupstring(buf);
+		pm.node.nam = dupstring(buf);
 		if ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		    !(flags & SCANPM_WANTKEYS))
 		    pm.u.str = pmjobtext(job);
 	    }
-	    func((HashNode) &pm, flags);
+	    func(&pm.node, flags);
 	}
     }
 }
@@ -1184,8 +1184,8 @@ getpmjobstate(UNUSED(HashTable ht), char *name)
     int job;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
 
     if ((job = atoi(name)) >= 1 && job <= maxjob &&
@@ -1194,9 +1194,9 @@ getpmjobstate(UNUSED(HashTable ht), char *name)
 	pm->u.str = pmjobstate(job);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1208,7 +1208,7 @@ scanpmjobstates(UNUSED(HashTable ht), ScanFunc func, int flags)
     char buf[40];
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (job = 1; job <= maxjob; job++) {
@@ -1216,12 +1216,12 @@ scanpmjobstates(UNUSED(HashTable ht), ScanFunc func, int flags)
 	    !(jobtab[job].stat & STAT_NOPRINT)) {
 	    if (func != scancountparams) {
 		sprintf(buf, "%d", job);
-		pm.nam = dupstring(buf);
+		pm.node.nam = dupstring(buf);
 		if ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		    !(flags & SCANPM_WANTKEYS))
 		    pm.u.str = pmjobstate(job);
 	    }
-	    func((HashNode) &pm, flags);
+	    func(&pm.node, flags);
 	}
     }
 }
@@ -1246,8 +1246,8 @@ getpmjobdir(UNUSED(HashTable ht), char *name)
     int job;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
 
     if ((job = atoi(name)) >= 1 && job <= maxjob &&
@@ -1256,9 +1256,9 @@ getpmjobdir(UNUSED(HashTable ht), char *name)
 	pm->u.str = pmjobdir(job);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1270,7 +1270,7 @@ scanpmjobdirs(UNUSED(HashTable ht), ScanFunc func, int flags)
     char buf[40];
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (job = 1; job <= maxjob; job++) {
@@ -1278,12 +1278,12 @@ scanpmjobdirs(UNUSED(HashTable ht), ScanFunc func, int flags)
            !(jobtab[job].stat & STAT_NOPRINT)) {
            if (func != scancountparams) {
 	       sprintf(buf, "%d", job);
-	       pm.nam = dupstring(buf);
+	       pm.node.nam = dupstring(buf);
                if ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		   !(flags & SCANPM_WANTKEYS))
 		   pm.u.str = pmjobdir(job);
 	   }
-           func((HashNode) &pm, flags);
+           func(&pm.node, flags);
        }
     }
 }
@@ -1299,9 +1299,9 @@ setpmnameddir(Param pm, char *value)
     else {
 	Nameddir nd = (Nameddir) zshcalloc(sizeof(*nd));
 
-	nd->flags = 0;
+	nd->node.flags = 0;
 	nd->dir = value;
-	nameddirtab->addnode(nameddirtab, ztrdup(pm->nam), nd);
+	nameddirtab->addnode(nameddirtab, ztrdup(pm->node.nam), nd);
     }
 }
 
@@ -1309,7 +1309,7 @@ setpmnameddir(Param pm, char *value)
 static void
 unsetpmnameddir(Param pm, UNUSED(int exp))
 {
-    HashNode hd = nameddirtab->removenode(nameddirtab, pm->nam);
+    HashNode hd = nameddirtab->removenode(nameddirtab, pm->node.nam);
 
     if (hd)
 	nameddirtab->freenode(hd);
@@ -1328,7 +1328,7 @@ setpmnameddirs(UNUSED(Param pm), HashTable ht)
     for (i = 0; i < nameddirtab->hsize; i++)
 	for (hn = nameddirtab->nodes[i]; hn; hn = next) {
 	    next = hn->next;
-	    if (!(((Nameddir) hn)->flags & ND_USERNAME) &&
+	    if (!(((Nameddir) hn)->node.flags & ND_USERNAME) &&
 		(hd = nameddirtab->removenode(nameddirtab, hn->nam)))
 		nameddirtab->freenode(hd);
 	}
@@ -1348,7 +1348,7 @@ setpmnameddirs(UNUSED(Param pm), HashTable ht)
 	    else {
 		Nameddir nd = (Nameddir) zshcalloc(sizeof(*nd));
 
-		nd->flags = 0;
+		nd->node.flags = 0;
 		nd->dir = ztrdup(val);
 		nameddirtab->addnode(nameddirtab, ztrdup(hn->nam), nd);
 	    }
@@ -1374,17 +1374,17 @@ getpmnameddir(UNUSED(HashTable ht), char *name)
     Nameddir nd;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR;
     pm->gsu.s = &pmnamedir_gsu;
     if ((nd = (Nameddir) nameddirtab->getnode(nameddirtab, name)) &&
-	!(nd->flags & ND_USERNAME))
+	!(nd->node.flags & ND_USERNAME))
 	pm->u.str = dupstring(nd->dir);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1397,18 +1397,18 @@ scanpmnameddirs(UNUSED(HashTable ht), ScanFunc func, int flags)
     Nameddir nd;
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR;
+    pm.node.flags = PM_SCALAR;
     pm.gsu.s = &pmnamedir_gsu;
 
     for (i = 0; i < nameddirtab->hsize; i++)
 	for (hn = nameddirtab->nodes[i]; hn; hn = hn->next) {
-	    if (!((nd = (Nameddir) hn)->flags & ND_USERNAME)) {
-		pm.nam = hn->nam;
+	    if (!((nd = (Nameddir) hn)->node.flags & ND_USERNAME)) {
+		pm.node.nam = hn->nam;
 		if (func != scancountparams &&
 		    ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		     !(flags & SCANPM_WANTKEYS)))
 		    pm.u.str = dupstring(nd->dir);
-		func((HashNode) &pm, flags);
+		func(&pm.node, flags);
 	    }
 	}
 }
@@ -1425,17 +1425,17 @@ getpmuserdir(UNUSED(HashTable ht), char *name)
     nameddirtab->filltable(nameddirtab);
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_SCALAR | PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_SCALAR | PM_READONLY;
     pm->gsu.s = &nullsetscalar_gsu;
     if ((nd = (Nameddir) nameddirtab->getnode(nameddirtab, name)) &&
-	(nd->flags & ND_USERNAME))
+	(nd->node.flags & ND_USERNAME))
 	pm->u.str = dupstring(nd->dir);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1450,18 +1450,18 @@ scanpmuserdirs(UNUSED(HashTable ht), ScanFunc func, int flags)
     nameddirtab->filltable(nameddirtab);
 
     memset((void *)&pm, 0, sizeof(struct param));
-    pm.flags = PM_SCALAR | PM_READONLY;
+    pm.node.flags = PM_SCALAR | PM_READONLY;
     pm.gsu.s = &nullsetscalar_gsu;
 
     for (i = 0; i < nameddirtab->hsize; i++)
 	for (hn = nameddirtab->nodes[i]; hn; hn = hn->next) {
-	    if ((nd = (Nameddir) hn)->flags & ND_USERNAME) {
-		pm.nam = hn->nam;
+	    if ((nd = (Nameddir) hn)->node.flags & ND_USERNAME) {
+		pm.node.nam = hn->nam;
 		if (func != scancountparams &&
 		    ((flags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		     !(flags & SCANPM_WANTKEYS)))
 		    pm.u.str = dupstring(nd->dir);
-		func((HashNode) &pm, flags);
+		func(&pm.node, flags);
 	    }
 	}
 }
@@ -1472,7 +1472,7 @@ scanpmuserdirs(UNUSED(HashTable ht), ScanFunc func, int flags)
 static void
 setalias(HashTable ht, Param pm, char *value, int flags)
 {
-    ht->addnode(ht, ztrdup(pm->nam),
+    ht->addnode(ht, ztrdup(pm->node.nam),
 		createaliasnode(value, flags));
 }
 
@@ -1522,7 +1522,7 @@ setpmdissalias(Param pm, char *value)
 static void
 unsetpmalias(Param pm, UNUSED(int exp))
 {
-    HashNode hd = aliastab->removenode(aliastab, pm->nam);
+    HashNode hd = aliastab->removenode(aliastab, pm->node.nam);
 
     if (hd)
 	aliastab->freenode(hd);
@@ -1532,7 +1532,7 @@ unsetpmalias(Param pm, UNUSED(int exp))
 static void
 unsetpmsalias(Param pm, UNUSED(int exp))
 {
-    HashNode hd = sufaliastab->removenode(sufaliastab, pm->nam);
+    HashNode hd = sufaliastab->removenode(sufaliastab, pm->node.nam);
 
     if (hd)
 	sufaliastab->freenode(hd);
@@ -1557,7 +1557,7 @@ setaliases(HashTable alht, UNUSED(Param pm), HashTable ht, int flags)
 	     * The predecessor to this code didn't do that; presumably
 	     * that was a bug.
 	     */
-	    if (flags == ((Alias)hn)->flags &&
+	    if (flags == ((Alias)hn)->node.flags &&
 		(hd = alht->removenode(alht, hn->nam)))
 		alht->freenode(hd);
 	}
@@ -1638,7 +1638,7 @@ static const struct gsu_scalar pmdissalias_gsu =
 static void
 assignaliasdefs(Param pm, int flags)
 {
-    pm->flags = PM_SCALAR;
+    pm->node.flags = PM_SCALAR;
 
     /* we really need to squirrel the flags away somewhere... */
     switch (flags) {
@@ -1676,18 +1676,18 @@ getalias(HashTable alht, UNUSED(HashTable ht), char *name, int flags)
     Alias al;
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
+    pm->node.nam = dupstring(name);
 
     assignaliasdefs(pm, flags);
 
     if ((al = (Alias) alht->getnode2(alht, name)) &&
-	flags == al->flags)
+	flags == al->node.flags)
 	pm->u.str = dupstring(al->text);
     else {
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -1745,14 +1745,14 @@ scanaliases(HashTable alht, UNUSED(HashTable ht), ScanFunc func,
     assignaliasdefs(&pm, alflags);
 
     for (i = 0; i < alht->hsize; i++)
-	for (al = (Alias) alht->nodes[i]; al; al = (Alias) al->next) {
-	    if (alflags == al->flags) {
-		pm.nam = al->nam;
+	for (al = (Alias) alht->nodes[i]; al; al = (Alias) al->node.next) {
+	    if (alflags == al->node.flags) {
+		pm.node.nam = al->node.nam;
 		if (func != scancountparams &&
 		    ((pmflags & (SCANPM_WANTVALS|SCANPM_MATCHVAL)) ||
 		     !(pmflags & SCANPM_WANTKEYS)))
-		    pm.u.str = dupstring(al->text);
-		func((HashNode) &pm, pmflags);
+		    pm.u.str = dupstring(al->node.nam);
+		func(&pm.node, pmflags);
 	    }
 	}
 }
@@ -1958,7 +1958,7 @@ boot_(UNUSED(Module m))
 	    if (!(def->pm = createspecialhash(def->name, def->getnfn,
 					      def->scantfn)))
 		return 1;
-	    def->pm->flags |= def->flags;
+	    def->pm->node.flags |= def->flags;
 	    if (def->hash_gsu)
 		def->pm->gsu.h = def->hash_gsu;
 	} else {
@@ -1983,7 +1983,7 @@ cleanup_(UNUSED(Module m))
     for (def = partab; def->name; def++) {
 	if ((pm = (Param) paramtab->getnode(paramtab, def->name)) &&
 	    pm == def->pm) {
-	    pm->flags &= ~PM_READONLY;
+	    pm->node.flags &= ~PM_READONLY;
 	    unsetparam_pm(pm, 0, 1);
 	}
     }
diff --git a/Src/Modules/system.c b/Src/Modules/system.c
index 3f932c9fa..7b1c08a95 100644
--- a/Src/Modules/system.c
+++ b/Src/Modules/system.c
@@ -376,7 +376,7 @@ tidyparam(Param pm)
 {
     if (!pm)
 	return;
-    pm->flags &= ~PM_READONLY;
+    pm->node.flags &= ~PM_READONLY;
     unsetparam_pm(pm, 0, 1);
 }
 
diff --git a/Src/Modules/termcap.c b/Src/Modules/termcap.c
index 8573477c5..9e7ee57ae 100644
--- a/Src/Modules/termcap.c
+++ b/Src/Modules/termcap.c
@@ -233,8 +233,8 @@ gettermcap(UNUSED(HashTable ht), char *name)
     unmetafy(name, &len);
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_READONLY;
     u = buf;
 
     /* logic in the following cascade copied from echotc, above */
@@ -242,8 +242,8 @@ gettermcap(UNUSED(HashTable ht), char *name)
     if ((num = tgetnum(name)) != -1) {
 	pm->gsu.i = &nullsetinteger_gsu;
 	pm->u.val = num;
-	pm->flags |= PM_INTEGER;
-	return (HashNode) pm;
+	pm->node.flags |= PM_INTEGER;
+	return &pm->node;
     }
 
     pm->gsu.s = &nullsetscalar_gsu;
@@ -252,25 +252,22 @@ gettermcap(UNUSED(HashTable ht), char *name)
 	break;
     case 0:
 	pm->u.str = dupstring("no");
-	pm->flags |= PM_SCALAR;
-	return (HashNode) pm;
+	pm->node.flags |= PM_SCALAR;
+	return &pm->node;
     default:
 	pm->u.str = dupstring("yes");
-	pm->flags |= PM_SCALAR;
-	return (HashNode) pm;
+	pm->node.flags |= PM_SCALAR;
+	return &pm->node;
     }
-    if ((tcstr = tgetstr(name, &u)) != NULL && tcstr != (char *)-1)
-    {
+    if ((tcstr = tgetstr(name, &u)) != NULL && tcstr != (char *)-1) {
 	pm->u.str = dupstring(tcstr);
-	pm->flags |= PM_SCALAR;
-    }
-    else
-    {
+	pm->node.flags |= PM_SCALAR;
+    } else {
 	/* zwarn("no such capability: %s", name, 0); */
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -332,37 +329,37 @@ scantermcap(UNUSED(HashTable ht), ScanFunc func, int flags)
     pm = (Param) hcalloc(sizeof(struct param));
     u = buf;
 
-    pm->flags = PM_READONLY | PM_SCALAR;
+    pm->node.flags = PM_READONLY | PM_SCALAR;
     pm->gsu.s = &nullsetscalar_gsu;
 
     for (capcode = (char **)boolcodes; *capcode; capcode++) {
 	if ((num = ztgetflag(*capcode)) != -1) {
 	    pm->u.str = num ? dupstring("yes") : dupstring("no");
-	    pm->nam = dupstring(*capcode);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*capcode);
+	    func(&pm->node, flags);
 	}
     }
 
-    pm->flags = PM_READONLY | PM_INTEGER;
+    pm->node.flags = PM_READONLY | PM_INTEGER;
     pm->gsu.i = &nullsetinteger_gsu;
 
     for (capcode = (char **)numcodes; *capcode; capcode++) {
 	if ((num = tgetnum(*capcode)) != -1) {
 	    pm->u.val = num;
-	    pm->nam = dupstring(*capcode);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*capcode);
+	    func(&pm->node, flags);
 	}
     }
 
-    pm->flags = PM_READONLY | PM_SCALAR;
+    pm->node.flags = PM_READONLY | PM_SCALAR;
     pm->gsu.s = &nullsetscalar_gsu;
 
     for (capcode = (char **)strcodes; *capcode; capcode++) {
 	if ((tcstr = (char *)tgetstr(*capcode,&u)) != NULL &&
 	    tcstr != (char *)-1) {
 	    pm->u.str = dupstring(tcstr);
-	    pm->nam = dupstring(*capcode);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*capcode);
+	    func(&pm->node, flags);
 	}
     }
 }
@@ -403,7 +400,7 @@ cleanup_(Module m)
 
     if ((pm = (Param) paramtab->getnode(paramtab, termcap_nam)) &&
 	pm == termcap_pm) {
-	pm->flags &= ~PM_READONLY;
+	pm->node.flags &= ~PM_READONLY;
 	unsetparam_pm(pm, 0, 1);
     }
 #endif
diff --git a/Src/Modules/terminfo.c b/Src/Modules/terminfo.c
index 610df5a6d..4c8dce3ce 100644
--- a/Src/Modules/terminfo.c
+++ b/Src/Modules/terminfo.c
@@ -200,33 +200,28 @@ getterminfo(UNUSED(HashTable ht), char *name)
     unmetafy(name, &len);
 
     pm = (Param) hcalloc(sizeof(struct param));
-    pm->nam = dupstring(name);
-    pm->flags = PM_READONLY;
+    pm->node.nam = dupstring(name);
+    pm->node.flags = PM_READONLY;
 
     if (((num = tigetnum(name)) != -1) && (num != -2)) {
 	pm->u.val = num;
-	pm->flags |= PM_INTEGER;
+	pm->node.flags |= PM_INTEGER;
 	pm->gsu.i = &nullsetinteger_gsu;
-    }
-    else if ((num = tigetflag(name)) != -1) {
+    } else if ((num = tigetflag(name)) != -1) {
 	pm->u.str = num ? dupstring("yes") : dupstring("no");
-	pm->flags |= PM_SCALAR;
+	pm->node.flags |= PM_SCALAR;
 	pm->gsu.s = &nullsetscalar_gsu;
-    }
-    else if ((tistr = (char *)tigetstr(name)) != NULL && tistr != (char *)-1)
-    {
+    } else if ((tistr = (char *)tigetstr(name)) != NULL && tistr != (char *)-1) {
 	pm->u.str = dupstring(tistr);
-	pm->flags |= PM_SCALAR;
+	pm->node.flags |= PM_SCALAR;
 	pm->gsu.s = &nullsetscalar_gsu;
-    }
-    else
-    {
+    } else {
 	/* zwarn("no such capability: %s", name, 0); */
 	pm->u.str = dupstring("");
-	pm->flags |= PM_UNSET;
+	pm->node.flags |= PM_UNSET;
 	pm->gsu.s = &nullsetscalar_gsu;
     }
-    return (HashNode) pm;
+    return &pm->node;
 }
 
 /**/
@@ -309,37 +304,37 @@ scanterminfo(UNUSED(HashTable ht), ScanFunc func, int flags)
 
     pm = (Param) hcalloc(sizeof(struct param));
 
-    pm->flags = PM_READONLY | PM_SCALAR;
+    pm->node.flags = PM_READONLY | PM_SCALAR;
     pm->gsu.s = &nullsetscalar_gsu;
 
     for (capname = (char **)boolnames; *capname; capname++) {
 	if ((num = tigetflag(*capname)) != -1) {
 	    pm->u.str = num ? dupstring("yes") : dupstring("no");
-	    pm->nam = dupstring(*capname);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*capname);
+	    func(&pm->node, flags);
 	}
     }
 
-    pm->flags = PM_READONLY | PM_INTEGER;
+    pm->node.flags = PM_READONLY | PM_INTEGER;
     pm->gsu.i = &nullsetinteger_gsu;
 
     for (capname = (char **)numnames; *capname; capname++) {
 	if (((num = tigetnum(*capname)) != -1) && (num != -2)) {
 	    pm->u.val = num;
-	    pm->nam = dupstring(*capname);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*capname);
+	    func(&pm->node, flags);
 	}
     }
 
-    pm->flags = PM_READONLY | PM_SCALAR;
+    pm->node.flags = PM_READONLY | PM_SCALAR;
     pm->gsu.s = &nullsetscalar_gsu;
 
     for (capname = (char **)strnames; *capname; capname++) {
 	if ((tistr = (char *)tigetstr(*capname)) != NULL &&
 	    tistr != (char *)-1) {
 	    pm->u.str = dupstring(tistr);
-	    pm->nam = dupstring(*capname);
-	    func((HashNode) pm, flags);
+	    pm->node.nam = dupstring(*capname);
+	    func(&pm->node, flags);
 	}
     }
 }
@@ -383,7 +378,7 @@ cleanup_(Module m)
 
     if ((pm = (Param) paramtab->getnode(paramtab, terminfo_nam)) &&
 	pm == terminfo_pm) {
-	pm->flags &= ~PM_READONLY;
+	pm->node.flags &= ~PM_READONLY;
 	unsetparam_pm(pm, 0, 1);
     }
 #endif
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 96417f613..803f517c6 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -497,17 +497,17 @@ zfsetparam(char *name, void *val, int flags)
     int type = (flags & ZFPM_INTEGER) ? PM_INTEGER : PM_SCALAR;
 
     if (!(pm = (Param) paramtab->getnode(paramtab, name))
-	|| (pm->flags & PM_UNSET)) {
+	|| (pm->node.flags & PM_UNSET)) {
 	/*
 	 * just make it readonly when creating, in case user
 	 * *really* knows what they're doing
 	 */
 	if ((pm = createparam(name, type)) && (flags & ZFPM_READONLY))
-	    pm->flags |= PM_READONLY;
+	    pm->node.flags |= PM_READONLY;
     } else if (flags & ZFPM_IFUNSET) {
 	pm = NULL;
     }
-    if (!pm || PM_TYPE(pm->flags) != type) {
+    if (!pm || PM_TYPE(pm->node.flags) != type) {
 	/* parameters are funny, you just never know */
 	if (type == PM_SCALAR)
 	    zsfree((char *)val);
@@ -531,7 +531,7 @@ zfunsetparam(char *name)
     Param pm;
 
     if ((pm = (Param) paramtab->getnode(paramtab, name))) {
-	pm->flags &= ~PM_READONLY;
+	pm->node.flags &= ~PM_READONLY;
 	unsetparam_pm(pm, 0, 1);
     }
 }