diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2004-12-07 16:54:58 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2004-12-07 16:54:58 +0000 |
commit | 69b4b8bdde76b5aee6befa2b66957db22b3f6353 (patch) | |
tree | 505c080a68853aa351a887a3eac55c4737997885 /Src/Modules/langinfo.c | |
parent | ddc186f3f69ee72f97d222eba424667164f73526 (diff) | |
download | zsh-69b4b8bdde76b5aee6befa2b66957db22b3f6353.tar.gz zsh-69b4b8bdde76b5aee6befa2b66957db22b3f6353.tar.xz zsh-69b4b8bdde76b5aee6befa2b66957db22b3f6353.zip |
20605: Use separate structure with get/set/unset methods fro parameters.
Separate justification width of parameters from base/precision.
Diffstat (limited to 'Src/Modules/langinfo.c')
-rw-r--r-- | Src/Modules/langinfo.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/Src/Modules/langinfo.c b/Src/Modules/langinfo.c index 677440f52..10754e36c 100644 --- a/Src/Modules/langinfo.c +++ b/Src/Modules/langinfo.c @@ -417,9 +417,7 @@ createlihash() return NULL; pm->level = pm->old ? locallevel : 0; - pm->gets.hfn = hashgetfn; - pm->sets.hfn = hashsetfn; - pm->unsetfn = stdunsetfn; + pm->gsu.h = &stdhash_gsu; pm->u.hash = ht = newhashtable(7, langinfo_nam, NULL); ht->hash = hasher; @@ -447,19 +445,10 @@ getlanginfo(UNUSED(HashTable ht), char *name) unmetafy(name, &len); - pm = (Param) zhalloc(sizeof(struct param)); + pm = (Param) hcalloc(sizeof(struct param)); pm->nam = dupstring(name); pm->flags = PM_READONLY | PM_SCALAR; - pm->sets.cfn = NULL; - pm->gets.cfn = strgetfn; - pm->sets.ifn = NULL; - pm->gets.ifn = intgetfn; - pm->unsetfn = NULL; - pm->ct = 0; - pm->env = NULL; - pm->ename = NULL; - pm->old = NULL; - pm->level = 0; + pm->gsu.s = &nullsetscalar_gsu; if(name) elem = liitem(name); @@ -486,17 +475,8 @@ scanlanginfo(UNUSED(HashTable ht), ScanFunc func, int flags) char **element, *langstr; nl_item *nlcode; - pm = (Param) zhalloc(sizeof(struct param)); - pm->sets.cfn = NULL; - pm->gets.cfn = strgetfn; - pm->sets.ifn = NULL; - pm->gets.ifn = intgetfn; - pm->unsetfn = NULL; - pm->ct = 0; - pm->env = NULL; - pm->ename = NULL; - pm->old = NULL; - + pm = (Param) hcalloc(sizeof(struct param)); + pm->gsu.s = &nullsetscalar_gsu; pm->flags = PM_READONLY | PM_SCALAR; nlcode = &nl_vals[0]; |