1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src
Martijn Dekker 1884f57a74 Streamline some nval(3) and related flaggery
In the olden days, ksh used the hash(3) library to store variables,
aliases, functions, etc. For many years, it's been using the cdt(3)
library instead. But the low-level nv_search() name-value tree
lookup function was still repurposing some bit flags from the old
hash API for its options, though that API is otherwise unused.

So we were still including the entire obsolete <hash.h> API just
to use two repurposed HASH_* bit flags for nv_search(). This commit
makes nv_search() repurpose some flags from <nval.h> instead.

This commit should not change ksh's behaviour.

src/cmd/ksh93/sh/nvdisc.c:
- Make nv_search() use NV_NOSCOPE instead of HASH_NOSCOPE and
  NV_REF instead of HASH_BUCKET.
- The HASH_SCOPE flag was also passed to some nv_search() calls,
  but nv_search() ignores it, so that flag is deleted from those.
- Document nv_search() in a comment.

src/cmd/ksh93/include/name.h:
- Move NV_UNATTR to nval.h to join the other nv_open() options
  there. (re: 1184b2ad)

src/cmd/ksh93/include/nval.h:
- Since we no longer use HASH_* macros, do not include <hash.h>.
- Remove unused NV_NOASSIGN macro, defined to 0. This was there
  for "backward compatibility" since before 1995; long enough.

src/cmd/ksh93/include/shell.h:
- Bump SH_VERSION due to the nv_search() API change (even though no
  changes were made to the APIs documented in nval.3 or shell.3).

All other changed files:
- Update to match the flaggery changes.
2022-07-20 04:32:43 +02:00
..
cmd Streamline some nval(3) and related flaggery 2022-07-20 04:32:43 +02:00
lib More misc. tweaks and cleanups 2022-07-14 17:34:08 +02:00
Mamfile More misc. tweaks and cleanups 2022-07-14 17:34:08 +02:00