Skip to content

Commit

Permalink
Remove legacy, pre 2012, APIs
Browse files Browse the repository at this point in the history
We cannot reasonably support binary plugins built for ksh93u+ or earlier
releases. This is due to a variety of factors such as removing the AST
vmalloc subsystem. Consequently there is no need to retain the pre 2012
APIs. So eliminate them and rename the post 2012 APIs.

Resolves #983
  • Loading branch information
krader1961 committed Nov 5, 2018
1 parent b1d7f0a commit 15b061e
Show file tree
Hide file tree
Showing 38 changed files with 57 additions and 368 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,8 @@ None at this time.


## Notable non-backward compatible changes ## Notable non-backward compatible changes


- Support for binary plugins written for ksh93u+ or earlier releases has been
dropped (issue #983).
- Support for coshell has been removed (issue #619). - Support for coshell has been removed (issue #619).
- Support for the `universe` command has been removed (issue #793). - Support for the `universe` command has been removed (issue #793).
- Support for building on systems using EBCDIC has been removed (issue #742). - Support for building on systems using EBCDIC has been removed (issue #742).
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/cflow.c
Expand Up @@ -37,7 +37,6 @@
#include "error.h" #include "error.h"
#include "fault.h" #include "fault.h"
#include "option.h" #include "option.h"
#include "shellapi.h"


// //
// Builtins `return` and `exit`. // Builtins `return` and `exit`.
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/enum.c
Expand Up @@ -31,7 +31,6 @@
#include "error.h" #include "error.h"
#include "fault.h" #include "fault.h"
#include "name.h" #include "name.h"
#include "nvapi.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shcmd.h" // IWYU pragma: keep #include "shcmd.h" // IWYU pragma: keep
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/getopts.c
Expand Up @@ -39,7 +39,6 @@
#include "name.h" #include "name.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stk.h" #include "stk.h"
#include "variables.h" #include "variables.h"


Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/hist.c
Expand Up @@ -38,7 +38,6 @@
#include "name.h" #include "name.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stak.h" #include "stak.h"
#include "variables.h" #include "variables.h"


Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/misc.c
Expand Up @@ -53,7 +53,6 @@
#include "option.h" #include "option.h"
#include "path.h" #include "path.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "shnodes.h" #include "shnodes.h"
#include "stk.h" #include "stk.h"
#include "variables.h" #include "variables.h"
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/print.c
Expand Up @@ -45,7 +45,6 @@
#include "name.h" #include "name.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stk.h" #include "stk.h"
#include "streval.h" #include "streval.h"
#include "tmx.h" #include "tmx.h"
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/ksh93/bltins/read.c
Expand Up @@ -47,10 +47,8 @@
#include "io.h" #include "io.h"
#include "lexstates.h" #include "lexstates.h"
#include "name.h" #include "name.h"
#include "nvapi.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stk.h" #include "stk.h"
#include "terminal.h" #include "terminal.h"
#include "variables.h" #include "variables.h"
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/ksh93/bltins/typeset.c
Expand Up @@ -53,11 +53,9 @@
#include "fault.h" #include "fault.h"
#include "history.h" #include "history.h"
#include "name.h" #include "name.h"
#include "nvapi.h"
#include "option.h" #include "option.h"
#include "path.h" #include "path.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stk.h" #include "stk.h"
#include "variables.h" #include "variables.h"


Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/bltins/ulimit.c
Expand Up @@ -38,7 +38,6 @@
#include "name.h" #include "name.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "ulimit.h" #include "ulimit.h"


#ifndef SH_DICT #ifndef SH_DICT
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/edit/completion.c
Expand Up @@ -38,7 +38,6 @@
#include "name.h" #include "name.h"
#include "path.h" #include "path.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stk.h" #include "stk.h"


static char *fmtx(Shell_t *shp, const char *string) { static char *fmtx(Shell_t *shp, const char *string) {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/edit/edit.c
Expand Up @@ -48,7 +48,6 @@
#include "io.h" #include "io.h"
#include "name.h" #include "name.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "stk.h" #include "stk.h"
#include "terminal.h" #include "terminal.h"
#include "variables.h" #include "variables.h"
Expand Down
1 change: 0 additions & 1 deletion src/cmd/ksh93/edit/emacs.c
Expand Up @@ -67,7 +67,6 @@
#include "fault.h" #include "fault.h"
#include "history.h" #include "history.h"
#include "io.h" #include "io.h"
#include "shellapi.h"
#include "stak.h" #include "stak.h"
#include "terminal.h" #include "terminal.h"


Expand Down
2 changes: 0 additions & 2 deletions src/cmd/ksh93/edit/pcomplete.c
Expand Up @@ -33,10 +33,8 @@
#include "error.h" #include "error.h"
#include "fault.h" #include "fault.h"
#include "name.h" #include "name.h"
#include "nvapi.h"
#include "option.h" #include "option.h"
#include "sfio.h" #include "sfio.h"
#include "shellapi.h"
#include "shtable.h" #include "shtable.h"
#include "stk.h" #include "stk.h"
#include "variables.h" #include "variables.h"
Expand Down
6 changes: 2 additions & 4 deletions src/cmd/ksh93/include/nval.h
Expand Up @@ -234,8 +234,7 @@ extern void *nv_associative(Namval_t *, const char *, int);
extern int nv_aindex(Namval_t *); extern int nv_aindex(Namval_t *);
extern bool nv_nextsub(Namval_t *); extern bool nv_nextsub(Namval_t *);
extern char *nv_getsub(Namval_t *); extern char *nv_getsub(Namval_t *);
extern Namval_t *nv_putsub(Namval_t *, char *, long); extern Namval_t *nv_putsub(Namval_t *, char *, long, int);
extern Namval_t *nv_putsub_20120720(Namval_t *, char *, long, int);
extern Namval_t *nv_opensub(Namval_t *); extern Namval_t *nv_opensub(Namval_t *);


// Name-value pair function prototypes. // Name-value pair function prototypes.
Expand All @@ -253,8 +252,7 @@ extern char *nv_getval(Namval_t *);
extern Namfun_t *nv_hasdisc(Namval_t *, const Namdisc_t *); extern Namfun_t *nv_hasdisc(Namval_t *, const Namdisc_t *);
extern int nv_isnull(Namval_t *); extern int nv_isnull(Namval_t *);
extern Namfun_t *nv_isvtree(Namval_t *); extern Namfun_t *nv_isvtree(Namval_t *);
extern Namval_t *nv_lastdict(void); extern Namval_t *nv_lastdict(void *);
extern Namval_t *nv_lastdict_20120720(void *);
extern Namval_t *nv_mkinttype(char *, size_t, int, const char *, Namdisc_t *); extern Namval_t *nv_mkinttype(char *, size_t, int, const char *, Namdisc_t *);
extern void nv_newattr(Namval_t *, unsigned, int); extern void nv_newattr(Namval_t *, unsigned, int);
extern void nv_newtype(Namval_t *); extern void nv_newtype(Namval_t *);
Expand Down
30 changes: 0 additions & 30 deletions src/cmd/ksh93/include/nvapi.h

This file was deleted.

61 changes: 17 additions & 44 deletions src/cmd/ksh93/include/shell.h
Expand Up @@ -302,70 +302,50 @@ struct Shell_s {
#define SH_FDCLOSE (-1) #define SH_FDCLOSE (-1)


extern int sh_access(const char *, int); extern int sh_access(const char *, int);
extern Namval_t *sh_addbuiltin(const char *, int (*)(int, char *[], Shbltin_t *), void *);
extern Dt_t *sh_bltin_tree(void);
extern int sh_chdir(const char *); extern int sh_chdir(const char *);
extern int sh_close(int); extern int sh_close(int);
extern void sh_delay(double); extern void sh_delay(double);
extern int sh_dup(int); extern int sh_dup(int);
extern int sh_eval(Sfio_t *, int);
extern int sh_exec(Shell_t *, const Shnode_t *, int); extern int sh_exec(Shell_t *, const Shnode_t *, int);
extern void sh_exit(int);
extern int sh_fchdir(int); extern int sh_fchdir(int);
extern int sh_fcntl(int, int, ...); extern int sh_fcntl(int, int, ...);
extern Sfio_t *sh_fd2sfio(int);
extern int (*sh_fdnotify(int (*)(int, int)))(int, int); extern int (*sh_fdnotify(int (*)(int, int)))(int, int);
extern char *sh_fmtq(const char *); extern char *sh_fmtq(const char *);
extern char *sh_fmtqf(const char *, int, int); extern char *sh_fmtqf(const char *, int, int);
extern int sh_fun(Namval_t *, Namval_t *, char *[]);
extern int sh_funscope(int, char *[], int (*)(void *), void *, int);
extern Shell_t *sh_getinterp(void); extern Shell_t *sh_getinterp(void);
extern Shscope_t *sh_getscope(int, int);
extern Shell_t *sh_init(int, char *[], Shinit_f); extern Shell_t *sh_init(int, char *[], Shinit_f);
extern Sfio_t *sh_iogetiop(int, int); extern Sfio_t *sh_iogetiop(int, int);
extern int sh_main(int, char *[], Shinit_f); extern int sh_main(int, char *[], Shinit_f);
extern void sh_menu(Sfio_t *, int, char *[]);
extern void sh_offoption(int);
extern bool sh_isoption(int);
extern void sh_onoption(int);
extern int sh_open(const char *, int, ...); extern int sh_open(const char *, int, ...);
extern int sh_openmax(void); extern int sh_openmax(void);
extern void *sh_parse(Shell_t *, Sfio_t *, int); extern void *sh_parse(Shell_t *, Sfio_t *, int);
extern Sfio_t *sh_pathopen(const char *);
extern int sh_pipe(int[]); extern int sh_pipe(int[]);
extern ssize_t sh_read(int, void *, size_t); extern ssize_t sh_read(int, void *, size_t);
extern int sh_reinit(char *[]);
extern int sh_run(int, char *[]);
extern off_t sh_seek(int, off_t, int); extern off_t sh_seek(int, off_t, int);
extern Shscope_t *sh_setscope(Shscope_t *);
extern void sh_sigcheck(Shell_t *); extern void sh_sigcheck(Shell_t *);
extern int sh_stat(const char *, struct stat *); extern int sh_stat(const char *, struct stat *);
extern Sfdouble_t sh_strnum(const char *, char **, int);
extern void sh_subfork(void); extern void sh_subfork(void);
extern int sh_trap(const char *, int);
extern mode_t sh_umask(mode_t); extern mode_t sh_umask(mode_t);
extern int sh_waitsafe(void); extern int sh_waitsafe(void);
extern ssize_t sh_write(int, const void *, size_t); extern ssize_t sh_write(int, const void *, size_t);


extern Namval_t *sh_addbuiltin_20120720(Shell_t *, const char *, extern Namval_t *sh_addbuiltin(Shell_t *, const char *, int (*)(int, char *[], Shbltin_t *), void *);
int (*)(int, char *[], Shbltin_t *), void *); extern int sh_eval(Shell_t *, Sfio_t *, int);
extern Dt_t *sh_bltin_tree_20120720(Shell_t *); extern void sh_exit(Shell_t *, int);
extern int sh_eval_20120720(Shell_t *, Sfio_t *, int); extern Sfio_t *sh_fd2sfio(Shell_t *, int);
extern void sh_exit_20120720(Shell_t *, int); extern int sh_fun(Shell_t *, Namval_t *, Namval_t *, char *[]);
extern Sfio_t *sh_fd2sfio_20120720(Shell_t *, int); extern int sh_funscope(Shell_t *, int, char *[], int (*)(void *), void *, int);
extern int sh_fun_20120720(Shell_t *, Namval_t *, Namval_t *, char *[]); extern Shscope_t *sh_getscope(Shell_t *, int, int);
extern int sh_funscope_20120720(Shell_t *, int, char *[], int (*)(void *), void *, int); extern void sh_offoption(Shell_t *, int);
extern Shscope_t *sh_getscope_20120720(Shell_t *, int, int); extern bool sh_isoption(Shell_t *, int);
extern void sh_offoption_20120720(Shell_t *, int); extern void sh_onoption(Shell_t *, int);
extern bool sh_isoption_20120720(Shell_t *, int); extern void sh_menu(Shell_t *, Sfio_t *, int, char *[]);
extern void sh_onoption_20120720(Shell_t *, int); extern Sfio_t *sh_pathopen(Shell_t *, const char *);
extern void sh_menu_20120720(Shell_t *, Sfio_t *, int, char *[]); extern int sh_reinit(Shell_t *, char *[]);
extern Sfio_t *sh_pathopen_20120720(Shell_t *, const char *); extern int sh_run(Shell_t *, int, char *[]);
extern int sh_reinit_20120720(Shell_t *, char *[]); extern Shscope_t *sh_setscope(Shell_t *, Shscope_t *);
extern int sh_run_20120720(Shell_t *, int, char *[]); extern Sfdouble_t sh_strnum(Shell_t *, const char *, char **, int);
extern Shscope_t *sh_setscope_20120720(Shell_t *, Shscope_t *); extern int sh_trap(Shell_t *, const char *, int);
extern Sfdouble_t sh_strnum_20120720(Shell_t *, const char *, char **, int);
extern int sh_trap_20120720(Shell_t *, const char *, int);


#define sh_ptr(np) ((np)->nvshell) #define sh_ptr(np) ((np)->nvshell)


Expand All @@ -374,8 +354,6 @@ extern int sh_trap_20120720(Shell_t *, const char *, int);
// //
extern Shell_t sh; extern Shell_t sh;


#include "shellapi.h"

#if _lib_lseek64 #if _lib_lseek64
#undef stat64 #undef stat64
#define stat64(a, b) sh_stat(a, b) #define stat64(a, b) sh_stat(a, b)
Expand Down Expand Up @@ -404,13 +382,8 @@ extern Shell_t sh;
#ifndef _SH_PRIVATE #ifndef _SH_PRIVATE
#undef close #undef close
#define close(a) sh_close(a) #define close(a) sh_close(a)
#if SHELLAPI(20120720)
#undef exit #undef exit
#define exit(a) sh_exit(sh_getinterp(), a) #define exit(a) sh_exit(sh_getinterp(), a)
#else
#undef exit
#define exit(a) sh_exit(a)
#endif
#undef fcntl #undef fcntl
#define fcntl(a, b, c) sh_fcntl(a, b, c) #define fcntl(a, b, c) sh_fcntl(a, b, c)
#undef pipe #undef pipe
Expand Down
112 changes: 0 additions & 112 deletions src/cmd/ksh93/include/shellapi.h

This file was deleted.

0 comments on commit 15b061e

Please sign in to comment.