mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
This takes another step towards cleaning up the build system. We now do not even pretend to be theoretically compatible with pre-1989 K&R C compilers or with C++ compilers. In practice, this had already been broken for many years due to bit rot. Commit46593a89already removed the license handling enormity that depended on proto, so now we can cleanly remove it altogether. But we do need to leave some backwards compatibility stubs to keep the build system compatible with older AST code; it should remain possible to build older ksh versions with the current build system (the bin/ and src/cmd/INIT/ directories) for testing purposes. So as of now there is no more __MANGLE__d rubbish in your generated header files. This is only about a quarter of a century overdue... This commit also includes a huge amount of code cleanup to remove thousands of unused K&R C fallbacks and other cruft, particularly in libast. This code base should now be a little easier to understand for people who are familiar with a modern(ish) C standard. ratz is now also removed; this was a standalone and simplified 2005 version of gunzip. As of6137b99a, none of our code uses it, even theoretically. And the real g(un)zip is now everywhere. src/cmd/INIT/proto.c, src/cmd/INIT/ratz.c: - Removed. COPYRIGHT: - Remove zlib license; this only applied to ratz. bin/package, src/cmd/INIT/package.sh: - Related cleanups. - Unset LC_ALL before invoking a new shell, respecting the user's locale again and avoiding multibyte character corruption on the command line. src/cmd/INIT/proto.sh: - Add stub for backwards compatibility with Mamfiles that depend on proto. It does nothing but pass input without modification and is now installed as the new arch/*/bin/proto by src/cmd/INIT/Mamfile. src/cmd/INIT/iffe.sh: - Ignore the proto-related -e (--package) and -p (--prototyped) options; keep parsing them for backwards compatibility. - Trim the macros passed to every test to their standard C versions, removing K&R C and C++ versions. These are now considered to be for backwards compatibility only. src/cmd/INIT/iffe.tst: - Remove proto(1) mangling code. By the way, iffe can be regression-tested as follows: $ bin/package use # set up environment in a child shell $ regress src/cmd/INIT/iffe.tst $ exit # leave package environment src/cmd/INIT/make.probe, src/cmd/INIT/probe.win32: - Remove code to handle C++. src/lib/libast/features/common: - As in iffe.sh above, trim macros designed for compatibility with C++ and ancient C compilers to their standard C versions and comment that they are for backwards compatibility with AST code. This is needed to keep all the old ast and ksh code compiling. src/cmd/ksh93/sh/init.c, src/cmd/ksh93/sh/name.c: - Clarify libshell ABI compatibility function versions of macros. A "proto workaround" comment in the original code mislead me into thinking this had something to do with the removed proto(1), but it's unrelated. Call the workaround macro BYPASS_MACRO instead. src/cmd/ksh93/include/defs.h: - sh_sigcheck() macro: allow &sh as an argument: parenthesise shp. src/cmd/ksh93/sh/nvtype.c: - Remove unused nv_mkstruct() function. (re:d0a5cab1) **/features/*: - Remove obsolete iffe 'set prototyped' option. **/Mamfile: - Remove all references to the ast/prototyped.h header. - Remove all use of the proto command. Simply copy instead. *** 850-ish source files: *** - Remove all '#pragma prototyped' directives. - Remove all C++ compat code conditional upon defined(__cplusplus). - Remove all use of the _ARG_ macro, which on standard C expands to its argument: #define _ARG_(x) x (on K&R C, it expanded to nothing) - Remove all use of _BEGIN_EXTERNS_ and _END_EXTERNS_ macros (empty on standard C; this was for C++ compatibility) - Reduce all #if __STD_C (standard code) #else (K&R code) #endif blocks to the standard code only, without use of the macro. - Same for _STD_ macro which seems to have had the same function. - Change all instances of 'Void_t' to standard 'void'.
This commit is contained in:
parent
3785a0685c
commit
a1f5c99204
869 changed files with 1853 additions and 14292 deletions
|
|
@ -77,10 +77,7 @@ make install
|
|||
done ${PACKAGE_ast_INCLUDE}/dlldefs.h dontcare
|
||||
make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/shcmd.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare
|
||||
done ${PACKAGE_ast_INCLUDE}/shcmd.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/cmdext.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/stak.h implicit
|
||||
|
|
@ -120,13 +117,10 @@ make install
|
|||
prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/regex.h dontcare
|
||||
make ${PACKAGE_ast_INCLUDE}/getopt.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit
|
||||
|
|
@ -146,12 +140,9 @@ make install
|
|||
make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare
|
||||
done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/stk.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/stak.h dontcare
|
||||
make ${PACKAGE_ast_INCLUDE}/error.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/option.h implicit
|
||||
|
|
@ -163,15 +154,11 @@ make install
|
|||
done ${PACKAGE_ast_INCLUDE}/vmalloc.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/option.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/error.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/cmd.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit
|
||||
make include/nval.h implicit
|
||||
|
|
@ -213,7 +200,6 @@ make install
|
|||
make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_time.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/times.h dontcare
|
||||
done FEATURE/time generated
|
||||
make include/builtins.h implicit
|
||||
|
|
@ -292,7 +278,6 @@ make install
|
|||
done ${PACKAGE_ast_INCLUDE}/ast_mode.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ls.h
|
||||
prev include/builtins.h implicit
|
||||
prev include/name.h implicit
|
||||
|
|
@ -442,7 +427,6 @@ make install
|
|||
make ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_ccode.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ccode.h
|
||||
make ${PACKAGE_ast_INCLUDE}/tmx.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/tv.h implicit
|
||||
|
|
@ -451,7 +435,6 @@ make install
|
|||
make ${PACKAGE_ast_INCLUDE}/tm.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/times.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/tm.h dontcare
|
||||
done ${PACKAGE_ast_INCLUDE}/tmx.h
|
||||
make include/streval.h implicit
|
||||
|
|
@ -800,12 +783,10 @@ make install
|
|||
make dirlib.h implicit
|
||||
done dirlib.h dontcare virtual
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_dir.h
|
||||
prev ${PACKAGE_ast_INCLUDE}/stak.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/ls.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/glob.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/glob.h
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev include/test.h implicit
|
||||
|
|
@ -946,7 +927,6 @@ make install
|
|||
make ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_wait.h dontcare
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/wait.h
|
||||
prev include/defs.h implicit
|
||||
done sh/jobs.c
|
||||
|
|
@ -1508,26 +1488,23 @@ make install
|
|||
make ${PACKAGE_ast_INCLUDE}/nval.h
|
||||
prev ${PACKAGE_ast_INCLUDE}
|
||||
prev include/nval.h
|
||||
exec - proto -p -s include/nval.h > 1.${COTEMP}.x
|
||||
exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/nval.h 1.${COTEMP}.x
|
||||
exec - then rm -f 1.${COTEMP}.x
|
||||
exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/nval.h
|
||||
exec - if cmp 2>/dev/null -s include/nval.h ${PACKAGE_ast_INCLUDE}/nval.h
|
||||
exec - then :
|
||||
exec - else ${STDCP} include/nval.h ${PACKAGE_ast_INCLUDE}/nval.h
|
||||
exec - fi
|
||||
done ${PACKAGE_ast_INCLUDE}/nval.h generated
|
||||
make ${PACKAGE_ast_INCLUDE}/shell.h
|
||||
prev include/shell.h
|
||||
exec - proto -p -s include/shell.h > 1.${COTEMP}.x
|
||||
exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/shell.h 1.${COTEMP}.x
|
||||
exec - then rm -f 1.${COTEMP}.x
|
||||
exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/shell.h
|
||||
exec - if cmp 2>/dev/null -s include/shell.h ${PACKAGE_ast_INCLUDE}/shell.h
|
||||
exec - then :
|
||||
exec - else ${STDCP} include/shell.h ${PACKAGE_ast_INCLUDE}/shell.h
|
||||
exec - fi
|
||||
done ${PACKAGE_ast_INCLUDE}/shell.h generated
|
||||
make ${PACKAGE_ast_INCLUDE}/history.h
|
||||
prev include/history.h
|
||||
exec - proto -p -s include/history.h > 1.${COTEMP}.x
|
||||
exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/history.h 1.${COTEMP}.x
|
||||
exec - then rm -f 1.${COTEMP}.x
|
||||
exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/history.h
|
||||
exec - if cmp 2>/dev/null -s include/history.h ${PACKAGE_ast_INCLUDE}/history.h
|
||||
exec - then :
|
||||
exec - else ${STDCP} include/history.h ${PACKAGE_ast_INCLUDE}/history.h
|
||||
exec - fi
|
||||
done ${PACKAGE_ast_INCLUDE}/history.h generated
|
||||
make ${INSTALLROOT}/bin/suid_exec
|
||||
|
|
|
|||
|
|
@ -620,8 +620,8 @@ ____
|
|||
10-09-29 A bug in which loading a function from FPATH could leave a file
|
||||
descriptor open has been fixed.
|
||||
10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being
|
||||
evaluated. It allows fixed sized indexed arrays be to defined
|
||||
using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays
|
||||
evaluated. It allows fixed-size indexed arrays be to defined
|
||||
using "typeset array[dim1][dim2]...[dimn]". Fixed-size arrays
|
||||
are used the same way indexed arrays are. Currently, only fixed
|
||||
arrays of fixed objects (float, int, and justified objects) are
|
||||
supported.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* alarm [-r] [varname [+]when]
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* cd [-L] [-Pe] [dirname]
|
||||
* cd [-L] [-Pe] [old] [new]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* break [n]
|
||||
* continue [n]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#include "defs.h"
|
||||
|
||||
#define ENUM_ID "enum (ksh 93u+m) 2021-12-17"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* getopts [-a name] optstring name [args...]
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#include "defs.h"
|
||||
#include <stak.h>
|
||||
#include <ls.h>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* bg [job...]
|
||||
* disown [job...]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* mkservice varname pathname
|
||||
* eloop [-t timeout]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* echo [arg...]
|
||||
* print [-enprsvC] [-f format] [-u fd] [string ...]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* read [-ACprsSv] [-d delim] [-u fd] [-t timeout] [-n count] [-N count] [var?prompt] [var ...]
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* regression test intercept control
|
||||
* enable with 'SHOPT REGRESS=1' in src/cmd/ksh93/SHOPT.sh
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* sleep [-s] duration
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* test expression
|
||||
* [ expression ]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* trap [-p] action sig...
|
||||
* kill [-lL] [sig...]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* export [-p] [arg...]
|
||||
* readonly [-p] [arg...]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* ulimit [-HSaMctdfxlqenupmrbiswTv] [limit]
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* umask [-S] [mask]
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* command [-pvVx] name [arg...]
|
||||
* whence [-afpqv] name...
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#include "defs.h"
|
||||
#include <signal.h>
|
||||
#include "FEATURE/options"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
|
||||
#include "defs.h"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#include "shell.h"
|
||||
#include "shlex.h"
|
||||
#include "FEATURE/options"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include <ast.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include <ast.h>
|
||||
#include "ulimit.h"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* UNIX shell
|
||||
* S. R. Bourne
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include "defs.h"
|
||||
#include "name.h"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* data for string evaluator library
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
/*
|
||||
* tables for the test builtin [[ ... ]] and [ ... ]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include <ast.h>
|
||||
#include "FEATURE/options"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* completion.c - command and file completion for shell editors
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* edit.c - common routines for vi and emacs one line editors in shell
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/* Original version by Michael T. Veach
|
||||
* Adapted for ksh by David Korn */
|
||||
/* EMACS_MODES: c tabstop=4
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* bash style history expansion
|
||||
*
|
||||
|
|
@ -591,7 +590,7 @@ getsel:
|
|||
{
|
||||
/* preset old with match from !?string? */
|
||||
if(!sb.str[0] && wm)
|
||||
sb.str[0] = sh_strdup(sfsetbuf(wm, (Void_t*)1, 0));
|
||||
sb.str[0] = sh_strdup(sfsetbuf(wm, (void*)1, 0));
|
||||
cp = parse_subst(cp, &sb);
|
||||
}
|
||||
|
||||
|
|
@ -608,7 +607,7 @@ getsel:
|
|||
}
|
||||
|
||||
/* need pointer for strstr() */
|
||||
str = sfsetbuf(tmp, (Void_t*)1, 0);
|
||||
str = sfsetbuf(tmp, (void*)1, 0);
|
||||
|
||||
flag |= HIST_SUBSTITUTE;
|
||||
while(flag & HIST_SUBSTITUTE)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* History file manipulation routines
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/* Adapted for ksh by David Korn */
|
||||
/*+ VI.C P.D. Sullivan
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
set prototyped
|
||||
hdr nc,exec_attr
|
||||
mem exception.name,_exception.name math.h
|
||||
lib setreuid,setregid,nice,fork,spawnveg,fchdir
|
||||
|
|
@ -21,16 +20,12 @@ tst note{ determining extra bytes per argument for arguments list }end output{
|
|||
* even if all the arguments should fit in ARG_MAX based on their length.
|
||||
*/
|
||||
|
||||
/* AST includes */
|
||||
#include <ast.h>
|
||||
#include <error.h>
|
||||
#include <sfio.h>
|
||||
#include <stak.h>
|
||||
#include <wait.h>
|
||||
|
||||
/* Standard includes */
|
||||
#include <errno.h>
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
int extra_bytes = 0, envlen, argmax, i;
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ eval `iffe $iffeflags -c "$cc" - dat,npt,mac $lib $iffehdrs $iffelibs 2>&$stderr
|
|||
eval `iffe $iffeflags -c "$cc" - num $nums $iffehdrs $iffelibs 2>&$stderr`
|
||||
|
||||
cat <<!
|
||||
#pragma prototyped
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
/* : : generated by $command from $table : : */
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ tst socketpair_shutdown_mode note{ fchmod() after socketpair() shutdown() }end e
|
|||
}
|
||||
}end
|
||||
cat{
|
||||
#pragma prototyped
|
||||
#ifdef _lib_poll
|
||||
# define poll _SYS_poll
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef ARG_RAW
|
||||
/*
|
||||
* struct to hold a word argument
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#ifndef __builtins_h_defined
|
||||
#define __builtins_h_defined
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
@ -417,7 +416,7 @@ extern char *sh_getcwd(void);
|
|||
#define sh_getstate() (sh.st.states)
|
||||
#define sh_setstate(x) (sh.st.states = (x))
|
||||
|
||||
#define sh_sigcheck(shp) do{if(shp->trapnote&SH_SIGSET)sh_exit(SH_EXITSIG);} while(0)
|
||||
#define sh_sigcheck(shp) do{if((shp)->trapnote&SH_SIGSET)sh_exit(SH_EXITSIG);} while(0)
|
||||
|
||||
extern int32_t sh_mailchk;
|
||||
extern const char e_dict[];
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef SEARCHSIZE
|
||||
/*
|
||||
* edit.h - common data structure for vi and emacs edit options
|
||||
|
|
@ -238,11 +237,11 @@ extern int hist_expand(const char *, char **);
|
|||
#endif /* SHOPT_HISTEXPAND */
|
||||
|
||||
#if SHOPT_ESH
|
||||
extern void emacs_redraw(Void_t*);
|
||||
extern void emacs_redraw(void*);
|
||||
#endif /* SHOPT_ESH */
|
||||
|
||||
#if SHOPT_VSH
|
||||
extern void vi_redraw(Void_t*);
|
||||
extern void vi_redraw(void*);
|
||||
#endif /* SHOPT_VSH */
|
||||
|
||||
#endif /* !SEARCHSIZE */
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef SH_SIGBITS
|
||||
/*
|
||||
* UNIX shell
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef fcgetc
|
||||
/*
|
||||
* David Korn
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef HIST_VERSION
|
||||
/*
|
||||
* Interface for history mechanism
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* UNIX shell
|
||||
* David Korn
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef JOB_NFLAG
|
||||
/*
|
||||
* Interface to job control for shell
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef S_BREAK
|
||||
#define S_BREAK 1 /* end of token */
|
||||
#define S_EOF 2 /* end of buffer */
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef _NV_PRIVATE
|
||||
/*
|
||||
* This is the implementation header file for name-value pairs
|
||||
|
|
@ -76,7 +75,7 @@ union Value
|
|||
#if SHOPT_FIXEDARRAY
|
||||
# define ARRAY_FIXED ARRAY_NOCLONE /* For index values */
|
||||
#endif /* SHOPT_FIXEDARRAY */
|
||||
#define NV_FARRAY 0x10000000 /* fixed sized arrays */
|
||||
#define NV_FARRAY 0x10000000 /* fixed-size arrays */
|
||||
#define NV_ASETSUB 8 /* set subscript */
|
||||
|
||||
/* These flags are used as options to array_get() */
|
||||
|
|
@ -213,7 +212,7 @@ extern Namval_t *nv_parent(Namval_t*);
|
|||
extern char *nv_getbuf(size_t);
|
||||
extern Namval_t *nv_mount(Namval_t*, const char *name, Dt_t*);
|
||||
extern Namval_t *nv_arraychild(Namval_t*, Namval_t*, int);
|
||||
extern int nv_compare(Dt_t*, Void_t*, Void_t*, Dtdisc_t*);
|
||||
extern int nv_compare(Dt_t*, void*, void*, Dtdisc_t*);
|
||||
extern void nv_outnode(Namval_t*,Sfio_t*, int, int);
|
||||
extern int nv_subsaved(Namval_t*, int);
|
||||
extern void nv_typename(Namval_t*, Sfio_t*);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* national.h - definitions for multibyte character sets
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef NV_DEFAULT
|
||||
/*
|
||||
* David Korn
|
||||
|
|
@ -87,7 +86,7 @@ struct Namarray
|
|||
Namfun_t hdr;
|
||||
long nelem; /* number of elements */
|
||||
void *(*fun)(Namval_t*,const char*,int); /* associative arrays */
|
||||
void *fixed; /* for fixed sized arrays */
|
||||
void *fixed; /* for fixed-size arrays */
|
||||
Dt_t *table; /* for subscripts */
|
||||
void *scope; /* non-zero when scoped */
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef PATH_OFFSET
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef SH_INTERACTIVE
|
||||
/*
|
||||
* David Korn
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef NOTSYM
|
||||
/*
|
||||
* UNIX shell
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef _SHNODES_H
|
||||
#define _SHNODES_H 1
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef _SHTABLE_H
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef SEQPOINT
|
||||
/*
|
||||
* D. G. Korn
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#ifndef _terminal_
|
||||
#define _terminal_ 1
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef TEST_ARITH
|
||||
/*
|
||||
* UNIX shell
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#ifndef _ULIMIT_H
|
||||
#define _ULIMIT_H 1
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#ifndef SH_VALNOD
|
||||
|
||||
|
|
|
|||
|
|
@ -1267,7 +1267,7 @@ For each of these attributes, a width can be defined explicitly or else
|
|||
it is defined the first time an assignment is made to the variable.
|
||||
Each assignment causes justification of the field, truncating
|
||||
if necessary.
|
||||
Assignment to fixed sized variables
|
||||
Assignment to fixed-size variables
|
||||
provides one way to generate a substring consisting of
|
||||
a fixed number of characters from
|
||||
the beginning or end of a string.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* UNIX shell
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Shell arithmetic - uses streval library
|
||||
* David Korn
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Array processing routines
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* File name expansion
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Fault handling routines
|
||||
*
|
||||
|
|
@ -50,7 +49,7 @@ static int cursig = -1;
|
|||
/*
|
||||
* This exception handler is called after vmalloc() unlocks the region
|
||||
*/
|
||||
static int malloc_done(Vmalloc_t* vm, int type, Void_t* val, Vmdisc_t* dp)
|
||||
static int malloc_done(Vmalloc_t* vm, int type, void* val, Vmdisc_t* dp)
|
||||
{
|
||||
dp->exceptf = 0;
|
||||
sh_exit(SH_EXITSIG);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Routines to implement fast character input
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
*
|
||||
* Shell initialization
|
||||
|
|
@ -2005,43 +2004,32 @@ static void env_import_attributes(Shell_t *shp, char *next)
|
|||
}
|
||||
|
||||
/*
|
||||
* terminate shell and free up the space
|
||||
* libshell ABI compatibility functions
|
||||
*/
|
||||
int sh_term(void)
|
||||
{
|
||||
sfdisc(sfstdin,SF_POPDISC);
|
||||
free((char*)sh.outbuff);
|
||||
stakset(NIL(char*),0);
|
||||
return(0);
|
||||
}
|
||||
#define BYPASS_MACRO
|
||||
|
||||
/* function versions of these */
|
||||
|
||||
#define DISABLE /* proto workaround */
|
||||
|
||||
unsigned long sh_isoption DISABLE (int opt)
|
||||
unsigned long sh_isoption BYPASS_MACRO (int opt)
|
||||
{
|
||||
return(sh_isoption(opt));
|
||||
}
|
||||
|
||||
unsigned long sh_onoption DISABLE (int opt)
|
||||
unsigned long sh_onoption BYPASS_MACRO (int opt)
|
||||
{
|
||||
return(sh_onoption(opt));
|
||||
}
|
||||
|
||||
unsigned long sh_offoption DISABLE (int opt)
|
||||
unsigned long sh_offoption BYPASS_MACRO (int opt)
|
||||
{
|
||||
return(sh_offoption(opt));
|
||||
}
|
||||
|
||||
void sh_sigcheck DISABLE (Shell_t *shp)
|
||||
void sh_sigcheck BYPASS_MACRO (Shell_t *shp)
|
||||
{
|
||||
if(!shp)
|
||||
shp = sh_getinterp();
|
||||
sh_sigcheck(shp);
|
||||
NOT_USED(shp);
|
||||
sh_sigcheck(&sh);
|
||||
}
|
||||
|
||||
Dt_t* sh_bltin_tree DISABLE (void)
|
||||
Dt_t* sh_bltin_tree(void)
|
||||
{
|
||||
return(sh.bltin_tree);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
/*
|
||||
* Input/output file processing
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Job control for UNIX Shell
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* KornShell lexical analyzer
|
||||
*
|
||||
|
|
@ -145,7 +144,7 @@ static void lex_advance(Sfio_t *iop, const char *buff, register int size, void *
|
|||
sfwrite(shp->strbuf,lp->lexd.docend,n);
|
||||
lp->lexd.docextra += n;
|
||||
if(sffileno(iop)>=0)
|
||||
lp->lexd.docend = sfsetbuf(iop,(Void_t*)iop,0);
|
||||
lp->lexd.docend = sfsetbuf(iop,(void*)iop,0);
|
||||
else
|
||||
lp->lexd.docend = fcfirst();
|
||||
}
|
||||
|
|
@ -1736,7 +1735,7 @@ void sh_lexskip(Lex_t *lp,int close, register int copy, int state)
|
|||
}
|
||||
|
||||
#if SHOPT_CRNL
|
||||
ssize_t _sfwrite(Sfio_t *sp, const Void_t *buff, size_t n)
|
||||
ssize_t _sfwrite(Sfio_t *sp, const void *buff, size_t n)
|
||||
{
|
||||
const char *cp = (const char*)buff, *next=cp, *ep = cp + n;
|
||||
int m=0,k;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Shell macro expander
|
||||
* expands ~
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* UNIX shell
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* AT&T Labs
|
||||
*
|
||||
|
|
@ -3703,28 +3702,25 @@ char *nv_name(register Namval_t *np)
|
|||
|
||||
Namval_t *nv_lastdict(void)
|
||||
{
|
||||
Shell_t *shp = sh_getinterp();
|
||||
return(shp->last_table);
|
||||
return(sh.last_table);
|
||||
}
|
||||
|
||||
#undef nv_context
|
||||
/*
|
||||
* returns the data context for a builtin
|
||||
* libshell ABI compatibility functions
|
||||
*/
|
||||
void *nv_context(Namval_t *np)
|
||||
#define BYPASS_MACRO
|
||||
|
||||
void *nv_context BYPASS_MACRO (Namval_t *np)
|
||||
{
|
||||
return((void*)np->nvfun);
|
||||
return(nv_context(np));
|
||||
}
|
||||
|
||||
#define DISABLE /* proto workaround */
|
||||
|
||||
int nv_isnull DISABLE (register Namval_t *np)
|
||||
int nv_isnull BYPASS_MACRO (Namval_t *np)
|
||||
{
|
||||
return(nv_isnull(np));
|
||||
}
|
||||
|
||||
#undef nv_setsize
|
||||
int nv_setsize(register Namval_t *np, int size)
|
||||
int nv_setsize BYPASS_MACRO (Namval_t *np, int size)
|
||||
{
|
||||
int oldsize = nv_size(np);
|
||||
if(size>=0)
|
||||
|
|
@ -3732,9 +3728,7 @@ int nv_setsize(register Namval_t *np, int size)
|
|||
return(oldsize);
|
||||
}
|
||||
|
||||
#undef nv_unset
|
||||
|
||||
void nv_unset(register Namval_t *np)
|
||||
void nv_unset BYPASS_MACRO (Namval_t *np)
|
||||
{
|
||||
_nv_unset(np,0);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* AT&T Labs
|
||||
*
|
||||
|
|
@ -33,7 +32,7 @@
|
|||
|
||||
static void assign(Namval_t*,const char*,int,Namfun_t*);
|
||||
|
||||
int nv_compare(Dt_t* dict, Void_t *sp, Void_t *dp, Dtdisc_t *disc)
|
||||
int nv_compare(Dt_t* dict, void *sp, void *dp, Dtdisc_t *disc)
|
||||
{
|
||||
if(sp==dp)
|
||||
return(0);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
/*
|
||||
* code for tree nodes and name walking
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
@ -1408,129 +1407,6 @@ Fields_t foo[]=
|
|||
0
|
||||
};
|
||||
|
||||
|
||||
Namval_t *nv_mkstruct(const char *name, int rsize, Fields_t *fields)
|
||||
{
|
||||
Namval_t *mp, *nq, *nr, *tp;
|
||||
Fields_t *fp;
|
||||
Namtype_t *dp, *pp;
|
||||
char *cp, *sp;
|
||||
int nnodes=0, offset=staktell(), n, r, i, j;
|
||||
size_t m, size=0;
|
||||
stakputs(NV_CLASS);
|
||||
stakputc('.');
|
||||
r = staktell();
|
||||
stakputs(name);
|
||||
stakputc(0);
|
||||
mp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME);
|
||||
stakseek(r);
|
||||
|
||||
for(fp=fields; fp->name; fp++)
|
||||
{
|
||||
m = strlen(fp->name)+1;
|
||||
size += m;
|
||||
nnodes++;
|
||||
if(memcmp(fp->type,"typeset",7))
|
||||
{
|
||||
stakputs(fp->type);
|
||||
stakputc(0);
|
||||
tp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME|NV_NOADD|NV_NOFAIL);
|
||||
stakseek(r);
|
||||
if(!tp)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_exit(1),e_unknowntype,strlen(fp->type),fp->type);
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(dp = (Namtype_t*)nv_hasdisc(tp,&type_disc))
|
||||
{
|
||||
nnodes += dp->numnodes;
|
||||
if((i=dp->strsize) < 0)
|
||||
i = -i;
|
||||
size += i + dp->numnodes*m;
|
||||
}
|
||||
}
|
||||
}
|
||||
pp = sh_newof(NiL,Namtype_t, 1, nnodes*NV_MINSZ + rsize + size);
|
||||
pp->fun.dsize = sizeof(Namtype_t)+nnodes*NV_MINSZ +rsize;
|
||||
pp->fun.type = mp;
|
||||
pp->np = mp;
|
||||
pp->childfun.fun.disc = &chtype_disc;
|
||||
pp->childfun.fun.nofree = 1;
|
||||
pp->childfun.ttype = pp;
|
||||
pp->childfun.ptype = pp;
|
||||
pp->fun.disc = &type_disc;
|
||||
pp->nodes = (char*)(pp+1);
|
||||
pp->numnodes = nnodes;
|
||||
pp->strsize = size;
|
||||
pp->data = pp->nodes + nnodes*NV_MINSZ;
|
||||
cp = pp->data + rsize;
|
||||
for(i=0,fp=fields; fp->name; fp++)
|
||||
{
|
||||
nq = nv_namptr(pp->nodes,i++);
|
||||
nq->nvname = cp;
|
||||
nq->nvalue.cp = pp->data + fp->offset;
|
||||
nv_onattr(nq,NV_MINIMAL|NV_NOFREE);
|
||||
m = strlen(fp->name)+1;
|
||||
memcpy(cp, fp->name, m);
|
||||
cp += m;
|
||||
if(memcmp(fp->type,"typeset",7))
|
||||
{
|
||||
stakputs(fp->type);
|
||||
stakputc(0);
|
||||
tp = nv_open(stakptr(offset), sh.var_tree, NV_VARNAME);
|
||||
stakseek(r);
|
||||
clone_all_disc(tp,nq,NV_RDONLY);
|
||||
nq->nvflag = tp->nvflag|NV_MINIMAL|NV_NOFREE;
|
||||
nq->nvsize = tp->nvsize;
|
||||
if(dp = (Namtype_t*)nv_hasdisc(nq,&type_disc))
|
||||
dp->strsize = -dp->strsize;
|
||||
if(dp = (Namtype_t*)nv_hasdisc(tp,&type_disc))
|
||||
{
|
||||
if(nv_hasdisc(nq,&chtype_disc))
|
||||
nv_disc(nq, &pp->childfun.fun, NV_LAST);
|
||||
sp = (char*)nq->nvalue.cp;
|
||||
memcpy(sp, dp->data, nv_size(tp));
|
||||
for(j=0; j < dp->numnodes; j++)
|
||||
{
|
||||
nr = nv_namptr(dp->nodes,j);
|
||||
nq = nv_namptr(pp->nodes,i++);
|
||||
nq->nvname = cp;
|
||||
memcpy(cp,fp->name,m);
|
||||
cp[m-1] = '.';
|
||||
cp += m;
|
||||
n = strlen(nr->nvname)+1;
|
||||
memcpy(cp,nr->nvname,n);
|
||||
cp += n;
|
||||
if(nr->nvalue.cp>=dp->data && nr->nvalue.cp < (char*)pp + pp->fun.dsize)
|
||||
{
|
||||
nq->nvalue.cp = sp + (nr->nvalue.cp-dp->data);
|
||||
}
|
||||
nq->nvflag = nr->nvflag;
|
||||
nq->nvsize = nr->nvsize;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strmatch(fp->type+7,"*-*i*")==0)
|
||||
{
|
||||
nv_onattr(nq,NV_NOFREE|NV_RDONLY|NV_INTEGER);
|
||||
if(strmatch(fp->type+7,"*-*s*")==0)
|
||||
nv_onattr(nq,NV_INT16P);
|
||||
else if(strmatch(fp->type+7,"*-*l*")==0)
|
||||
nv_onattr(nq,NV_INT64);
|
||||
if(strmatch(fp->type+7,"*-*u*")==0)
|
||||
nv_onattr(nq,NV_UNSIGN);
|
||||
}
|
||||
|
||||
}
|
||||
stakseek(offset);
|
||||
nv_onattr(mp,NV_RDONLY|NV_NOFREE|NV_BINARY);
|
||||
nv_setsize(mp,rsize);
|
||||
nv_disc(mp, &pp->fun, NV_LAST);
|
||||
mp->nvalue.cp = pp->data;
|
||||
nv_newtype(mp);
|
||||
return(mp);
|
||||
}
|
||||
|
||||
static void write_indent(Sfio_t *out,char *str,int n,int indent)
|
||||
{
|
||||
register int c, first=1;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* UNIX shell
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include <shell.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
/*
|
||||
* D. G. Korn
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* string processing routines for Korn shell
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* Create and manage subshells avoiding forks when possible
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* This is a program to execute 'execute only' and suid/sgid shell scripts.
|
||||
* This program must be owned by root and must have the set uid bit set.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include <ast.h>
|
||||
#include <sig.h>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
#include "defs.h"
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* UNIX shell parse tree executer
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue