dtksh: Upgrade ksh93 to 1.0.0-beta.2 2021-12-28
Patch from current ksh93 maintainer <https://github.com/ksh93/ksh>. cde/programs/dtksh/ksh93/**: - Upgraded. A load of bugs fixed, some minor features added. See NEWS from 2021-02-01 upwards. cde/programs/dtksh/Makefile.am: - Don't cd into ksh93 any more to invoke the package or shtests scripts; they now automatically find their directories. - Pass $(CFLAGS) to build ksh with optimisation. - Remove -D_std_malloc flag as vmalloc is now deprecated and disabled by default. - Add a 'make check' target to Makefile.am that runs the ksh93 regression tests on dtksh to make sure the additions don't interfere with anything. It skips running the tests with shcomp because CDE doesn't use that. The tests all pass here on Slackware 14.2. :-) cde/programs/dtksh/init.patch: - Removed; I've upstreamed it. It was the only one that wasn't upstreamed yet, and more code cleanups are coming, breaking downstream patches. If something needs updating, just email me a diff. cde/programs/dtksh/dtkcmds.h: - Update the ADDBUILTIN macro to remove the __PROTO__ macro use. The proto(1) tool, responsible for all such pre-C89 K&R C compatibility voodoo, has been removed, so that macro is no longer defined. cde/programs/dtksh/setup.sh: - Workaround script removed. I rewrote 'bin/package flat make' in a way that works correctly and changed Makefile.am to use that instead. Hope this helps. Happy new year.
This commit is contained in:
committed by
Jon Trulson
parent
d5e651ecf3
commit
bf00d3b274
@@ -32,7 +32,7 @@ are Linux, System V Release 4, Solaris, Sun OS, HP-UX Release 8 and above,
|
||||
AIX 3.2 and above, and Microsoft Windows systems.
|
||||
<P>
|
||||
This memo describes how to write and compile programs
|
||||
that can be loaded into <TT>ksh</TT> at run time as built-in
|
||||
that can be loaded into <TT>ksh</TT> at run time as built-in
|
||||
commands.
|
||||
<P>
|
||||
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="INTRODUCTION">INTRODUCTION</A></H3></FONT></FONT></CENTER>
|
||||
@@ -93,7 +93,7 @@ The development kit has three directories,
|
||||
It is best to set the value of the environment variable
|
||||
<TT>PACKAGE_ast</TT> to the pathname of the directory
|
||||
containing the development kit.
|
||||
The <TT>include</TT> directory contains a sub-directory
|
||||
The <TT>include</TT> directory contains a subdirectory
|
||||
named <TT>ast</TT> that contains interface prototypes
|
||||
for functions that you can call from built-ins. The <TT>lib</TT>
|
||||
directory contains the <TT>ast</TT> library
|
||||
@@ -128,7 +128,7 @@ to terminate your command.
|
||||
The return value will become the exit status of the command.
|
||||
The <TT>open</TT> built-in, installed in <TT>lib/ksh</TT> in the AST Toolkit, uses this method.
|
||||
The <TT>Shbltin_t</TT> structure contains a field named <TT>shp</TT> which is
|
||||
a pointer the the shell data that is needed for <TT>shell</TT> library callbacks.
|
||||
a pointer to the shell data that is needed for <TT>shell</TT> library callbacks.
|
||||
It also contains the fields, <TT>shrun</TT>, <TT>shtrap</TT>, <TT>shexit</TT>,
|
||||
and <TT>shbltin</TT>
|
||||
that are function pointers to the <TT>shell</TT> library functions <TT>sh_run</TT>, <TT>sh_trap</TT>
|
||||
@@ -273,7 +273,7 @@ The development kit provides a portable interface
|
||||
to the C library and to libast.
|
||||
The header files in the development kit are compatible with
|
||||
K&R C<FONT SIZE=-6>[3]</FONT>,
|
||||
ANSI-C<FONT SIZE=-6>[4]</FONT>,
|
||||
ANSI C<FONT SIZE=-6>[4]</FONT>,
|
||||
and C++<FONT SIZE=-6>[5]</FONT>.
|
||||
<P>
|
||||
The best thing to do is to include the header file <TT><shell.h></TT>.
|
||||
@@ -285,7 +285,7 @@ services for your builtins.
|
||||
The header file <TT><ast.h></TT>
|
||||
provides prototypes for many <STRONG>libast</STRONG> functions
|
||||
and all the symbol and function definitions from the
|
||||
ANSI-C headers, <TT><stddef.h></TT>,
|
||||
ANSI C headers, <TT><stddef.h></TT>,
|
||||
<TT><stdlib.h></TT>, <TT><stdarg.h></TT>, <TT><limits.h></TT>,
|
||||
and <TT><string.h></TT>.
|
||||
It also provides all the symbols and definitions for the
|
||||
@@ -311,7 +311,7 @@ the Safe/Fast I/O library<FONT SIZE=-6>[7]</FONT>,
|
||||
to perform all I/O operations.
|
||||
The <STRONG>sfio</STRONG> library, which is part of <STRONG>libast</STRONG>,
|
||||
provides a superset of the functionality provided by the standard
|
||||
I/O library defined in ANSI-C.
|
||||
I/O library defined in ANSI C.
|
||||
If none of the additional functionality is required,
|
||||
and if you are not familiar with <STRONG>sfio</STRONG> and
|
||||
you do not want to spend the time learning it,
|
||||
@@ -412,7 +412,7 @@ The variable <TT>opt_info.num</TT> will contain this
|
||||
value after the given argument is encountered.
|
||||
<DT><TT>?</TT><DD>
|
||||
Used after a <TT>:</TT> or <TT>#</TT> (and after the optional <TT>?</TT>)
|
||||
to indicate the the
|
||||
to indicate the
|
||||
preceding option argument is not required.
|
||||
<DT><TT>[</TT>...<TT>]</TT><DD><BR>
|
||||
After a <TT>:</TT> or <TT>#</TT>, the characters contained
|
||||
@@ -458,7 +458,7 @@ while(1) switch(n=optget(argv,"xf:[file]"))
|
||||
break;
|
||||
case '?':
|
||||
error(ERROR_usage(2), opt_info.arg);
|
||||
break;
|
||||
UNREACHABLE();
|
||||
}
|
||||
</DIV>
|
||||
</PRE>
|
||||
@@ -521,7 +521,7 @@ The <STRONG>shell</STRONG> library is used to access other shell services.
|
||||
<P>
|
||||
<H4><A name="The nval library">The nval library</A></H4>
|
||||
A great deal of power is derived from the ability to use
|
||||
portions of the hierarchal variable namespace provided by <TT>ksh-93</TT>
|
||||
portions of the hierarchical variable namespace provided by <TT>ksh-93</TT>
|
||||
and turn these names into active objects.
|
||||
<P>
|
||||
The <STRONG>nval</STRONG> library is used to interface with shell
|
||||
@@ -544,7 +544,7 @@ using this handle so that the space can be freed once
|
||||
the value is unset.
|
||||
The two most frequent operations are to get the value of
|
||||
the variable, and to assign value to the variable.
|
||||
The <TT>nv_getval()</TT> returns a pointer the the
|
||||
The <TT>nv_getval()</TT> function returns a pointer to the
|
||||
value of the variable.
|
||||
In some cases the pointer returned is to a region that
|
||||
will be overwritten by the next <TT>nv_getval()</TT> call
|
||||
@@ -593,7 +593,7 @@ The <TT>getval()</TT>
|
||||
function is called by <TT>nv_getval()</TT>
|
||||
value and must return a string.
|
||||
The <TT>getnum()</TT>
|
||||
function is called by by the arithmetic evaluator
|
||||
function is called by the arithmetic evaluator
|
||||
and must return double.
|
||||
If omitted, then it will call <TT>nv_getval()</TT> and
|
||||
convert the result to a number.
|
||||
|
||||
Reference in New Issue
Block a user