1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Yet more misc. cleanups; rm SHOPT_PFSH, SHOPT_TYPEDEF

Notable changes:
- Remove SHOPT_PFSH compile-time option and associated code.
  This was meant to work with Solaris rights profiles, see:
  https://docs.oracle.com/cd/E23824_01/html/821-1461/profiles-1.html#REFMAN1profiles-1
  But it has been obsolete for years as Solaris stopped using
  it in its shipped ksh several OS versions ago, preferring a
  library-based wrapper around ksh and other shells.
  Nonetheless I experimented with the option on Solaris 11.4.
  Result: no external command will run; output of unitialised
  memory in error message. So it's already fallen victim to bit
  rot. There's nothing interesting here, so just get rid.
- Remove SHOPT_TYPEDEF compile-time option (but keep the code!).
  Turning it off caused the build to fail. It may be possible to
  fix it, but the type definition code is integral to ksh now (e.g.
  'enum' depends on much of it) so it makes no sense to disable it.
  This was removed in the ksh 93v- beta version as well.
- Remove nv_close() calls and remove nv_close() documentation from
  the nval.3 man page. This function is a dummy, present without
  any changes since the beginning of the ast-open-archive repo in
  1995. The comment was: "Currently this is a dummy, but someday
  will be needed for reference counting". 27 or more years later,
  it's time to admit it's never going to happen. (And of course,
  nv_close() calls were not being used with anything resembling
  consistency.)
- Add a null nv_close() macro to nval.h for compatibility with
  third party code that follows the old documentation.
- Add a few missing regression tests.
This commit is contained in:
Martijn Dekker 2022-02-10 13:44:43 +00:00
parent a00fe6b7fd
commit 14a43a0a88
38 changed files with 101 additions and 356 deletions

View file

@ -207,6 +207,7 @@ struct Namval
#define nv_onattr(n,f) ((n)->nvflag |= (f))
#define nv_offattr(n,f) ((n)->nvflag &= ~(f))
#define nv_isarray(np) (nv_isattr((np),NV_ARRAY))
#define nv_close(np) /* no-op */
/* The following are operations for associative arrays */
#define NV_AINIT 1 /* initialize */
@ -252,7 +253,6 @@ extern Namval_t *nv_opensub(Namval_t*);
/* name-value pair function prototypes */
extern int nv_adddisc(Namval_t*, const char**, Namval_t**);
extern int nv_clone(Namval_t*, Namval_t*, int);
extern void nv_close(Namval_t*);
extern void *nv_context(Namval_t*);
extern Namval_t *nv_create(const char*, Dt_t*, int,Namfun_t*);
extern void nv_delete(Namval_t*, Dt_t*, int);