MCDE: dtksh is out; dterror.ds is a Motif program; dtterm keeps starting the login shell

Konrad, 2026-11-14: "was soll dtksh ueberhaupt sein... einfach ne shell von
CDE? fuck it. schmeiss das komplett raus aus MCDE."  dtksh is CDE's ksh93
with Motif bindings for scripting dialogs; its bundled ksh93 (AT&T ast's
bin/package) compiles and RUNS test programs while it builds, which a cross
build for NetBSD on a Linux host cannot do -- the reason wm/mcde did not
build for days ("cc: not found", userland-2026-11-14g.log).

- programs/dtksh removed (1204 files); not in programs/Makefile.am,
  configure.ac, the recipe (REPLACE_INTERPRETER dtksh, KSH_CC), PLIST (bin,
  lib, man page, six catalogues), msg.C.am (dtksh.cat), AGENTS.md.
- What used dtksh:
  * dterror.src, dtfile_error.cpp, types/error.ds.src: an error dialog with a
    message.  New programs/dterror/dterror.c (about 70 lines of Motif), built
    as dterror.ds: dterror.ds MESSAGE [TITLE [OK-LABEL]], the convention of
    every caller (the data types, dtopen, dtfile ModAttr.c).  dtfile_error
    was only the 'test' entry of dtfile.config and ModAttr.c's fallback; the
    entry is gone and ModAttr.c calls dterror.ds.
  * dthelpgen.dtsh: the "building help" dialog helpgen.c forked; it runs
    silently now (childPid stays -1).
  * dtprintegrate/dtlp.src: the print dialog (1711 lines of dtksh); printing
    is to come back through CUPS (tasksd t0177, t0193).  dtlp's man page is
    out of the doc build and PLIST with it.
  * The data types DTKSH_SCRIPT (*.ds) and DTKSH_CONV (*.dtsh) in dt.dt.src:
    they would have classed dterror.ds as a script.
- dtterm needs no change: lib/DtTerm/TermPrim/TermPrimSubproc.c takes /usr/bin/zsh,
  then the shell of the passwd entry, then /bin/sh, and never started dtksh.
- ksh93 stays as the NetBSD binary for the scripts that say ksh (Xsession).

Measured: make mcde-linux exit=0 (build/logs/mcde-linux-nodtksh-2026-11-14.log),
autogen picked up programs/dterror; dterror.ds under Xvfb shows the error
icon, a two-line message and one button "Understood", and exits 0 on Return.

Not in this commit: the other agents' pending dtfile edits (Search.c,
Navigation.c) and the regenerated distinfo files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
lotherkandClaude Sonnet 5.5 committed 2026-11-14 09:12:55 +00:00
1 parent 54309406d6
commit c01da186a7
1227 files changed
+107 -368573

No files matched your search

+1 -1
View File
@@ -139,7 +139,7 @@ tests installs.
`build/mcde-root/dt`), and `make mcde-host` (`tools/mcde-host.sh`, the
desktop in `/usr/mdt`).
- The C dialect is set by `configure.ac` (`-std=gnu11` and five GCC 14
downgrades, handed to dtksh's ksh93 as `MCDE_DIALECT_CFLAGS`); no build
downgrades; `MCDE_DIALECT_CFLAGS` for a build that ignores CFLAGS); no build
system needs to know it.
- Tests: `make check` (`test_sysinfo`, `test_menumodel`, `test_displays`,
`test_items`, `test_panes`, `test_profiles`).
+1 -2
View File
@@ -22,8 +22,7 @@ AM_MAKEFLAGS = CC_FOR_BUILD='$(CC_FOR_BUILD)' \
CPPFLAGS_FOR_BUILD='$(CPPFLAGS_FOR_BUILD)' \
LDFLAGS_FOR_BUILD='$(LDFLAGS_FOR_BUILD)' \
LIBS_FOR_BUILD='$(LIBS_FOR_BUILD)' \
AR_FOR_BUILD='$(AR_FOR_BUILD)' RANLIB_FOR_BUILD='$(RANLIB_FOR_BUILD)' \
KSH_CC='$(KSH_CC)'
AR_FOR_BUILD='$(AR_FOR_BUILD)' RANLIB_FOR_BUILD='$(RANLIB_FOR_BUILD)'
if BUILD_DOCS
SUBDIRS += doc
+2 -4
View File
@@ -46,8 +46,7 @@ dnl C23 reads as `int f(void)`; GCC 15 defaults to C23. gnu11 is the dialect
dnl NetBSD builds its own tree with (share/mk/bsd.sys.mk). GCC 14 also made
dnl five old diagnostics errors that CDE trips; they stay warnings here. New
dnl MCDE code must be valid C99 and POSIX on its own (AGENTS.md).
dnl MCDE_DIALECT_CFLAGS: the accepted flags, for builds that ignore CFLAGS
dnl (programs/dtksh builds ksh93 with its own tool and cc from PATH).
dnl MCDE_DIALECT_CFLAGS: the accepted flags, for builds that ignore CFLAGS.
MCDE_DIALECT_CFLAGS=
for mcde_flag in -std=gnu11 -Wno-error=implicit-function-declaration \
-Wno-error=implicit-int -Wno-error=int-conversion \
@@ -891,8 +890,7 @@ programs/dtspcd/Makefile
programs/dtscreen/Makefile
programs/dtksh/Makefile
programs/dtksh/examples/Makefile
programs/dterror/Makefile
programs/dtcm/Makefile
programs/dtcm/libDtCmP/Makefile
+3 -12
View File
@@ -14,12 +14,12 @@ MANSEC1 = man1/tttrace.1 man1/tttar.1 man1/ttsession.1 man1/ttrmdir.1 \
man1/dtsrdbrec.1 man1/dtsrcreate.1 man1/dtsession_res.1 \
man1/dtsession.1 man1/dtsearchpath.1 man1/dtscreen.1 \
man1/dtprintinfo.1 man1/dtpdmd.1 man1/dtpdm.1 man1/dtpad.1 \
man1/dtmailpr.1 man1/dtmail.1 man1/dtlp.1 man1/dtlogin.1 \
man1/dtksh.1 man1/dtdocbook2infolib.1 man1/dtinfo.1 \
man1/dtmailpr.1 man1/dtmail.1 man1/dtlogin.1 \
man1/dtdocbook2infolib.1 man1/dtinfo.1 \
man1/dtimsstart.1 man1/dticon.1 man1/dthelpview.1 man1/dthelptag.1 \
man1/dthelpprint.1 man1/dthelpgen.1 man1/dthelp_htag2.1 \
man1/dthelp_htag1.1 man1/dthelp_ctag1.1 man1/dthello.1 \
man1/dtgreet.1 man1/dtfplist.1 man1/dtfile_error.1 \
man1/dtgreet.1 man1/dtfplist.1 \
man1/dtfile_copy.1 man1/dtfile.1 man1/dtexec.1 man1/dtdocbook.1 \
man1/dtcreate.1 man1/dtconvertvf.1 man1/dtconfig.1 \
man1/dtcodegen.1 man1/dtcm_lookup.1 man1/dtcm_insert.1 \
@@ -400,9 +400,6 @@ man1/dtfile.1: ../guides/man/man1_dt/file.sgm $(MANDEPS)
man1/dtfile_copy.1: ../guides/man/man1_dt/file_cop.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
man1/dtfile_error.1: ../guides/man/man1_dt/file_err.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
man1/dtfplist.1: ../guides/man/man1_dt/fplist.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
@@ -445,15 +442,9 @@ man1/dtinfo.1: ../guides/man/man1_dt/info.sgm $(MANDEPS)
man1/dtdocbook2infolib.1: ../guides/man/man1_dt/docbook2infolib.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
man1/dtksh.1: ../guides/man/man1_dt/ksh.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
man1/dtlogin.1: ../guides/man/man1_dt/login.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
man1/dtlp.1: ../guides/man/man1_dt/lp.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
man1/dtmail.1: ../guides/man/man1_dt/mail.sgm $(MANDEPS)
$(DBTOMAN) cdedecl.sgm $< $@
-12
View File
@@ -68,11 +68,6 @@ REPLACE_PERL+= programs/dtinfo/tools/bin/ccdate
# its path, which NetBSD and Linux have; REPLACE_AWK changes #! lines only,
# and awk:run kept the package from being cross-built on a Linux host)
REPLACE_INTERPRETER+= dtksh
REPLACE.dtksh.old= .*/bin/dtksh
REPLACE.dtksh.new= ${PREFIX}/dt/bin/dtksh
REPLACE_FILES.dtksh+= programs/dthelp/dthelpgen/dthelpgen.dtsh
REPLACE_INTERPRETER+= tclsh
REPLACE.tclsh.old= .*/bin/tclsh
REPLACE.tclsh.new= ${PREFIX}/bin/tclsh
@@ -128,13 +123,6 @@ MAKE_FLAGS+= CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD:Q}
MAKE_FLAGS+= LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD:Q}
MAKE_FLAGS+= LIBS_FOR_BUILD=
MAKE_FLAGS+= CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:Q}
# dtksh builds the ksh93 it carries, and that ksh93's bin/package runs the
# compiler by absolute path (programs/dtksh/Makefile.am: KSH_CC_ARG). The
# compiler wrapper is that path: it is a program, and it applies the cross flags.
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
MAKE_FLAGS+= KSH_CC=${WRKDIR:Q}/.cwrapper/bin/cc
.endif
SPECIAL_PERMS+= ${PREFIX}/dt/bin/dtterm ${SETUID_ROOT_PERMS}
SPECIAL_PERMS+= ${PREFIX}/dt/bin/dtapppgather ${SETUID_ROOT_PERMS}
SPECIAL_PERMS+= ${PREFIX}/dt/bin/dtmail ${REAL_ROOT_USER} mail 2755
-14
View File
@@ -2540,7 +2540,6 @@ dt/bin/dterror.ds
dt/bin/dtexec
dt/bin/dtfile
dt/bin/dtfile_copy
dt/bin/dtfile_error
dt/bin/dtfplist
dt/bin/dtgreet
dt/bin/dthello
@@ -2548,7 +2547,6 @@ dt/bin/dthelp_ctag1
dt/bin/dthelp_htag1
dt/bin/dthelp_htag2
dt/bin/dthelpgen
dt/bin/dthelpgen.dtsh
dt/bin/dthelpprint
dt/bin/dthelpprint.sh
dt/bin/dthelptag
@@ -2557,10 +2555,8 @@ dt/bin/dticon
dt/bin/dtimsstart
dt/bin/dtinfo
dt/bin/dtkeys
dt/bin/dtksh
dt/bin/dtlaunch
dt/bin/dtlogin
dt/bin/dtlp
dt/bin/dtlpsetup
dt/bin/dtmail
dt/bin/dtmailpr
@@ -2717,7 +2713,6 @@ dt/infolib/en_US.UTF-8/cde.dti/cde.oli
dt/infolib/etc/dtinfo_start
dt/infolib/etc/mmdb.mark.spec
dt/lib/cde/dtdocbook/tcl/docbook.tcl
dt/lib/dtksh/DtFuncs.dtsh
dt/lib/libDtHelp.la
dt/lib/libDtMmdb.la
dt/lib/libDtMrm.la
@@ -2757,7 +2752,6 @@ dt/lib/nls/msg/C/dticon.cat
dt/lib/nls/msg/C/dtimsstart.cat
dt/lib/nls/msg/C/dtinfo.cat
dt/lib/nls/msg/C/dtinfo_start.cat
dt/lib/nls/msg/C/dtksh.cat
dt/lib/nls/msg/C/dtlogin.cat
dt/lib/nls/msg/C/dtlp.cat
dt/lib/nls/msg/C/dtmailopts.cat
@@ -2809,7 +2803,6 @@ dt/man/man1/dtdocbook2infolib.1
dt/man/man1/dtexec.1
dt/man/man1/dtfile.1
dt/man/man1/dtfile_copy.1
dt/man/man1/dtfile_error.1
dt/man/man1/dtfplist.1
dt/man/man1/dtgreet.1
dt/man/man1/dthello.1
@@ -2823,9 +2816,7 @@ dt/man/man1/dthelpview.1
dt/man/man1/dticon.1
dt/man/man1/dtimsstart.1
dt/man/man1/dtinfo.1
dt/man/man1/dtksh.1
dt/man/man1/dtlogin.1
dt/man/man1/dtlp.1
dt/man/man1/dtmail.1
dt/man/man1/dtmailpr.1
dt/man/man1/dtpad.1
@@ -7222,7 +7213,6 @@ ${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dticon.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtimsstart.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtinfo.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtinfo_start.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtksh.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtlogin.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtlp.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtmailopts.cat
@@ -7263,7 +7253,6 @@ ${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dticon.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtimsstart.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtinfo.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtinfo_start.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtksh.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtlogin.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtlp.cat
${PLIST.nls}dt/lib/nls/msg/es_ES.UTF-8/dtmailopts.cat
@@ -7304,7 +7293,6 @@ ${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dticon.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtimsstart.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtinfo.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtinfo_start.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtksh.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtlogin.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtlp.cat
${PLIST.nls}dt/lib/nls/msg/fr_FR.UTF-8/dtmailopts.cat
@@ -7347,7 +7335,6 @@ ${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dticon.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtimsstart.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtinfo.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtinfo_start.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtksh.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtlogin.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtlp.cat
${PLIST.nls}dt/lib/nls/msg/it_IT.UTF-8/dtmailopts.cat
@@ -7390,7 +7377,6 @@ ${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dticon.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtimsstart.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtinfo.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtinfo_start.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtksh.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtlogin.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtlp.cat
${PLIST.nls}dt/lib/nls/msg/ja_JP.UTF-8/dtmailopts.cat
+2 -2
View File
@@ -1,8 +1,8 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = backdrops icons dsdm dtmail dtpad dtfile dtwm dtlogin \
SUBDIRS = backdrops icons dsdm dtmail dtpad dtfile dterror dtwm dtlogin \
dtsession dthello dtstyle dtexec dtdbcache dticon dtterm \
dtcalc dtaction dtspcd dtscreen dtksh dtcm dtsearchpath \
dtcalc dtaction dtspcd dtscreen dtcm dtsearchpath \
dtappbuilder palettes dtappintegrate dtprintegrate dtconfig \
dtcreate dtprintinfo fontaliases dtdspmsg ttsnoop dtimsstart \
dtpdm dtsr dtpdmd dtinfo types tttypes util dtopen localized \
+15
View File
@@ -0,0 +1,15 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dterror.ds
dterror_ds_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB)
if SOLARIS
dterror_ds_LDADD += -lgen
endif
if LINUX
dterror_ds_LDADD += $(TIRPCLIB)
endif
dterror_ds_SOURCES = dterror.c
+72
View File
@@ -0,0 +1,72 @@
/*
* dterror.ds -- an error dialog with a message.
*
* usage: dterror.ds MESSAGE [TITLE [OK-LABEL]]
*
* For the places that have to tell the user something when the program that
* should do it cannot: an action whose command is missing, an exec that failed
* in a child, an error before an application's window exists (the data types
* of the desktop, dtopen, dtfile). It was a dtksh script (dterror.src,
* dtfile_error.cpp, types/error.ds.src); Konrad, 2026-11-14: dtksh is out of
* MCDE, this is a Motif program like the rest, in C.
*
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <Xm/Xm.h>
#include <Xm/MessageB.h>
static void
Quit(Widget w, XtPointer data, XtPointer call)
{
(void) w;
(void) data;
(void) call;
exit(0);
}
int
main(int argc, char **argv)
{
XtAppContext app;
Widget top, dialog;
Arg args[4];
XmString message, title, ok = NULL;
int n = 0;
top = XtVaOpenApplication(&app, "DtError", NULL, 0, &argc, argv, NULL,
applicationShellWidgetClass, NULL);
if (argc < 2) {
fprintf(stderr, "usage: dterror.ds MESSAGE [TITLE [OK-LABEL]]\n");
return 2;
}
/* LtoR: the message may have line ends */
message = XmStringCreateLtoR(argv[1], XmFONTLIST_DEFAULT_TAG);
title = XmStringCreateLocalized(argc > 2 ? argv[2] : "dt Error");
XtSetArg(args[n], XmNmessageString, message); n++;
XtSetArg(args[n], XmNdialogTitle, title); n++;
if (argc > 3) {
ok = XmStringCreateLocalized(argv[3]);
XtSetArg(args[n], XmNokLabelString, ok); n++;
}
dialog = XmCreateErrorDialog(top, "error", args, n);
XmStringFree(message);
XmStringFree(title);
if (ok != NULL)
XmStringFree(ok);
XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
XtAddCallback(dialog, XmNokCallback, Quit, NULL);
/* closed by the window manager: nothing keeps the process alive */
XtAddCallback(dialog, XmNunmapCallback, Quit, NULL);
XtManageChild(dialog);
XtAppMainLoop(app);
return 0;
}
+2 -12
View File
@@ -4,13 +4,11 @@ SUBDIRS = dtcopy
bin_PROGRAMS = dtfile
BUILT_SOURCES = dtfile.config dtfile_error
CLEANFILES = dtfile.config dtfile_error
BUILT_SOURCES = dtfile.config
CLEANFILES = dtfile.config
dist_config_DATA = dtfile.config
dist_bin_SCRIPTS = dtfile_error dterror.ds
dtfile_CPPFLAGS = -I./dtcopy -DSHAPE -D_ILS_MACROS -DSUN_PERF \
-DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
-DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\"
@@ -51,11 +49,3 @@ SCRIPTFLAGS = -DSHAPE -D_ILS_MACROS -DSUN_PERF \
dtfile.config: dtfile.config.cpp
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(SCRIPTFLAGS) $< > $@
dtfile_error: dtfile_error.cpp
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(SCRIPTFLAGS) $< > $@
dterror.ds: dterror.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(SCRIPTFLAGS) $< > $@
+1 -1
View File
@@ -2341,7 +2341,7 @@ displayFSDialog (Widget w,
Widget dialog;
String s;
XmString xm_string;
String errorScript = CDE_INSTALLATION_TOP "/bin/dtfile_error";
String errorScript = CDE_INSTALLATION_TOP "/bin/dterror.ds";
switch ((pid = fork()))
{
-59
View File
@@ -1,59 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: dterror.src /main/4 1996/11/19 11:40:20 drk $
XCOMM ####################################################################
XCOMM Display an error dialog using the argument(s) as the message
XCOMM
XCOMM This script can be used by applications to display an error
XCOMM dialog when it would be difficult or impossible to do in the
XCOMM context of the executing program. For example, it can be used
XCOMM when exec fails in a child process or if an error is detected
XCOMM before an applications main window can be realized.
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #####################################################################
XCOMM --------------------
XCOMM OK button callback
XCOMM --------------------
okCallback()
{
exit
}
XCOMM ------
XCOMM main
XCOMM ------
MESSAGE="$@"
#ifdef _AIX
MSGCAT=/usr/dt/lib/nls/msg/$LANG/dtfile.cat
TITLE=`dspmsg $MSGCAT -s 32 1 "dt Error"`
#else
TITLE="dt Error"
#endif /* _AIX */
XtInitialize TOP dtError DtError "$@"
XmCreateErrorDialog DIALOG \
$TOP \
"Test" \
dialogTitle:"$TITLE" \
messageString:"$MESSAGE"
XCOMM remove cancel and help buttons
XmMessageBoxGetChild CANCEL $DIALOG DIALOG_CANCEL_BUTTON
XmMessageBoxGetChild HELP $DIALOG DIALOG_HELP_BUTTON
XtUnmanageChild $CANCEL
XtUnmanageChild $HELP
XtAddCallback $DIALOG okCallback "okCallback"
XtManageChild $DIALOG
XtMainLoop
-3
View File
@@ -76,6 +76,3 @@ end
afs: buttonLabel = %|nls-1-#Change AFS ACL ...#|
warning = %|nls-3-#Warning: This is an Andrew File System (AFS) object.\nAccess permissions may be further restricted by the AFS Access Control List (ACL).#|
fsDialog = CDE_INSTALLATION_TOP/bin/dtaclafs
test: buttonLabel = %|nls-2-#Display test dialog ...#|
fsDialog = CDE_INSTALLATION_TOP/bin/dtfile_error
-63
View File
@@ -1,63 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: dtfile_error.cpp /main/3 1996/04/21 19:29:14 drk $
XCOMM ##################################################################
XCOMM Display an error dialog using the argument(s) as the message
XCOMM
XCOMM This script can be used by applications to display an error
XCOMM dialog when it would be difficult or impossible to do in the
XCOMM context of the executing program. For example, it can be used
XCOMM when exec fails in a child process or if an error is detected
XCOMM before an applications main window can be realized.
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM ###################################################################
XCOMM --------------------
XCOMM OK button callback
XCOMM --------------------
okCallback()
{
exit
}
XCOMM ------
XCOMM main
XCOMM ------
MESSAGE="$@"
#ifdef _AIX
MSGCAT=/usr/dt/lib/nls/msg/$LANG/dtfile.cat
TITLE=`dspmsg $MSGCAT -s 32 1 "dt Error"`
#else
TITLE="dt Error"
#endif /* _AIX */
XtInitialize TOP dtError DtError "$@"
XmCreateErrorDialog DIALOG \
$TOP \
"Test" \
dialogTitle:"$TITLE" \
messageString:"$MESSAGE"
XCOMM remove cancel and help buttons
XmMessageBoxGetChild CANCEL $DIALOG DIALOG_CANCEL_BUTTON
XmMessageBoxGetChild HELP $DIALOG DIALOG_HELP_BUTTON
XtUnmanageChild $CANCEL
XtUnmanageChild $HELP
XtAddCallback $DIALOG okCallback "okCallback"
XtManageChild $DIALOG
XtMainLoop
-2
View File
@@ -2,8 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dthelpgen
bin_SCRIPTS = dthelpgen.dtsh
dthelpgen_CPPFLAGS = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
-DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \
-I ../../../lib/DtHelp
-139
View File
@@ -1,139 +0,0 @@
#! /usr/dt/bin/dtksh
#####################################################################
### File: dthelpgen.dtsh
###
### Default Location: /usr/dt/bin/dthelpgen.dtsh
###
### Purpose: Display a 'working' dialog for dthelpgen.
###
### Description: This shell script provides a graphical interface
### to notify the user that the help browser is
### being (re)generated.
###
### Invoked by: The the dthelpgen application.
###
### Product: @(#)Common Desktop Environment 1.0
###
### Note: Please do not modify this file.
### Later product updates will overwrite this file.
###
### Revision: $XConsortium: dthelpgen.dtsh /main/3 1995/11/07 13:13:18 rswiston $
###
### Defect(s):
###
#####################################################################
set -u
##################################################################
### Internal Globals
###
### Actually, most variables in this script are global.
###
### Most are defined in the Initialize() routine.
###
##################################################################
COMMAND_NAME=dthelpgen
#
# Exit/Return codes
#
SUCCESS=0
USAGE_EXIT=2
NO_INIT_FILE_ERR=5
failure_flag=$SUCCESS
##################################################################
### Initialize()
###
### Initialize the tile, msg and cat id.
###
##################################################################
Initialize()
{
CAT_MESG_TITLE=""
CAT_MESG_MSG=""
catopen CAT_ID $COMMAND_NAME
}
##################################################################
### Exit()
###
### All exits should go through this routine.
###
##################################################################
Exit() {
exit $1
}
################## GUI Callbacks ####################
#
# This is the callback for the 'OK' button. It will exit the program
#
OkButton()
{
XtUnmanageChild $_DT_WORKING_DIALOG_HANDLE
XSync $DISPLAY True
Exit 0
}
#
# This is the callback if the timer goes off
#
# TimerCB()
# {
#
# CAT_MESG_MSG=${CAT_MESG_MSG}"."
# XtSetValues $_DT_WORKING_DIALOG_HANDLE \
# messageString:"${CAT_MESG_MSG}"
#
# XtAppAddTimeOut TIMER_ID $TIMER_CONTEXT $TIMER_TIME "TimerCB" ""
#
# }
##################################################################
### Main()
###
### Display a 'working' dialog for dthelpgen.
###
##################################################################
Initialize
if [[ -r /usr/dt/lib/dtksh/DtFuncs.dtsh ]]
then
. /usr/dt/lib/dtksh/DtFuncs.dtsh
else
echo Sorry--cannot find initialization file.
Exit $NO_INIT_FILE_ERR
fi
XtInitialize TOPLEVEL dthelpgenDialog Dthelpgen ""
XtDisplay DISPLAY $TOPLEVEL
catgets CAT_MESG_TITLE $CAT_ID 2 6 "${COMMAND_NAME}"
catgets CAT_MESG_MSG $CAT_ID 2 7 \
"Generating browser information. Please wait."
DtkshDisplayWorkingDialog "${CAT_MESG_TITLE}" \
"${CAT_MESG_MSG}" \
"OkButton" "" "" \
DIALOG_PRIMARY_APPLICATION_MODAL
XtManageChild $_DT_WORKING_DIALOG_HANDLE
# XtWidgetToApplicationContext TIMER_CONTEXT $_DT_WORKING_DIALOG_HANDLE
# XtGetMultiClickTime TIMER_TIME $DISPLAY
# XtAppAddTimeOut TIMER_ID $TIMER_CONTEXT $TIMER_TIME "TimerCB" ""
XtMainLoop
#
# Never reached.
#
##################### eof ##############################
+3 -13
View File
@@ -1313,20 +1313,10 @@ main(
}
/*
* fork off the dtksh script that will put up a dialog
* telling the user that we're building help browser
* information.
* (A dtksh script, dthelpgen.dtsh, used to be forked off here to show a
* "building the help browser information" dialog. dtksh is not part of
* MCDE any more; the work goes on without a dialog, childPid stays -1.)
*/
childPid = fork();
/*
* if this is the child, exec the dthelpgen.ds script.
*/
if (childPid == 0)
{
execlp("dthelpgen.ds", "dthelpgen.ds",
((char *) 0), ((char *) 0), ((char *) 0));
_exit(1);
}
/*
* initialize the main topic
-107
View File
@@ -1,107 +0,0 @@
DtFuncs.dtsh
dtksh
examples/CallDataTest4
examples/CallbackTest2
examples/DtCursorTest2
examples/DtWsTest1
examples/EventHandlerTest
examples/ListBounds1
examples/ListItemPos1
examples/PopupTest
examples/SelBoxResTest
examples/SessionTest
examples/TextCutBuf1
examples/TextDisp1
examples/TextFXYPos1
examples/TransEventTest
examples/TransTest1
examples/WorkProcTest1
examples/XdrawTest
examples/crMovesText1
init.c
ksh93/lib/
ksh93/src/cmd/INIT/crossexec
ksh93/src/cmd/INIT/dbm.req
ksh93/src/cmd/INIT/dl.req
ksh93/src/cmd/INIT/execrate
ksh93/src/cmd/INIT/filter
ksh93/src/cmd/INIT/iconv.req
ksh93/src/cmd/INIT/iffe
ksh93/src/cmd/INIT/ignore
ksh93/src/cmd/INIT/intl.req
ksh93/src/cmd/INIT/m.req
ksh93/src/cmd/INIT/mamake
ksh93/src/cmd/INIT/mamprobe
ksh93/src/cmd/INIT/mktest
ksh93/src/cmd/INIT/mprobe
ksh93/src/cmd/INIT/nsl.req
ksh93/src/cmd/INIT/package
ksh93/src/cmd/INIT/probe
ksh93/src/cmd/INIT/probe.ini
ksh93/src/cmd/INIT/probe.sh
ksh93/src/cmd/INIT/regress
ksh93/src/cmd/INIT/rt
ksh93/src/cmd/INIT/silent
ksh93/src/cmd/INIT/socket.req
ksh93/src/cmd/INIT/w.req
ksh93/src/cmd/builtin/FEATURE/
ksh93/src/cmd/builtin/pty
ksh93/src/cmd/ksh93/FEATURE/
ksh93/src/cmd/ksh93/shopt.h
ksh93/src/cmd/ksh93/ksh
ksh93/src/cmd/ksh93/shcomp
ksh93/src/cmd/ksh93/shell.req
ksh93/src/cmd/ksh93/suid_exec
ksh93/src/lib/libast/FEATURE/
ksh93/src/lib/libast/align.h
ksh93/src/lib/libast/ast.req
ksh93/src/lib/libast/ast_api.h
ksh93/src/lib/libast/ast_botch.h
ksh93/src/lib/libast/ast_ccode.h
ksh93/src/lib/libast/ast_common.h
ksh93/src/lib/libast/ast_dirent.h
ksh93/src/lib/libast/ast_fcntl.h
ksh93/src/lib/libast/ast_float.h
ksh93/src/lib/libast/ast_fs.h
ksh93/src/lib/libast/ast_iconv.h
ksh93/src/lib/libast/ast_lib.h
ksh93/src/lib/libast/ast_limits.h
ksh93/src/lib/libast/ast_map.h
ksh93/src/lib/libast/ast_mmap.h
ksh93/src/lib/libast/ast_mode.h
ksh93/src/lib/libast/ast_namval.h
ksh93/src/lib/libast/ast_ndbm.h
ksh93/src/lib/libast/ast_nl_types.h
ksh93/src/lib/libast/ast_param.h
ksh93/src/lib/libast/ast_sizeof.h
ksh93/src/lib/libast/ast_standards.h
ksh93/src/lib/libast/ast_stdio.h
ksh93/src/lib/libast/ast_sys.h
ksh93/src/lib/libast/ast_time.h
ksh93/src/lib/libast/ast_tty.h
ksh93/src/lib/libast/ast_vfork.h
ksh93/src/lib/libast/ast_wait.h
ksh93/src/lib/libast/ast_wchar.h
ksh93/src/lib/libast/ast_wctype.h
ksh93/src/lib/libast/astmath.exe
ksh93/src/lib/libast/conf
ksh93/src/lib/libast/conflim.h
ksh93/src/lib/libast/conftab.c
ksh93/src/lib/libast/conftab.h
ksh93/src/lib/libast/lc.h
ksh93/src/lib/libast/lcgen
ksh93/src/lib/libast/lctab.c
ksh93/src/lib/libast/preroot.h
ksh93/src/lib/libast/sig.h
ksh93/src/lib/libast/t.c
ksh93/src/lib/libast/tmx.h
ksh93/src/lib/libast/tv.h
ksh93/src/lib/libcmd/FEATURE/
ksh93/src/lib/libcmd/cmd.req
ksh93/src/lib/libcmd/cmdext.h
ksh93/src/lib/libcmd/cmdlist.h
ksh93/src/lib/libdll/FEATURE/
ksh93/src/lib/libdll/dll.req
ksh93/src/lib/libdll/dlldefs.h
ksh93/src/lib/libsum/FEATURE/
ksh93/src/lib/libsum/sum.req
-60
View File
@@ -1,60 +0,0 @@
# $XConsortium: DtFuncs.compat.sh /main/1 1995/11/01 15:48:48 rswiston $
#
# COMPONENT_NAME: desktop
#
# FUNCTIONS: DtAddButtons
# DtFloatBottom
# DtFloatLeft
# DtFloatRight
# DtFloatTop
# DtLeftOf
# DtOver
# DtRightOf
# DtSetReturnKeyControls
# DtUnder
#
# ORIGINS: 27,118,119,120,121
#
# This module contains IBM CONFIDENTIAL code. -- (IBM
# Confidential Restricted when combined with the aggregated
# modules for this product)
# OBJECT CODE ONLY SOURCE MATERIALS
#
# (C) COPYRIGHT International Business Machines Corp. 1995
# All Rights Reserved
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
###############################################################################
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
# Novell, Inc.
###############################################################################
# This script is for compatibility with previous AIXwindows Desktop releases.
###############################################################################
. /usr/dt/lib/dtksh/DtFuncs.dtsh
alias DtAddButtons="DtkshAddButtons"
alias DtSetReturnKeyControls="DtkshSetReturnKeyControls"
alias DtUnder="DtkshUnder"
alias DtOver="DtkshOver"
alias DtRightOf="DtkshRightOf"
alias DtLeftOf="DtkshLeftOf"
alias DtFloatRight="DtkshFloatRight"
alias DtFloatLeft="DtkshFloatLeft"
alias DtFloatTop="DtkshFloatTop"
alias DtFloatBottom="DtkshFloatBottom"
alias DtAnchorRight="DtkshAnchorRight"
alias DtAnchorLeft="DtkshAnchorLeft"
alias DtAnchorTop="DtkshAnchorTop"
alias DtAnchorBottom="DtkshAnchorBottom"
alias DtSpanWidth="DtkshSpanWidth"
alias DtSpanHeight="DtkshSpanHeight"
alias DtDisplayErrorDialog="DtkshDisplayErrorDialog"
alias DtDisplayQuestionDialog="DtkshDisplayQuestionDialog"
alias DtDisplayWorkingDialog="DtkshDisplayWorkingDialog"
alias DtDisplayWarningDialog="DtkshDisplayWarningDialog"
alias DtDisplayInformationDialog="DtkshDisplayInformationDialog"
alias DtDisplayQuickHelpDialog="DtkshDisplayQuickHelpDialog"
alias DtDisplayHelpDialog="DtkshDisplayHelpDialog"
-739
View File
@@ -1,739 +0,0 @@
# $XConsortium: DtFuncs.sh /main/3 1995/11/01 15:48:57 rswiston $
###############################################################################
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
# Novell, Inc.
###############################################################################
###############################################################################
#
# DtkshAddButtons - Convenience function for adding 1 or more buttons of the
# same kind into a composite widget. Most frequently
# used to add a collection of buttons into a menupane.
#
# Usages:
#
# DtkshAddButtons parent widgetClass label1 callback1 [label2 callback2 ...]
#
# DtkshAddButtons [-w] parent widgetClass variable1 label1 callback1 \
# [variable2 label2 callback2 ...]
#
# The "-w" option indicates that the convenience function should return
# the widget handle for each of the created buttons. The widget handle
# is returned in the specified environment variable.
#
# The widgetClass can be one of the following, and will default to the
# XmPushButtonGadget class, if not specified:
#
# XmPushButton
# XmPushButtonGadget
# XmToggleButton
# XmToggleButtonGadget
# XmCascadeButton
# XmCascadeButtonGadget
#
# Examples:
#
# DtkshAddButtons $MENU XmPushButtonGadget Open do_Open Save do_Save Quit exit
#
# DtkshAddButtons -w $MENU XmPushButtonGadget B1 Open do_Open B2 Save do_Save
#
DtkshAddButtons()
{
typeset parent widgetClass callback returnWidget="false" TMP=""
typeset -i paramCount=2
if [ $# -ge 1 ] && [ x"$1" = "x-w" ]; then
returnWidget=true
paramCount=3
shift
fi
if [ $# -lt 2 ]; then
return 1
fi
parent=$1
shift
widgetClass=${1:-XmPushButtonGadget}
shift
case $widgetClass in
XmPushButtonGadget) callback=activateCallback;;
XmPushButton) callback=activateCallback;;
XmToggleButtonGadget) callback=valueChangedCallback;;
XmToggleButton) callback=valueChangedCallback;;
XmCascadeButtonGadget) callback=activateCallback;;
XmCascadeButton) callback=activateCallback;;
*) return 1
esac
while [ $# -ge $paramCount ]
do
if [ "$returnWidget" = true ]; then
if [ ! "$3" = "" ]; then
XtCreateManagedWidget "$1" "$1" $widgetClass "$parent" \
labelString:"$2" ${callback}:"$3"
else
XtCreateManagedWidget "$1" "$1" $widgetClass "$parent" \
labelString:"$2"
fi
shift 3
else
if [ ! "$2" = "" ]; then
XtCreateManagedWidget Id "btn" $widgetClass "$parent" \
labelString:"$1" ${callback}:"$2"
else
XtCreateManagedWidget Id "btn" $widgetClass "$parent" \
labelString:"$1"
fi
shift 2
fi
done
return 0
}
###############################################################################
#
# DtkshSetReturnKeyControls - Convenience function for configuring a text
# widget (within a form!) so that the Return key does not
# activate the default button within the form, but instead
# moves the focus to the next text widget within the form.
# This is useful if you have a window which contains a
# series of text fields, and the default button should not
# be activated until the user presses the Return key in the
# last text field.
#
# Usage:
#
# DtkshSetReturnKeyControls textWidgetId nextTextWidgetId formWidgetId \
# defaultButtonId
#
# The textWidgetId parameter specifies the widget which is to be configured
# to catch the 'Return' key, and force the focus to move to the next text
# widget (as indicated by the nextTextWidgetId parameter). The formWidgetId
# parameter specifies the form which contains the default button, and should
# be the parent of the two text widgets. The defaultButtonId indicates which
# component is to be treated as the default button within the form.
#
# Examples:
#
# DtkshSetReturnKeyControls $TEXT1 $TEXT2 $FORM $OK
# DtkshSetReturnKeyControls $TEXT2 $TEXT3 $FORM $OK
#
DtkshSetReturnKeyControls()
{
if [ $# -ne 4 ]; then
return 1
fi
XtAddCallback $1 focusCallback "XtSetValues $3 defaultButton:NULL"
XtAddCallback $1 losingFocusCallback "XtSetValues $3 defaultButton:$4"
XtOverrideTranslations $1 \
"Ctrl<Key>Return:ksh_eval(\"XmProcessTraversal $2 TRAVERSE_CURRENT\")
<Key>Return:ksh_eval(\"XmProcessTraversal $2 TRAVERSE_CURRENT\")"
return 0
}
###############################################################################
#
# DtkshUnder
# DtkshOver
# DtkshRightOf
# DtkshLeftOf - Convenience functions for specifying form constraints.
# This set of functions allow a component to be attached
# to one of the edges of another component.
#
# Usages:
#
# DtkshUnder widgetId [offset]
# DtkshOver widgetId [offset]
# DtkshRightOf widgetId [offset]
# DtkshLeftOf widgetId [offset]
#
# The widgetId parameter specifies the widget to which the current
# component is to be attached. The offset value is optional, and
# defaults to 0 if not specified.
#
# Examples:
#
# XtCreateManagedWidget BUTTON2 button2 XmPushButton $FORM \
# labelString:"Exit" \
# $(DtkshUnder $BUTTON1)
#
DtkshUnder()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "topWidget:$1 topAttachment:ATTACH_WIDGET topOffset:${2:-0}"
}
DtkshOver()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "bottomWidget:$1 bottomAttachment:ATTACH_WIDGET bottomOffset:${2:-0}"
}
DtkshRightOf()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "leftWidget:$1 leftAttachment:ATTACH_WIDGET leftOffset:${2:-0}"
}
DtkshLeftOf()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "rightWidget:$1 rightAttachment:ATTACH_WIDGET rightOffset:${2:-0}"
}
###############################################################################
#
# DtkshFloatRight
# DtkshFloatLeft
# DtkshFloatTop
# DtkshFloatBottom - Convenience functions for specifying form constraints.
# This set of functions allow a component to be positioned
# independent of the other components within the form.
# As the form grows or shrinks, the component maintains
# its relative position within the form. The component
# may still grow or shrink, depending upon the other form
# constraints which have been specified for the component.
#
# Usages:
#
# DtkshFloatRight [position]
# DtkshFloatLeft [position]
# DtkshFloatTop [position]
# DtkshFloatBottom [position]
#
# The optional position parameter specifies the relative position
# to which the indicated edge of the component will be positioned.
# A default position is used, if not specified.
#
# Examples:
#
# XtCreateManagedWidget BUTTON1 button1 XmPushButton $FORM \
# labelString:"Ok" \
# $(DtkshUnder $SEPARATOR) \
# $(DtkshFloatLeft 10) \
# $(DtkshFloatRight 40)
#
DtkshFloatRight()
{
echo "rightAttachment:ATTACH_POSITION rightPosition:${1:-0}"
}
DtkshFloatLeft()
{
echo "leftAttachment:ATTACH_POSITION leftPosition:${1:-0}"
}
DtkshFloatTop()
{
echo "topAttachment:ATTACH_POSITION topPosition:${1:-0}"
}
DtkshFloatBottom()
{
echo "bottomAttachment:ATTACH_POSITION bottomPosition:${1:-0}"
}
###############################################################################
#
# DtkshAnchorRight
# DtkshAnchorLeft
# DtkshAnchorTop
# DtkshAnchorBottom - Convenience functions for specifying form constraints.
# This set of functions allow a component to be attached
# to one of the edges of the form in such a fashion that
# as the form grows or shrinks, the component's position
# does not change. However, depending upon the other
# form constaints set on this component, the component
# may still grow or shrink in size.
#
# Usages:
#
# DtkshAnchorRight [offset]
# DtkshAnchorLeft [offset]
# DtkshAnchorTop [offset]
# DtkshAnchorBottom [offset]
#
# The optional offset parameter specifies how far from the edge
# of the form the component should be positioned. If an offset
# is not specified, then 0 is user.
#
# Examples:
#
# XtCreateManagedWidget BUTTON1 button1 XmPushButton $FORM \
# labelString:"Ok" \
# $(DtkshUnder $SEPARATOR) \
# $(DtkshAnchorLeft 10) \
# $(DtkshAnchorBottom 10)
#
DtkshAnchorRight()
{
echo "rightAttachment:ATTACH_FORM rightOffset:${1:-0}"
}
DtkshAnchorLeft()
{
echo "leftAttachment:ATTACH_FORM leftOffset:${1:-0}"
}
DtkshAnchorTop()
{
echo "topAttachment:ATTACH_FORM topOffset:${1:-0}"
}
DtkshAnchorBottom()
{
echo "bottomAttachment:ATTACH_FORM bottomOffset:${1:-0}"
}
###############################################################################
#
# DtkshSpanWidth
# DtkshSpanHeight - Convenience functions for specifying form constraints.
# This set of functions allow a component to be configured
# such that it spans either the full height or width of
# the form widget. This effect is accomplished by attaching
# two edges of the component (top & bottom for DtkshSpanHeight,
# and left and right for DtkshSpanWidth) to the form. The
# component will typically resize whenever the form is
# resized.
#
# Usages:
#
# DtkshSpanWidth [offset]
# DtkshSpanHeight [offset]
#
# The optional offset parameter specifies how far from the edge
# of the form the component should be positioned. If an offset
# is not specified, then 0 is user.
#
# Examples:
#
# XtCreateManagedWidget SEPARATOR $FORM XmSeparator \
# $(DtkshSpanWidth 1 1)
#
DtkshSpanWidth()
{
echo "leftAttachment:ATTACH_FORM leftOffset:${1:-0} \
rightAttachment:ATTACH_FORM rightOffset:${2:-0}"
}
DtkshSpanHeight()
{
echo "topAttachment:ATTACH_FORM topOffset:${1:-0} \
bottomAttachment:ATTACH_FORM bottomOffset:${2:-0}"
}
###############################################################################
#
# DtkshDisplayInformationDialog
# DtkshDisplayQuestionDialog
# DtkshDisplayWarningDialog
# DtkshDisplayWorkingDialog
# DtkshDisplayErrorDialog - Convenience functions for creating a single
# instance of each of the flavors of the Motif
# feedback dialog. If an instance of the requested
# type of dialog already exists, then it will be
# reused. The parent of the dialog is obtained
# from the environment variable $TOPLEVEL, which
# should be set by the calling shell script. The
# handle for the requested dialog is returned in
# one of the following environment variables:
#
# _DT_ERROR_DIALOG_HANDLE
# _DT_QUESTION_DIALOG_HANDLE
# _DT_WORKING_DIALOG_HANDLE
# _DT_WARNING_DIALOG_HANDLE
# _DT_INFORMATION_DIALOG_HANDLE
#
# WARNING: IF ATTACHING YOUR OWN CALLBACKS TO THE DIALOG
# BUTTONS, DO NOT DESTROY THE DIALOG WHEN YOU
# ARE DONE WITH IT; SIMPLY UNMANAGE THE DIALOG,
# SO THAT IT CAN BE USED AT A LATER TIME.
#
# Usages:
#
# DtkshDisplay*Dialog title message okCallback closeCallback helpCallback \
# dialogStyle
#
# The "Ok" button is always managed, and by default will simply unmanage
# the dialog. The "Cancel" and "Help" buttons are only managed when a
# callback is supplied for them.
#
# The "dialogStyle" parameter accepts any of the standard resource settings
# supported by the bulletin board widget.
#
# Examples:
#
# DtkshDisplayErrorDialog "Read Error" "Unable to read the file" "OkCallback" \
# "CancelCallback" "" DIALOG_PRIMARY_APPLICATION_MODAL
#
# Global feedback dialog handles
_DT_ERROR_DIALOG_HANDLE=""
_DT_QUESTION_DIALOG_HANDLE=""
_DT_WORKING_DIALOG_HANDLE=""
_DT_WARNING_DIALOG_HANDLE=""
_DT_INFORMATION_DIALOG_HANDLE=""
_DT_TMP_DIALOG_HANDLE=""
#
# This function was accidentally *not* renamed to DtkshDisplayErrorDialog
# when the sample implementation of dtksh was released; however, the
# documentation tells users to use DtkshDisplayErrorDialog, but it did not
# exist. Therefore, to be backwards compatible, both DtDisplayErrorDialog
# and DtkshDisplayErrorDialog are defined.
#
DtDisplayErrorDialog()
{
_DtkshDisplayFeedbackDialog "$_DT_ERROR_DIALOG_HANDLE" "Error" "${@:-}"
if [ "$_DT_ERROR_DIALOG_HANDLE" = "" ] ; then
_DT_ERROR_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayErrorDialog()
{
_DtkshDisplayFeedbackDialog "$_DT_ERROR_DIALOG_HANDLE" "Error" "${@:-}"
if [ "$_DT_ERROR_DIALOG_HANDLE" = "" ] ; then
_DT_ERROR_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayQuestionDialog()
{
_DtkshDisplayFeedbackDialog "$_DT_QUESTION_DIALOG_HANDLE" "Question" "${@:-}"
if [ "$_DT_QUESTION_DIALOG_HANDLE" = "" ] ; then
_DT_QUESTION_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayWorkingDialog()
{
_DtkshDisplayFeedbackDialog "$_DT_WORKING_DIALOG_HANDLE" "Working" "${@:-}"
if [ "$_DT_WORKING_DIALOG_HANDLE" = "" ] ; then
_DT_WORKING_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayWarningDialog()
{
_DtkshDisplayFeedbackDialog "$_DT_WARNING_DIALOG_HANDLE" "Warning" "${@:-}"
if [ "$_DT_WARNING_DIALOG_HANDLE" = "" ] ; then
_DT_WARNING_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayInformationDialog()
{
_DtkshDisplayFeedbackDialog "$_DT_INFORMATION_DIALOG_HANDLE" "Information" \
"${@:-}"
if [ "$_DT_INFORMATION_DIALOG_HANDLE" = "" ] ; then
_DT_INFORMATION_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
###############################################################################
#
# DtkshDisplayQuickHelpDialog
# DtkshDisplayHelpDialog - Convenience functions for creating a single
# instance of a help dialog and a quick help
# dialog. If an instance of the requested type
# of help dialog already exists, then it will be
# reused. The parent of the dialog is obtained
# from the environment variable $TOPLEVEL, which
# should be set by the calling shell script. The
# handle for the requested dialog is returned in
# one of the following environment variables:
#
# _DT_HELP_DIALOG_HANDLE
# _DT_QUICK_HELP_DIALOG_HANDLE
#
# WARNING: DO NOT DESTROY THIS DIALOG, UNLESS YOU ALSO CLEAR THE
# CORRESPONDING ENVIRONMENT VARIABLE, SO THAT THIS CODE
# WILL NOT ATTEMPT TO REUSE THE DIALOG AGAIN.
#
# Usages:
#
# DtkshDisplay*HelpDialog title helpType helpInformation [locationId]
#
# The meaning of the parameters is dependent upon the value specified
# for the 'helpType' parameter. There meanings are explained below:
#
# helpType = HELP_TYPE_TOPIC
# helpInformation = help volume name
# locationId = help topic location id
#
# helpType = HELP_TYPE_STRING
# helpInformation = help string
# locationId = <not used>
#
# helpType = HELP_TYPE_DYNAMIC_STRING
# helpInformation = help string
# locationId = <not used>
#
# helpType = HELP_TYPE_MAN_PAGE
# helpInformation = man page name
# locationId = <not used>
#
# helpType = HELP_TYPE_FILE
# helpInformation = help file name
# locationId = <not used>
#
# Examples:
#
# DtkshDisplayHelpDialog "Help On Dtksh" HELP_TYPE_FILE "HelpFileName"
#
# Global help dialog handles
_DT_HELP_DIALOG_HANDLE=""
_DT_QUICK_HELP_DIALOG_HANDLE=""
DtkshDisplayQuickHelpDialog()
{
_DtkshDisplayHelpDialog "$_DT_QUICK_HELP_DIALOG_HANDLE" "Quick" "${@:-}"
if [ "$_DT_QUICK_HELP_DIALOG_HANDLE" = "" ] ; then
_DT_QUICK_HELP_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
}
DtkshDisplayHelpDialog()
{
_DtkshDisplayHelpDialog "$_DT_HELP_DIALOG_HANDLE" "" "${@:-}"
if [ "$_DT_HELP_DIALOG_HANDLE" = "" ] ; then
_DT_HELP_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
}
##############################################################################
#
# This internal shell function performs most of the work required to
# create an instance of a feedback dialog (error, warning, information,
# working and question). It will reuse an existing instance of the
# requested type of feedback dialog, if one has already been created;
# otherwise, it will create a new one.
#
# The "Ok" button is always managed, and by default will simply unpost
# the dialog. The "Cancel" and "Help" buttons are only managed if the
# callers specifies a callback for the butttons. Both the "Ok" and
# "Cancel" buttons rely on the fact that the 'autoUnpost' resource for
# the dialog is 'True'.
#
# The implied parent of the dialog is identified by the environment
# variable '$TOPLEVEL'.
#
# The incoming parameters are defined as follows (note that $1 and $2 are
# defined by the convenience function which is calling us, while $3 - $8
# are the parameters which were passed by the caller to the convenience
# function:
#
# $1 = existing dialog handle, or "" if first time
# $2 = type of feedback dialog (Information, Question, Working, ... )
# $3 = dialog title
# $4 = message string
# $5 = okCallback
# $6 = cancelCallback
# $7 = helpCallback
# $8 = dialogStyle
#
_DtkshDisplayFeedbackDialog()
{
if [ "$1" = "" ]; then
XmCreate${2}Dialog _DT_TMP_DIALOG_HANDLE $TOPLEVEL "$2"
else
_DT_TMP_DIALOG_HANDLE=$1
fi
XtSetValues $_DT_TMP_DIALOG_HANDLE \
dialogTitle:"${3:-$2}" \
messageString:"${4:- }" \
dialogStyle:"${8:-DIALOG_MODELESS}"
if [ $# -ge 5 ] && [ "$5" != "" ]; then
XtSetValues $_DT_TMP_DIALOG_HANDLE okCallback:"$5"
fi
if [ $# -lt 6 ] || [ "$6" = "" ]; then
XtUnmanageChild $(XmMessageBoxGetChild "-" $_DT_TMP_DIALOG_HANDLE \
DIALOG_CANCEL_BUTTON)
else
XtSetValues $_DT_TMP_DIALOG_HANDLE cancelCallback:"$6"
fi
if [ $# -lt 7 ] || [ "$7" = "" ]; then
XtUnmanageChild $(XmMessageBoxGetChild "-" $_DT_TMP_DIALOG_HANDLE \
DIALOG_HELP_BUTTON)
else
XtSetValues $_DT_TMP_DIALOG_HANDLE helpCallback:"$7"
fi
_DtkshPositionDialog "$1"
XtManageChild $_DT_TMP_DIALOG_HANDLE
return 0
}
##############################################################################
#
# This internal shell function performs most of the work required to
# create an instance of a help dialog (regular help or quick help)
# It will reuse an existing instance of the requested type of help
# dialog, if one has already been created; otherwise, it will create
# a new one.
#
# The implied parent of the dialog is identified by the environment
# variable '$TOPLEVEL'.
#
# The incoming parameters are defined as follows (note that $1 and $2 are
# defined by the convenience function which is calling us, while $3 - $6
# are the parameters which were passed by the caller to the convenience
# function:
#
# $1 = existing dialog handle, or "" if first time
# $2 = type of help dialog (Quick or "")
# $3 = dialog title
# $4 = help type
# $5 = help information:
# help volume (if help type = HELP_TYPE_TOPIC)
# help string (if help type = HELP_TYPE_STRING)
# help string (if help type = HELP_TYPE_DYNAMIC_STRING)
# man page name (if help type = HELP_TYPE_MAN_PAGE)
# help file name (if help type = HELP_TYPE_FILE)
# $6 = help location Id (if help type = HELP_TYPE_TOPIC)
#
_DtkshDisplayHelpDialog()
{
typeset helpType ARG1="" ARG2="" ARG3=""
typeset helpType VAL1="" VAL2="" VAL3=""
helpType="${4:-HELP_TYPE_TOPIC}"
ARG1="helpType:"
VAL1="$helpType"
case $helpType in
HELP_TYPE_TOPIC) ARG2="helpVolume:"
VAL2="${5:-}"
ARG3="locationId:"
VAL3="${6:-_HOMETOPIC}";;
HELP_TYPE_STRING) ARG2="stringData:"
VAL2="${5:-}";;
HELP_TYPE_DYNAMIC_STRING) ARG2="stringData:"
VAL2="${5:-}";;
HELP_TYPE_MAN_PAGE) ARG2="manPage:"
VAL2="${5:-}";;
HELP_TYPE_FILE) ARG2="helpFile:"
VAL2="${5:-}";;
*) return 1;;
esac
if [ "$1" = "" ]; then
if [ "$ARG3" != "" ]; then
DtCreateHelp${2}Dialog _DT_TMP_DIALOG_HANDLE $TOPLEVEL "$2" \
"${ARG1}${VAL1}" "${ARG2}${VAL2}" "${ARG3}${VAL3}"
else
DtCreateHelp${2}Dialog _DT_TMP_DIALOG_HANDLE $TOPLEVEL "$2" \
"${ARG1}${VAL1}" "${ARG2}${VAL2}"
fi
else
_DT_TMP_DIALOG_HANDLE=$1
if [ "$ARG3" != "" ]; then
XtSetValues $_DT_TMP_DIALOG_HANDLE \
"${ARG1}${VAL1}" "${ARG2}${VAL2}" "${ARG3}${VAL3}"
else
XtSetValues $_DT_TMP_DIALOG_HANDLE \
"${ARG1}${VAL1}" "${ARG2}${VAL2}"
fi
fi
if [ "$2" = "Quick" ]; then
XtSetSensitive $(DtHelpQuickDialogGetChild "-" $_DT_TMP_DIALOG_HANDLE \
HELP_QUICK_HELP_BUTTON) false
fi
XtSetValues $(XtParent "-" $_DT_TMP_DIALOG_HANDLE) title:"${3:-Help}"
_DtkshPositionDialog "$1"
XtManageChild $_DT_TMP_DIALOG_HANDLE
return 0
}
##############################################################################
#
# This internal shell function takes care of positioning the dialog so
# that it is centered over the window for which it is transient; if the
# window it is transient for is not currently managed, then the window
# will be positioned over in the center of the screen.
#
# Positioning does not occur that first time the dialog is posted; that
# is taken care of automatically by Motif and the window manager. It
# only needs to happen for subsequent postings.
#
_DtkshPositionDialog()
{
typeset -i WIDTH HEIGHT X_P Y_P WIDTH_P HEIGHT_P
typeset -i finalX finalY
if [ "$1" != "" ] && ! XtIsManaged $1 && XtIsShell $TOPLEVEL ; then
XtGetValues $1 width:WIDTH height:HEIGHT
if XtIsRealized $TOPLEVEL; then
XtGetValues $TOPLEVEL x:X_P y:Y_P width:WIDTH_P height:HEIGHT_P
(( finalX=$X_P+($WIDTH_P-$WIDTH)/2 ))
(( finalY=$Y_P+($HEIGHT_P-$HEIGHT)/2 ))
else
(( finalX=($(XWidthOfScreen "-" $(XtScreen "-" $1) )-$WIDTH)/2 ))
(( finalY=($(XHeightOfScreen "-" $(XtScreen "-" $1) )-$HEIGHT)/2 ))
fi
XtSetValues $(XtParent "-" $1) x:$finalX y:$finalY
fi
}
-751
View File
@@ -1,751 +0,0 @@
# $XConsortium: DtFuncs.sh.src /main/1 1995/11/01 15:49:09 rswiston $
#
# COMPONENT_NAME: desktop
#
# FUNCTIONS: DtkshAddButtons
# DtkshFloatBottom
# DtkshFloatLeft
# DtkshFloatRight
# DtkshFloatTop
# DtkshLeftOf
# DtkshOver
# DtkshRightOf
# DtkshSetReturnKeyControls
# DtkshUnder
#
# ORIGINS: 27,118,119,120,121
#
# This module contains IBM CONFIDENTIAL code. -- (IBM
# Confidential Restricted when combined with the aggregated
# modules for this product)
# OBJECT CODE ONLY SOURCE MATERIALS
#
# (C) COPYRIGHT International Business Machines Corp. 1995
# All Rights Reserved
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
###############################################################################
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
# Novell, Inc.
###############################################################################
###############################################################################
#
# DtkshAddButtons - Convenience function for adding 1 or more buttons of the
# same kind into a composite widget. Most frequently
# used to add a collection of buttons into a menupane.
#
# Usages:
#
# DtkshAddButtons parent widgetClass label1 callback1 [label2 callback2 ...]
#
# DtkshAddButtons [-w] parent widgetClass variable1 label1 callback1 \
# [variable2 label2 callback2 ...]
#
# The "-w" option indicates that the convenience function should return
# the widget handle for each of the created buttons. The widget handle
# is returned in the specified environment variable.
#
# The widgetClass can be one of the following, and will default to the
# XmPushButtonGadget class, if not specified:
#
# XmPushButton
# XmPushButtonGadget
# XmToggleButton
# XmToggleButtonGadget
# XmCascadeButton
# XmCascadeButtonGadget
#
# Examples:
#
# DtkshAddButtons $MENU XmPushButtonGadget Open do_Open Save do_Save Quit exit
#
# DtkshAddButtons -w $MENU XmPushButtonGadget B1 Open do_Open B2 Save do_Save
#
DtkshAddButtons()
{
typeset parent widgetClass callback returnWidget="false" TMP=""
typeset -i paramCount=2
if [ $# -ge 1 ] && [ x"$1" = "x-w" ]; then
returnWidget=true
paramCount=3
shift
fi
if [ $# -lt 2 ]; then
return 1
fi
parent=$1
shift
widgetClass=${1:-XmPushButtonGadget}
shift
case $widgetClass in
XmPushButtonGadget) callback=activateCallback;;
XmPushButton) callback=activateCallback;;
XmToggleButtonGadget) callback=valueChangedCallback;;
XmToggleButton) callback=valueChangedCallback;;
XmCascadeButtonGadget) callback=activateCallback;;
XmCascadeButton) callback=activateCallback;;
*) return 1
esac
while [ $# -ge $paramCount ]
do
if [ "$returnWidget" = true ]; then
if [ ! "$3" = "" ]; then
XtCreateManagedWidget "$1" "$1" $widgetClass "$parent" \
labelString:"$2" ${callback}:"$3"
else
XtCreateManagedWidget "$1" "$1" $widgetClass "$parent" \
labelString:"$2"
fi
shift 3
else
if [ ! "$2" = "" ]; then
XtCreateManagedWidget Id "btn" $widgetClass "$parent" \
labelString:"$1" ${callback}:"$2"
else
XtCreateManagedWidget Id "btn" $widgetClass "$parent" \
labelString:"$1"
fi
shift 2
fi
done
return 0
}
###############################################################################
#
# DtkshSetReturnKeyControls - Convenience function for configuring a text
# widget (within a form!) so that the Return key does not
# activate the default button within the form, but instead
# moves the focus to the next text widget within the form.
# This is useful if you have a window which contains a
# series of text fields, and the default button should not
# be activated until the user presses the Return key in the
# last text field.
#
# Usage:
#
# DtkshSetReturnKeyControls textWidgetId nextTextWidgetId formWidgetId \
# defaultButtonId
#
# The textWidgetId parameter specifies the widget which is to be configured
# to catch the 'Return' key, and force the focus to move to the next text
# widget (as indicated by the nextTextWidgetId parameter). The formWidgetId
# parameter specifies the form which contains the default button, and should
# be the parent of the two text widgets. The defaultButtonId indicates which
# component is to be treated as the default button within the form.
#
# Examples:
#
# DtkshSetReturnKeyControls $TEXT1 $TEXT2 $FORM $OK
# DtkshSetReturnKeyControls $TEXT2 $TEXT3 $FORM $OK
#
DtkshSetReturnKeyControls()
{
if [ $# -ne 4 ]; then
return 1
fi
XtAddCallback $1 focusCallback "XtSetValues $3 defaultButton:NULL"
XtAddCallback $1 losingFocusCallback "XtSetValues $3 defaultButton:$4"
XtOverrideTranslations $1 \
"Ctrl<Key>Return:ksh_eval(\"XmProcessTraversal $2 TRAVERSE_CURRENT\")
<Key>Return:ksh_eval(\"XmProcessTraversal $2 TRAVERSE_CURRENT\")"
return 0
}
###############################################################################
#
# DtkshUnder
# DtkshOver
# DtkshRightOf
# DtkshLeftOf - Convenience functions for specifying form constraints.
# This set of functions allow a component to be attached
# to one of the edges of another component.
#
# Usages:
#
# DtkshUnder widgetId [offset]
# DtkshOver widgetId [offset]
# DtkshRightOf widgetId [offset]
# DtkshLeftOf widgetId [offset]
#
# The widgetId parameter specifies the widget to which the current
# component is to be attached. The offset value is optional, and
# defaults to 0 if not specified.
#
# Examples:
#
# XtCreateManagedWidget BUTTON2 button2 XmPushButton $FORM \
# labelString:"Exit" \
# $(DtkshUnder $BUTTON1)
#
DtkshUnder()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "topWidget:$1 topAttachment:ATTACH_WIDGET topOffset:${2:-0}"
}
DtkshOver()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "bottomWidget:$1 bottomAttachment:ATTACH_WIDGET bottomOffset:${2:-0}"
}
DtkshRightOf()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "leftWidget:$1 leftAttachment:ATTACH_WIDGET leftOffset:${2:-0}"
}
DtkshLeftOf()
{
if [ $# -lt 1 ]; then
return 1
fi
echo "rightWidget:$1 rightAttachment:ATTACH_WIDGET rightOffset:${2:-0}"
}
###############################################################################
#
# DtkshFloatRight
# DtkshFloatLeft
# DtkshFloatTop
# DtkshFloatBottom - Convenience functions for specifying form constraints.
# This set of functions allow a component to be positioned
# independent of the other components within the form.
# As the form grows or shrinks, the component maintains
# its relative position within the form. The component
# may still grow or shrink, depending upon the other form
# constraints which have been specified for the component.
#
# Usages:
#
# DtkshFloatRight [position]
# DtkshFloatLeft [position]
# DtkshFloatTop [position]
# DtkshFloatBottom [position]
#
# The optional position parameter specifies the relative position
# to which the indicated edge of the component will be positioned.
# A default position is used, if not specified.
#
# Examples:
#
# XtCreateManagedWidget BUTTON1 button1 XmPushButton $FORM \
# labelString:"Ok" \
# $(DtkshUnder $SEPARATOR) \
# $(DtkshFloatLeft 10) \
# $(DtkshFloatRight 40)
#
DtkshFloatRight()
{
echo "rightAttachment:ATTACH_POSITION rightPosition:${1:-0}"
}
DtkshFloatLeft()
{
echo "leftAttachment:ATTACH_POSITION leftPosition:${1:-0}"
}
DtkshFloatTop()
{
echo "topAttachment:ATTACH_POSITION topPosition:${1:-0}"
}
DtkshFloatBottom()
{
echo "bottomAttachment:ATTACH_POSITION bottomPosition:${1:-0}"
}
###############################################################################
#
# DtkshAnchorRight
# DtkshAnchorLeft
# DtkshAnchorTop
# DtkshAnchorBottom - Convenience functions for specifying form constraints.
# This set of functions allow a component to be attached
# to one of the edges of the form in such a fashion that
# as the form grows or shrinks, the component's position
# does not change. However, depending upon the other
# form constaints set on this component, the component
# may still grow or shrink in size.
#
# Usages:
#
# DtkshAnchorRight [offset]
# DtkshAnchorLeft [offset]
# DtkshAnchorTop [offset]
# DtkshAnchorBottom [offset]
#
# The optional offset parameter specifies how far from the edge
# of the form the component should be positioned. If an offset
# is not specified, then 0 is user.
#
# Examples:
#
# XtCreateManagedWidget BUTTON1 button1 XmPushButton $FORM \
# labelString:"Ok" \
# $(DtkshUnder $SEPARATOR) \
# $(DtkshAnchorLeft 10) \
# $(DtkshAnchorBottom 10)
#
DtkshAnchorRight()
{
echo "rightAttachment:ATTACH_FORM rightOffset:${1:-0}"
}
DtkshAnchorLeft()
{
echo "leftAttachment:ATTACH_FORM leftOffset:${1:-0}"
}
DtkshAnchorTop()
{
echo "topAttachment:ATTACH_FORM topOffset:${1:-0}"
}
DtkshAnchorBottom()
{
echo "bottomAttachment:ATTACH_FORM bottomOffset:${1:-0}"
}
###############################################################################
#
# DtkshSpanWidth
# DtkshSpanHeight - Convenience functions for specifying form constraints.
# This set of functions allow a component to be configured
# such that it spans either the full height or width of
# the form widget. This effect is accomplished by attaching
# two edges of the component (top & bottom for DtkshSpanHeight,
# and left and right for DtkshSpanWidth) to the form. The
# component will typically resize whenever the form is
# resized.
#
# Usages:
#
# DtkshSpanWidth [offset]
# DtkshSpanHeight [offset]
#
# The optional offset parameter specifies how far from the edge
# of the form the component should be positioned. If an offset
# is not specified, then 0 is user.
#
# Examples:
#
# XtCreateManagedWidget SEPARATOR $FORM XmSeparator \
# $(DtkshSpanWidth 1 1)
#
DtkshSpanWidth()
{
echo "leftAttachment:ATTACH_FORM leftOffset:${1:-0} \
rightAttachment:ATTACH_FORM rightOffset:${2:-0}"
}
DtkshSpanHeight()
{
echo "topAttachment:ATTACH_FORM topOffset:${1:-0} \
bottomAttachment:ATTACH_FORM bottomOffset:${2:-0}"
}
###############################################################################
#
# DtkshDisplayInformationDialog
# DtkshDisplayQuestionDialog
# DtkshDisplayWarningDialog
# DtkshDisplayWorkingDialog
# DtkshDisplayErrorDialog - Convenience functions for creating a single
# instance of each of the flavors of the Motif
# feedback dialog. If an instance of the requested
# type of dialog already exists, then it will be
# reused. The parent of the dialog is obtained
# from the environment variable $TOPLEVEL, which
# should be set by the calling shell script. The
# handle for the requested dialog is returned in
# one of the following environment variables:
#
# _DT_ERROR_DIALOG_HANDLE
# _DT_QUESTION_DIALOG_HANDLE
# _DT_WORKING_DIALOG_HANDLE
# _DT_WARNING_DIALOG_HANDLE
# _DT_INFORMATION_DIALOG_HANDLE
#
# WARNING: IF ATTACHING YOUR OWN CALLBACKS TO THE DIALOG
# BUTTONS, DO NOT DESTROY THE DIALOG WHEN YOU
# ARE DONE WITH IT; SIMPLY UNMANAGE THE DIALOG,
# SO THAT IT CAN BE USED AT A LATER TIME.
#
# Usages:
#
# DtDisplay*Dialog title message okCallback closeCallback helpCallback \
# dialogStyle
#
# The "Ok" button is always managed, and by default will simply unmanage
# the dialog. The "Cancel" and "Help" buttons are only managed when a
# callback is supplied for them.
#
# The "dialogStyle" parameter accepts any of the standard resource settings
# supported by the bulletin board widget.
#
# Examples:
#
# DtkshDisplayErrorDialog "Read Error" "Unable to read the file" \
# "OkCallback" "CancelCallback" "" \
# DIALOG_PRIMARY_APPLICATION_MODAL
#
# Global feedback dialog handles
_DT_ERROR_DIALOG_HANDLE=""
_DT_QUESTION_DIALOG_HANDLE=""
_DT_WORKING_DIALOG_HANDLE=""
_DT_WARNING_DIALOG_HANDLE=""
_DT_INFORMATION_DIALOG_HANDLE=""
_DT_TMP_DIALOG_HANDLE=""
DtkshDisplayErrorDialog()
{
_DtDisplayFeedbackDialog "$_DT_ERROR_DIALOG_HANDLE" "Error" "${@:-}"
if [ "$_DT_ERROR_DIALOG_HANDLE" = "" ] ; then
_DT_ERROR_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayQuestionDialog()
{
_DtDisplayFeedbackDialog "$_DT_QUESTION_DIALOG_HANDLE" "Question" "${@:-}"
if [ "$_DT_QUESTION_DIALOG_HANDLE" = "" ] ; then
_DT_QUESTION_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayWorkingDialog()
{
_DtDisplayFeedbackDialog "$_DT_WORKING_DIALOG_HANDLE" "Working" "${@:-}"
if [ "$_DT_WORKING_DIALOG_HANDLE" = "" ] ; then
_DT_WORKING_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayWarningDialog()
{
_DtDisplayFeedbackDialog "$_DT_WARNING_DIALOG_HANDLE" "Warning" "${@:-}"
if [ "$_DT_WARNING_DIALOG_HANDLE" = "" ] ; then
_DT_WARNING_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
DtkshDisplayInformationDialog()
{
_DtDisplayFeedbackDialog "$_DT_INFORMATION_DIALOG_HANDLE" "Information" \
"${@:-}"
if [ "$_DT_INFORMATION_DIALOG_HANDLE" = "" ] ; then
_DT_INFORMATION_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
return 0
}
###############################################################################
#
# DtkshDisplayQuickHelpDialog
# DtkshDisplayHelpDialog - Convenience functions for creating a single
# instance of a help dialog and a quick help
# dialog. If an instance of the requested type
# of help dialog already exists, then it will be
# reused. The parent of the dialog is obtained
# from the environment variable $TOPLEVEL, which
# should be set by the calling shell script. The
# handle for the requested dialog is returned in
# one of the following environment variables:
#
# _DT_HELP_DIALOG_HANDLE
# _DT_QUICK_HELP_DIALOG_HANDLE
#
# WARNING: DO NOT DESTROY THIS DIALOG, UNLESS YOU ALSO CLEAR THE
# CORRESPONDING ENVIRONMENT VARIABLE, SO THAT THIS CODE
# WILL NOT ATTEMPT TO REUSE THE DIALOG AGAIN.
#
# Usages:
#
# DtDisplay*HelpDialog title helpType helpInformation [locationId]
#
# The meaning of the parameters is dependent upon the value specified
# for the 'helpType' parameter. There meanings are explained below:
#
# helpType = HELP_TYPE_TOPIC
# helpInformation = help volume name
# locationId = help topic location id
#
# helpType = HELP_TYPE_STRING
# helpInformation = help string
# locationId = <not used>
#
# helpType = HELP_TYPE_DYNAMIC_STRING
# helpInformation = help string
# locationId = <not used>
#
# helpType = HELP_TYPE_MAN_PAGE
# helpInformation = man page name
# locationId = <not used>
#
# helpType = HELP_TYPE_FILE
# helpInformation = help file name
# locationId = <not used>
#
# Examples:
#
# DtkshDisplayHelpDialog "Help On Dtksh" HELP_TYPE_FILE "HelpFileName"
#
# Global help dialog handles
_DT_HELP_DIALOG_HANDLE=""
_DT_QUICK_HELP_DIALOG_HANDLE=""
DtkshDisplayQuickHelpDialog()
{
_DtkshDisplayHelpDialog "$_DT_QUICK_HELP_DIALOG_HANDLE" "Quick" "${@:-}"
if [ "$_DT_QUICK_HELP_DIALOG_HANDLE" = "" ] ; then
_DT_QUICK_HELP_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
}
DtkshDisplayHelpDialog()
{
_DtkshDisplayHelpDialog "$_DT_HELP_DIALOG_HANDLE" "" "${@:-}"
if [ "$_DT_HELP_DIALOG_HANDLE" = "" ] ; then
_DT_HELP_DIALOG_HANDLE=$_DT_TMP_DIALOG_HANDLE
fi
}
##############################################################################
#
# This internal shell function performs most of the work required to
# create an instance of a feedback dialog (error, warning, information,
# working and question). It will reuse an existing instance of the
# requested type of feedback dialog, if one has already been created;
# otherwise, it will create a new one.
#
# The "Ok" button is always managed, and by default will simply unpost
# the dialog. The "Cancel" and "Help" buttons are only managed if the
# callers specifies a callback for the butttons. Both the "Ok" and
# "Cancel" buttons rely on the fact that the 'autoUnpost' resource for
# the dialog is 'True'.
#
# The implied parent of the dialog is identified by the environment
# variable '$TOPLEVEL'.
#
# The incoming parameters are defined as follows (note that $1 and $2 are
# defined by the convenience function which is calling us, while $3 - $8
# are the parameters which were passed by the caller to the convenience
# function:
#
# $1 = existing dialog handle, or "" if first time
# $2 = type of feedback dialog (Information, Question, Working, ... )
# $3 = dialog title
# $4 = message string
# $5 = okCallback
# $6 = cancelCallback
# $7 = helpCallback
# $8 = dialogStyle
#
_DtDisplayFeedbackDialog()
{
if [ "$1" = "" ]; then
XmCreate${2}Dialog _DT_TMP_DIALOG_HANDLE $TOPLEVEL "$2"
else
_DT_TMP_DIALOG_HANDLE=$1
fi
XtSetValues $_DT_TMP_DIALOG_HANDLE \
dialogTitle:"${3:-$2}" \
messageString:"${4:- }" \
dialogStyle:"${8:-DIALOG_MODELESS}"
if [ $# -ge 5 ] && [ "$5" != "" ]; then
XtSetValues $_DT_TMP_DIALOG_HANDLE okCallback:"$5"
fi
if [ $# -lt 6 ] || [ "$6" = "" ]; then
XtUnmanageChild $(XmMessageBoxGetChild "-" $_DT_TMP_DIALOG_HANDLE \
DIALOG_CANCEL_BUTTON)
else
XtSetValues $_DT_TMP_DIALOG_HANDLE cancelCallback:"$6"
fi
if [ $# -lt 7 ] || [ "$7" = "" ]; then
XtUnmanageChild $(XmMessageBoxGetChild "-" $_DT_TMP_DIALOG_HANDLE \
DIALOG_HELP_BUTTON)
else
XtSetValues $_DT_TMP_DIALOG_HANDLE helpCallback:"$7"
fi
_DtkshPositionDialog "$1"
XtManageChild $_DT_TMP_DIALOG_HANDLE
return 0
}
##############################################################################
#
# This internal shell function performs most of the work required to
# create an instance of a help dialog (regular help or quick help)
# It will reuse an existing instance of the requested type of help
# dialog, if one has already been created; otherwise, it will create
# a new one.
#
# The implied parent of the dialog is identified by the environment
# variable '$TOPLEVEL'.
#
# The incoming parameters are defined as follows (note that $1 and $2 are
# defined by the convenience function which is calling us, while $3 - $6
# are the parameters which were passed by the caller to the convenience
# function:
#
# $1 = existing dialog handle, or "" if first time
# $2 = type of help dialog (Quick or "")
# $3 = dialog title
# $4 = help type
# $5 = help information:
# help volume (if help type = HELP_TYPE_TOPIC)
# help string (if help type = HELP_TYPE_STRING)
# help string (if help type = HELP_TYPE_DYNAMIC_STRING)
# man page name (if help type = HELP_TYPE_MAN_PAGE)
# help file name (if help type = HELP_TYPE_FILE)
# $6 = help location Id (if help type = HELP_TYPE_TOPIC)
#
_DtkshDisplayHelpDialog()
{
typeset helpType ARG1="" ARG2="" ARG3=""
typeset helpType VAL1="" VAL2="" VAL3=""
helpType="${4:-HELP_TYPE_TOPIC}"
ARG1="helpType:"
VAL1="$helpType"
case $helpType in
HELP_TYPE_TOPIC) ARG2="helpVolume:"
VAL2="${5:-}"
ARG3="locationId:"
VAL3="${6:-_HOMETOPIC}";;
HELP_TYPE_STRING) ARG2="stringData:"
VAL2="${5:-}";;
HELP_TYPE_DYNAMIC_STRING) ARG2="stringData:"
VAL2="${5:-}";;
HELP_TYPE_MAN_PAGE) ARG2="manPage:"
VAL2="${5:-}";;
HELP_TYPE_FILE) ARG2="helpFile:"
VAL2="${5:-}";;
*) return 1;;
esac
if [ "$1" = "" ]; then
if [ "$ARG3" != "" ]; then
DtCreateHelp${2}Dialog _DT_TMP_DIALOG_HANDLE $TOPLEVEL "$2" \
"${ARG1}${VAL1}" "${ARG2}${VAL2}" "${ARG3}${VAL3}"
else
DtCreateHelp${2}Dialog _DT_TMP_DIALOG_HANDLE $TOPLEVEL "$2" \
"${ARG1}${VAL1}" "${ARG2}${VAL2}"
fi
else
_DT_TMP_DIALOG_HANDLE=$1
if [ "$ARG3" != "" ]; then
XtSetValues $_DT_TMP_DIALOG_HANDLE \
"${ARG1}${VAL1}" "${ARG2}${VAL2}" "${ARG3}${VAL3}"
else
XtSetValues $_DT_TMP_DIALOG_HANDLE \
"${ARG1}${VAL1}" "${ARG2}${VAL2}"
fi
fi
if [ "$2" = "Quick" ]; then
XtSetSensitive $(DtHelpQuickDialogGetChild "-" $_DT_TMP_DIALOG_HANDLE \
HELP_QUICK_HELP_BUTTON) false
fi
XtSetValues $(XtParent "-" $_DT_TMP_DIALOG_HANDLE) title:"${3:-Help}"
_DtkshPositionDialog "$1"
XtManageChild $_DT_TMP_DIALOG_HANDLE
return 0
}
##############################################################################
#
# This internal shell function takes care of positioning the dialog so
# that it is centered over the window for which it is transient; if the
# window it is transient for is not currently managed, then the window
# will be positioned over in the center of the screen.
#
# Positioning does not occur that first time the dialog is posted; that
# is taken care of automatically by Motif and the window manager. It
# only needs to happen for subsequent postings.
#
_DtkshPositionDialog()
{
typeset -i WIDTH HEIGHT X_P Y_P WIDTH_P HEIGHT_P
typeset -i finalX finalY
if [ "$1" != "" ] && ! XtIsManaged $1 && XtIsShell $TOPLEVEL ; then
XtGetValues $1 width:WIDTH height:HEIGHT
if XtIsRealized $TOPLEVEL; then
XtGetValues $TOPLEVEL x:X_P y:Y_P width:WIDTH_P height:HEIGHT_P
(( finalX=$X_P+($WIDTH_P-$WIDTH)/2 ))
(( finalY=$Y_P+($HEIGHT_P-$HEIGHT)/2 ))
else
(( finalX=($(XWidthOfScreen "-" $(XtScreen "-" $1) )-$WIDTH)/2 ))
(( finalY=($(XHeightOfScreen "-" $(XtScreen "-" $1) )-$HEIGHT)/2 ))
fi
XtSetValues $(XtParent "-" $1) x:$finalX y:$finalY
fi
}
-17
View File
@@ -1,17 +0,0 @@
!######################################################################
!#
!# Dtksh
!#
!# Common Desktop Environment (CDE)
!#
!# Application Defaults for the CDE dtksh application
!#
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
!# (c) Copyright 1993, 1994 International Business Machines Corp.
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
!#
!# $XConsortium: Dtksh /main/3 1995/11/01 15:49:19 rswiston $
!#
!######################################################################
#include "Dt"
-96
View File
@@ -1,96 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = init.c DtFuncs.dtsh
SUBDIRS = examples
kshdir = ${libdir}/dtksh
dist_ksh_SCRIPTS = DtFuncs.dtsh
KSH93SRC = ./ksh93
KSH93LIBSHELL = $(KSH93SRC)/lib/libshell.a
bin_PROGRAMS = dtksh
BUILT_SOURCES = init.c
# Put all SHOPT definitions here. It is vital that dtksh and ksh93
# are built with the same options. We pass this list to both the
# dtksh components and to the ksh93 build as well. They must be
# specifically assigned a 1 or various preprocessor checks (#if SHOPT
# ...) in ksh93 will fail.
KSH93_SHOPTS = -DSHOPT_DYNAMIC=1 -DSHOPT_NAMESPACE=1 -DSHOPT_MULTIBYTE=1 \
-DSHOPT_STATS=1 -DSHOPT_BGX=1 -DSHOPT_AUDIT=1 \
-DSHOPT_KIA=1 -DSHOPT_HISTEXPAND=1 -DSHOPT_EDPREDICT=1 \
-DSHOPT_ESH=1 -DSHOPT_VSH=1 -DSHOPT_FIXEDARRAY=1 -DSHOPT_SUID_EXEC=1 \
-DSHOPT_BRACEPAT=1 -DSHOPT_ECHOPRINT=1
dtksh_CPPFLAGS = -I$(KSH93SRC)/include/ast -I$(KSH93SRC)/src/cmd/ksh93/include \
-I$(KSH93SRC)/src/cmd/ksh93 -I${srcdir}/lib/DtPrint \
-I${srcdir}/lib/DtHelp $(KSH93_SHOPTS) \
-D_PACKAGE_ast -DKSHELL \
'-DERROR_CONTEXT_T=Error_context_t' \
-D_API_ast=20100309 -DBUILD_DTKSH
dtksh_LDADD = $(DTCLIENTLIBS) ksh93/src/cmd/ksh93/pmain.o $(XTOOLLIB) \
libshell.a $(KSH93SRC)/lib/libcmd.a $(KSH93SRC)/lib/libast.a \
$(KSH93SRC)/lib/libdll.a
if SOLARIS
dtksh_LDADD += -lsecdb -lsocket -lnsl
endif
if AIX
dtksh_CPPFLAGS += -D_IBMRPC_
dtksh_LDFLAGS = -bE:dtksh.exp
endif
dtksh_SOURCES = init.c \
widget.c \
dtkcvt.c \
dtkcmds.c \
XtCvtrs.c \
xmcvt.c \
xmcmds.c \
xmwidgets.c \
extra.c \
msgs.c
# ksh93's bin/package insists on the compiler as an ABSOLUTE path
# ("case $cc in /*)", else "$CC: not found -- set CC=C-compiler"), and it only
# recognises a bare path, not CC=<path>. A cross build's compiler is a name
# (x86_64--netbsd-gcc), so the pkgsrc recipe passes KSH_CC, the compiler wrapper
# by its path; native builds leave it empty and bin/package uses $CC as before
# (build/logs/userland-2026-11-14n.log:16461).
# CWRAPPERS_CONFIG_DIR is pkgsrc's; it is exported to every make of the build and
# names the wrapper directory, whose bin/cc applies the cross flags. A plain
# build has neither KSH_CC nor CWRAPPERS_CONFIG_DIR and keeps using $CC.
# ksh93's bin/package takes the compiler from $CC and insists on an absolute
# path ("case $cc in /*)"); a bare path argument did not survive its parsing
# (build/logs/userland-2026-11-14-finish4.log:16480), so the compiler is given in
# the environment of that one command. KSH_CC wins; otherwise the wrapper is
# derived from pkgsrc's CWRAPPERS_CONFIG_DIR, which every make of the build sees.
# A plain build has neither and keeps its own $CC.
KSH_CC_ENV = $(if $(KSH_CC),CC=$(KSH_CC),$(if $(CWRAPPERS_CONFIG_DIR),CC=$(dir $(CWRAPPERS_CONFIG_DIR))bin/cc))
ksh93/bin/ksh:
$(KSH_CC_ENV) ksh93/bin/package flat make CCFLAGS='$(KSH93_SHOPTS) $(MCDE_DIALECT_CFLAGS)'
init.c: ksh93/bin/ksh
$(CP) ksh93/src/cmd/ksh93/sh/init.c ./
libshell.a: $(KSH93SLIBSHELL) dtksh-init.o
$(CP) $(KSH93LIBSHELL) libshell.a; \
$(AR) d libshell.a init.o; \
$(AR) cq libshell.a dtksh-init.o
check-local:
./dtksh -c true && ksh93/bin/shtests --posix --utf8 SHELL=.libs/dtksh
clean-local:
ksh93/bin/package clean
DtFuncs.dtsh:
$(CP) DtFuncs.sh DtFuncs.dtsh
-369
View File
@@ -1,369 +0,0 @@
/* $XConsortium: README-DEVELOPER /main/3 1996/07/15 14:12:13 drk $ */
(NOTE: As of CDE 2.3.1 and later, this entire document is obsolete and only kept
for historical purposes, the updating process has been streamlined to a simple
two step process:
1. cd ksh93; git pull
2. Merge upstream init.c with ours, keeping all of our changes.
and thats all there is to it.)
IMPORTANT!!! PLEASE READ ON!!
------------------------------
The intention of this file is to outline the procedure to use, anytime
a new update of the ksh-93 source is received. When you receive the
new source package, you will first need to do the following:
0) mkdir ksh93-base
1) copy the packing into this directory
2) uudecode the package
3) uncompress the package
4) un-tar the package into ksh93-base (you may need to use
cpio, if that is what Korn used to create his package).
Once the source ball has been un-tar'ed, go down into the hierarchy,
until you see a directory called 'ship' ; don't go down into the 'ship'
directory, simply stop at its parent. Dave Korn uses his own mechanism
for creating the actual ksh-93 sources. It's not like you can simply
look at what is in the 'ship' directory. Instead, you need to run his
'shipin' tool, which takes his base source ball, and applies all of his
patches, thus generating the source tree. To start this process, which
will result in the latest source files being generated, issue the following
commands:
<First, log onto a 10.0 build machine, such as hpcvusp>
/bin/ksh
export SHELL=/bin/ksh
nohup /bin/ksh ship/shipin -u -L&
tail -f nohup.out
When this completes, you will notice that the current directory now
contains a series of other subdirectories; the only ones we really care
about now are the 'man', 'ship' and the 'src' subdirectories.
The trick now is to determine which of the files in
these subdirectories have changed, so that you can update the real
dtksh/ksh93 source tree. You will want to copy into the dtksh/ksh93/ship
directory the newest versions of the following files:
shipiffe.sh
shipout
shipin
shipproto.c
shipop.c
Go into the 'shipin' file, and locate the several places where it attempts
to mail out information (I look for the word 'mail', until I find what
looks like the correct places). Remove this code, since we don't want
a ton of mail messages happening each time we build.
Within the 'ship' directory, you will notice a series of subdirectories;
each one of these corresponds to one of the pieces making up the ksh93
client (i.e. there is one for each library: libast, libcmd, libvdelta, etc).
Within each of these subdirectories is another subdirectory, whose name
represents the date that source depot was created (i.e. 950619). You will
need to recreate these dated directories, along with their contents, within
your dtksh tree (under dtksh/ksh93/ship). Within each dated directory,
copy over (and check in) the items, copyright, UNCRATED and owner files.
Check in a dummy 'base' file also. Doing these steps will allow the ksh
build to proceed, without it ever again attempting to uncrate new ksh93
sources. The 'items' file is particularly important, since it indicates
which other libraries the indicated piece is dependent upon.
====================
In /clone/fred/DtkshTools I have a collection of scripts which make it easier
to update a dtksh tree with new ksh sources. The steps for determining which
files have changed are as follows:
1) First get a list of all of the files in the new source tree. I do this
with the following steps:
cd ksh93-base (This is the tree you just untar'ed)
find src -print > srcList
This gives you a complete list of all of the source files.
2) Use this list to determine which source files are new or have changed:
/clone/fred/DtkshTools/CheckKshSrc dtksh ksh93-base srcList > diffList
The output generated by the above script will tell you which files have
changed, which have not changed, and which have been added.
3) You now need to take the diffList, and modify it so that it only
contains the name of new or changed files within the ksh93 source
tree:
/clone/fred/DtkshTools/CreateTrimList diffList > trimList
4) Now, we will delete the files in the dtksh tree which we are going
to replace; we do this before we copy over the new versions:
/clone/fred/DtkshTools/TrimOldSrcs /clone/fred/dtksh trimList
5) We now need to check out (Rcs -l) the files we are going to replace:
/clone/fred/DtkshTools/CheckOutSrcs /clone/fred/dtksh trimList
If at any time you want to get a complete list of checked out files
in your dtksh tree, issue the following commands:
find /clone/fred/dtksh -type d > dirList
/clone/fred/DtkshTools/RunRcslocks dirList
6) We are now ready to copy the new source files out of the ksh93-base
directory, and into the dtksh directory:
cd /clone/fred
/clone/fred/DtkshTools/CopyNewSrcs ksh93-base dtksh trimList
====================
You're not done yet, however. We have found it necessary to modify
several of the stock ksh sources, Makefiles and Mamfiles, to accommodate
problems we have encountered, or to enable options not turned on by
default, such as multibyte support. You will need to make sure that
these changes get rolled back in, before checking in the new source.
The following source files need to have changes added:
src/cmd/ksh93/Makefile (*** THIS STEP IS OBSOLETE ***)
----------------------
Change: MULTIBYTE ==
To: MULTIBYTE == 1
src/cmd/ksh93/Mamfile (*** THIS STEP IS OBSOLETE ***)
---------------------
Change: setv MULTIBYTE -UMULTIBYTE
To: setv MULTIBYTE -DMULTIBYTE
src/cmd/ksh93/OPTIONS (*** THIS STEP IS OBSOLETE ***)
---------------------
Change: MULTIBYTE=0
To: MULTIBYTE=1
***
The following two files must change, to prevent the ksh source from linking
in its own malloc package. This creates problems on the IBM platform, due
to the way their libraries are built. As it turns out, the IBM Xt library
already has all of its malloc/free/etc calls resolved to their standard
libc malloc functions. If ksh defines its own malloc package, then dtksh
ends of effectively linked simultaneously to two different malloc packages.
This rapidly leads to a core dump, due to cross contamination of the
memory pools (i.e. A value obtained by XtMalloc() passed to free() ). As
it turns out, this also creates problems on the HP platform, as was
recently discovered (Note that it appears that the problem which was
seen on the HP platform was due to a defect in the ksh93 memory allocation
code; this defect had not yet been fixed in the ksh93-d release. Until
the time that this is fixed, we must continue to be sure to not link
in ksh93's malloc package).
src/lib/libast/Makefile
-----------------------
Remove: calloc.c malloc.c from the list of sources
src/lib/libast/Mamfile
----------------------
Remove: calloc.o malloc.o from the archive line; DO NOT REMOVE
ANY OF THE OTHER REFERENCES TO malloc OR calloc, AS
THIS WILL CAUSE THE BUILD TO BREAK.
***
Another file which needs special handling is builtins.c, which is in
the base dtksh directory. This file was first created by taking the
file 'dtksh/ksh93/src/cmd/ksh93/data/builtins.c', and adding into its
list of builtin commands, the list we added for X, Xt, Xm and Dt. The
best way to update this file is to first goto 'dtksh/ksh93/src/cmd/ksh93/data'
and do an Rcsdiff, to find out what changes Dave Korn made. You will
then make those same changes to the dtksh/builtins.c file.
dtksh/builtins.c
----------------
Fold in any changes made to dtksh/ksh93/src/cmd/ksh93/data/builtins.c
***
Another file which needs special handling is aliases.c, which is in
the base dtksh directory. This file was first created by taking the
file 'dtksh/ksh93/src/cmd/ksh93/data/aliases.c', and adding into its
list of commands aliases, the list we added for X, Xt, Xm and Dt. The
best way to update this file is to first goto 'dtksh/ksh93/src/cmd/ksh93/data'
and do an Rcsdiff, to find out what changes Dave Korn made. You will
then make those same changes to the dtksh/aliases.c file.
dtksh/aliases.c
---------------
Fold in any changes made to dtksh/ksh93/src/cmd/ksh93/data/aliases.c
HP-SPECIFIC Ksh-93 SOURCE MODIFICATIONS:
========================================
The dtksh code requires a handful of changes to be made to the ksh93
source itself. Most of these changes relate to either localization
customizations, additional multibyte support, or fixes for environment
variable mirroring. For each of the files listed below, two versions
have been checked into the RCS vaults: the original (unaltered) version,
and the version with our customizations. This will make it easy to
determine the changes we have made, so that the next time we receive
new code from Korn, it is a relatively simple task to again merge in the
changes. Note that all of the changes relating to multibyte support
have been passed onto David Korn, and that hopefully they will show up
in the official source sometime in the future (after the ksh93-d release).
Modification 1:
---------------
The ksh (and dtksh) executables use a special client (suid_exec) when
trying to execute an suid script; this special client makes sure that
you really have permission to run the suid script. The client, as
supplied by David Korn, has hardcoded assumptions about where it lives
(/etc) and where the valid (and secure) places are where shells can
live. We need to change this so that it knows the client lives in
the cde tree, and that in addition to the normal 'safe' shell locations,
/usr/dt/bin is also a safe location. To do this, the following changes
must be made, each time new ksh source is received:
dtksh/ksh93/src/cmd/ksh93/data/msg.c
------------------------------------
Change:
e_sysprofile = "/etc/profile";
e_suidprofile = "/etc/suid_profile";
e_suidexec = "/etc/suid_exec";
To:
e_sysprofile = PROFILEPATH;
e_suidprofile = SUIDPROFILEPATH;
e_suidexec = SUIDEXECPATH;
dtksh/ksh93/src/cmd/ksh93/sh/suid_exec.c
----------------------------------------
Change:
#define THISPROG "/etc/suid_exec"
To:
#define THISPROG SUIDEXECPATH
Also, search for the block of code like the following (around line 256):
if (shell == 0 || !endsh(shell) || (
!in_dir("/bin",shell) &&
!in_dir("/usr/bin",shell) &&
And change it as follows:
if (shell == 0 || !endsh(shell) || (
!in_dir(CDE_INSTALLATION_TOP"/bin",shell) &&
!in_dir("/bin",shell) &&
!in_dir("/usr/bin",shell) &&
Modification 2:
---------------
During CDE development, it was discovered that some shared library
implementations (i.e. at least IBM) bound a shared library to all
of its dependencies at the time that the library was build. This
created problems for libraries which made getenv() or putenv()
calls, because we expected those calls to be resolved against the
getenv() and putenv() calls provided in the ksh93 libraries, not
against the standard libc versions. This was a problem because
ksh keeps track of its own environment, and does not pass the
information on through to the standard libc environment. The result
was that certain key pieces of information (i.e LANG) might be set
by a shell script, but when calls where made to shared library functions,
they would not see this setting. The fix is to modify the ksh93 code
to *also* pass along any environment settings onto the libc functions;
we call this 'environment variable mirroring'. We won't describe the
exact changes here; you can find them by diff'ing the last two revisions
for the following files:
src/cmd/ksh93/include/nval.h (New field added to Namval structure)
src/cmd/ksh93/sh/name.c (Mirroring code implemented here)
Modification 3:
---------------
There are a handful of multibyte and localization changes which we
must make. Some of them relate to adding message catalog support
to ksh, while others relate to making changes so that Japanese SJIS character
will work. The files which must be modified are:
src/cmd/ksh93/sh/init.c (Message cat and file desc locking/unlocking)
src/cmd/ksh93/sh/lex.c (Japanese SJIS processing fixes)
src/cmd/ksh93/sh/macro.c (Multibyte fixes)
src/cmd/ksh93/bltins/print.c (SJIS multibyte fix to echo/print command)
src/cmd/ksh93/sh/userinit.c (Add call to setlocale() in sh_userinit())
Modification 4:
---------------
There appears to be a bug in the ksh93 build process, which shows up
on the HP platform. David Korn was unable to find the cause, so we
need to modify one of his build scripts:
ksh93/src/cmd/ksh93/features/options.sh
---------------------------------------
Towards the top of the script, there is the following set of
statements:
: get the option settings from the options file
. $OPTIONS
You need to modify this so that it is like the following:
: get the option settings from the options file
if [ -z "$OPTIONS" ] ; then
OPTIONS="OPTIONS"
fi
. $OPTIONS
=======================
Each time a new release is received from Dave Korn, we also need to copy
his latest ksh93 man page from src/cmd/ksh93/sh.1 into
/x/cdesrc/doc/cde1/man/man1/ksh93. You will need to make one change to
the man page, so that it prints out the ksh information, instead of sh
information. The change is one approximately line 7.
Change:
-------
.nr Z 0 \" set to 1 when command name is ksh rather than sh
To:
---
.nr Z 1 \" set to 1 when command name is ksh rather than sh
===================
One last note. There is a shell script called 'MakeClean' in the root
directory of the dtksh tree. This script cleans out files in the ksh93
portion of the tree, which will force a complete build to occur. Since
the ksh93 portion does not use Imake (it uses Mam or something bazarre
like that), we needed to jury rig something which would act like our
normal 'make clean' . If you discover any other ksh93 files which need
to be removed during a 'make clean' operation, simply add another line
to the MakeClean script. A good indication that a file needs to be
added is if you make a clone from one of the source trees, do a 'make clean',
start a 'make', and somewhere during the building of the ksh93 sources,
you see an error message telling you that you did not have permission to
overwrite something within your clone tree. The ksh93 build process builds
a lot of files on the fly, and moves things around to other directories, so
these file typically need to be cleared out before doing a complete make.
-42
View File
@@ -1,42 +0,0 @@
/* $XConsortium: README.building /main/2 1996/07/15 14:12:43 drk $ */
Since dtksh does not use anything like a normal build environment,
here are some hints.
- Make a Makefile in cdesrc/cde1/dtksh as if it were a normal
component
- make includes; make all
dtksh will build initially fine.
Now, if you change anything, you'll find that just typing "make"
doesn't do anything. What you have to do is go to
cdesrc/cde1/dtksh/ksh93/ship. Under there you'll find a distorted
version of the directory structure under ksh93. Find the directory
that corresponds to the directory that contains your change and
remove the file "BUILT". Now cd back up to dtksh and make, and
dtksh should remake itself. Of course, it will recompile many
more files than you actually built, since dtksh does not use
make in any recognizable way.
In fact, it appears the best thing to do is go to cde1/dtksh
and run "ksh MakeClean" which will blow away many files and force
a clean make.
Be extremely careful: Just because you get a dtksh built at
the end does *not* mean the build was successful. There
are several auxiliary binaries in ksh93/bin that must be built.
Make sure that ksh93/bin looks like this at the end:
urth 1331$ pwd
/scde/SunOS_sparc/opt/stable/build/cde1/dtksh/ksh93/bin
urth 1332$ ls
feature* ksh* proto* silent*
ignore* pax* shcomp* suid_exec*
If any of these are missing, search carefully back through
the make log looking for errors.
-239
View File
@@ -1,239 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: XtCvtrs.c /main/3 1995/07/14 13:25:38 drk $ */
/*LINTLIBRARY*/
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
/* Conversion.c - implementations of resource type conversion procs */
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/keysym.h>
#include <X11/Xlocale.h>
#include "msgs.h"
#include "XtCvtrs.h"
#define done(type, value) \
{ \
if (toVal->addr != NULL) { \
if (toVal->size < sizeof(type)) { \
toVal->size = sizeof(type); \
return False; \
} \
*(type*)(toVal->addr) = (value); \
} \
else { \
static type static_val; \
static_val = (value); \
toVal->addr = (XPointer)&static_val; \
} \
toVal->size = sizeof(type); \
return True; \
}
static void FreePixel(
XtAppContext app,
XrmValuePtr toVal,
XtPointer closure,
XrmValuePtr args,
Cardinal *num_args) ;
static XtConvertArgRec xtColorConvertArgs[] = {
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
sizeof(Screen *)},
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
sizeof(Colormap)}
};
Boolean
DtkshCvtStringToPixel(
Display *dpy,
XrmValuePtr args,
Cardinal *num_args,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *closure_ret )
{
String str = (String)fromVal->addr;
XColor screenColor;
XColor exactColor;
Screen *screen;
Colormap colormap;
Status status;
char *errmsg;
if (*num_args != 2)
return False;
screen = *((Screen **) args[0].addr);
colormap = *((Colormap *) args[1].addr);
if (DtCompareISOLatin1(str, XtDefaultBackground)) {
*closure_ret = False;
done(Pixel, WhitePixelOfScreen(screen));
}
if (DtCompareISOLatin1(str, XtDefaultForeground)) {
*closure_ret = False;
done(Pixel, BlackPixelOfScreen(screen));
}
status = XAllocNamedColor(DisplayOfScreen(screen), colormap,
(char*)str, &screenColor, &exactColor);
if (status == 0) {
String type;
/* Server returns a specific error code but Xlib discards it. Ugh */
if (XLookupColor(DisplayOfScreen(screen), colormap, (char*)str,
&exactColor, &screenColor)) {
*closure_ret = (char*)True;
done(Pixel, screenColor.pixel);
}
else {
/* One last chance; see if it is a pixel number */
char * p;
Pixel pixelValue;
pixelValue = strtoul(str, &p, 0);
if (p == str)
{
char * errbuf;
errmsg = GETMESSAGE(
"DtkshCvtStringToPixel: The color '%s' is not defined");
errbuf = XtMalloc(strlen(errmsg) + strlen(str) + 10);
sprintf(errbuf, errmsg, str);
XtWarning(errbuf);
XtFree(errbuf);
*closure_ret = False;
return False;
}
else
{
*closure_ret = False;
done(Pixel, pixelValue);
}
}
} else {
*closure_ret = (char*)True;
done(Pixel, screenColor.pixel);
}
}
/* ARGSUSED */
static void
FreePixel(
XtAppContext app,
XrmValuePtr toVal,
XtPointer closure,
XrmValuePtr args,
Cardinal *num_args )
{
Screen *screen;
Colormap colormap;
if (*num_args != 2)
return;
screen = *((Screen **) args[0].addr);
colormap = *((Colormap *) args[1].addr);
if (closure) {
XFreeColors( DisplayOfScreen(screen), colormap,
(unsigned long*)toVal->addr, 1, (unsigned long)0
);
}
}
Boolean
DtCompareISOLatin1(
char *first,
char *second )
{
unsigned char *ap, *bp;
for (ap = (unsigned char *) first, bp = (unsigned char *) second;
*ap && *bp; ap++, bp++) {
unsigned char a, b;
if ((a = *ap) != (b = *bp)) {
/* try lowercasing and try again */
if ((a >= XK_A) && (a <= XK_Z))
a += (XK_a - XK_A);
else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis))
a += (XK_agrave - XK_Agrave);
else if ((a >= XK_Ooblique) && (a <= XK_Thorn))
a += (XK_oslash - XK_Ooblique);
if ((b >= XK_A) && (b <= XK_Z))
b += (XK_a - XK_A);
else if ((b >= XK_Agrave) && (b <= XK_Odiaeresis))
b += (XK_agrave - XK_Agrave);
else if ((b >= XK_Ooblique) && (b <= XK_Thorn))
b += (XK_oslash - XK_Ooblique);
if (a != b) break;
}
}
return ((((int) *bp) - ((int) *ap)) == 0);
}
void
RegisterXtOverrideConverters( void )
{
XtSetTypeConverter(XtRString, XtRPixel,
(XtTypeConverter)DtkshCvtStringToPixel,
xtColorConvertArgs, XtNumber(xtColorConvertArgs),
XtCacheNone, FreePixel);
}
-66
View File
@@ -1,66 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: XtCvtrs.h /main/4 1995/11/01 15:50:01 rswiston $ */
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Digital or MIT not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef _Dtksh_XtCvtrs_h
#define _Dtksh_XtCvtrs_h
extern Boolean DtkshCvtStringToPixel(
Display *dpy,
XrmValuePtr args,
Cardinal *num_args,
XrmValuePtr fromVal,
XrmValuePtr toVal,
XtPointer *closure_ret) ;
extern void RegisterXtOverrideConverters( void ) ;
extern Boolean DtCompareISOLatin1(
char *first,
char *second) ;
#endif /* _Dtksh_XtCvtrs_h */
File diff suppressed because it is too large. Load diff
-697
View File
@@ -1,697 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: dtkcmds.h /main/6 1996/04/01 17:54:01 rswiston $ */
/************************************<+>*************************************
****************************************************************************
**
** File: dtkcmds.h
**
** Project: CDE
**
** Description: Public include file for dtkcmds.c
**
**
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992
** by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _Dtksh_dtkcmds_h
#define _Dtksh_dtkcmds_h
#include <Dt/Wsm.h>
#include <Dt/Print.h>
#include "name.h"
#define CONVERT_SUCCEEDED 1
#define CONVERT_POSTPONED 0
#define CONVERT_FAILED -1
#define ADDBUILTIN(a,b) sh_addbuiltin(a, ((int (*)(int, char*[], Shbltin_t*))b), (void*) 0)
extern Widget Toplevel;
extern char str_nill[];
extern wtab_t * DTKSHConversionWidget;
extern classtab_t * DTKSHConversionClass;
extern char * DTKSHConversionResource;
extern wtab_t * set_up_w(
Widget wid,
wtab_t *parent,
char *var,
char *name,
classtab_t *class) ;
extern void parse_args(
char *arg0,
int argc,
char **argv,
wtab_t *w,
wtab_t *parent,
classtab_t *class,
int *n,
Arg *args,
int * pargc,
char ** pargv,
Boolean postponePixmaps ) ;
extern void free_args(
int n,
Arg *args) ;
extern int do_XtInitialize(
int argc,
char *argv[]) ;
extern int do_XtCreateApplicationShell(
int argc,
char *argv[]) ;
extern int do_XtCreatePopupShell(
int argc,
char *argv[]) ;
extern int do_XtCreateManagedWidget(
int argc,
char *argv[]) ;
extern int do_XtCreateWidget(
int argc,
char *argv[]) ;
extern int do_XtPopup(
int argc,
char *argv[]) ;
extern int do_XtDestroyWidget(
int argc,
char *argv[]) ;
extern int do_single_widget_test_func(
int (*func)(),
int argc,
char **argv) ;
extern int do_XtIsSensitive(
int argc,
char *argv[]) ;
extern int do_XtIsShell(
int argc,
char *argv[]) ;
extern int do_XtIsManaged(
int argc,
char *argv[]) ;
extern int do_XtIsRealized(
int argc,
char *argv[]) ;
extern int do_XtRealizeWidget(
int argc,
char *argv[]) ;
extern int do_XtUnrealizeWidget(
int argc,
char *argv[]) ;
extern int do_XtMapWidget(
int argc,
char *argv[]) ;
extern int do_XtUnmapWidget(
int argc,
char **argv) ;
extern int do_XtPopdown(
int argc,
char **argv) ;
extern int do_XtMainLoop(
int argc,
char **argv) ;
extern int do_XtDisplay(
int argc,
char **argv) ;
extern int do_XtDisplayOfObject(
int argc,
char **argv) ;
extern int do_XtNameToWidget(
int argc,
char **argv) ;
extern int do_XtScreen(
int argc,
char **argv) ;
extern int do_XtWindow(
int argc,
char **argv) ;
extern int do_XtCallCallbacks(
int argc,
char **argv) ;
extern int do_XtHasCallbacks(
int argc,
char **argv) ;
extern int do_XtAddCallback(
int argc,
char **argv) ;
extern int AddOneCallback(
char *cmd,
char *widget,
char *cbName,
char *kshcmd,
char *propAtomStr) ;
extern int do_XtRemoveCallback(
int argc,
char **argv) ;
extern int RemoveOneCallback(
char *cmd,
char *widget,
char *cbName,
char *kshcmd,
char *propAtomStr,
char *handleStr) ;
extern int do_XtAddEventHandler(
int argc,
char **argv) ;
extern int do_XtRemoveEventHandler(
int argc,
char **argv) ;
extern int do_XtGetValues(
int argc,
char **argv) ;
extern int do_XtSetValues(
int argc,
char **argv) ;
extern int do_XtAddWorkProc(
int argc,
char *argv[]) ;
extern int do_XtRemoveWorkProc(
int argc,
char *argv[]) ;
extern int do_XtAddTimeOut(
int argc,
char *argv[]) ;
extern int do_XtRemoveTimeOut(
int argc,
char *argv[]) ;
extern int do_XtUnmanageChildren(
int argc,
char *argv[]) ;
extern int do_XtManageChildren(
int argc,
char *argv[]) ;
extern int do_XtIsSubclass(
int argc,
char *argv[]) ;
extern int do_XtClass(
int argc,
char *argv[]) ;
extern int do_managelist_func(
int argc,
char *argv[],
int (*func)()) ;
extern int create_standard_gc(
Display *display,
Window drawable) ;
extern int do_XBell(
int argc,
char *argv[]) ;
extern int do_XRootWindowOfScreen(
int argc,
char *argv[]) ;
extern int do_XWidthOfScreen(
int argc,
char *argv[]) ;
extern int do_XHeightOfScreen(
int argc,
char *argv[]) ;
extern int do_XDefineCursor(
int argc,
char *argv[]) ;
extern int do_XUndefineCursor(
int argc,
char *argv[]) ;
extern int do_XtRemoveAllCallbacks(
int argc,
char *argv[]) ;
extern int do_XTextWidth(
int argc,
char *argv[]) ;
extern int do_XDrawArc(
int argc,
char *argv[]) ;
extern int do_XDrawImageString(
int argc,
char *argv[]) ;
extern int do_XDrawLine(
int argc,
char *argv[]) ;
extern int do_XDrawLines(
int argc,
char *argv[]) ;
extern int do_XDrawPoint(
int argc,
char *argv[]) ;
extern int do_XDrawPoints(
int argc,
char *argv[]) ;
extern int do_XDrawRectangle(
int argc,
char *argv[]) ;
extern int do_XCopyArea(
int argc,
char *argv[]) ;
extern int do_XDrawSegments(
int argc,
char *argv[]) ;
extern int do_XDrawString(
int argc,
char *argv[]) ;
extern int do_XFillArc(
int argc,
char *argv[]) ;
extern int do_XFillPolygon(
int argc,
char *argv[]) ;
extern int do_XFillRectangle(
int argc,
char *argv[]) ;
extern int do_XClearArea(
int argc,
char *argv[]) ;
extern int do_XClearWindow(
int argc,
char *argv[]) ;
extern int ConvertTypeToString(
char *arg0,
classtab_t *class,
wtab_t *w,
wtab_t *parent,
char *resource,
XtArgVal val,
char **ret) ;
extern int ConvertStringToType(
char *arg0,
wtab_t *w,
wtab_t *parent,
classtab_t *class,
char *resource,
char *val,
XtArgVal *ret,
int *freeit,
Boolean postponePixmaps) ;
extern int do_XtAddInput(
int argc,
char *argv[]) ;
extern int do_XtRemoveInput(
int argc,
char *argv[]) ;
extern void Translation_ksh_eval(
Widget w,
XEvent *event,
String *params,
Cardinal *num_params) ;
extern void RestorePriorEnvVarValues(
Namval_t *np1,
char *value1,
Namval_t *np2,
char *value2) ;
extern void stdCB(
void *widget,
caddr_t clientData,
caddr_t callData) ;
extern void stdWSCB(
void *widget,
Atom atom,
caddr_t clientData) ;
extern void stdInputCB(
inputrec_t *inp,
int *source,
XtInputId *id) ;
extern int stdWorkProcCB(
char *clientData) ;
extern void stdTimerCB(
char *clientData,
long *id) ;
extern void stdPrintSetupProc(
int proctype,
void *widget,
DtPrintSetupData *callData);
extern void stdPrinterInfoProc(
void *widget,
DtPrintSetupData *callData);
extern void stdSelectFileProc(
void *widget,
DtPrintSetupData *callData);
extern void stdSelectPrinterProc(
void *widget,
DtPrintSetupData *callData);
extern void stdSetupProc(
void *widget,
DtPrintSetupData *callData);
extern void stdVerifyPrinterProc(
void *widget,
DtPrintSetupData *callData);
extern int do_VerifyString(
int argc,
char *argv[]) ;
extern int do_XFlush(
int argc,
char *argv[]) ;
extern int do_XSync(
int argc,
char *argv[]) ;
extern int do_XRaiseWindow(
int argc,
char *argv[]) ;
extern int do_XtSetSensitive(
int argc,
char *argv[]) ;
extern int do_XtOverrideTranslations(
int argc,
char **argv) ;
extern int do_XtAugmentTranslations(
int argc,
char **argv) ;
extern int do_XtUninstallTranslations(
int argc,
char *argv[]) ;
extern int do_XtParent(
int argc,
char **argv) ;
extern int do_XtLastTimestampProcessed(
int argc,
char **argv) ;
extern dtksh_client_data_t * GetNewCBData(
char *ksh_cmd,
wtab_t *w,
char *cbname,
Atom propAtom) ;
extern int LocateCBRecord(
wtab_t *w,
char *cbname,
char *ksh_cmd,
Atom propAtom,
DtWsmCBContext handle) ;
extern void stdEH(
void *widget,
caddr_t clientData,
XEvent *event,
Boolean *continueToDispatch) ;
extern dtksh_event_handler_data_t * GetNewEHData(
char *ksh_cmd,
wtab_t *w,
EventMask eventMask,
Boolean nonMaskable) ;
extern int do_DtSessionRestorePath(
int argc,
char *argv[]) ;
extern int do_DtSessionSavePath(
int argc,
char *argv[]) ;
extern int do_DtShellIsIconified(
int argc,
char *argv[]) ;
extern int do_DtSetStartupCommand(
int argc,
char *argv[]) ;
extern int do_DtSetIconifyHint(
int argc,
char *argv[]) ;
extern int do_DtWsmAddWorkspaceFunctions(
int argc,
char *argv[]) ;
extern int do_DtWsmRemoveWorkspaceFunctions(
int argc,
char *argv[]) ;
extern int do_DtWsmGetCurrentWorkspace(
int argc,
char *argv[]) ;
extern int do_DtWsmSetCurrentWorkspace(
int argc,
char *argv[]) ;
extern int do_DtWsmGetWorkspaceList(
int argc,
char *argv[]) ;
extern int do_DtWsmGetWorkspacesOccupied(
int argc,
char *argv[]) ;
extern int do_DtWsmSetWorkspacesOccupied(
int argc,
char *argv[]) ;
extern int do_DtWsmGetCurrentBackdropWindow(
int argc,
char *argv[]) ;
extern int do_DtWsmOccupyAllWorkspaces(
int argc,
char *argv[]) ;
extern int do__DtGetHourGlassCursor(
int argc,
char *argv[]) ;
extern int do__DtTurnOnHourGlass(
int argc,
char *argv[]) ;
extern int do__DtTurnOffHourGlass(
int argc,
char *argv[]) ;
extern int do_DtWsmAddCurrentWorkspaceCallback(
int argc,
char **argv) ;
extern int do_DtWsmRemoveWorkspaceCallback(
int argc,
char **argv) ;
extern int do_DtDbLoad(
int argc,
char *argv[]) ;
extern int do_DtDbReloadNotify(
int argc,
char *argv[]) ;
extern int do_DtActionExists(
int argc,
char *argv[]) ;
extern int do_DtActionLabel(
int argc,
char *argv[]) ;
extern int do_DtActionDescription(
int argc,
char *argv[]) ;
extern int do_DtActionInvoke(
int argc,
char *argv[]) ;
extern int do_DtDtsLoadDataTypes(
int argc,
char *argv[] );
extern int do_DtDtsFileToDataType(
int argc,
char *argv[] );
extern int do_DtDtsFileToAttributeValue(
int argc,
char *argv[] );
extern int do_DtDtsFileToAttributeList(
int argc,
char *argv[] );
extern int do_DtDtsDataTypeToAttributeValue(
int argc,
char *argv[] );
extern int do_DtDtsDataTypeToAttributeList(
int argc,
char *argv[] );
extern int do_DtDtsFindAttribute(
int argc,
char *argv[] );
extern int do_DtDtsDataTypeNames(
int argc,
char *argv[] );
extern int do_DtDtsSetDataType(
int argc,
char *argv[] );
extern int do_DtDtsDataTypeIsAction(
int argc,
char *argv[] );
extern int do_ttdt_open(
int argc,
char *argv[] );
extern int do_ttdt_close(
int argc,
char *argv[] );
extern int do_tttk_Xt_input_handler(
int argc,
char *argv[] );
extern int do_ttdt_session_join(
int argc,
char *argv[] );
extern int do_ttdt_session_quit(
int argc,
char *argv[] );
extern int do_ttdt_file_event(
int argc,
char *argv[] );
extern int do_ttdt_file_join(
int argc,
char *argv[] );
extern int do_ttdt_file_quit(
int argc,
char *argv[] );
extern int do_ttdt_Get_Modified(
int argc,
char *argv[] );
extern int do_ttdt_Save(
int argc,
char *argv[] );
extern int do_ttdt_Revert(
int argc,
char *argv[] );
extern int do_tt_error_pointer(
int argc,
char *argv[] );
extern int do_tttk_message_destroy(
int argc,
char *argv[] );
extern int do_tt_message_reply(
int argc,
char *argv[] );
extern int do_tttk_message_reject(
int argc,
char *argv[] );
extern int do_tttk_message_fail(
int argc,
char *argv[] );
extern int do_tt_file_netfile(
int argc,
char *argv[] );
extern int do_tt_netfile_file(
int argc,
char *argv[] );
extern int do_tt_host_file_netfile(
int argc,
char *argv[] );
extern int do_tt_host_netfile_file(
int argc,
char *argv[] );
extern Namval_t * GetNameValuePair(
char *name) ;
extern void FreeNestedVariables( void ) ;
extern Namval_t * nopCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * dftCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * ehCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * transCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * scaleCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * arrowCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * comboCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * cmdCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * dAreaCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * dbtnCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * dtPrintSetupProcDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp);
extern Namval_t * fselCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * listCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * pbtnCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * rcCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * sbarCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * swinCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * sboxCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * tbtnCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * textCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * textCreateDisc2(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern Namval_t * helpCreateDisc(
Namval_t *np,
char *name,
int flags,
Namfun_t *fp) ;
extern int * LockKshFileDescriptors( void ) ;
extern void UnlockKshFileDescriptors(
int * fdList) ;
#endif /* _Dtksh_dtkcmds_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */
File diff suppressed because it is too large. Load diff
-195
View File
@@ -1,195 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: dtkcvt.h /main/5 1996/03/13 13:19:27 rswiston $ */
/************************************<+>*************************************
****************************************************************************
**
** File: dtkcvt.h
**
** Project: CDE
**
** Description: Public include file for dtkcvt.c
**
**
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992
** by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _Dtksh_dtkcvt_h
#define _Dtksh_dtkcvt_h
extern void DtkshCvtWindowToString(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtScreenToString(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtStringToScreen(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtStringToTopItemPosition(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtHexIntToString(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtIntToString(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtBooleanToString(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtStringToPointer(
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval) ;
extern void DtkshCvtStringToWidget(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToCallback(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtCallbackToString(
Display *display,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer converterData) ;
extern void DtkshCvtStringToPrintSetupProc(
Display *display,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data);
extern void DtkshCvtWidgetToString(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToEventMask(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToListItems(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToWidgetClass(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtWidgetClassToString(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToMWMDecoration(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtMWMDecorationToString(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToMWMFunctions(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtMWMFunctionsToString(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtStringToPanedWinPosIndex(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
extern void DtkshCvtPanedWinPosIndexToString(
Display *dpy,
XrmValuePtr args,
Cardinal *nargs,
XrmValuePtr fval,
XrmValuePtr toval,
XtPointer data) ;
#endif /* _Dtksh_dtkcvt_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */
-4
View File
@@ -1,4 +0,0 @@
env_get
env_set
handle_to_widget
ksh_eval
-159
View File
@@ -1,159 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: dtksh.h /main/4 1996/03/13 13:19:34 rswiston $ */
/* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
/* UNIX System Laboratories, Inc. */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ifndef _Dtksh_dtksh_h
#define _Dtksh_dtksh_h
#define SUCCESS 0
#define FAIL (-1)
/* bits for the flags field of wtab_t */
#define F_CHILD 1
#define F_TOPLEVEL 2
/*
* Table types
*/
#define TAB_EMPTY 0
#define TAB_FIELDS 1
#define TAB_ITEMS 2
#define TAB_WIDGET 3
/*
* Widget entry states
*/
#define DT_PENDING_DESTROY 0x01
typedef struct {
char *name;
char *class;
char *type;
int size;
} resfixup_t;
typedef struct {
char * callbackName;
void * discipline;
} discInfo;
typedef struct {
char *cname;
WidgetClass class; /* Class record */
resfixup_t *resfix; /* fixup list for resources */
resfixup_t *confix; /* fixup list for constraint resources */
discInfo * disciplines; /* Callback data environment disciplines */
char *res; /* Hashed list of resources */
char *con; /* Hashed list of constraint resources */
} classtab_t;
typedef struct wtab {
int type; /* entry type (TAB_) */
int size; /* entry size */
Widget w; /* widget pointer */
char *wname; /* name of widget */
char *widid; /* id of widget */
classtab_t *wclass; /* widget's class */
struct wtab *parent; /* pointer to widget's parent wtab_t */
char *envar; /* initial environment variable user gave */
unsigned char mask; /* keeps track of state; i.e. pending destroy */
XtPointer info; /* some widgets use this for any other info */
} wtab_t;
typedef struct {
char *ksh_cmd;
wtab_t *w;
char *cbname;
int refCount;
Atom propAtom;
XtPointer handle;
} dtksh_client_data_t;
typedef struct {
char *ksh_cmd;
wtab_t *w;
EventMask eventMask;
Boolean nonMaskable;
} dtksh_event_handler_data_t;
typedef struct {
char *name;
EventMask mask;
} EventMaskTable;
typedef struct {
char *name;
int value;
} MWMTable;
#define LINESIZE 1024
/* Input buffer modes */
#define LINE_INPUT_MODE (1<<0)
#define RAW_INPUT_MODE (1<<1)
#define INPUT_SOURCE_BUSY (1<<2)
#define INPUT_SOURCE_PENDING_DELETE (1<<3)
typedef struct {
int fd; /* the input source */
char *lnbuf; /* a line being built */
int lnbufsize; /* size of line buffer */
int lnend; /* current end of the line */
char *cmd; /* the ksh command to execute given the line */
unsigned char flags; /* mode flags */
char lastCharIsBackslash; /* Used during backslash processing */
char lineWasTouched; /* Empty line, but had a backslash */
} inputrec_t;
#ifndef CONSTCHAR
#define CONSTCHAR (const char *)
#endif
#define PRINTER_INFO_PROC 0
#define SELECT_FILE_PROC 1
#define SELECT_PRINTER_PROC 2
#define SETUP_PROC 3
#define VERIFY_PRINTER_PROC 4
typedef struct {
String printerInfoProcCommand;
String selectFileProcCommand;
String selectPrinterProcCommand;
String setupProcCommand;
String verifyPrinterProcCommand;
} ProcInfo_t;
void dtksh_init(void);
#endif /* _Dtksh_dtksh_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */
-539
View File
@@ -1,539 +0,0 @@
$ $XConsortium: dtksh.msg /main/3 1995/11/01 15:53:40 rswiston $
$set 1
1 DtkshCvtStringToPixel: The color '%s' is not defined
$set 5
1 Too many resource parameters have been specified; skipping '%s'
2 Bad resource specification; should be of the form 'name:value' : %s
3 The resource separator is ':' but you used '=' : %s
4 The toolkit has already been initialized
5 Usage: XtInitialize variable applicationName applicationClass [args ...]
6 Usage: %s variable name class parent [arg:val ...]
7 Usage: XtCreateApplicationShell variable name class [arg:val ...]
8 Usage: XtPopup widget GrabNone|GrabNonexclusive|GrabExclusive
9 The grab type '%s' is not recognized; using 'GrabNone'
10 Usage: XtIsShell widget
11 Usage: XtMapWidget widget
12 Usage: XtUnmapWidget widget
13 Usage: %s variable widget
14 Usage: XtScreen variable widget
15 Usage: XtWindow variable widget
16 Usage: XtCallCallbacks widget callbackName
17 Usage: XtHasCallbacks variable widget callbackName
18 Usage: XtAddCallback widget callbackName ksh-command
19 Usage: XtRemoveCallback widget callbackName ksh-command
20 The following is an invalid callback handle: %s
21 The specified callback is not registered
22 Usage: XtAddEventHandler widget mask nonMaskable ksh-command
23 Usage: XtRemoveEventHandler widget mask nonMaskable ksh-command
24 The specified event handler is not registered
25 Usage: XtGetValues widget resource:variable ...
26 The following resource parameter is incorrectly formed: %s
27 Usage: XtSetValues widget arg:val ...
28 Usage: XtAddWorkProc variable command
29 Usage: XtRemoveWorkProc workProcId
30 The workProcId parameter must be a hex number: %s
31 Usage: XtAddTimeOut variable milliseconds command
32 The milliseconds parameter must be greater than zero
33 Usage: XtRemoveTimeOut intervalId
34 The intervalId parameter must be a hex number: %s
35 Usage: %s widget ...
36 Usage: XBell display volume
37 Usage: %s variable screen
38 The screen parameter is invalid: %s
39 Usage: XDefineCursor display window cursorId
40 The cursorId parameter is invalid: %s
41 Usage: XUndefineCursor display window
42 Usage: XtRemoveAllCallbacks widget callbackName
43 Usage: XTextWidth variable fontName string
44 Usage: %s display drawable [args ...]
45 The drawable parameter is invalid: %s
46 The destination parameter is invalid: %s
47 Unrecognized graphics function name: %s
48 Unrecognized line style: %s
49 Unrecognized drawing option: %s
50 There were left over points which were ignored
51 Usage: XCopyArea display source dest sourceX sourceY width height destX destY [args ...]
52 Unable to convert resource type '%s' to 'String'
53 Unable to convert resource type 'String' to type '%s'
54 Usage: XtAddInput variable [-r] fileDescriptor kshCommand
56 Usage: XtRemoveInput inputId
57 The inputId parameter must be a hex number: %s
59 Usage: XFlush display
60 Usage: XSync display discard
61 Usage: XRaiseWindow display window
62 Usage: %s widget [True|False]
63 Usage: %s widget translations
64 Usage: XtUninstallTranslations widget
65 Usage: XtParent variable widget
66 Usage: XtLastTimestampProcessed variable display
67 Usage: DtSessionRestorePath widget pathVariable saveFile
68 Usage: DtSessionSavePath widget pathVariable fileVariable
69 Usage: DtShellIsIconified widget
70 Usage: DtSetStartupCommand widget command
71 Usage: DtSetIconifyHint widget boolean
73 The rootWindow parameter is invalid: %s
74 Usage: DtWsmSetCurrentWorkspace widget atom
75 The workspace atom is invalid: %s
78 Usage: DtWsmSetWorkspacesOccupied display window workspaceList
79 Usage: DtGetHourGlassCursor variable display
80 Usage: DtWsmAddCurrentWorkspaceCallback variable widget ksh-command
81 Usage: DtWsmRemoveWorkspaceCallback handle
82 Usage: XtNameToWidget variable referenceWidget names
83 Usage: DtDbLoad
84 Usage: DtDbReloadNotify ksh-command
85 Usage: DtActionExists actionName
86 Usage: DtActionLabel variable actionName
87 Usage: DtActionDescription variable actionName
88 Usage: DtActionInvoke widget actionName termParms execHost contextDir useIndicator ksh-command ["FILE" fileName] ...
89 Usage: DtDtsLoadDataTypes
90 Usage: DtDtsFileToDataType variable fileName
91 Usage: DtDtsFileToAttributeValue variable fileName attrName
92 Usage: DtDtsFileToAttributeList variable fileName
93 Usage: DtDtsDataTypeToAttributeValue variable dataType attrName optName
94 Usage: DtDtsDataTypeToAttributeList variable dataType optName
95 Usage: DtDtsFindAttribute variable name value
96 Usage: DtDtsDataTypeNames variable
97 Usage: DtDtsSetDataType variable fileName dataType override
98 Usage: DtDtsDataTypeIsAction dataType
99 Usage: ttdt_open variable status variable2 toolname vendor version sendStarted
100 Usage: tttk_Xt_input_handler procId source id
101 The source parameter must be an integer: %s
102 The id parameter must be a hex number: %s
103 Usage: ttdt_close status procId newProcId sendStopped
104 Usage: ttdt_session_join variable status sessId shellWidgetHandle join
105 Usage: ttdt_session_quit status sessId sessPatterns quit
106 The sessPatterns parameter is invalid: %s
107 Usage: ttdt_file_event status op patterns send
108 Usage: ttdt_file_quit status patterns quit
109 Usage: ttdt_Get_Modified pathName scope timeout
110 Usage: %s status pathName scope timeout
112 Usage: tt_error_pointer variable ttStatus
113 Usage: %s status msg
114 Usage: %s status msg msgStatus msgStatusString destroy
115 Usage: ttdt_file_join variable status pathName scope join ksh-command
116 Usage: tt_file_netfile variable status filename
117 Usage: tt_netfile_file variable status netfilename
118 Usage: tt_host_file_netfile variable status host filename
119 Usage: tt_host_netfile_file variable status host netfilename
120 Usage: XtIsSubclass widget class
121 %s is not a valid widget class name
122 Usage: XtClass variable widget
$set 6
1 DtkshCvtWindowToString: The 'from' value is an invalid size
2 DtkshCvtHexIntToString: The 'from' value is an invalid size
3 DtkshCvtIntToString: The 'from' value is an invalid size
4 DtkshCvtBooleanToString: The 'from' value is an invalid size
5 DtkshCvtStringToWidget: The 'from' value is an invalid size
6 DtkshCvtStringToWidget: Unable to find a widget named '%s'
7 DtkshCvtStringToCallback: The 'from' value is an invalid size
8 DtkshCvtCallbackToString: The 'from' value is an invalid size
9 DtkshCvtWidgetToString: The 'from' value is an invalid size
10 DtkshCvtWidgetToString: Unable to find a name for the widget
11 DtkshCvtWidgetClassToString: The 'from' value is an invalid size
12 DtkshCvtWidgetClassToString: Unknown widget class
13 DtkshCvtStringToWidgetClass: Unknown widget class name
14 DtkshCvtScreenToString: The 'from' value is an invalid size
$set 11
1 Cannot find a field named '%s' in the structure '%s'
2 DtkshCvtCallbackToString: An internal conversion buffer overflowed
3 Hashing failure for resource '%s' in widget class '%s'
4 No function name was supplied
5 The command cannot be executed; the toolkit has not been initialized
6 The creation of widget '%s' failed
7 The display parameter is invalid: %s
8 The following property atom is invalid: %s
9 The following resource is not defined for widget '%s': %s
10 The position specified is invalid: %s
11 The specified font is invalid: %s
12 The widget handle '%s' does not refer to an existing widget
13 The widget must be a 'command' widget
14 The widget must be a 'mainWindow' widget
15 The widget must be a 'scale' widget
16 The widget must be a 'scrollBar' widget
17 The widget must be a 'toggleButton' widget or gadget
18 The window parameter is invalid: %s
19 Unable to allocate required memory; exiting
20 Unable to find the parent widget
21 Unable to locate the symbol '%s'
22 Unable to locate the type '%s'
23 Unable to parse the declaration '%s'; using 'unsigned long'
24 Unknown child type: %s
25 Unrecognized option flag: %s
26 Usage: %s widget position
27 Usage: %s widget time
28 Usage: %s widget
29 dtksh error
30 dtksh warning
31 Usage: %s display window
32 Usage: %s display window variable
33 Usage: %s display rootWindow variable
34 The timeout parameter is invalid: %s
35 The msg parameter is invalid: %s
36 The patterns parameter is invalid: %s
$set 14
1 Internal hash table failure during widget class initialization; exiting
2 Could not find a widget class named '%s'
3 The identifier '%s' is not a valid widget handle
4 Unable to find the widget class
5 Usage: DtLoadWidget widgetClassName widgetClassRecordName
6 Unable to locate a widget class record named '%s'
7 Internal hash table failure during initialization of widget class '%s'
8 \n%sRESOURCES FOR %s%s%s:\n
9 CONSTRAINT
10 R
11 M
12 S
13 %-15s %-6s %-6s %-18s %-6s %s\n
14 ENV VARIABLE HANDLE PARENT CLASS STATUS NAME\n
15 \nUsage:\tDtWidgetInfo [widgetHandle]\n\tDtWidgetInfo -r <widgetHandle|className>\n\tDtWidgetInfo -R <widgetHandle|className>\n\tDtWidgetInfo -c [className]\n\tDtWidgetInfo -h [widgetHandle]
$set 15
1 Unable to initialize the Toolkit
2 The following resource cannot be set at widget\ncreation time. Use XtSetValues after creation instead: %s
3 Usage: %s variable parent name [argument:value ...]
4 Usage: DtHelpReturnSelectedWidgetId variable widget variable
5 Usage: DtHelpSetCatalogName catalogName
6 Usage: DtHelpQuickDialogGetChild variable quickHelpWidget child
7 The widget must be a 'quickHelp' widget
8 The widget must be a 'list' widget
9 Usage: %s widget position item
10 Usage: %s widget position itemList
11 Usage: %s widget item
12 Usage: XmListDeleteItemsPos widget count position
13 Usage: XmListDeleteItems widget itemList
14 Usage: XmListDeletePositions widget positionList
15 Usage: XmListGetKbdItemPos variable widget
16 Usage: XmListItemExists widget item
17 Usage: XmListItemPos variable widget item
18 Usage: XmListPosSelected widget position
19 Usage: XmListPosToBounds widget position variable variable variable variable
20 Usage: %s widget position notifyFlag
21 Usage: %s widget item notifyFlag
22 Usage: XmListSetAddMode widget boolean
23 Usage: XmListSetKbdItemPos widget position
24 Usage: XmMainWindowSetAreas mainwindow menu command hscroll vscroll work
25 The 'mainWindow' handle is NULL
26 Usage: %s variable mainwindow
27 Usage: XmProcessTraversal widget direction
28 Unknown traversal direction: %s
29 Usage: XmInternAtom variable display name onlyIfExists
30 Usage: XmGetAtomName variable display atom
31 The specified atom is invalid: %s
32 Usage: XmGetColors widget background foreground topshadow bottomshadow select
33 The background pixel is invalid: %s
34 Usage: XmUpdateDisplay widget
35 Usage: %s widget protocol [protocol ...]
36 The atom specified is invalid: %s
37 Usage: XmAddWMProtocolCallback widget protocol ksh-command
38 Usage: XmRemoveWMProtocolCallback widget protocol ksh-command
39 Usage: XmMenuPosition menu event
40 The specified event is invalid: %s
41 Usage: XmCommandAppendValue commandWidget string
42 Usage: XmCommandError commandWidget errorMessage
43 Usage: XmCommandSetValue commandWidget command
44 Usage: XmCommandGetChild variable commandWidget child
45 Usage: XmMessageBoxGetChild variable commandWidget child
46 The widget must be a 'messageBox' widget
47 Usage: XmFileSelectionBoxGetChild variable widget child
48 The widget must be a 'file selection box' widget
49 Usage: XmSelectionBoxGetChild variable widget child
50 The widget must be a 'selection box' widget
51 Usage: XmScaleGetValue scaleWidget variable
52 Usage: XmScaleSetValue scaleWidget value
53 The scale value specified is invalid: %s
54 Usage: XmScrollBarGetValues scrollbar variable variable variable variable
55 Usage: XmScrollBarSetValues scrollbar value sliderSize increment pageIncrement notify
56 The value specified is invalid: %s
57 The slider size specified is invalid: %s
58 The increment specified is invalid: %s
59 The page increment specified is invalid: %s
60 Usage: XmScrollVisible scrolledWin widget leftRightMargin topBottomMargin
61 The widget must be a 'scrolledWindow' widget
62 The widget to be made visible does not exist.
63 The left/right margin specified is invalid: %s
64 The top/bottom margin specified is invalid: %s
65 Usage: %s widget state notify
66 Usage: catopen variable catName
67 Usage: catclose catId
68 Usage: catgets variable catId setNum msgNum dftMsg
69 The widget must be a 'text' or 'textField' widget
70 Usage: %s variable widget
71 Usage: %s widget boolean
72 The parameter specified is invalid: %s
73 Usage: %s widget lines
74 Usage: %s widget maxLength
75 Usage: %s widget string
76 Usage: %s widget variable variable
77 Usage: %s widget position string
78 Usage: %s widget position variable variable
79 Usage: %s widget fromPosition toPosition string
80 The 'from' position specified is invalid: %s
81 The 'to' position specified is invalid: %s
82 Usage: %s widget firstPosition lastPosition time
83 The first position specified is invalid: %s
84 The last position specified is invalid: %s
85 The time specified is invalid: %s
86 Usage: %s variable widget x y
87 The x position specified is invalid: %s
88 The y position specified is invalid: %s
89 Usage: %s widget left right mode
90 The left position specified is invalid: %s
91 The right position specified is invalid: %s
92 Usage: %s widget start string direction variable
93 The start position specified is invalid: %s
94 Usage: XmListGetSelectedPos variable widget
95 Usage: XmListGetMatchPos variable widget item
96 Usage: XmOptionLabelGadget variable widget
97 Usage: XmOptionButtonGadget variable widget
98 Usage: XmGetVisibility variable widget
99 Usage: XmGetTearOffControl variable widget
100 Usage: XmGetTabGroup variable widget
101 Usage: XmGetPostedFromWidget variable widget
102 Usage: XmGetFocusWidget variable widget
103 Usage: XmFileSelectionDoSearch widget directoryMask
$set 16
1 DtkshCvtNamedValueToString: No match found
2 DtkshCvtStringToNamedValue: Unable to convert the string '%s'
$ The following messages are for ksh93 itself. The message numbers must
$ match those specified in the MsgStr array allmsgs in
$ ksh93/src/cmd/ksh93/sh/init.c, as must the set number.
$set 25
1 Done
3 Running
4 [-n] [arg...]
5 [arg...]
6 [dir] [list]
7 [job...]
8 [n]
9 [name [pathname] ]
10 [name]
11 [top] [base]
12 expr...
13 format [arg...]
14 is a function
15 is a keyword
16 is a shell builtin
17 is an exported function
18 is an undefined function
19 name [arg...]
20 :a:[name] optstring name [args...]
21 seconds
23 ${HOME:-.}/.profile
24 %c: invalid character in expression - %s
25 %c: unknown format specifier
26 %d-%d: invalid range
27 %d: invalid binary script version
28 %s is an alias for
29 %s is an exported alias for
30 %s missing
31 %s unknown base
32 %s: ':' expected for '?' operator
33 %s: Ambiguous
34 %s: Arguments must be %job or process ids
35 %s: alias not found\n
36 %s: arithmetic syntax error
37 %s: assignment requires lvalue
38 %s: bad file unit number
39 %s: bad format
40 %s: bad number
41 %s: bad option(s)
42 %s: bad substitution
43 %s: bad trap
44 %s: cannot create
45 %s: cannot execute
46 %s: cannot open
47 %s: divide by zero
48 %s: domain exception
49 %s: fails %s
50 %s: file already exists
51 %s: illegal function name
52 %s: invalid alias name
53 %s: invalid discipline function
54 %s: invalid export name
55 %s: invalid function name
56 %s: invalid name
57 %s: invalid regular expression
58 %s: invalid self reference
59 %s: invalid use of :
60 %s: invalid variable name
61 %s: is not an identifier
62 %s: is read only
63 %s: label not implemented
64 %s: limit exceeded
65 %s: more tokens expected
66 %s: no parent
67 %s: no reference name
68 %s: not found
69 %s: not implemented
70 %s: operands have incompatible types
71 %s: overflow exception
72 %s: parameter not set
73 %s: parameter null or not set
74 %s: recursion too deep
75 %s: reference variable cannot be an array
76 %s: requires pathname argument
77 %s: restricted
78 %s: singularity exception
79 %s: subscript out of range
80 %s: unbalanced parenthesis
81 %s: unknown function
82 %s: unknown locale
83 %s: unknown operator
84 %s: unknown signal name
85 %s: would cause loop
86 (coredump)
87 -c requires argument
88 -e - requires single argument
89 /vpix
90 <command unknown>
91 AC:E#?F#?H:[name]L#?R#?Z#?fi#?[base]lnprtux [name=[value]...]
92 AE#?F#?HL#?R#?Z#?fi#?[base]lnprtux [name=[value]...]
93 Abort
94 Ad:[delim]prst#[timeout]u#[filenum] [name...]
95 Alarm call
96 Bad root node specification
97 Bad system call
98 Broken Pipe
99 Bus error
100 Cannot start job control
101 Current option settings
102 DIL signal
103 Death of Child
104 DircabefhkmnpstuvxCR:[file]o:?[option] [arg...]
105 DircabefhkmnpstuvxCo:?[option] [arg...]
106 EMT trap
107 Exceeded CPU time limit
108 Exceeded file size limit
109 Floating exception
110 HSacdfmnstv [limit]
111 Hangup
112 IO signal
113 Illegal instruction
114 Interrupt
115 Killed
116 LP [dir] [change]
117 Memory fault
118 Migrate process
119 No job control
120 Phone interrupt
121 Polling alarm
122 Power fail
123 Profiling time alarm
124 Quit
125 Resources lost
126 Reverting to old tty driver...
127 S [mask]
129 Security label changed
130 Socket interrupt
131 Sound completed
132 Stopped (signal)
133 Stopped (tty input)
134 Stopped process continued
135 Stopped
136 Stopped(tty output)
137 Switching to new tty driver...
138 System crash soon
139 Terminated
140 Trace/BPT trap
141 Unrecognized version
142 Use 'exit' to terminate this shell
143 User signal 1
144 User signal 2
145 Version not defined
146 Virtual time alarm
147 Window size change
148 You have running jobs
149 You have stopped jobs
150 [_[:alpha:]]*([_[:alnum:]])
151 \n@(#)Version 12/28/93\0\n
152 \n@(#)Version M-12/28/93\0\n
153 \nreal
154 \r\n\007shell will timeout in 60 seconds due to inactivity
155 a name...
156 a:[name]c [command [args...] ]
157 afpv name...
158 alarm %s %.3f\n
159 alarm -r %s +%.3g\n
160 argument expected
161 bad directory
162 bad file unit number
163 bad substitution
164 cannot access parent directories
165 cannot create pipe
166 cannot create tempory file
167 cannot fork
168 cannot get %s
169 cannot set %s
170 cannot set alarm
171 condition(s) required
172 dsf:[library] [name...]
173 e:[editor]lnrsN# [first] [last]
174 end of file
175 f:[format]enprsu:[filenum] [arg...]
176 fnv name...
177 hist -e "${VISUAL:-${EDITOR:-vi}}"
178 history file cannot open
179 incorrect syntax
180 invalid argument of type %c
181 is a shell builtin version of
182 is a tracked alias for
183 kill
184 line %d: $ not preceded by \\
185 line %d: %c within ${} should be quoted
186 line %d: %s unknown label
187 line %d: %s within [[...]] obsolete, use ((...))
188 line %d: '=' obsolete, use '=='
189 line %d: -a obsolete, use -e
190 line %d: \\ in front of %c reserved for future use
191 line %d: `...` obsolete, use $(...)
192 line %d: escape %c to avoid ambiguities
193 line %d: label %s ignored
194 line %d: quote %c to avoid ambiguities
195 line %d: set %s obsolete
196 line %d: spaces required for nested subshell
197 line %d: use braces to avoid ambiguities with $id[...]
198 line %d: use space or tab to separate operators %c and %c
199 ln#[signum]s:[signame] sig...
200 login setuid/setgid shells prohibited
201 mapping
202 newline
203 nlp [job...]
204 no history file
205 no query process
206 no such job
207 no such process
208 not supported
209 off
210 on
211 open file limit exceeded
212 out of memory
213 p [action condition...]
214 p [name[=value]...]
215 parameter not set
216 permission denied
217 process already exists
218 ptx [name=[value]...]
219 pvV name [arg]...
220 r [varname seconds]
221 syntax error at line %d: `%s' %s
222 syntax error at line %d: duplicate label %s
223 syntax error: `%s' %s
224 sys
225 timed out waiting for input
226 unexpected
227 universe not accessible
228 unlimited
229 unmatched
230 user
231 versions
232 write to %d failed
233 you have mail in $_
234 zero byte
-143
View File
@@ -1,143 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: CallDataTest4.src /main/3 1996/04/23 20:17:51 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how the CB_WIDGET and CB_CALL_DATA
XCOMM convenience environment variables can be referenced within a callback
XCOMM function.
XCOMM
XCOMM PushButton Callback: Forces the scale to reset to the origin
ResetScale()
{
XmScaleSetValue $SCALE 0
}
XCOMM PushButton Callback: Forces the scale to its minimum value
SetScaleMin()
{
XmScaleSetValue $SCALE -200
}
XCOMM PushButton Callback: Forces the scale to its maximum value
SetScaleMax()
{
XmScaleSetValue $SCALE 200
echo "CB Widget = "$CB_WIDGET
echo "CallData = "$CB_CALL_DATA
echo "CallData.Reason = "${CB_CALL_DATA.REASON}
echo "CallData.Event = "${CB_CALL_DATA.EVENT}
echo "CallData.Event.Type = "${CB_CALL_DATA.EVENT.TYPE}
echo "CallData.Event.Xbutton.Type = "${CB_CALL_DATA.EVENT.XBUTTON.TYPE}
echo "CallData.Event.Xbutton.Serial = "${CB_CALL_DATA.EVENT.XBUTTON.SERIAL}
echo "CallData.Event.Xbutton.Send_Event = "${CB_CALL_DATA.EVENT.XBUTTON.SEND_EVENT}
echo "CallData.Event.Xbutton.Display = "${CB_CALL_DATA.EVENT.XBUTTON.DISPLAY}
echo "CallData.Event.Xbutton.Window = "${CB_CALL_DATA.EVENT.XBUTTON.WINDOW}
echo "CallData.Event.Xbutton.Root = "${CB_CALL_DATA.EVENT.XBUTTON.ROOT}
echo "CallData.Event.Xbutton.Subwindow = "${CB_CALL_DATA.EVENT.XBUTTON.SUBWINDOW}
echo "CallData.Event.Xbutton.Time = "${CB_CALL_DATA.EVENT.XBUTTON.TIME}
echo "CallData.Event.Xbutton.X = "${CB_CALL_DATA.EVENT.XBUTTON.X}
echo "CallData.Event.Xbutton.Y = "${CB_CALL_DATA.EVENT.XBUTTON.Y}
echo "CallData.Event.Xbutton.X_root = "${CB_CALL_DATA.EVENT.XBUTTON.X_ROOT}
echo "CallData.Event.Xbutton.Y_root = "${CB_CALL_DATA.EVENT.XBUTTON.Y_ROOT}
echo "CallData.Event.Xbutton.State = "${CB_CALL_DATA.EVENT.XBUTTON.STATE}
echo "CallData.Event.Xbutton.Button = "${CB_CALL_DATA.EVENT.XBUTTON.BUTTON}
echo "CallData.Event.Xbutton.Same_Screen = "${CB_CALL_DATA.EVENT.XBUTTON.SAME_SCREEN}
echo
}
XCOMM Scale Callback: Invoked when the user interactively modified the scale value
ScaleValueChanged()
{
XmScaleGetValue $CB_WIDGET VALUE
echo "New Scale Value = "$VALUE
echo "CB Widget = "$CB_WIDGET
echo "CallData = "$CB_CALL_DATA
echo "CallData.Value = "${CB_CALL_DATA.VALUE}
echo "CallData.Event = "${CB_CALL_DATA.EVENT}
echo "CallData.Event.Xany.Type = "${CB_CALL_DATA.EVENT.XANY.TYPE}
echo "CallData.Event.Type = "${CB_CALL_DATA.EVENT.TYPE}
echo "CallData.Reason = "${CB_CALL_DATA.REASON}
echo
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL command1 Command1 "$0" "$@"
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
XtCreateManagedWidget SCALE scale XmScale $FORM \
showValue:True \
orientation:HORIZONTAL \
maximum:200 \
minimum:-200 \
topAttachment:ATTACH_FORM \
topOffset:10 \
leftAttachment:ATTACH_FORM \
leftOffset:10 \
rightAttachment:ATTACH_FORM \
rightOffset:10
XtAddCallback $SCALE valueChangedCallback ScaleValueChanged
XtCreateManagedWidget SEP sep XmSeparator $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$SCALE \
topOffset:10 \
leftAttachment:ATTACH_FORM \
rightAttachment:ATTACH_FORM
XtCreateManagedWidget PB pb XmPushButton $FORM \
labelString:"Reset Scale" \
topAttachment:ATTACH_WIDGET \
topOffset:10 \
topWidget:$SEP \
bottomAttachment:ATTACH_FORM \
bottomOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:30
XtAddCallback $PB activateCallback ResetScale
XtCreateManagedWidget PB2 pb XmPushButton $FORM \
labelString:"Set Scale Max" \
topAttachment:ATTACH_WIDGET \
topOffset:10 \
topWidget:$SEP \
bottomAttachment:ATTACH_FORM \
bottomOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:40 \
rightAttachment:ATTACH_POSITION \
rightPosition:60
XtAddCallback $PB2 activateCallback SetScaleMax
XtCreateManagedWidget PB3 pb XmPushButton $FORM \
labelString:"Set Scale Min" \
topAttachment:ATTACH_WIDGET \
topOffset:10 \
topWidget:$SEP \
bottomAttachment:ATTACH_FORM \
bottomOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:70 \
rightAttachment:ATTACH_POSITION \
rightPosition:90
XtAddCallback $PB3 activateCallback SetScaleMin
XtRealizeWidget $TOPLEVEL
XtMainLoop
-89
View File
@@ -1,89 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: CallbackTest2.src /main/3 1996/04/23 20:17:57 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how widget callbacks can be
XCOMM added and removed. It adds callbacks both using XtAddCallback and
XCOMM by specifying a callback as a resource, when the test pushbutton
XCOMM is created.
XCOMM
XCOMM The activate callback which can be dynamically added and removed
ActivateCallback1()
{
echo "activateCallback1 invoked"
}
XCOMM The activate callback which is added when the widget was created
ActivateCallback2()
{
echo "activateCallback2 invoked"
}
XCOMM Pushbutton Callback: Adds an activate callback to the test pushbutton
AddCallback1()
{
XtAddCallback $TESTPB activateCallback ActivateCallback1
XtGetValues $TESTPB activateCallback:AC
echo "Callback list = "$AC
}
XCOMM Pushbutton Callback: Removes an activate callback from the test pushbutton
DeleteCallback1()
{
XtRemoveCallback $TESTPB activateCallback ActivateCallback1
XtGetValues $TESTPB activateCallback:AC2
echo "Callback list = "$AC2
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL callbackTest CallbackTest "$0" "$@"
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
XtCreateManagedWidget PB1 pb XmPushButton $FORM \
labelString:"Add Callback1" \
topAttachment:ATTACH_FORM \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:40 \
activateCallback:AddCallback1
XtCreateManagedWidget PB2 pb2 XmPushButton $FORM \
labelString:"Delete Callback1" \
topAttachment:ATTACH_FORM \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:60 \
rightAttachment:ATTACH_POSITION \
rightPosition:90 \
activateCallback:DeleteCallback1
XtCreateManagedWidget TESTPB testpb XmPushButton $FORM \
labelString:"Test Button" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB2 \
topOffset:20 \
leftAttachment:ATTACH_POSITION \
leftPosition:20 \
rightAttachment:ATTACH_POSITION \
rightPosition:80 \
bottomAttachment:ATTACH_FORM \
bottomOffset:10 \
activateCallback:ActivateCallback2
XtRealizeWidget $TOPLEVEL
XtMainLoop
-59
View File
@@ -1,59 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: DtCursorTest2.src /main/3 1996/04/23 20:18:02 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how a cursor can be defined or
XCOMM undefined for an X window.
XCOMM
XCOMM Pushbutton Callback: set the busy cursor for the toplevel window
DefineCursor()
{
XDefineCursor $(XtDisplay "-" $TOPLEVEL) $(XtWindow "-" $TOPLEVEL) $CURSOR
}
XCOMM Pushbutton Callback: remove the busy cursor from the toplevel window
UndefineCursor()
{
XUndefineCursor $(XtDisplay "-" $TOPLEVEL) $(XtWindow "-" $TOPLEVEL)
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL dtCursorTest2 DtCursorTest2 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XtCreateManagedWidget DA da XmDrawingArea $TOPLEVEL
XtSetValues $DA height:200 width:200
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 dtCursorTest2a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Define Cursor"
XtAddCallback $PB1 activateCallback "DefineCursor"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Undefine Cursor"
XtAddCallback $PB2 activateCallback "UndefineCursor"
_DtGetHourGlassCursor CURSOR $(XtDisplay "-" $TOPLEVEL)
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-155
View File
@@ -1,155 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: DtWsTest1.src /main/3 1996/04/23 20:18:06 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how to interact with the workspace
XCOMM manager. It demonstrates the following capabilities:
XCOMM
XCOMM 1) How to query which workspaces the widgets currently reside it.
XCOMM 2) How to set the current workspace.
XCOMM 3) How to be notified when the current workspace changes.
XCOMM
integer wsCount
XCOMM Pushbutton Callback: This function asks the workspace manager to change
XCOMM to the workspace indicated by $1; $1 is an X atom
XCOMM which identifies the new workspace. At some point
XCOMM after our request to the workspace manager, the
XCOMM workspace manager will activate our WsCB function,
XCOMM letting us know that the change has actually taken
XCOMM place.
SetWorkspace()
{
echo
if DtWsmSetCurrentWorkspace $TOPLEVEL $1; then
echo "Changing to new workspace"
else
XmGetAtomName NAME $(XtDisplay "-" $TOPLEVEL) $1
echo "Unable to Change to workspace " $NAME
fi
}
XCOMM Workspace Changed Callback: This function is invoked whenever the workspace
XCOMM manager changes workspaces. It will simply
XCOMM query the 'name' of the new workspace, and
XCOMM echo it outl
WsCB()
{
DtWsmGetCurrentWorkspace $(XtDisplay "-" $TOPLEVEL) \
$(XRootWindowOfScreen "-" $(XtScreen "-" $TOPLEVEL)) \
NEW_ATOM
XmGetAtomName NAME $(XtDisplay "-" $TOPLEVEL) $NEW_ATOM
echo "Change to workspace complete " $NAME "("$NEW_ATOM")"
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL dtWsTest DtWsTest "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XtCreateManagedWidget DA da XmDrawingArea $TOPLEVEL
XtSetValues $DA height:200 width:200
XtRealizeWidget $TOPLEVEL
XSync $(XtDisplay "-" $TOPLEVEL) False
XtCreateApplicationShell TOPLEVEL2 DtWsTesta TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
packing:PACK_COLUMN
XCOMM Get a list of all of the workspaces, and create a pushbutton for each one.
XCOMM When a pushbutton is activated, it will ask the workspace manager to
XCOMM change to the indicated workspace.
oldIF=$IFS
if DtWsmGetWorkspaceList $(XtDisplay "-" $TOPLEVEL) \
$(XRootWindowOfScreen "-" $(XtScreen "-" $TOPLEVEL)) \
WS_LIST;
then
IFS=,
wsCount=0
for item in $WS_LIST;
do
XmGetAtomName NAME $(XtDisplay "-" $TOPLEVEL) $item
label="Set Current Workspace to "$NAME
XtCreateManagedWidget ITEM $item XmPushButton $RC \
labelString:$label
XtAddCallback $ITEM activateCallback "SetWorkspace $item"
wsCount=$wsCount+1
done
IFS=$oldIFS
else
echo "Unable to get workspace list"
exit -1
fi
XtSetValues $RC numColumns:$wsCount
XtRealizeWidget $TOPLEVEL2
XSync $(XtDisplay "-" $TOPLEVEL) False
XCOMM The following block queries the initial set of workspaces occupied by
XCOMM this shell script; this list is printed out. Next, it will ask the
XCOMM workspace manager to move the shell script windows into all workspaces.
XCOMM Lastly, it will again ask the workspace manager for the list of
XCOMM workspaces occupied by the shell script windows, and will again print
XCOMM out the list.
if DtWsmGetWorkspacesOccupied $(XtDisplay "-" $TOPLEVEL) \
$(XtWindow "-" $TOPLEVEL) \
CURRENT_WS_LIST ;
then
echo "Initial workspaces occupied:"
for item in $CURRENT_WS_LIST;
do
XmGetAtomName NAME $(XtDisplay "-" $TOPLEVEL) $item
echo " "$NAME
done
DtWsmGetWorkspaceList $(XtDisplay "-" $TOPLEVEL) \
$(XRootWindowOfScreen "-" $(XtScreen "-" $TOPLEVEL)) \
WS_LIST
DtWsmSetWorkspacesOccupied $(XtDisplay "-" $TOPLEVEL) \
$(XtWindow "-" $TOPLEVEL) \
$WS_LIST
DtWsmSetWorkspacesOccupied $(XtDisplay "-" $TOPLEVEL2) \
$(XtWindow "-" $TOPLEVEL2) \
$WS_LIST
else
echo "Unable to get current list of occupied workspaces"
echo -2
fi
XSync $(XtDisplay "-" $TOPLEVEL) False
XCOMM Print the new list of workspaces occupied
DtWsmGetWorkspacesOccupied $(XtDisplay "-" $TOPLEVEL) \
$(XtWindow "-" $TOPLEVEL) \
CURRENT_WS_LIST
echo "After modification, workspaces occupied:"
IFS=,
for item in $CURRENT_WS_LIST;
do
XmGetAtomName NAME $(XtDisplay "-" $TOPLEVEL) $item
echo " "$NAME
done
IFS=$oldIFS
echo ""
XCOMM Add a callback to be notified whenever the workspace changes.
DtWsmAddCurrentWorkspaceCallback HANDLE1 $TOPLEVEL WsCB
XtMainLoop
@@ -1,215 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: EventHandlerTest.src /main/3 1996/04/23 20:18:10 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how event handlers can be added
XCOMM and removed. It also demonstrates how the EH_WIDGET and EH_EVENT
XCOMM convenience environment variables can be referenced.
XCOMM
EventHandler1()
{
echo "EH_WIDGET ="$EH_WIDGET
echo "EH_EVENT ="$EH_EVENT
echo "EH_EVENT.TYPE ="${EH_EVENT.TYPE}
echo "event handler 1 invoked ("$1")"
}
EventHandler2()
{
echo "EH_WIDGET ="$EH_WIDGET
echo "EH_EVENT ="$EH_EVENT
echo "EH_EVENT.TYPE ="${EH_EVENT.TYPE}
echo "event handler 1 invoked ("$1")"
}
XCOMM PushbuttonCallback: Adds an event handler to the form widget
AddMaskableEventHandler1()
{
XtAddEventHandler $FORM2 "Button2MotionMask" False \
"EventHandler1 1"
}
XCOMM PushbuttonCallback: Adds an event handler to the form widget
AddMaskableEventHandler2()
{
XtAddEventHandler $FORM2 "ButtonPressMask|ButtonReleaseMask" False \
"EventHandler1 1"
}
XCOMM PushbuttonCallback: Adds an event handler to the form widget
AddMaskableEventHandler3()
{
XtAddEventHandler $FORM2 "Button2MotionMask" False \
"EventHandler1 2"
}
XCOMM PushbuttonCallback: Adds an event handler to the form widget
AddNonmaskableEventHandler()
{
XtAddEventHandler $FORM2 "NoEventMask" True "EventHandler2 1"
}
XCOMM PushbuttonCallback: Adds an event handler to the form widget.
XCOMM Should report a bad event mask.
AddBadEventHandler()
{
XtAddEventHandler $FORM2 "fooMask" False "EventHandler2 1"
}
XCOMM PushbuttonCallback: Removes an event handler to the form widget
RemoveEventHandler1()
{
XtRemoveEventHandler $FORM2 "Button2MotionMask" False \
"EventHandler1 1"
}
XCOMM PushbuttonCallback: Removes an event handler to the form widget
RemoveEventHandler2()
{
XtRemoveEventHandler $FORM2 "ButtonPressMask|ButtonReleaseMask" False \
"EventHandler1 1"
}
XCOMM PushbuttonCallback: Removes an event handler to the form widget
RemoveEventHandler1and2()
{
XtRemoveEventHandler $FORM2 "XtAllEvents" True "EventHandler1 1"
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL eventHandlerTest EventHandlerTest "$0" "$@"
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
XtCreateManagedWidget FORM2 form2 XmForm $FORM \
topAttachment:ATTACH_FORM \
leftAttachment:ATTACH_FORM \
rightAttachment:ATTACH_FORM
XtSetValues $FORM2 height:150 width:150
XtCreateManagedWidget SEP sep XmSeparator $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$FORM2 \
leftAttachment:ATTACH_FORM \
rightAttachment:ATTACH_FORM
XtCreateManagedWidget PB1 pb XmPushButton $FORM \
labelString:"Add Maskable Event Handler 1" \
topAttachment:ATTACH_WIDGET \
topWidget:$SEP \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:40
XtAddCallback $PB1 activateCallback AddMaskableEventHandler1
XtCreateManagedWidget PB2 pb2 XmPushButton $FORM \
labelString:"Add Maskable Event Handler 2" \
topAttachment:ATTACH_WIDGET \
topWidget:$SEP \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:60 \
rightAttachment:ATTACH_POSITION \
rightPosition:90
XtAddCallback $PB2 activateCallback AddMaskableEventHandler2
XtCreateManagedWidget PB3 pb3 XmPushButton $FORM \
labelString:"Add Maskable Event Handler 3" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB2 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:40
XtAddCallback $PB3 activateCallback AddMaskableEventHandler3
XtCreateManagedWidget PB4 pb4 XmPushButton $FORM \
labelString:"Add Maskable Event Handler 4" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB2 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:60 \
rightAttachment:ATTACH_POSITION \
rightPosition:90
XtAddCallback $PB4 activateCallback AddMaskableEventHandler4
XtSetSensitive $PB4 False
XtCreateManagedWidget PB5 pb5 XmPushButton $FORM \
labelString:"Add non-maskable Event Handler" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB4 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:40
XtAddCallback $PB5 activateCallback AddNonmaskableEventHandler
XtCreateManagedWidget PB6 pb6 XmPushButton $FORM \
labelString:"Add Bad Event Handler" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB4 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:60 \
rightAttachment:ATTACH_POSITION \
rightPosition:90
XtAddCallback $PB6 activateCallback AddBadEventHandler
XtCreateManagedWidget PB7 pb7 XmPushButton $FORM \
labelString:"Remove Maskable Event Handler 1" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB6 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:40
XtAddCallback $PB7 activateCallback RemoveEventHandler1
XtCreateManagedWidget PB8 pb8 XmPushButton $FORM \
labelString:"Remove Maskable Event Handler 2" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB6 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:60 \
rightAttachment:ATTACH_POSITION \
rightPosition:90
XtAddCallback $PB8 activateCallback RemoveEventHandler2
XtCreateManagedWidget PB9 pb9 XmPushButton $FORM \
labelString:"Remove Maskable Event Handler 1 and 2" \
topAttachment:ATTACH_WIDGET \
topWidget:$PB8 \
topOffset:10 \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:40 \
bottomAttachment:ATTACH_FORM \
bottomOffset:10
XtAddCallback $PB9 activateCallback RemoveEventHandler1and2
XtRealizeWidget $TOPLEVEL
XtMainLoop
-71
View File
@@ -1,71 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: ListBounds1.src /main/3 1996/04/23 20:18:16 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how to create a list widget, and
XCOMM also how to query the bounds for each of the list items.
XCOMM
integer i
XCOMM Pushbutton Callback: Query the bound for each list item
GetBounds()
{
i=1
echo
while XmListPosToBounds $LIST $i X Y W H; do
echo "Bounds of item "$i" is ("$X $Y $W $H")"
i=i+1
done
}
XCOMM Pushbutton Callback: Delete the first list item
DelFirst()
{
XmListDeletePos $LIST 1
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL listKbd1 ListKbd1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XmCreateScrolledList LIST $TOPLEVEL list \
itemCount:11 \
items:"item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11" \
visibleItemCount:15 \
listSizePolicy:VARIABLE
XtSetValues $LIST \
selectedItemCount:3 \
selectedItems:"item2,item4,item6"
XtManageChild $LIST
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 listKbd1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Get Item Bounds"
XtAddCallback $PB1 activateCallback "GetBounds"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Delete First Item"
XtAddCallback $PB2 activateCallback "DelFirst"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-71
View File
@@ -1,71 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: ListItemPos1.src /main/3 1996/04/23 20:18:21 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how to create a list widget, and
XCOMM verifies that the XmListItemPos command operates correctly. The list
XCOMM contains multiple items with the label "item4"; XmListItemPos will
XCOMM return the position of the first occurrence. By selecting the push
XCOMM button labeled "Delete First Item", you can delete the first item
XCOMM labeled "item4"; the next call to XmListItemPos should now return
XCOMM the position of the next item labeled "item4".
XCOMM
XCOMM Pushbutton Callback: prints the position occupied by the first occurrence
XCOMM of the "item4" label.
GetItemPosition()
{
XmListItemPos POS $LIST "item4"
echo "First position for item4 is: "$POS
}
XCOMM Pushbutton Callback: deletes the first item in the list.
DelFirstItem()
{
XmListDeletePos $LIST 1
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL listItemPos1 ListItemPos1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XmCreateScrolledList LIST $TOPLEVEL list \
itemCount:11 \
items:"item4,item2,item4,item3,item5,item6,item7,item8,item9,item4,item11" \
visibleItemCount:15 \
listSizePolicy:VARIABLE
XtSetValues $LIST \
selectedItemCount:3 \
selectedItems:"item2,item4,item6"
XtManageChild $LIST
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 ListItemPos1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Get Position Of item4"
XtAddCallback $PB1 activateCallback "GetItemPosition"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Delete First Item"
XtAddCallback $PB2 activateCallback "DelFirstItem"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-66
View File
@@ -1,66 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: ListPosSel1.src /main/3 1996/04/23 20:18:25 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how to create a list widget, and
XCOMM also verifies that the XmListPosSelected command works; this command
XCOMM returns information about whether an indicated list item is selected.
XCOMM
integer i
XCOMM Pushbutton Callback: print the selection state of each list item.
GetSelectionStatus()
{
i=1
echo
while (($i <= 11 )); do
if XmListPosSelected $LIST $i; then
echo "Item "$i" is selected"
else
echo "Item "$i" is not selected"
fi
i=i+1
done
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL listPosSel1 ListPosSel1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XmCreateScrolledList LIST $TOPLEVEL list \
itemCount:11 \
items:"item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11" \
visibleItemCount:15 \
listSizePolicy:VARIABLE
XtSetValues $LIST \
selectedItemCount:3 \
selectedItems:"item2,item4,item6"
XtManageChild $LIST
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 ListPosSel1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Get Item Selection Status"
XtAddCallback $PB1 activateCallback "GetSelectionStatus"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-104
View File
@@ -1,104 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
noinst_SCRIPTS = CallbackTest2 CallDataTest4 crMovesText1 DtCursorTest2 \
DtWsTest1 EventHandlerTest ListBounds1 ListItemPos1 PopupTest \
SelBoxResTest SessionTest TextCutBuf1 TextDisp1 TextFXYPos1 \
TransEventTest TransTest1 WorkProcTest1 XdrawTest
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP)
BUILT_SOURCES = CallbackTest2 CallDataTest4 crMovesText1 DtCursorTest2 \
DtWsTest1 EventHandlerTest ListBounds1 ListItemPos1 PopupTest \
SelBoxResTest SessionTest TextCutBuf1 TextDisp1 TextFXYPos1 \
TransEventTest TransTest1 WorkProcTest1 XdrawTest
CLEANFILES = $(BUILT_SOURCES)
CallbackTest2: CallbackTest2.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
CallDataTest4: CallDataTest4.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
crMovesText1: crMovesText1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
DtCursorTest2: DtCursorTest2.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
DtWsTest1: DtWsTest1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
EventHandlerTest: EventHandlerTest.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
ListBounds1: ListBounds1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
ListItemPos1: ListItemPos1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
PopupTest: PopupTest.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
SelBoxResTest: SelBoxResTest.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
SessionTest: SessionTest.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
TextCutBuf1: TextCutBuf1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
TextDisp1: TextDisp1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
TextFXYPos1: TextFXYPos1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
TransEventTest: TransEventTest.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
TransTest1: TransTest1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
WorkProcTest1: WorkProcTest1.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
XdrawTest: XdrawTest.src
$(RM) $@
$(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
chmod +x $@
-57
View File
@@ -1,57 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: PopupTest.src /main/3 1996/04/23 20:18:36 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates the steps necessary to create and
XCOMM manage a popup menu.
XCOMM
XCOMM This event handler positions the menu at the point where the button event
XCOMM occurred, and then posts the popup menu.
EventHandler()
{
XmMenuPosition $POPUP $EH_EVENT
XtManageChild $POPUP
}
XCOMM Menu button callback
MenuActivated()
{
echo "Menu Activated: "$1
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL popupTest PopupTest "$0" "$@"
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
XtSetValues $FORM height:300 width:300
XtAddEventHandler $FORM "ButtonPressMask" False EventHandler
XmCreatePopupMenu POPUP $FORM "popup"
XmCreatePushButton PB1 $POPUP "pb1" \
labelString:"Menu Item 1"
XtManageChild $PB1
XtAddCallback $PB1 activateCallback "MenuActivated MenuItem1"
XmCreatePushButton PB2 $POPUP "pb2" \
labelString:"Menu Item 2"
XtManageChild $PB2
XtAddCallback $PB2 activateCallback "MenuActivated MenuItem2"
XtRealizeWidget $TOPLEVEL
XtMainLoop
-63
View File
@@ -1,63 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: SelBoxResTest.src /main/3 1996/04/23 20:18:42 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script verifies that the selection box properly
XCOMM interprets the 'childPlacement' resource. Using a timer, it will
XCOMM set the resource to a particular value, verify it is correct, and
XCOMM then repeat for the next setting.
XCOMM
Timeout3()
{
XtGetValues $SB childPlacement:CP
echo ChildPlacement
echo " Expected = PLACE_TOP"
echo " Actual = " $CP
}
Timeout2()
{
XtGetValues $SB childPlacement:CP
echo ChildPlacement
echo " Expected = PLACE_BELOW_SELECTION"
echo " Actual = " $CP
XtSetValues $SB childPlacement:PLACE_TOP
XtAddTimeOut ID 5000 "Timeout3"
}
Timeout1()
{
XtGetValues $SB childPlacement:CP
echo ChildPlacement
echo " Expected = PLACE_ABOVE_SELECTION"
echo " Actual = " $CP
XtSetValues $SB childPlacement:PLACE_BELOW_SELECTION
XtAddTimeOut ID 5000 "Timeout2"
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL selectionBoxTest SelectionBoxTest "$0" "$@"
XtCreateManagedWidget SB sb XmSelectionBox $TOPLEVEL \
childPlacement:PLACE_ABOVE_SELECTION
XtCreateManagedWidget SCALE scale XmScale $SB \
orientation:HORIZONTAL
XtRealizeWidget $TOPLEVEL
XtAddTimeOut ID 5000 "Timeout1"
XtMainLoop
-137
View File
@@ -1,137 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: SessionTest.src /main/6 1996/04/23 20:18:46 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates the steps necessary for tying into
XCOMM session management. To run, simply run this script, and then save the
XCOMM current session. When the session is restored, this script should again
XCOMM restore to its previous state.
XCOMM
XCOMM This function is invoked when the user attempts to save the current session.
XCOMM It will save off its state information (whether it is iconified, and the
XCOMM list of workspaces it occupies) into a session file, and then tell the
XCOMM session manager how to reinvoke it when the session is restored.
SessionCallback()
{
XCOMM Get the name of our session file
if DtSessionSavePath $TOPLEVEL PATH SAVEFILE; then
exec 9>$PATH
XCOMM Save our iconification state
if DtShellIsIconified $TOPLEVEL ; then
print -u9 'Iconified'
else
print -u9 'Deiconified'
fi
XCOMM Save the list of workspace we occupy
if DtWsmGetWorkspacesOccupied $(XtDisplay "-" $TOPLEVEL) \
$(XtWindow "-" $TOPLEVEL) \
CURRENT_WS_LIST ;
then
oldIFS=$IFS
IFS=","
for item in $CURRENT_WS_LIST;
do
XmGetAtomName NAME $(XtDisplay "-" $TOPLEVEL) $item
print -u9 $NAME
done
IFS=$oldIFS
fi
exec 9<&-
XCOMM Tell the session manager how to restart us
DtSetStartupCommand $TOPLEVEL \
"/usr/dt/share/examples/dtksh/SessionTest $SAVEFILE"
else
echo "DtSessionSavePath FAILED!!"
exit -3
fi
}
XCOMM This function is invoked when we are restarted at session restore time.
XCOMM It is passed the name of the session file as $1. It will extract our
XCOMM session information from the session file, and will restore our state
XCOMM accordingly.
RestoreSession()
{
XCOMM Get the full path of our session file
if DtSessionRestorePath $TOPLEVEL PATH $1; then
exec 9<$PATH
read -u9 ICONIFY
XCOMM Restore our iconification state
case $ICONIFY in
Iconified) DtSetIconifyHint $TOPLEVEL True;;
*) DtSetIconifyHint $TOPLEVEL False;;
esac
XCOMM Place us into the indicated set of workspaces
WS_LIST=""
while read -u9 NAME
do
XmInternAtom ATOM $(XtDisplay "-" $TOPLEVEL) $NAME False
if [ ${#WS_LIST} -gt 0 ]; then
WS_LIST=$WS_LIST,$ATOM
else
WS_LIST=$ATOM
fi
done
DtWsmSetWorkspacesOccupied $(XtDisplay "-" $TOPLEVEL) \
$(XtWindow "-" $TOPLEVEL) \
$WS_LIST
exec 9<&-
else
echo "DtSessionRestorePath FAILED!!"
exit -3
fi
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL wmProtTest WmProtTest "$0" "$@"
XtCreateManagedWidget DA da XmDrawingArea $TOPLEVEL
XtSetValues $DA height:200 width:200
XmInternAtom SAVE_SESSION_ATOM $(XtDisplay "-" $TOPLEVEL) "WM_SAVE_YOURSELF" False
XCOMM If we are invoked with any command line parameters, then we will assume
XCOMM that it is the name of our session file, and will restore to the indicated
XCOMM state.
if (( $# > 0))
then
XtSetValues $TOPLEVEL mappedWhenManaged:False
XtRealizeWidget $TOPLEVEL
XSync $(XtDisplay "-" $TOPLEVEL) False
RestoreSession $1
XtSetValues $TOPLEVEL mappedWhenManaged:True
XtPopup $TOPLEVEL GrabNone
else
XtRealizeWidget $TOPLEVEL
XSync $(XtDisplay "-" $TOPLEVEL) False
fi
XCOMM Register our interest in participating in session management.
XmAddWMProtocols $TOPLEVEL $SAVE_SESSION_ATOM
XmAddWMProtocolCallback $TOPLEVEL $SAVE_SESSION_ATOM SessionCallback
XtMainLoop
-114
View File
@@ -1,114 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: TextCutBuf1.src /main/3 1996/04/23 20:18:52 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates how the Text cut, copy and paste
XCOMM facilities work.
XCOMM
XCOMM Pushbutton Callback: cut the currently select text
Cut()
{
if XmTextCut $TEXT $(XtLastTimestampProcessed "-" $(XtDisplay "-" $TEXT));
then
echo "Cut occurred"
else
echo "No primary selection"
fi
}
XCOMM Pushbutton Callback: copy the currently select text
Copy()
{
if XmTextCopy $TEXT $(XtLastTimestampProcessed "-" $(XtDisplay "-" $TEXT));
then
echo "Copy occurred"
else
echo "No primary selection"
fi
}
XCOMM Pushbutton Callback: clear the text selection
ClearSelection()
{
XmTextClearSelection $TEXT $(XtLastTimestampProcessed "-" $(XtDisplay "-" $TEXT))
}
XCOMM Pushbutton Callback: paste the cut buffer at the current insertion position
Paste()
{
if XmTextPaste $TEXT; then
echo "Paste occurred"
else
echo "No primary selection"
fi
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL textCutBuf1 TextCutBuf1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XtCreateManagedWidget FORM form XmForm $TOPLEVEL \
XtCreateManagedWidget TEXT text XmText $FORM \
topAttachment:ATTACH_FORM \
topOffset:10 \
leftAttachment:ATTACH_FORM \
leftOffset:10 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
columns:40 \
value:"This is the default string"
XtCreateManagedWidget TEXT2 text2 XmText $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$TEXT \
topOffset:10 \
leftAttachment:ATTACH_FORM \
leftOffset:10 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
bottomAttachment:ATTACH_FORM \
bottomOffset:10 \
columns:40 \
editable:False
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 textCutBuf1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Cut Selection"
XtAddCallback $PB1 activateCallback "Cut"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Copy Selection"
XtAddCallback $PB2 activateCallback "Copy"
XtCreateManagedWidget PB3 pb3 XmPushButton $RC \
labelString:"Paste"
XtAddCallback $PB3 activateCallback "Paste"
XtCreateManagedWidget PB4 pb4 XmPushButton $RC \
labelString:"Clear Selection"
XtAddCallback $PB4 activateCallback "ClearSelection"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-100
View File
@@ -1,100 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: TextDisp1.src /main/3 1996/04/23 20:18:56 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script exercises the commands which enable and disable
XCOMM updating in a text widget. If the update is disabled, and the value of
XCOMM the text field is then changed, the text field will not update what is
XCOMM shown, until update is again enabled.
XCOMM
XCOMM Pushbutton Callback: enable update in the text widget
EnableUpdate()
{
XmTextEnableRedisplay $TEXT
}
XCOMM Pushbutton Callback: disable update in the text widget
DisableUpdate()
{
XmTextDisableRedisplay $TEXT
}
XCOMM Pushbutton Callback: changes the text value
ChangeValue1()
{
XmTextSetString $TEXT "line A
line B
line C
line D
line E
line F
line G"
}
XCOMM Pushbutton Callback: changes the text value
ChangeValue2()
{
XmTextSetString $TEXT "line a
line b
line c
line d
line e
line f
line g"
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL textDisp1 TextDisp1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XmCreateScrolledText TEXT $TOPLEVEL text \
columns:20 \
rows:5 \
editMode:MULTI_LINE_EDIT \
value:\
"line 1
line 2
line 3
line 4"
XtManageChild $TEXT
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 textDisp1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Disable Update"
XtAddCallback $PB1 activateCallback "DisableUpdate"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Enable Update"
XtAddCallback $PB2 activateCallback "EnableUpdate"
XtCreateManagedWidget PB3 pb3 XmPushButton $RC \
labelString:"Change Value 1"
XtAddCallback $PB3 activateCallback "ChangeValue1"
XtCreateManagedWidget PB4 pb4 XmPushButton $RC \
labelString:"Change Value 2"
XtAddCallback $PB4 activateCallback "ChangeValue2"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-65
View File
@@ -1,65 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: TextFXYPos1.src /main/3 1996/04/23 20:19:01 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script verifies that the XmTextFieldPosToXY command
XCOMM functions correctly.
XCOMM
XCOMM Pushbutton Callback: exercise the Text functions
RunTests()
{
XCOMM This position should not be visible
if XmTextFieldPosToXY $TEXT 90 X Y; then
echo "Text position 90 is at point ("$X","$Y")"
else
echo "Text position 90 is not currently visible"
fi
XCOMM This position should be visible
if XmTextFieldPosToXY $TEXT 3 X Y; then
echo "Text position 3 is at point ("$X","$Y")"
else
echo "Text position 3 is not currently visible"
fi
XmTextFieldXYToPos POS $TEXT $X $Y
echo "At point ("$X","$Y") is character position "$POS
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL textFXYPos1 TextFXYPos1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XmCreateTextField TEXT $TOPLEVEL text \
columns:20 \
value:"line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8"
XtManageChild $TEXT
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 textFXYPos1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Run XY Position Tests"
XtAddCallback $PB1 activateCallback "RunTests"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
@@ -1,80 +0,0 @@
XCOMM!CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: TransEventTest.src /main/3 1996/04/23 20:19:07 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script verifies that the augment and override
XCOMM capabilities for translations work as expected. Since augmenting
XCOMM a translation does not replace an existing translation, the first
XCOMM pushbutton should only use our button3 translation. Since overriding
XCOMM a translation replaces an existing translation, the second pushbutton
XCOMM should use both our Enter and button1 translations.
XCOMM
XCOMM It also demonstrates access to the TRANSLATION_EVENT convenience
XCOMM environment variable.
XCOMM
XCOMM EnterNotify handler
Enter()
{
echo EnterNotify
echo "Event = "${TRANSLATION_EVENT}
echo "Event.type = "${TRANSLATION_EVENT.TYPE}
echo "Event.xany.window = "${TRANSLATION_EVENT.XANY.WINDOW}
}
XCOMM ButtonDown handler; $1 indicates which button
BtnDown()
{
echo "ButtonDown ("$1")"
echo "Event = "${TRANSLATION_EVENT}
echo "Event.type = "${TRANSLATION_EVENT.TYPE}
echo "Event.xany.window = "${TRANSLATION_EVENT.XANY.WINDOW}
echo "Event.xbutton.x = "${TRANSLATION_EVENT.XBUTTON.X}
echo "Event.xbutton.y = "${TRANSLATION_EVENT.XBUTTON.Y}
}
XCOMM Default activate callback for the pushbuttons; should only get called
XCOMM for the first pushbutton (augmented one).
Activate()
{
echo "Activate ("$1")"
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL transEventTest TransEventTest "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Augmented Button" \
translations:'#augment
<EnterNotify>:ksh_eval("Enter")
<Btn1Down>:ksh_eval("BtnDown 1")
<Btn3Down>:ksh_eval("BtnDown 3")'
XtAddCallback $PB1 activateCallback "Activate 1"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Overridden Button" \
translations:'#override
<EnterNotify>:ksh_eval("Enter")
<Btn1Down>:ksh_eval("BtnDown 1")'
XtAddCallback $PB2 activateCallback "Activate 2"
XtRealizeWidget $TOPLEVEL
XtMainLoop
-91
View File
@@ -1,91 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: TransTest1.src /main/3 1996/04/23 20:19:11 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates the operation of augmented and
XCOMM overridden translations. If the translations are cleared, then both
XCOMM overriding and augmenting the translations will cause all of the new
XCOMM translations to take effect.
XCOMM
Enter()
{
echo "EnterNotify ("$1")"
}
BtnDown()
{
echo "ButtonDown ("$1")"
}
Activate()
{
echo "Activate"
}
Augment()
{
XtAugmentTranslations $PB \
'<EnterNotify>:ksh_eval("Enter augmented")
<Btn1Down>:ksh_eval("BtnDown 1")
<Btn3Down>:ksh_eval("BtnDown 3")'
}
Override()
{
XtOverrideTranslations $PB \
'<EnterNotify>:ksh_eval("Enter overridden")
<Btn1Down>:ksh_eval("BtnDown 1")'
}
Uninstall()
{
XtUninstallTranslations $PB
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL transTest1 TransTest1 "$0" "$@"
XtSetValues $TOPLEVEL allowShellResize:True
XmCreateForm FORM $TOPLEVEL form
XtManageChild $FORM
XtCreateManagedWidget PB pb XmPushButton $FORM \
labelString:"Test Button"
XtAddCallback $PB activateCallback "Activate"
XtRealizeWidget $TOPLEVEL
XtCreateApplicationShell TOPLEVEL2 listAdd1a TopLevelShell
XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
orientation:HORIZONTAL \
numColumns:2 \
packing:PACK_COLUMN
XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
labelString:"Augment Translations"
XtAddCallback $PB1 activateCallback "Augment"
XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
labelString:"Override Translations"
XtAddCallback $PB2 activateCallback "Override"
XtCreateManagedWidget PB3 pb3 XmPushButton $RC \
labelString:"Uninstall Translations"
XtAddCallback $PB3 activateCallback "Uninstall"
XtRealizeWidget $TOPLEVEL2
XtMainLoop
-40
View File
@@ -1,40 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: WorkProcTest1.src /main/3 1996/04/23 20:19:16 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates the usage of an Xt workproc
XCOMM
integer count=5
XCOMM The work proc will be called five time, at which point it will return
XCOMM '1', which will cause it to be automatically unregistered.
function WorkProc1
{
count=$count-1
echo "WorkProc1 ("$count")"
if [ "$count" -eq 0 ]
then
return 1
else
return 0
fi
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL workProcTest1 WorkProcTest1 "$0" "$@"
XtAddWorkProc ID1 "WorkProc1"
XtMainLoop
-116
View File
@@ -1,116 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: XdrawTest.src /main/3 1996/04/23 20:19:28 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This sample shell script demonstrates the calling sequence for most of
XCOMM the X drawing commands.
XCOMM
ExposeCallback()
{
XDrawRectangle $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
10 20 100 200 \
120 20 200 100
XFillRectangle $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-foreground red -background green 20 30 80 180
XClearArea $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
30 40 60 40 false
XDrawLine $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-foreground red -background white 130 22 130 117
XDrawLines $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
140 30 140 101 \
150 101 150 30
XDrawLines $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-CoordModePrevious -line_width 3 160 30 0 71 \
10 0 0 -71
XDrawPoint $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
180 30 180 101
XDrawPoints $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
190 30 190 40 190 50 190 60 190 70 190 80 190 90 190 101
XDrawPoints $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-CoordModePrevious \
200 30 0 10 0 10 0 10 0 10 0 10 0 10 0 10
XDrawSegments $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-function clear -foreground green -background red \
-line_width 3 \
210 30 210 40 210 50 210 60 210 70 210 80 210 90 210 100
XDrawArc $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-line_width 3 20 300 100 150 300 5760
XFillArc $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-line_width 3 20 270 100 150 11520 5760
XDrawString $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-font fixed -foreground blue -background red 200 200 \
"XDrawString"
XDrawImageString $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-foreground green -background red 200 250 \
"XDrawImageString"
XFillPolygon $(XtDisplay "-" $CB_WIDGET) $(XtWindow "-" $CB_WIDGET) \
-Convex -CoordModePrevious \
300 300 30 70 30 -140
XTextWidth "-" fixed "Hi Mom"
}
ClearWindow()
{
XClearWindow $(XtDisplay "-" $DRAWINGAREA) $(XtWindow "-" $DRAWINGAREA)
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL drawingArea DrawingArea "$0" "$@"
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
XtCreateManagedWidget DRAWINGAREA drawingArea XmDrawingArea $FORM \
topAttachment:ATTACH_FORM \
leftAttachment:ATTACH_FORM \
rightAttachment:ATTACH_FORM
XtAddCallback $DRAWINGAREA exposeCallback ExposeCallback
XtCreateManagedWidget SEP sep XmSeparator $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$DRAWINGAREA \
leftAttachment:ATTACH_FORM \
rightAttachment:ATTACH_FORM
XtCreateManagedWidget PB pb XmPushButton $FORM \
labelString:"Clear The Window" \
topAttachment:ATTACH_WIDGET \
topWidget:$SEP \
leftAttachment:ATTACH_FORM \
rightAttachment:ATTACH_FORM \
bottomAttachment:ATTACH_FORM
XtAddCallback $PB activateCallback ClearWindow
XtSetValues $DRAWINGAREA \
height:450 \
width:450
XtRealizeWidget $TOPLEVEL
XtMainLoop
-327
View File
@@ -1,327 +0,0 @@
XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
XCOMM $XConsortium: crMovesText1.src /main/3 1996/04/23 20:19:33 drk $
XCOMM #########################################################################
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM #########################################################################
XCOMM
XCOMM This advanced shell script demonstrates the code necessary for forcing
XCOMM the Return key to move the focus to the next text field in a dialog,
XCOMM instead of causing the default pushbutton to be activated. When the
XCOMM focus has moved to the last text field, then the Return key will activate
XCOMM the default pushbutton.
XCOMM
XCOMM This function modifies the text field indicated by $1, so that when
XCOMM the text field receives the focus, it clears the default button; when
XCOMM it loses the focus, it will reenable the default button. It also adds
XCOMM some translations for catching the Return key, so that it can force
XCOMM the focus to the next text widget, which is indicated by $2
SetCrControls()
{
XtAddCallback $1 focusCallback "ClearDftButton"
XtAddCallback $1 losingFocusCallback "SetDftButton $OK"
XtOverrideTranslations $1 \
"Ctrl<Key>Return:ksh_eval(\"XmProcessTraversal $2 TRAVERSE_CURRENT\")
<Key>Return:ksh_eval(\"XmProcessTraversal $2 TRAVERSE_CURRENT\")"
}
XCOMM FocusOut Callback: reenables the default button
SetDftButton()
{
XtSetValues $FORM defaultButton:$OK
}
XCOMM FocusIn Callback: disables the default button
ClearDftButton()
{
XtSetValues $FORM defaultButton:NULL
}
XCOMM If the 'Ok' button is activated, but the 'Name' field is empty, then
XCOMM this function will display an error dialog.
EmptyNameError()
{
XmCreateErrorDialog ERROR_DIALOG $TOPLEVEL noName \
okLabelString:Ok \
messageString:"You must supply a name...."
XmMessageBoxGetChild CANCEL_BTN $ERROR_DIALOG DIALOG_CANCEL_BUTTON
XmMessageBoxGetChild HELP_BTN $ERROR_DIALOG DIALOG_HELP_BUTTON
XtUnmanageChildren $CANCEL_BTN $HELP_BTN
XtSetValues $(XtParent "-" $ERROR_DIALOG) title:foo
XtManageChildren $ERROR_DIALOG
}
XCOMM Pushbutton Callback: attached to the 'Cancel' pushbutton
QuitCB()
{
exit 0
}
XCOMM Pushbutton Callback: attached to the default pushbutton. It extracts the
XCOMM fields within the dialog, and does some validation.
CheckActionValues()
{
XtGetValues $LARGEICON value:LARGEICON_VALUE
XtGetValues $SMALLICON value:SMALLICON_VALUE
XtGetValues $DESCRIPTION value:DESCRIPTION_VALUE
XtGetValues $COMMANDLINE value:COMMANDLINE_VALUE
XtGetValues $PROMPT value:PROMPT_VALUE
XtGetValues $COMMANDTYPE menuHistory:COMMANDTYPE_WIDGET
XmTextGetString NAME_VALUE $NAME
if [ "$NAME_VALUE" = "" ]
then
EmptyNameError
else
echo "Name: "$NAME_VALUE
echo "Large Icon: "$LARGEICON_VALUE
echo "Small Icon: "$SMALLICON_VALUE
echo "Description: "$DESCRIPTION_VALUE
echo "Command Line: "$COMMANDLINE_VALUE
echo "Prompt: "$PROMPT_VALUE
echo "Command Type: "$COMMANDTYPE_WIDGET
fi
}
XCOMM ###################### Create the Main UI ###############################
XtInitialize TOPLEVEL createAction CreateAction "$0" "$@"
XtCreateManagedWidget FORM form XmForm $TOPLEVEL
XtCreateManagedWidget NAMELABEL nameLabel XmLabel $FORM \
topAttachment:ATTACH_FORM \
topOffset:20 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
labelString:"Name:"
XtCreateManagedWidget NAME name XmText $FORM \
topAttachment:ATTACH_OPPOSITE_WIDGET \
topWidget:$NAMELABEL \
topOffset:-7 \
leftAttachment:ATTACH_WIDGET \
leftWidget:$NAMELABEL \
leftOffset:10 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
navigationType:EXCLUSIVE_TAB_GROUP
XtCreateManagedWidget COMMANDLINELABEL commandLineLabel XmLabel $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$NAMELABEL \
topOffset:20 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
labelString:"Command Line:"
XtCreateManagedWidget COMMANDLINE commandLine XmText $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$COMMANDLINELABEL \
topOffset:5 \
leftAttachment:ATTACH_FORM \
leftOffset:40 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
navigationType:EXCLUSIVE_TAB_GROUP
XmCreatePulldownMenu PANE $FORM pane
XtCreateManagedWidget XWIN xwin XmPushButton $PANE \
labelString:"X Windows"
XtCreateManagedWidget NOOUT noOut XmPushButton $PANE \
labelString:"No Output"
XtCreateManagedWidget TERM term XmPushButton $PANE \
labelString:"Terminal"
XtCreateManagedWidget TERMCLOSE termClose XmPushButton $PANE \
labelString:"Terminal [auto-close]"
XmCreateOptionMenu COMMANDTYPE $FORM commandType \
topAttachment:ATTACH_WIDGET \
topWidget:$COMMANDLINE \
topOffset:20 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
labelString:"Window Type:" \
menuHistory:$TERM \
subMenuId:$PANE \
navigationType:EXCLUSIVE_TAB_GROUP
XtSetValues $COMMANDTYPE spacing:35
XtManageChildren $COMMANDTYPE
XtCreateManagedWidget OPTLABEL optLabel XmLabel $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$COMMANDTYPE \
topOffset:30 \
leftAttachment:ATTACH_FORM \
leftOffset:100 \
labelString:"Optional Fields"
XtCreateManagedWidget SEP1 sep1 XmSeparator $FORM \
topAttachment:ATTACH_OPPOSITE_WIDGET \
topWidget:$OPTLABEL \
topOffset:10 \
rightAttachment:ATTACH_WIDGET \
rightWidget:$OPTLABEL \
rightOffset:5 \
leftAttachment:ATTACH_FORM \
orientation:HORIZONTAL \
separatorType:SHADOW_ETCHED_OUT
XtCreateManagedWidget SEP2 sep2 XmSeparator $FORM \
topAttachment:ATTACH_OPPOSITE_WIDGET \
topWidget:$OPTLABEL \
topOffset:10 \
leftAttachment:ATTACH_WIDGET \
leftWidget:$OPTLABEL \
leftOffset:5 \
rightAttachment:ATTACH_FORM \
orientation:HORIZONTAL \
separatorType:SHADOW_ETCHED_OUT
XtCreateManagedWidget PROMPTLABEL promptLabel XmLabel $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$OPTLABEL \
topOffset:20 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
labelString:"Filename Prompt:"
XtCreateManagedWidget PROMPT prompt XmText $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$PROMPTLABEL \
topOffset:5 \
leftAttachment:ATTACH_FORM \
leftOffset:40 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
navigationType:EXCLUSIVE_TAB_GROUP
XtCreateManagedWidget LARGEICONLABEL largeIconLabel XmLabel $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$PROMPT \
topOffset:30 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
labelString:"Large Icon:"
XtCreateManagedWidget LARGEICON largeIcon XmText $FORM \
topAttachment:ATTACH_OPPOSITE_WIDGET \
topWidget:$LARGEICONLABEL \
topOffset:-7 \
leftAttachment:ATTACH_WIDGET \
leftWidget:$LARGEICONLABEL \
leftOffset:20 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
navigationType:EXCLUSIVE_TAB_GROUP
XtCreateManagedWidget SMALLICONLABEL smallIconLabel XmLabel $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$LARGEICONLABEL \
topOffset:20 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
labelString:"Small Icon:"
XtCreateManagedWidget SMALLICON smallIcon XmText $FORM \
topAttachment:ATTACH_OPPOSITE_WIDGET \
topWidget:$SMALLICONLABEL \
topOffset:-7 \
leftAttachment:ATTACH_OPPOSITE_WIDGET \
leftWidget:$LARGEICON \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
navigationType:EXCLUSIVE_TAB_GROUP
XtCreateManagedWidget DESCRIPTIONLABEL descriptionLabel XmLabel $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$SMALLICONLABEL \
topOffset:20 \
leftAttachment:ATTACH_FORM \
leftOffset:20 \
labelString:"Description:"
XmCreateScrolledText DESCRIPTION $FORM description \
topAttachment:ATTACH_WIDGET \
topWidget:$DESCRIPTIONLABEL \
topOffset:5 \
leftAttachment:ATTACH_FORM \
leftOffset:40 \
rightAttachment:ATTACH_FORM \
rightOffset:10 \
editMode:MULTI_LINE_EDIT \
rows:4 \
navigationType:EXCLUSIVE_TAB_GROUP
XtManageChildren $DESCRIPTION
XtCreateManagedWidget SEP sep XmSeparator $FORM \
topAttachment:ATTACH_WIDGET \
topWidget:$DESCRIPTION \
topOffset:20 \
rightAttachment:ATTACH_FORM \
leftAttachment:ATTACH_FORM
XtCreateManagedWidget OK ok XmPushButton $FORM \
labelString:Apply \
leftAttachment:ATTACH_POSITION \
leftPosition:10 \
rightAttachment:ATTACH_POSITION \
rightPosition:30 \
topAttachment:ATTACH_WIDGET \
topWidget:$SEP \
topOffset:20 \
bottomOffset:10 \
bottomAttachment:ATTACH_FORM
XtAddCallback $OK activateCallback CheckActionValues
XtCreateManagedWidget CLOSE close XmPushButton $FORM \
labelString:Close \
leftAttachment:ATTACH_POSITION \
leftPosition:40 \
rightAttachment:ATTACH_POSITION \
rightPosition:60 \
topAttachment:ATTACH_WIDGET \
topWidget:$SEP \
topOffset:20 \
bottomOffset:10 \
bottomAttachment:ATTACH_FORM
XtAddCallback $CLOSE activateCallback QuitCB
XtCreateManagedWidget HELP help XmPushButton $FORM \
labelString:Help \
leftAttachment:ATTACH_POSITION \
leftPosition:70 \
rightAttachment:ATTACH_POSITION \
rightPosition:90 \
topAttachment:ATTACH_WIDGET \
topWidget:$SEP \
topOffset:20 \
bottomOffset:10 \
bottomAttachment:ATTACH_FORM
XtSetValues $FORM \
defaultButton:$OK \
cancelButton:$CLOSE \
navigationType:EXCLUSIVE_TAB_GROUP \
initialFocus:$NAME
XCOMM Set up proper behavior for the Return key
SetCrControls $NAME $COMMANDLINE
SetCrControls $COMMANDLINE $PROMPT
SetCrControls $PROMPT $LARGEICON
SetCrControls $LARGEICON $SMALLICON
XtRealizeWidget $TOPLEVEL
XtMainLoop
-226
View File
@@ -1,226 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: extra.c /main/4 1995/11/01 15:54:55 rswiston $ */
/* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
/* UNIX System Laboratories, Inc. */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#include "defs.h"
#include "shell.h"
#include "name.h"
#include "stdio.h"
#include "msgs.h"
void
env_set(
char *var )
{
(void)nv_open(var, sh.var_tree, NV_ASSIGN);
}
void
env_set_gbl(
char *vareqval )
{
env_set(vareqval);
}
char *
env_get(
char *var )
{
Namval_t *np;
char *val;
np = nv_search(var,sh.var_tree,0);
if (np && (val = nv_getval(np)))
return(val);
return(NULL);
}
int
ksh_eval(
char *cmd )
{
sh_eval(sfopen(NIL(Sfio_t*),cmd,"s"),0);
sfsync(sh.outpool);
return(sh.exitval);
}
void
env_set_var(
char *var,
char *val )
{
int len;
char tmp[512];
char *set = &tmp[0];
if ((len = strlen(var) + strlen(val?val:"") + 2) > sizeof(tmp)) /* 11/06 CHANGED */
set = malloc(len);
strcpy(set, var);
strcat(set, "=");
strcat(set, val?val:""); /* 11/06 CHANGED */
env_set(set);
if (set != &tmp[0])
free(set);
}
void
env_blank(
char *var )
{
env_set_var(var, "");
}
void
printerr(
char *cmd,
char *msg1,
char *msg2 )
{
if (msg1 == NULL)
msg1 = "";
if (msg2 == NULL)
msg2 = "";
if (cmd && (strlen(cmd) > 0))
printf( "%s: %s %s\n", cmd, msg1, msg2);
else
printf( "%s %s\n", msg1, msg2);
}
void
printerrf(
char *cmd,
char *fmt,
char *arg0,
char *arg1,
char *arg2,
char *arg3,
char *arg4,
char *arg5,
char *arg6,
char *arg7 )
{
char buf[2048];
if (arg0 == NULL)
arg0 = "";
if (arg1 == NULL)
arg1 = "";
if (arg2 == NULL)
arg2 = "";
if (arg3 == NULL)
arg3 = "";
if (arg4 == NULL)
arg4 = "";
if (arg5 == NULL)
arg5 = "";
if (arg6 == NULL)
arg6 = "";
if (arg7 == NULL)
arg7 = "";
sprintf(buf, fmt, arg0, arg1, arg2, arg3,arg4, arg5, arg6, arg7);
if (cmd && (strlen(cmd) > 0))
printf("%s: %s\n", cmd, buf);
else
printf("%s\n", buf);
}
/****************************************************************************
*
* The following two functions are ugly, but necessary. Ksh reserves file
* descriptors 0 - 9 for use by shell scripts, and has intimate knowledge
* of how and when they were opened. Unfortunately, certain dtksh functions
* (XtInitialize, catopen, ttdt_open, _DtActionInvoke, others) open file
* descriptors which are not known to ksh. We can't let these file
* descriptors fall in the 0 - 9 range, because we can't afford to have
* the shell script overriding our file descriptors. Therefore, any of
* our commands which open files must first lock our file descriptors 0 - 9,
* thus forcing the command to get a file descriptor out of the shell's
* range. After the command has opened its file descriptor, it then needs
* to unlock file descriptors 0 - 9, so that the shell script will have
* access to them again.
*
**************************************************************************/
/*
* Return a list of the file descriptors we had to open, to lock out file
* descriptors 0 - 9; this list should be freed (and the file descriptors
* closed) by calling UnlockkshFileDescriptors().
*/
int *LockKshFileDescriptors(void)
{
int * fdList;
int i;
int fd, newfd;
fdList = (int *)malloc(sizeof(int) * 10);
for (i = 0; i < 10; i++)
fdList[i] = -1;
if ((fd = open("/dev/null", O_RDONLY)) >= 0)
{
if (fd < 10)
{
fdList[0] = fd;
for (i = 1; i < 10; i++)
{
if ((newfd = dup(fd)) < 10)
fdList[i] = newfd;
else
{
close(newfd);
break;
}
}
}
else
close(fd);
}
return(fdList);
}
void UnlockKshFileDescriptors(int *fdList)
{
int i;
for (i = 0; i < 10; i++)
{
if (fdList[i] != (-1))
close(fdList[i]);
}
free((char *)fdList);
}
-77
View File
@@ -1,77 +0,0 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: extra.h /main/4 1995/11/01 15:55:04 rswiston $ */
/************************************<+>*************************************
****************************************************************************
**
** File: extra.h
**
** Project: CDE
**
** Description: Public include file for extra.c
**
**
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992
** by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _Dtksh_extra_h
#define _Dtksh_extra_h
extern void env_set(
char *var) ;
extern void env_set_gbl(
char *vareqval) ;
extern char * env_get(
char *var) ;
extern int ksh_eval(
char *cmd) ;
extern void env_set_var(
char *var,
char *val) ;
extern void env_blank(
char *var) ;
extern void printerr(
char *cmd,
char *msg1,
char *msg2) ;
extern void printerrf(
char *cmd,
char *fmt,
char *arg0,
char *arg1,
char *arg2,
char *arg3,
char *arg4,
char *arg5,
char *arg6,
char *arg7) ;
#endif /* _Dtksh_extra_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-32
View File
@@ -1,32 +0,0 @@
name: CI
on: [push]
jobs:
Linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Build
run: bin/package make
- name: Regression tests
run: |
PS4="$PS4[ci.yml] "
set -o xtrace
export TZ=UTC
ulimit -n 1024
: default regression tests &&
script -q -e -c "bin/package test" &&
: regression tests with OS-provided multibyte locales &&
LANG=nl_NL.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
LANG=ja_JP.SJIS script -q -e -c "bin/shtests --locale --nocompile" &&
: disable most SHOPTs, rebuild ksh &&
sed --regexp-extended --in-place=.orig \
'/^SHOPT (AUDIT|BGX|BRACEPAT|DEVFD|DYNAMIC|EDPREDICT|ESH|FIXEDARRAY|HISTEXPAND|MULTIBYTE|NAMESPACE|OPTIMIZE|SPAWN|STATS|SUID_EXEC|VSH)=/ s/=1?/=0/' \
src/cmd/ksh93/SHOPT.sh &&
bin/package make &&
: default regression tests with SHOPTs disabled &&
script -q -e -c "bin/shtests"
-77
View File
@@ -1,77 +0,0 @@
# Project-specific files
arch
tgz
lcl
# Flat make libs, binaries, etc
*.a
*.o
*.req
FEATURE/
/bin/.paths
/bin/crossexec
/bin/execrate
/bin/filter
/bin/iffe
/bin/ksh
/bin/mamake
/bin/mktest
/bin/ok/
/bin/proto
/bin/pty
/bin/regress
/bin/rt
/bin/shcomp
/bin/suid_exec
/fun/
/include/
/lib/
/man/
/src/cmd/INIT/crossexec
/src/cmd/INIT/execrate
/src/cmd/INIT/filter
/src/cmd/INIT/iffe
/src/cmd/INIT/ignore
/src/cmd/INIT/mamake
/src/cmd/INIT/mamprobe
/src/cmd/INIT/mktest
/src/cmd/INIT/mprobe
/src/cmd/INIT/package
/src/cmd/INIT/probe
/src/cmd/INIT/probe.ini
/src/cmd/INIT/probe.sh
/src/cmd/INIT/regress
/src/cmd/INIT/rt
/src/cmd/INIT/silent
/src/cmd/builtin/pty
/src/cmd/ksh93/ksh
/src/cmd/ksh93/shcomp
/src/cmd/ksh93/suid_exec
/src/lib/libast/*.h
/src/lib/libast/astmath.exe
/src/lib/libast/conf
/src/lib/libast/conftab.c
/src/lib/libast/lcgen
/src/lib/libast/lctab.c
/src/lib/libast/t.c
/src/lib/libcmd/cmdext.h
/src/lib/libcmd/cmdlist.h
/src/lib/libdll/dlldefs.h
# Miscellaneous artefacts
*.dSYM/
*.bak
*.sav
*.old
*.orig
.*.swp
*.DS_Store
*~
.nfs*
*.tmp
*.rej
*.project
*.core
core
**/#*#
tags
-221
View File
@@ -1,221 +0,0 @@
Announcing: KornShell 93u+m/1.0.3
https://github.com/ksh93/ksh
This is the third bugfix release in the ksh 93u+m/1.0 series. Many thanks to
all contributors for their hard work! Compared to an unpatched ksh 93u+
2012-08-01, this release has roughly a thousand bugs fixed. It incorporates
a fair number of enhancements as well.
### CONTRIBUTORS ###
Work on ksh 93u+m started in May 2020.
Main developers: Martijn Dekker, Johnothan King, hyenias
Direct contributors: Andy Fiddaman, Anuradha Weeraman, atheik, Chase,
Govind Kamat, Harald van Dijk, K. Eugene Carlson, Lev Kujawski, Marc
Wilson, Ryan Schmidt, Sterling Jensen, Trey Valenta, Vincent Mihalkovic
Also includes backported contributions by: David Korn, Glenn Fowler,
Lefteris Koutsofios, Siteshwar Vashisht, Kurtis Rader, Roland Mainz,
Finnbarr P. Murphy, Lijo George, OpenSUSE ksh 93u+ patch authors, Red Hat
ksh 93u+ path authors, Solaris ksh 93u+ patch authors, Debian ksh 93u+
patch authors, Apple ksh 93u+ patch authors, Graphviz maintainers
Many fixes have also been backported from the AT&T 93v- beta as well as
the former ksh2020 project lead by Kurtis Rader and Siteshwar Vashisht;
we appreciate and benefit from their work. Many thanks also to Siteshwar
for graciously donating his 'ksh93' GitHub organisation account!
### HOW TO GET IT ###
Please download the source code tarball from our GitHub releases page:
https://github.com/ksh93/ksh/releases
To build, follow the instructions in README.md or src/cmd/ksh93/README.
Or ask your distribution package manager to upgrade ksh93 to this version.
### HOW TO GET INVOLVED ###
To report a bug, please open an issue at our GitHub page (see above).
Alternatively, email me at martijn@inlv.org with your report.
To get involved in development, read the brief policy information in
README.md and then jump right in with a pull request or email a patch.
See the TODO file in the top-level directory for a to-do list.
### MAIN CHANGES between ksh 93u+m 1.0.2 and 1.0.3 ###
This point release fixes the following:
- An old bug in history expansion (set -H) where any use of the history
comment character caused processing to be aborted as if it were an invalid
history expansion.
- A bug in command line options processing that caused short-form
option equivalents on some built-in commands to be ignored after one use,
e.g., the new read -a equivalent of read -A.
- Ksh freezing or using excessive memory if HISTSIZE is assigned a
pathologically large value.
- A bug that caused ksh in the vi editor mode to crash or produce invalid
completions if ESC = was used at the beginning of a line.
### MAIN CHANGES between ksh 93u+m 1.0.1 and 1.0.2 ###
This bugfix release fixes the interactive shell crashing when one of the
predefined aliases (currently 'history' and 'r') is redefined, whether from
a profile/kshrc script or manually. This crash occurred in two scenarios:
1. when redefining and then unsetting a predefined alias;
2. when redefining a predefined alias and then executing a shell script that
does not begin with a #! path.
### MAIN CHANGES between ksh 93u+m 1.0.0 and 1.0.1 ###
This is an urgent bugfix release that removes an incorrect exec
optimization that was capable of terminating the execution of scripts
prematurely in certain corner cases. It is known to make the build scripts
of GNU binutils produce corrupted results if ksh is used as /bin/sh.
See https://github.com/ksh93/ksh/issues/507 for more information.
### MAIN CHANGES between ksh 93u+ 2012-08-01 and 93u+m/1.0.0 ###
Roughly a thousand bugs have been fixed, including many serious/critical
bugs. See the NEWS file for more information, and the git commit log for
complete documentation of every fix. Incompatible changes have been
minimised, but not at the expense of fixing bugs. For a list of
potentially incompatible changes, see src/cmd/ksh93/COMPATIBILITY.
Though there was a "no new features, bugfixes only" policy, some new
features were found necessary, either to fix serious design flaws or to
complete functionality that was evidently intended, but not finished.
Below is a summary of these new features.
New command line editor features:
- The forward-delete and End keys are now handled as expected in the
emacs and vi built-in line editors.
- In the vi and emacs line editors, repeat counts can now also be used for
arrow keys and the forward-delete key, e.g., <ESC> 7 <left-arrow> works.
- Various keys on extended PC keyboards are now handled as expected in the
emacs and vi built-in line editors.
New shell language features:
- Pathname expansion (a.k.a. globbing) now never matches the special names
'.' (current directory) and '..' (parent directory). This change makes a
pattern like .* useful; it now matches all hidden files (dotfiles) in the
current directory, without the harmful inclusion of '.' and '..'.
- Tilde expansion can now be extended or modified by defining a .sh.tilde.get
or .sh.tilde.set discipline function. See the manual for details.
- The &>file redirection shorthand (for >file 2>&1) is now available for all
scripts and interactive sessions and not only for profile/login scripts.
- Arithmetic expressions in native ksh mode no longer interpret a number
with a leading zero as octal in any context. Use 8#octalnumber instead
(e.g. 8#400 == 256). Arithmetic expressions now also behave identically
within and outside ((...)) and $((...)). If the POSIX mode is turned on,
a leading zero now denotes an octal number in all arithmetic contexts.
New features in built-in commands:
- Usage error messages now show the --help/--man self-documentation options.
- Path-bound built-ins (such as /opt/ast/bin/cat) can now be executed by
invoking the canonical path, so the following will now work as expected:
$ /opt/ast/bin/cat --version
version cat (AT&T Research) 2012-05-31
- 'cd' now supports an -e option that, when combined with -P, verifies
that $PWD is correct after changing directories; this helps detect
access permission problems. See:
https://www.austingroupbugs.net/view.php?id=253
- 'command -x' now looks for external commands only, skipping built-ins.
In addition, its xargs-like functionality no longer freezes the shell on
Linux and macOS, making it effectively a new feature on these systems.
- 'printf' now supports a -v option as in bash. This assigns formatted
output directly to variables, which is very fast and will not strip
final newline (\n) characters.
- 'redirect' now checks if all arguments are valid redirections before
performing them. If an error occurs, it issues an error message instead
of terminating the shell.
- 'return', when used to return from a function, can now return any
status value in the 32-bit signed integer range, like on zsh. However,
due to a traditional Unix kernel limitation, $? is still trimmed to its
least significant 8 bits whenever a shell or subshell exits.
- 'suspend' now refuses to suspend a login shell, as there is probably no
parent shell to return to and the login session would freeze.
- 'test'/'[' now supports all the same operators as [[ (including =~,
\<, \>) except for the different 'and'/'or' operators. Note that
'test'/'[' remains deprecated due to its unfixable pitfalls;
[[ ... ]] is recommended instead.
- 'times' now gives high precision output in a POSIX compliant format.
- 'type'/'whence': Two bash-like flags were backported from ksh 93v-:
- 'whence -P/type -P' is an alias to the existing -p flag.
- 'whence -t/type -t' will print only the type of a command in a
simple format that is designed to be easy to use for scripts.
- 'typeset' has a new '-g' flag that forces variables to be created or
modified at the global scope regardless of context, as on bash 4.2+.
- 'typeset' now gives an informative error message if an incompatible
combination of options is given.
- 'ulimit': Added three options inspired by bash:
- 'ulimit -k' sets the maximum number of kqueues.
- 'ulimit -P' sets the maximum number of pseudo-terminals.
- 'ulimit -R' sets the maximum time in microseconds a real-time process
can run before blocking.
Note that not all operating systems support the limits set by these options.
- 'whence -v/-a' now reports the location of autoloadable functions.
New features in shell options:
- When the -b/--notify shell option is on and the vi or emacs/gmacs shell
line editor is in use, 'Done' and similar notifications from completed
background jobs are now inserted directly above the line you're typing,
without affecting your command line display.
- A new --functrace long-form shell option causes the -x/--xtrace option's
state and the DEBUG trap action to be inherited by function scopes instead
of being reset to default. Changes made to them within a function scope
still do not propagate back to the parent scope. Similarly, this option
also causes the DEBUG trap action to be inherited by subshells.
- A new --globcasedetect shell option is added on operating systems where
we can check for a case-insensitive file system (currently Linux, macOS,
QNX 7.0+, and Windows/Cygwin). When this option is turned on, pathname
expansion (globbing), as well as tab completion on interactive shells,
automatically become case-insensitive depending on the file system.
This is separately determined for each pathname component.
- Enhancement to -G/--globstar: symbolic links to directories are now
followed if they match a normal (non-**) glob pattern. For example, if
'/lnk' is a symlink to a directory, '/lnk/**' and '/l?k/**' now work as
you would expect.
- The new --histreedit and --histverify options modify history expansion
(--histexpand). If --histreedit is on and a history expansion fails, the
command line is reloaded into the next prompt's edit buffer, allowing
corrections. If --histverify is on, the results of a history expansion are
not immediately executed but instead loaded into the next prompt's edit
buffer, allowing further changes.
- A new --nobackslashctrl shell option disables the special escaping
behaviour of the backslash character in the emacs and vi built-in editors.
Particularly in the emacs editor, this makes it much easier to go back,
insert a forgotten backslash into a command, and then continue editing
without having your next arrow key replace your backslash with garbage.
- A new --posix shell option has been added to ksh 93u+m that makes the
ksh language more compatible with other shells by following the POSIX
standard more closely. See the manual page for details. It is enabled by
default if ksh is invoked as sh, otherwise it is disabled by default.
-140
View File
@@ -1,140 +0,0 @@
ksh 93u+m general copyright notice
########################################################################
# #
# The KornShell 93u+m distribution #
# Copyright (c) 2020-2022 Contributors to ksh 93u+m #
# <https://github.com/ksh93/ksh> #
# Derived from AT&T's ast package (see below) #
# Licensed under the Eclipse Public License, Version 2.0 #
# #
# A copy of the License is available at #
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html #
# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) #
# #
# CONTRIBUTORS #
# #
# Martijn Dekker <martijn@inlv.org> #
# Johnothan King <johnothanking@protonmail.com> #
# hyenias <58673227+hyenias@users.noreply.github.com> #
# Anuradha Weeraman <anuradha@debian.org> #
# Lev Kujawski <int21h@mailbox.org> #
# atheik <14833674+atheik@users.noreply.github.com> #
# K. Eugene Carlson <kvngncrlsn@gmail.com> #
# Ryan Schmidt <ryandesign@macports.org> #
# Chase <nicetrynsa@protonmail.ch> #
# Vincent Mihalkovic <vmihalko@redhat.com> #
# Trey Valenta <t@trey.net> #
# Sterling Jensen <5555776+sterlingjensen@users.noreply.github.com> #
# Marc Wilson <posguy99@gmail.com> #
# Harald van Dijk <harald@gigawatt.nl> #
# Govind Kamat <govind_kamat@yahoo.com> #
# Andy Fiddaman <andy@omniosce.org> #
# #
# ALSO INCLUDES BACKPORTED CONTRIBUTIONS BY #
# #
# David Korn <dgk@research.att.com> #
# Glenn Fowler <gsf@research.att.com> #
# Lefteris Koutsofios <ek@research.att.com> #
# Siteshwar Vashisht <svashisht@redhat.com> #
# Kurtis Rader <krader@skepticism.us> #
# Roland Mainz <roland.mainz@nrubsig.org> #
# Finnbarr P. Murphy <fpm@hotmail.com> #
# Lijo George <lijo.x.george@oracle.com> #
# OpenSUSE ksh 93u+ patch authors #
# Red Hat ksh 93u+ path authors #
# Solaris ksh 93u+ patch authors #
# Debian ksh 93u+ patch authors #
# Apple ksh 93u+ patch authors #
# Graphviz maintainers (libast, sfio) #
# #
########################################################################
ast package general copyright notice
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1986-2014 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.eclipse.org/org/documents/epl-v10.html #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# CONTRIBUTORS #
# #
# Glenn Fowler <gsf@research.att.com> #
# David Korn <dgk@research.att.com> #
# Phong Vo <kpv@research.att.com> #
# Roland Mainz <roland.mainz@nrubsig.org> #
# Karsten Fleischer <K.Fleischer@omnium.de> #
# Adam Edgar <aedgar@research.att.com> #
# Adam Buchsbaum <alb@adambuchsbaum.com> #
# Aman Shaikh <ashaikh@research.att.com> #
# Bala Krishnamurthy <bala@research.att.com> #
# Brian Russell <brussell@research.att.com> #
# Robin Chen <chen@research.att.com> #
# Don Caldwell <dfwc@research.att.com> #
# Lefty Koutsofios <ek@research.att.com> #
# Bob Gruber <bob.gruber@gmail.com> #
# Jia Wang <jiawang@research.att.com> #
# Jeff Fellin <jkf@research.att.com> #
# Jeff Korn <@google.com> #
# Kathleen Fisher <kfisher@research.att.com> #
# Ken Church <@microsoft.com> #
# Brian Kernighan <bwk@research.bell-labs.com> #
# Dennis Ritchie <dmr@research.bell-labs.com> #
# Doug McIlroy <doug@research.bell-labs.com> #
# Eduardo Krell <ekrell@adexus.cl> #
# John Snyder <jjs@adexus.cl> #
# Herman Rao <rao@fareastone.att.com.tw> #
# AST users mailgroup <ast-users@research.att.com> #
# AST developers mailgroup <ast-developers@research.att.com> #
# #
########################################################################
bsd package general copyright notice
########################################################################
# #
# This software is part of the BSD package #
# Copyright (c) 1979-2012 The Regents of the University of California #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions #
# are met: #
# 1. Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in #
# the documentation and/or other materials provided with the #
# distribution. #
# 3. Neither the name of the University nor the names of its #
# contributors may be used to endorse or promote products derived #
# from this software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" #
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT #
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF #
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND #
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT #
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF #
# SUCH DAMAGE. #
# #
# CONTRIBUTORS #
# #
# Bill Joy #
# #
########################################################################
-101
View File
@@ -1,101 +0,0 @@
## Eclipse Public License - v 2.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
### 1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and
b) in the case of each subsequent Contributor:
* i) changes to the Program, and
* ii) additions to the Program;
where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution "originates" from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works.
"Contributor" means any person or entity that Distributes the Program.
"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
"Program" means the Contributions Distributed in accordance with this Agreement.
"Recipient" means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors.
"Derivative Works" shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
"Modified Works" shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.
"Distribute" means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy.
"Source Code" means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Secondary License" means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor.
### 2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works.
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3).
### 3. REQUIREMENTS
3.1 If a Contributor Distributes the Program in any form, then:
a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and
b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license:
* i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
* ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
* iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and
* iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3.
3.2 When the Program is Distributed as Source Code:
a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and
b) a copy of this Agreement must be included with each copy of the Program.
3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability ('notices') contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices.
### 4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
### 5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
### 6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
### 7. GENERAL
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version.
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement.
### Exhibit A – Form of Secondary Licenses Notice
"This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}."
> Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses.
>
> If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
>
> You may add additional accurate notices of copyright ownership.
File diff suppressed because it is too large. Load diff
-197
View File
@@ -1,197 +0,0 @@
![](https://github.com/ksh93/ksh/workflows/CI/badge.svg)
# KornShell 93u+m
This is version 1.0.x of the 93u+m fork of the KornShell, including a
sizeable number of enhancements and roughly a thousand bugfixes compared
to the last stable release (93u+ 2012-08-01) of
[ksh93](http://www.kornshell.com/),
formerly developed by AT&T Software Technology (AST).
The sources in this repository were forked from the
GitHub [AST repository](https://github.com/att/ast)
which is no longer under active development.
For information on the shell, see
[`src/cmd/ksh93/README`](https://github.com/ksh93/ksh/tree/1.0/src/cmd/ksh93#readme)
and other files in the same directory.
For user-visible fixes, see [NEWS](https://github.com/ksh93/ksh/blame/1.0/NEWS)
and click on commit messages for full details.
For all fixes, see [the commit log](https://github.com/ksh93/ksh/commits/1.0).
For known issues in the current release, see [TODO](https://github.com/ksh93/ksh/blob/1.0/TODO).
## Build
To build ksh with a custom configuration of features, edit
[`src/cmd/ksh93/SHOPT.sh`](https://github.com/ksh93/ksh/blob/1.0/src/cmd/ksh93/SHOPT.sh).
Then `cd` to the top directory and run:
```sh
bin/package make
```
The compiled binaries are stored in the `arch` directory, in a subdirectory
that corresponds to your architecture. The command `bin/package host type`
outputs the name of this subdirectory.
If you have trouble or want to tune the binaries, you may pass additional
compiler and linker flags. It is usually best to export these as environment
variables *before* running `bin/package` as they could change the name of
the build subdirectory of the `arch` directory, so exporting them is a
convenient way to keep them consistent between build and test commands.
**Note that this system uses `CCFLAGS` instead of the usual `CFLAGS`.**
An example that makes Solaris Studio cc produce a 64-bit binary:
```sh
export CCFLAGS="-m64 -O" LDFLAGS="-m64"
bin/package make
```
Alternatively you can append these to the command, and they will only be
used for that command. You can also specify an alternative shell in which
to run the build scripts this way. For example:
```sh
bin/package make SHELL=/bin/bash CCFLAGS="-O2 -I/opt/local/include" LDFLAGS="-L/opt/local/lib"
```
**Note:** Do not add compiler flags that cause the compiler to emit terminal
escape codes, such as `-fdiagnostics-color=always`; this will cause the
build to fail as the probing code greps compiler diagnostics.
For more information run
```sh
bin/package help
```
Many other commands in this repo self-document via the `--help`, `--man` and
`--html` options; those that do have no separate manual page.
The autoloadable `man` function in
[`src/cmd/ksh93/fun/man`](https://github.com/ksh93/ksh/blob/1.0/src/cmd/ksh93/fun/man)
integrates this self-documentation into your regular `man` command.
### Test
After compiling, you can run the regression tests.
To run the default test sets for ksh and the build system, use:
```sh
bin/package test
```
For ksh, use the `shtests` command directly to control the regression test runs.
Start by reading the information printed by:
```sh
bin/shtests --man
```
### Install
Usage: `bin/package install` *destination_directory* [ *command* ... ]
Any command from the `arch` directory can be installed. If no *command* is
specified, `ksh` and `shcomp` are assumed.
The *destination_directory* is created if it does not exist. Commands are
installed in its `bin` subdirectory and each command's manual page, if
available, is installed in `share/man`.
Destination directories with whitespace or shell pattern characters in their
pathnames are not yet supported.
## What is ksh93?
The following is the official AT&T description from 1993 that came with the
ast-open distribution. The text is original, but hyperlinks were added here.
----
KSH-93 is the most recent version of the KornShell Language described in
"The KornShell Command and Programming Language," by Morris Bolsky and David
Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. The KornShell is a shell
programming language, which is upward compatible with "sh" (the Bourne
Shell), and is intended to conform to the IEEE P1003.2/ISO 9945.2
[Shell and Utilities standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html).
KSH-93 provides an enhanced programming environment in addition to the major
command-entry features of the BSD shell "csh". With KSH-93, medium-sized
programming tasks can be performed at shell-level without a significant loss
in performance. In addition, "sh" scripts can be run on KSH-93 without
modification.
The code should conform to the
[IEEE POSIX 1003.1 standard](http://www.opengroup.org/austin/papers/posix_faq.html)
and to the proposed ANSI C standard so that it should be portable to all
such systems. Like the previous version, KSH-88, it is designed to accept
eight bit character sets transparently, thereby making it internationally
compatible. It can support multi-byte characters sets with some
characteristics of the character set given at run time.
KSH-93 provides the following features, many of which were also inherent in
KSH-88:
* Enhanced Command Re-entry Capability: The KSH-93 history function records
commands entered at any shell level and stores them, up to a
user-specified limit, even after you log off. This allows you to re-enter
long commands with a few keystrokes - even those commands you entered
yesterday. The history file allows for eight bit characters in commands
and supports essentially unlimited size histories.
* In-line Editing: In "sh", the only way to fix mistyped commands is to
backspace or retype the line. KSH-93 allows you to edit a command line
using a choice of EMACS-TC or "vi" functions. You can use the in-line
editors to complete filenames as you type them. You may also use this
editing feature when entering command lines from your history file. A user
can capture keystrokes and rebind keys to customize the editing interface.
* Extended I/O Capabilities: KSH-93 provides several I/O capabilities not
available in "sh", including the ability to:
* specify a file descriptor for input and output
* start up and run co-processes
* produce a prompt at the terminal before a read
* easily format and interpret responses to a menu
* echo lines exactly as output without escape processing
* format output using printf formats.
* read and echo lines ending in "\\".
* Improved performance: KSH-93 executes many scripts faster than the System
V Bourne shell. A major reason for this is that many of the standard
utilities are built-in. To reduce the time to initiate a command, KSH-93
allows commands to be added as built-ins at run time on systems that
support dynamic loading such as System V Release 4.
* Arithmetic: KSH-93 allows you to do integer arithmetic in any base from
two to sixty-four. You can also do double precision floating point
arithmetic. Almost the complete set of C language operators are available
with the same syntax and precedence. Arithmetic expressions can be used to
as an argument expansion or as a separate command. In addition, there is an
arithmetic for command that works like the for statement in C.
* Arrays: KSH-93 supports both indexed and associative arrays. The subscript
for an indexed array is an arithmetic expression, whereas, the subscript
for an associative array is a string.
* Shell Functions and Aliases: Two mechanisms - functions and aliases - can
be used to assign a user-selected identifier to an existing command or
shell script. Functions allow local variables and provide scoping for
exception handling. Functions can be searched for and loaded on first
reference the way scripts are.
* Substring Capabilities: KSH-93 allows you to create a substring of any
given string either by specifying the starting offset and length, or by
stripping off leading or trailing substrings during parameter
substitution. You can also specify attributes, such as upper and lower
case, field width, and justification to shell variables.
* More pattern matching capabilities: KSH-93 allows you to specify extended
regular expressions for file and string matches.
* KSH-93 uses a hierarchical name space for variables. Compound variables can
be defined and variables can be passed by reference. In addition, each
variable can have one or more disciplines associated with it to intercept
assignments and references.
* Improved debugging: KSH-93 can generate line numbers on execution traces.
Also, I/O redirections are now traced. There is a DEBUG trap that gets
evaluated before each command so that errors can be localized.
* Job Control: On systems that support job control, including System V
Release 4, KSH-93 provides a job-control mechanism almost identical to
that of the BSD "csh", version 4.1. This feature allows you to stop and
restart programs, and to move programs between the foreground and the
background.
* Added security: KSH-93 can execute scripts which do not have read
permission and scripts which have the setuid and/or setgid set when
invoked by name, rather than as an argument to the shell. It is possible
to log or control the execution of setuid and/or setgid scripts. The
noclobber option prevents you from accidentally erasing a file by
redirecting to an existing file.
* KSH-93 can be extended by adding built-in commands at run time. In
addition, KSH-93 can be used as a library that can be embedded into an
application to allow scripting.
Documentation for KSH-93 consists of an "Introduction to KSH-93",
"Compatibility with the Bourne Shell" and a manual page and a README file.
In addition, the "New KornShell Command and Programming Language" book is
available from Prentice Hall.
-70
View File
@@ -1,70 +0,0 @@
The following bugs and issues are known for ksh 93u+m 1.0.3:
Memory leak when initialising associative array in subshell
https://github.com/ksh93/ksh/issues/94
command substitution botches output of non-waited-for child processes
https://github.com/ksh93/ksh/issues/124
wrong typeset -p output after unsetting multidimensional array elements
https://github.com/ksh93/ksh/issues/148
printf %T date parsing: GNU-style "ago" date spec completely broken
https://github.com/ksh93/ksh/issues/182
typeset -L/-R: string length breaks on multibyte characters
https://github.com/ksh93/ksh/issues/189
Unicode code points in $'...' strings should vary according to the locale
https://github.com/ksh93/ksh/issues/193
Variable expansion corruption in single-line function on 32-bit systems
https://github.com/ksh93/ksh/issues/203
Segfault with very large extended glob patterns
https://github.com/ksh93/ksh/issues/207
process substitution cannot be part of a larger argument
https://github.com/ksh93/ksh/issues/215
Nested compound assignment misparsed in $(...) command substitution
https://github.com/ksh93/ksh/issues/269
Builtins don't handle I/O errors
https://github.com/ksh93/ksh/issues/313
bug in printf when %b and %x$ are used in same format
https://github.com/ksh93/ksh/issues/324
Associative arrays of various types fail to be unset
https://github.com/ksh93/ksh/issues/345
Variable with discipline function in subshell causes memory leak
https://github.com/ksh93/ksh/issues/404
Memory leak(s) when modifying PATH in various contexts
https://github.com/ksh93/ksh/issues/405
Discipline function .unset only called once for array subscripts
https://github.com/ksh93/ksh/issues/419
Function autoload apparently broken on DragonFly BSD
https://github.com/ksh93/ksh/issues/432
confusing behaviour of backreferences with alternation
https://github.com/ksh93/ksh/issues/447
Alias expansion loop not detected in command substitution
https://github.com/ksh93/ksh/issues/458
Make KEYBD trap handling code multibyte-aware
https://github.com/ksh93/ksh/issues/460
$LINENO incorrect after compound assignment
https://github.com/ksh93/ksh/issues/484
Shell quoting within bracket patterns has no effect
https://github.com/ksh93/ksh/issues/488
OPTIND not initialised correctly on Solaris/SPARC when compiled with gcc
https://github.com/ksh93/ksh/issues/515
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env sh
IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches
let() { return $((!($1))); }
# Automatically (re-)indent make...done blocks in a Mamfile.
# Usage: Mamfile_indent <Mamfile >Mamfile.new
#
# Should work on all current POSIX compliant shells.
# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain.
# Spacing per indentation level. Edit to change style.
indent=' ' # one tab
# Remove existing indentation, add new indentation.
indentlvl=0
sed 's/^[[:space:]]*//' \
| while read -r line
do case $line in
'') continue ;;
done*) let "indentlvl -= 1" ;;
esac
spc=
i=0
while let "(i += 1) <= indentlvl"
do spc=$indent$spc
done
printf '%s\n' $spc$line
case $line in
make*) let "indentlvl += 1" ;;
esac
done
@@ -1,30 +0,0 @@
#!/usr/bin/env sh
IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches
CCn='
' # newline
let() { return $((!($1))); }
# Remove unused variable definitions from a Mamfile.
# Usage: Mamfile_rm_unused_vars <Mamfile >Mamfile.new
#
# Should work on all current POSIX compliant shells.
# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain.
#
# All variables are declared with 'setv' and they are used if an expansion
# of the form ${varname} exists (the braces are mandatory in Mamfiles).
mamfile=$(let $# && cat "$1" || cat)
vars=$(printf '%s\n' $mamfile | awk '$1 == "setv" { print $2; }')
rm_unused_ere=
IFS=$CCn; for varname in $vars; do IFS=
case $mamfile in
*"\${$varname}"* )
;;
* ) # add with '|' separator for Extended Regular Expression
rm_unused_ere="${rm_unused_ere:+$rm_unused_ere|}setv[[:blank:]]+$varname([[:blank:]]|$)" ;;
esac
done
case $rm_unused_ere in
'') printf '%s\n' $mamfile ;;
*) printf '%s\n' $mamfile | grep -vE $rm_unused_ere ;;
esac
-33
View File
@@ -1,33 +0,0 @@
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1994-2011 AT&T Intellectual Property #
# Copyright (c) 2020-2022 Contributors to ksh 93u+m #
# and is licensed under the #
# Eclipse Public License, Version 2.0 #
# #
# A copy of the License is available at #
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html #
# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) #
# #
# Glenn Fowler <gsf@research.att.com> #
# Martijn Dekker <martijn@inlv.org> #
# #
########################################################################
# non-ksh script for the nmake ignore prefix
# @(#)ignore (ksh 93u+m) 2021-12-31
while :
do case $# in
0) exit 0 ;;
esac
case $1 in
*=*) export "$1"
shift
;;
*) break
;;
esac
done
"$@"
exit 0
-270
View File
@@ -1,270 +0,0 @@
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1994-2011 AT&T Intellectual Property #
# Copyright (c) 2020-2022 Contributors to ksh 93u+m #
# and is licensed under the #
# Eclipse Public License, Version 2.0 #
# #
# A copy of the License is available at #
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html #
# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) #
# #
# Glenn Fowler <gsf@research.att.com> #
# Martijn Dekker <martijn@inlv.org> #
# #
########################################################################
### this script contains archaic constructs that work with all sh variants ###
# mamprobe - generate MAM cc probe info
# Glenn Fowler <gsf@research.att.com>
(command set -o posix) 2>/dev/null && set -o posix
command=mamprobe
bins=`
(
userPATH=$PATH
PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH
getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH"
) | sed 's/:/ /g'
` || exit
# check the options
opt=
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
0123) USAGE=$'
[-?
@(#)$Id: mamprobe (AT&T Labs Research) 2011-02-11 $
]
[+NAME?mamprobe - generate MAM cc probe info]
[+DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1)
probe information for use by \bmamake\b(1). \acc-path\a is the
absolute path of the probed compiler and \ainfo-file\a is where
the information is placed. \ainfo-file\a is usually
\b$INSTALLROOT/lib/probe/C/mam/\b\ahash\a, where \ahash\a is a hash
of \acc-path\a. Any \ainfo-file\a directories are created if needed.
If \ainfo-file\a is \b-\b then the probe information is written to
the standard output.]
[+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of
\bpackage\b(1) installation before \bnmake\b(1) is built. The
probed variable names are the \bnmake\b(1) names with a \bmam_\b
prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b.
Additional variables are:]{
[+_hosttype_?the \bpackage\b(1) host type]
[+mam_cc_L?\b-L\b\adir\a supported]
[+STDCAT?command to execute for \bcat\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
[+STDCHMOD?command to execute for \bchmod\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
[+STDCMP?command to execute for \bcmp\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
[+STDCP?command to execute for \bcp\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
[+STDED?command to execute for \bed\b(1) or \bex\b(1)]
[+STDEDFLAGS?flags for \bSTDED\b]
[+STDLN?command to execute for \bln\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
[+STDMV?command to execute for \bmv\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
[+STDRM?command to execute for \brm\b(1); prefixed by
\bexecrate\b(1) on \b.exe\b challenged systems]
}
[d:debug?Enable probe script debug trace.]
info-file cc-path
[+SEE ALSO?\bexecrate\b(1), \bpackage\b(1), \bmamake\b(1), \bnmake\b(1),
\bprobe\b(1)]
'
while getopts -a "$command" "$USAGE" OPT
do case $OPT in
d) opt=-d ;;
esac
done
shift `expr $OPTIND - 1`
;;
*) while :
do case $# in
0) break ;;
esac
case $1 in
--) shift
break
;;
-) break
;;
-d) opt=-d
;;
-*) echo $command: $1: unknown option >&2
;;
*) break
;;
esac
set ''
break
done
;;
esac
# check the args
case $1 in
-) ;;
/*) ;;
*) set '' ;;
esac
case $2 in
/*) ;;
*) set '' ;;
esac
case $# in
0|1) echo "Usage: $command info-file cc-path" >&2; exit 2 ;;
esac
info=$1
shift
cc=$*
# find the make probe script
ifs=${IFS-'
'}
IFS=:
set $PATH
IFS=$ifs
script=lib/probe/C/make/probe
while :
do case $# in
0) echo "$0: ../$script: probe script not found on PATH" >&2
exit 1
;;
esac
case $1 in
'') continue ;;
esac
makeprobe=`echo $1 | sed 's,[^/]*$,'$script,`
if test -x $makeprobe
then break
fi
shift
done
# create the info dir if necessary
case $info in
/*) i=X$info
ifs=${IFS-'
'}
IFS=/
set $i
IFS=$ifs
while :
do i=$1
shift
case $i in
X) break ;;
esac
done
case $info in
//*) path=/ ;;
*) path= ;;
esac
while :
do case $# in
0|1) break ;;
esac
comp=$1
shift
case $comp in
'') continue ;;
esac
path=$path/$comp
if test ! -d $path
then mkdir $path || exit
fi
done
;;
esac
# generate info in a tmp file and rename when finished
case $info in
-) ;;
*) tmp=${TMPDIR:-/tmp}/mam$$
trap "exec >/dev/null; rm -f $tmp" 0 1 2 3 15
exec > $tmp
echo "probing C language processor $cc for mam information" >&2
;;
esac
echo "note generated by $0 for $cc"
(
set '' $opt $cc
shift
. $makeprobe "$@"
case " $CC_DIALECT " in
*" -L "*) echo "CC.L = 1" ;;
esac
) | sed \
-e '/^CC\./!d' \
-e 's/^CC./setv mam_cc_/' \
-e 's/^\([^=.]*\)\./\1_/' \
-e 's/^\([^=.]*\)\./\1_/' \
-e 's/ =//' \
-e 's/\$("\([^"]*\)")/\1/g' \
-e 's/\$(\([^)]*\))/${\1}/g' \
-e 's/\${CC\./${mam_cc_}/g'
echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}'
# STD* are standard commands/flags with possible execrate(1)
if (
ed <<!
q
!
) < /dev/null > /dev/null 2>&1
then STDED=ed
else STDED=ex
fi
STDEDFLAGS=-
set STDCAT cat STDCHMOD chmod STDCMP cmp STDCP cp STDLN ln STDMV mv STDRM rm
while :
do case $# in
0|1) break ;;
esac
p=$2
for d in $bins
do if test -x $d/$p
then p=$d/$p
break
fi
done
eval $1=\$p
shift
shift
done
if execrate
then for n in STDCAT STDCHMOD STDCMP STDCP STDLN STDMV STDRM
do eval $n=\"execrate \$$n\"
done
fi
for n in STDCAT STDCHMOD STDCMP STDCP STDED STDEDFLAGS STDLN STDMV STDRM
do eval echo setv \$n \$$n
done
# all done
case $info in
-) ;;
*) exec >/dev/null
test -f "$info" && rm -f "$info"
cp "$tmp" "$info"
chmod -w "$info"
;;
esac
File diff suppressed because it is too large. Load diff
-54
View File
@@ -1,54 +0,0 @@
#! /bin/sh
# Wrapper script to run the ksh93 regression tests without requiring nmake.
# By Martijn Dekker <martijn@inlv.org> 2020-05-14
# Public domain. http://creativecommons.org/publicdomain/zero/1.0/
#
# The manual: bin/shtests --man
# Brief help: bin/shtests --help
#
# By default, this runs your compiled arch/*/bin/ksh.
#
# Note: The test suite actually uses $SHELL to indicate the shell to test. But
# we cannot use the $SHELL environment value on entry to this wrapper script,
# as that is already used for the user's default login shell on most systems.
# Process and remove any assignment-argument indicating the shell to test
for arg do
case $arg in
( SHELL=* | KSH=* )
KSH=${arg#*=} ;;
( * ) set -- "$@" "$1" ;;
esac
shift
done
# Find root dir of ksh source
mydir=$(dirname "$0") \
&& mydir=$(CDPATH='' cd -P -- "$mydir/.." && printf '%sX' "$PWD") \
&& mydir=${mydir%X} \
|| exit
myarch=$("$mydir/bin/package" host type) || exit
# Check if there is a ksh to test.
case ${KSH+set} in
( '' ) KSH=$mydir/arch/$myarch/bin/ksh ;;
esac
if ! test -x "$KSH" || ! test -f "$KSH"; then
printf '%s: shell not found: %s\n' "${0##*/}" "$KSH" >&2
printf 'Specify a shell like: KSH=path/to/ksh bin/shtests\n' >&2
exit 1
fi
# Ensure absolute path to ksh
KSH=$(CDPATH='' cd -P -- "$(dirname "$KSH")" \
&& printf '%s/%sX' "$PWD" "${KSH##*/}") \
&& KSH=${KSH%X}
# Run the test suite
CDPATH='' cd -P -- "$mydir/src/cmd/ksh93/tests" || exit
SHELL=$KSH
INSTALLROOT=${INSTALLROOT:-$mydir/arch/$myarch}
export SHELL INSTALLROOT
unset -v KSH
printf '#### Regression-testing %s ####\n' "$SHELL"
exec "$SHELL" shtests "$@"
-32
View File
@@ -1,32 +0,0 @@
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1994-2011 AT&T Intellectual Property #
# Copyright (c) 2020-2022 Contributors to ksh 93u+m #
# and is licensed under the #
# Eclipse Public License, Version 2.0 #
# #
# A copy of the License is available at #
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html #
# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) #
# #
# Glenn Fowler <gsf@research.att.com> #
# Martijn Dekker <martijn@inlv.org> #
# #
########################################################################
# non-ksh stub for the nmake silent prefix
# @(#)silent (ksh 93u+m) 2021-12-31
while :
do case $# in
0) exit 0 ;;
esac
case $1 in
*=*) export "$1"
shift
;;
*) break
;;
esac
done
"$@"
-6
View File
@@ -1,6 +0,0 @@
<html>
<head><title>AST Software</title></head>
<body>
<a href='ksh/index.html'>The KornShell</a><br>
</body>
</html>
-710
View File
@@ -1,710 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META name="generator" content="mm2html (AT&amp;T Research) 2012-01-11">
<TITLE> www/ksh/builtins.mm mm document </TITLE>
<META name="author" content="gsf+dgk+kpv">
<STYLE type="text/css">
div.FI { padding-left:2em; text-indent:0em; }
div.HI { padding-left:4em; text-indent:-2em; }
dt { float:left; clear:both; }
dd { margin-left:3em; }
</STYLE>
</HEAD>
<BODY bgcolor=white link=slateblue vlink=teal >
<TABLE border=0 align=center width=96%>
<TBODY><TR><TD valign=top align=left>
<!--INDEX--><!--/INDEX-->
<P>
<CENTER>
<H3><CENTER><FONT color=red><FONT face=courier>Guidelines for writing <TT>ksh-93</TT> built-in commands</FONT></FONT></CENTER></H3>
<BR>David G. Korn
<P><I></I>
</CENTER>
<P>
<CENTER><FONT color=red><FONT face=courier><H3 align=center><A name="Abstract">Abstract</A></H3></FONT></FONT></CENTER>
One of the features of <TT>ksh93</TT>, the latest version of <TT>ksh</TT>,
is the ability to add built-in commands at run time.
This feature only works on operating systems that have the ability
to load and link code into the current process at run time.
Some examples of the systems that have this feature
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
commands.
<P>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="INTRODUCTION">INTRODUCTION</A></H3></FONT></FONT></CENTER>
A built-in command is executed without creating a separate process.
Instead, the command is invoked as a C function by <TT>ksh</TT>.
If this function has no side effects in the shell process,
then the behavior of this built-in is identical to that of
the equivalent stand-alone command. The primary difference
in this case is performance. The overhead of process creation
is eliminated. For commands of short duration, the effect
can be dramatic. For example, on SUN OS 4.1, the time to
run <TT>wc</TT> on a small file of about 1000 bytes, runs
about 50 times faster as a built-in command.
<P>
In addition, built-in commands may have side effects on the
shell environment.
This is usually done to extend the application domain for
shell programming. For example, there is a group of X-windows extension
built-ins that make heavy use of the shell variable namespace.
These built-ins are added at run time and
result in a windowing shell that can be used to write
X-windows applications.
<P>
While there are definite advantages to adding built-in
commands, there are some disadvantages as well.
Since the built-in command and <TT>ksh</TT> share the same
address space, a coding error in the built-in program
may affect the behavior of <TT>ksh</TT>; perhaps causing
it to core dump or hang.
Debugging is also more complex since your code is now
a part of a larger entity.
The isolation provided by a separate process
guarantees that all resources used by the command
will be freed when the command completes.
Resources used by a built-in must be meticulously maintained and freed.
Also, since the address space of <TT>ksh</TT> will be larger when built-in are loaded,
it may increase the time it takes <TT>ksh</TT> to fork() and
exec() non-built-in commands.
It makes no sense to add a built-in command that takes
a long time to run or that is run only once, since the performance
benefits will be negligible.
Built-ins that have side effects in the current shell
environment have the disadvantage of increasing the
coupling between the built-in and <TT>ksh</TT>, making
the overall system less modular and more monolithic.
<P>
Despite these drawbacks, in many cases extending
<TT>ksh</TT> by adding built-in
commands makes sense and allows reuse of the shell
scripting ability in an application specific domain.
This memo describes how to write <TT>ksh</TT> extensions.
<P>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="WRITING BUILT-IN COMMANDS">WRITING BUILT-IN COMMANDS</A></H3></FONT></FONT></CENTER>
There is a development kit available for writing <TT>ksh</TT>
built-ins as part of the AST (AT&amp;T Software Technology) Toolkit.
The development kit has three directories,
<TT>include</TT>, <TT>lib</TT>, and <TT>bin</TT>.
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 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
and a library named <TT>cmd</TT> that contains a version
of several of the standard POSIX<FONT SIZE=-6>[1]</FONT>
utilities that can be made run time built-ins.
The <TT>lib/ksh</TT> directory contains shared libraries
that implement other <TT>ksh</TT> built-ins.
The <TT>bin</TT> directory contains build tools such as <TT>nmake</TT><FONT SIZE=-6>[2]</FONT>.
To add built-ins at runtime, it is necessary to build a shared library
containing one or more built-ins that you wish to add.
The built-ins are then added by running <TT>builtin &#45;f</TT> <EM>shared_lib</EM>.
Since the procedure for building share libraries is system dependent,
it is best to use
<TT>nmake</TT>
using the sample nmake makefile below as a prototype.
The AST Toolkit also contains some examples of built-in libraries under
the <TT>src/cmd/kshlib</TT> directory.
<P>
There are two ways to code adding built-ins. One method is to replace
the function <TT>main</TT> with a function
<TT>b_</TT><EM>name</EM>, where <EM>name</EM> is the name
of the built-in you wish to define.
A built-in command has a calling convention similar to
the <TT>main</TT> function of a program,
<TT>int main(int argc, char *argv&#0091;&#0093;)</TT>.
except that it takes a third argument of type <TT>Shbltin_t*</TT> which can
be passed as <TT><FONT SIZE=-1>NULL</FONT></TT> if it is not used. The definition for
<TT>Shbltin_t*</TT> is in <TT>&lt;ast/shcmd.h&gt;</TT>.
Instead of <TT>exit</TT>, you need to use <TT>return</TT>
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 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>
<TT>sh_exit</TT>, and <TT>sh_addbuiltin</TT>, respectively. These functions
can be invoked without the need for runtime symbol lookup when the
shell is statically linked with <TT>libshell</TT>.
<P>
The alternative method is to create a function <TT>lib_init</TT> and
use the <TT>Shbltin_t.shbltin()</TT> function to add one or more built-ins.
The <TT>lib_init</TT> function will be called with two arguments. The
first argument will be 0 when the library is loaded and the second
argument will be of type <TT>Shbltin_t*</TT>.
The <TT>dbm_t</TT> and <TT>dss</TT> shell built-ins use this method.
<P>
No matter which way you add built-ins you should add the line
<TT>SHLIB(</TT><EM>identifier</EM><TT>)</TT> as the last line of one
of the built-in source file, where <EM>identifier</EM> is any C identifier.
This line provides version information to the shell <TT>builtin</TT> command
that it uses to verify compatibility between the built-in and <TT>ksh</TT>
implementation versions. <TT>builtin</TT> fails with a diagnostic on version
mismatch. The diagnostic helps determine whether <TT>ksh</TT> is out of
date and requires an upgrade or the built-in is out of date and requires
recompilation.
<P>
The steps necessary to create and add a run time built-in are
illustrated in the following simple example.
Suppose you wish to add a built-in command named <TT>hello</TT>
which requires one argument and prints the word hello followed
by its argument. First, write the following program in the file
<TT>hello.c</TT>:
<DIV class=FI>
<PRE>
#include &lt;stdio.h&gt;
int b_hello(int argc, char *argv&#0091;&#0093;, void *context)
{
if(argc != 2)
{
fprintf(stderr,"Usage: hello arg&#0092;n");
return(2);
}
printf("hello %s&#0092;n",argv&#0091;1&#0093;);
return(0);
}
SHLIB(hello)
</DIV>
</PRE>
<P>
Next, the program needs to be compiled.
If you are building with AT&amp;T <TT>nmake</TT> use the following <TT>Makefile</TT>:
<DIV class=FI>
<PRE>
:PACKAGE: --shared ast
hello plugin=ksh :LIBRARY: hello.c
</DIV>
</PRE>
and run <TT>nmake install</TT> to compile, link, and install the built-in shared library
in <TT>lib/ksh/</TT> under <TT>PACKAGE_ast</TT>.
If the built-in extension uses several <TT>.c</TT> files, list all of these on
the <TT>:LIBRARY:</TT> line.
<P>
Otherwise you will have to compile <TT>hello.c</TT> with an option
to pick up the AST include directory
(since the AST <TT>&lt;stdio.h&gt;</TT> is required for <TT>ksh</TT> compatibility)
and options required for generating shared libraries.
For example, on Linux use this to compile:
<DIV class=FI>
<PRE>
cc -fpic -I$PACKAGE_ast/include/ast -c hello.c
</DIV>
</PRE>
and use the appropriate link line.
It really is best to use <TT>nmake</TT> because the 2 line Makefile above
will work on all systems that have <TT>ksh</TT> installed.
<P>
If you have several built-ins, it is desirable
to build a shared library that contains them all.
<P>
The final step is using the built-in.
This can be done with the <TT>ksh</TT> command <TT>builtin</TT>.
To load the shared library <TT>libhello.so</TT> from the current directory
and add the built-in <TT>hello</TT>, invoke the command,
<DIV class=FI>
<PRE>
builtin -f ./libhello.so hello
</DIV>
</PRE>
The shared library prefix (<TT>lib</TT> here) and suffix (<TT>.so</TT> here) be omitted;
the shell will add an appropriate suffix
for the system that it is loading from.
If you install the shared library in <TT>lib/ksh/</TT>, where <TT>../lib/ksh/</TT> is
a directory on <STRONG>$PATH</STRONG>, the command
<DIV class=FI>
<PRE>
builtin -f hello hello
</DIV>
</PRE>
will automatically find, load and install the built-in on any system.
Once this command has been invoked, you can invoke <TT>hello</TT>
as you do any other command.
If you are using <TT>lib_init</TT> method to add built-ins then no arguments
follow the <TT>&#45;f</TT> option.
<P>
It is often desirable to make a command <EM>built-in</EM>
the first time that it is referenced. The first
time <TT>hello</TT> is invoked, <TT>ksh</TT> should load and execute it,
whereas for subsequent invocations <TT>ksh</TT> should just execute the built-in.
This can be done by creating a file named <TT>hello</TT>
with the following contents:
<DIV class=FI>
<PRE>
function hello
{
unset -f hello
builtin -f hello hello
hello "$@"
}
</DIV>
</PRE>
This file <TT>hello</TT> needs to be placed in a directory that is
in your <STRONG><FONT SIZE=-1>FPATH</FONT></STRONG> variable, and the built-in shared library
should be installed in <TT>lib/ksh/</TT>, as described above.
<P>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="CODING REQUIREMENTS AND CONVENTIONS">CODING REQUIREMENTS AND CONVENTIONS</A></H3></FONT></FONT></CENTER>
As mentioned above, the entry point for built-ins must either be of
the form <TT>b_</TT><EM>name</EM> or else be loaded from a function named
<TT>lib_init</TT>.
Your built-ins can call functions from the standard C library,
the <TT>ast</TT> library, interface functions provided by <TT>ksh</TT>,
and your own functions.
You should avoid using any global symbols beginning with
<STRONG>sh_</STRONG>,
<STRONG>nv_</STRONG>,
and
<STRONG>ed_</STRONG>
since these are used by <TT>ksh</TT> itself.
<TT>#define</TT> constants in <TT>ksh</TT> interface
files use symbols beginning with <TT>SH_</TT> and <TT>NV_</TT>,
so avoid using names beginning with these too.
<P>
<H4><A name="Header Files">Header Files</A></H4>
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&amp;R C<FONT SIZE=-6>[3]</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>&lt;shell.h&gt;</TT>.
This header file causes the <TT>&lt;ast.h&gt;</TT> header, the
<TT>&lt;error.h&gt;</TT> header and the <TT>&lt;stak.h&gt;</TT>
header to be included as well as defining prototypes
for functions that you can call to get shell
services for your builtins.
The header file <TT>&lt;ast.h&gt;</TT>
provides prototypes for many <STRONG>libast</STRONG> functions
and all the symbol and function definitions from the
ANSI C headers, <TT>&lt;stddef.h&gt;</TT>,
<TT>&lt;stdlib.h&gt;</TT>, <TT>&lt;stdarg.h&gt;</TT>, <TT>&lt;limits.h&gt;</TT>,
and <TT>&lt;string.h&gt;</TT>.
It also provides all the symbols and definitions for the
POSIX<FONT SIZE=-6>[6]</FONT>
headers <TT>&lt;sys/types.h&gt;</TT>, <TT>&lt;fcntl.h&gt;</TT>, and
<TT>&lt;unistd.h&gt;</TT>.
You should include <TT>&lt;ast.h&gt;</TT> instead of one or more of
these headers.
The <TT>&lt;error.h&gt;</TT> header provides the interface to the error
and option parsing routines defined below.
The <TT>&lt;stak.h&gt;</TT> header provides the interface to the memory
allocation routines described below.
<P>
Programs that want to use the information in <TT>&lt;sys/stat.h&gt;</TT>
should include the file <TT>&lt;ls.h&gt;</TT> instead.
This provides the complete POSIX interface to <TT>stat()</TT>
related functions even on non-POSIX systems.
<P>
<P>
<H4><A name="Input/Output">Input/Output</A></H4>
<TT>ksh</TT> uses <STRONG>sfio</STRONG>,
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.
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,
then you can use <TT>sfio</TT> via the <TT>stdio</TT> library
interface. The development kit contains the header <TT>&lt;stdio.h&gt;</TT>
which maps <TT>stdio</TT> calls to <TT>sfio</TT> calls.
In most instances the mapping is done
by macros or inline functions so that there is no overhead.
The man page for the <TT>sfio</TT> library is in an Appendix.
<P>
However, there are some very nice extensions and
performance improvements in <TT>sfio</TT>
and if you plan any major extensions I recommend
that you use it natively.
<P>
<H4><A name="Error Handling">Error Handling</A></H4>
For error messages it is best to use the <TT>ast</TT> library
function <TT>errormsg()</TT> rather that sending output to
<TT>stderr</TT> or the equivalent <TT>sfstderr</TT> directly.
Using <TT>errormsg()</TT> will make error message appear
more uniform to the user.
Furthermore, using <TT>errormsg()</TT> should make it easier
to do error message translation for other locales
in future versions of <TT>ksh</TT>.
<P>
The first argument to
<TT>errormsg()</TT> specifies the dictionary in which the string
will be searched for translation.
The second argument to <TT>errormsg()</TT> contains that error type
and value. The third argument is a <EM>printf</EM> style format
and the remaining arguments are arguments to be printed
as part of the message. A new-line is inserted at the
end of each message and therefore, should not appear as
part of the format string.
The second argument should be one of the following:
<DIV class=SH>
<DL>
<DT><TT>ERROR_exit(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
If <EM>n</EM> is not-zero, the builtin will exit value <EM>n</EM> after
printing the message.
<DT><TT>ERROR_system(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
Exit builtin with exit value <EM>n</EM> after printing the message.
The message will display the message corresponding to <TT>errno</TT>
enclosed within <TT>&#0091;&nbsp;&#0093;</TT> at the end of the message.
<DT><TT>ERROR_usage(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
Will generate a usage message and exit. If <EM>n</EM> is non-zero,
the exit value will be 2. Otherwise the exit value will be 0.
<DT><TT>ERROR_debug(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
Will print a level <EM>n</EM> debugging message and will then continue.
<DT><TT>ERROR_warn(</TT><EM>n</EM><TT>)</TT>:<DD><BR>
Prints a warning message. <EM>n</EM> is ignored.
</DL><P>
<H4><A name="Option Parsing">Option Parsing</A></H4>
The first thing that a built-in should do is to check
the arguments for correctness and to print any usage
messages on standard error.
For consistency with the rest of <TT>ksh</TT>, it is best
to use the <TT>libast</TT> functions <TT>optget()</TT> and
<TT>optusage()</TT>for this
purpose.
The header <TT>&lt;error.h&gt;</TT> includes prototypes for
these functions.
The <TT>optget()</TT> function is similar to the
System V C library function <TT>getopt()</TT>,
but provides some additional capabilities.
Built-ins that use <TT>optget()</TT> provide a more
consistent user interface.
<P>
The <TT>optget()</TT> function is invoked as
<DIV class=FI>
<PRE>
int optget(char *<EM>argv</EM>&#0091;&#0093;, const char *<EM>optstring</EM>)
</DIV>
</PRE>
where <TT>argv</TT> is the argument list and <TT>optstring</TT>
is a string that specifies the allowable arguments and
additional information that is used to format <EM>usage</EM>
messages.
In fact a complete man page in <TT>troff</TT> or <TT>html</TT>
can be generated by passing a usage string as described
by the <TT>getopts</TT> command.
Like <TT>getopt()</TT>,
single letter options are represented by the letter itself,
and options that take a string argument are followed by the <TT>:</TT>
character.
Option strings have the following special characters:
<DIV class=SH>
<DL>
<DT><TT>:</TT><DD>
Used after a letter option to indicate that the option
takes an option argument.
The variable <TT>opt_info.arg</TT> will point to this
value after the given argument is encountered.
<DT><TT>#</TT><DD>
Used after a letter option to indicate that the option
can only take a numerical value.
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
preceding option argument is not required.
<DT><TT>&#0091;</TT>...<TT>&#0093;</TT><DD><BR>
After a <TT>:</TT> or <TT>#</TT>, the characters contained
inside the brackets are used to identify the option
argument when generating a <EM>usage</EM> message.
<DT><EM>space</EM><DD><BR>
The remainder of the string will only be used when generating
usage messages.
</DL>
</DIV>
<P>
The <TT>optget()</TT> function returns the matching option letter if
one of the legal option is matched.
Otherwise, <TT>optget()</TT> returns
<DIV class=SH>
<DL>
<DT><TT>':'</TT><DD>
If there is an error. In this case the variable <TT>opt_info.arg</TT>
contains the error string.
<DT><TT>0</TT><DD>
Indicates the end of options.
The variable <TT>opt_info.index</TT> contains the number of arguments
processed.
<DT><TT>'?'</TT><DD>
A usage message has been required.
You normally call <TT>optusage()</TT> to generate and display
the usage message.
</DL>
</DIV>
<P>
The following is an example of the option parsing portion
of the <TT>wc</TT> utility.
<DIV class=FI>
<PRE>
#include &lt;shell.h&gt;
while(1) switch(n=optget(argv,"xf:&#0091;file&#0093;"))
{
case 'f':
file = opt_info.arg;
break;
case ':':
error(ERROR_exit(0), opt_info.arg);
break;
case '?':
error(ERROR_usage(2), opt_info.arg);
UNREACHABLE();
}
</DIV>
</PRE>
<P>
<H4><A name="Storage Management">Storage Management</A></H4>
It is important that any memory used by your built-in
be returned. Otherwise, if your built-in is called frequently,
<TT>ksh</TT> will eventually run out of memory.
You should avoid using <TT>malloc()</TT> for memory that must
be freed before returning from you built-in, because by default,
<TT>ksh</TT> will terminate you built-in in the event of an
interrupt and the memory will not be freed.
<P>
The best way to allocate variable sized storage is
through calls to the <STRONG>stak</STRONG> library
which is included in <STRONG>libast</STRONG>
and which is used extensively by <TT>ksh</TT> itself.
Objects allocated with the <TT>stakalloc()</TT>
function are freed when you function completes
or aborts.
The <STRONG>stak</STRONG> library provides a convenient way to
build variable length strings and other objects dynamically.
The man page for the <STRONG>stak</STRONG> library is contained
in the Appendix.
<P>
Before <TT>ksh</TT> calls each built-in command, it saves
the current stack location and restores it after
it returns.
It is not necessary to save and restore the stack
location in the <TT>b_</TT> entry function,
but you may want to write functions that use this stack
are restore it when leaving the function.
The following coding convention will do this in
an efficient manner:
<DIV class=FI>
<PRE>
<EM>yourfunction</EM>()
{
char *savebase;
int saveoffset;
if(saveoffset=staktell())
savebase = stakfreeze(0);
...
if(saveoffset)
stakset(savebase,saveoffset);
else
stakseek(0);
}
</DIV>
</PRE>
<P>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="CALLING <TT>ksh</TT> SERVICES">CALLING <TT>ksh</TT> SERVICES</A></H3></FONT></FONT></CENTER>
Some of the more interesting applications are those that extend
the functionality of <TT>ksh</TT> in application specific directions.
A prime example of this is the X-windows extension which adds
builtins to create and delete widgets.
The <STRONG>nval</STRONG> library is used to interface with the shell
name space.
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 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
variables.
A man page for this file is provided in an Appendix.
You need to include the header <TT>&lt;nval.h&gt;</TT>
to access the functions defined in the <STRONG>nval</STRONG> library.
All the functions provided by the <STRONG>nval</STRONG> library begin
with the prefix <TT>nv_</TT>.
Each shell variable is an object in an associative table
that is referenced by name.
The type <TT>Namval_t*</TT> is pointer to a shell variable.
To operate on a shell variable, you first get a handle
to the variable with the <TT>nv_open()</TT> function
and then supply the handle returned as the first
argument of the function that provides an operation
on the variable.
You must call <TT>nv_close()</TT> when you are finished
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> 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
so that if the value isn't used immediately, it should
be copied.
Many variables can also generate a numeric value.
The <TT>nv_getnum()</TT> function returns a numeric
value for the given variable pointer, calling the
arithmetic evaluator if necessary.
<P>
The <TT>nv_putval()</TT> function is used to assign a new
value to a given variable.
The second argument to <TT>putval()</TT> is the value
to be assigned
and the third argument is a <EM>flag</EM> which
is used in interpreting the second argument.
<P>
Each shell variable can have one or more attributes.
The <TT>nv_isattr()</TT> is used to test for the existence
of one or more attributes.
See the appendix for a complete list of attributes.
<P>
By default, each shell variable passively stores the string you
give with with <TT>nv_putval()</TT>, and returns the value
with <TT>getval()</TT>. However, it is possible to turn
any node into an active entity by assigning functions
to it that will be called whenever <TT>nv_putval()</TT>
and/or <TT>nv_getval()</TT> is called.
In fact there are up to five functions that can
associated with each variable to override the
default actions.
The type <TT>Namfun_t</TT> is used to define these functions.
Only those that are non-<TT>NULL</TT> override the
default actions.
To override the default actions, you must allocate an
instance of <TT>Namfun_t</TT>, and then assign
the functions that you wish to override.
The <TT>putval()</TT>
function is called by the <TT>nv_putval()</TT> function.
A <TT>NULL</TT> for the <EM>value</EM> argument
indicates a request to unset the variable.
The <EM>type</EM> argument might contain the <TT>NV_INTEGER</TT>
bit so you should be prepared to do a conversion if
necessary.
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 the arithmetic evaluator
and must return double.
If omitted, then it will call <TT>nv_getval()</TT> and
convert the result to a number.
<P>
The functionality of a variable can further be increased
by adding discipline functions that
can be associated with the variable.
A discipline function allows a script that uses your
variable to define functions whose name is
<EM>varname</EM><TT>.</TT><EM>discname</EM>
where <EM>varname</EM> is the name of the variable, and <EM>discname</EM>
is the name of the discipline.
When the user defines such a function, the <TT>settrap()</TT>
function will be called with the name of the discipline and
a pointer to the parse tree corresponding to the discipline
function.
The application determines when these functions are actually
executed.
By default, <TT>ksh</TT> defines <TT>get</TT>,
<TT>set</TT>, and <TT>unset</TT> as discipline functions.
<P>
In addition, it is possible to provide a data area that
will be passed as an argument to
each of these functions whenever any of these functions are called.
To have private data, you need to define and allocate a structure
that looks like
<DIV class=FI>
<PRE>
struct <EM>yours</EM>
{
Namfun_t fun;
<EM>your_data_fields</EM>;
};
</DIV>
</PRE>
<P>
<H4><A name="The shell library">The shell library</A></H4>
There are several functions that are used by <TT>ksh</TT> itself
that can also be called from built-in commands.
The man page for these routines are in the Appendix.
<P>
The <TT>sh_addbuiltin()</TT> function can be used to add or delete
builtin commands. It takes the name of the built-in, the
address of the function that implements the built-in, and
a <TT>void*</TT> pointer that will be passed to this function
as the third argument whenever it is invoked.
If the function address is <TT>NULL</TT>, the specified built-in
will be deleted. However, special built-in functions cannot
be deleted or modified.
<P>
The <TT>sh_fmtq()</TT> function takes a string and returns
a string that is quoted as necessary so that it can
be used as shell input.
This function is used to implement the <TT>%q</TT> option
of the shell built-in <TT>printf</TT> command.
<P>
The <TT>sh_parse()</TT> function returns a parse tree corresponding
to a give file stream. The tree can be executed by supplying
it as the first argument to
the <TT>sh_trap()</TT> function and giving a value of <TT>1</TT> as the
second argument.
Alternatively, the <TT>sh_trap()</TT> function can parse and execute
a string by passing the string as the first argument and giving <TT>0</TT>
as the second argument.
<P>
The <TT>sh_isoption()</TT> function can be used to set to see whether one
or more of the option settings is enabled.
</DIV>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="References">References</A></H3></FONT></FONT></CENTER>
<P>
<DL compact>
<DT>[1]<DD>
<EM>POSIX &#45; Part 2: Shell and Utilities,</EM>
IEEE Std 1003.2-1992, ISO/IEC 9945-2:1993.
<DT>[2]<DD>
Glenn Fowler,
<EM>A Case for make</EM>,
Software - Practice and Experience, Vol. 20 No. S1, pp. 30-46, June 1990.
<DT>[3]<DD>
Brian W. Kernighan and Dennis M. Ritchie,
<EM>The C Programming Language</EM>,
Prentice Hall, 1978.
<DT>[4]<DD>
American National Standard for Information Systems &#45; Programming
Language &#45; C, ANSI X3.159-1989.
<DT>[5]<DD>
Bjarne Stroustroup,
<EM>C++</EM>,
Addison Wesley, xxxx
<DT>[6]<DD>
<EM>POSIX &#45; Part 1: System Application Program Interface,</EM>
IEEE Std 1003.1-1990, ISO/IEC 9945-1:1990.
<DT>[7]<DD>
David Korn and Kiem-Phong Vo,
<EM>SFIO - A Safe/Fast Input/Output library,</EM>
Proceedings of the Summer Usenix,
pp. , 1991.
</DL>
<P>
<HR>
<TABLE border=0 align=center width=96%>
<TR>
<TD align=left></TD>
<TD align=center></TD>
<TD align=right>March 13, 2012</TD>
</TR>
</TABLE>
<P>
</TD></TR></TBODY></TABLE>
</BODY>
</HTML>
@@ -1,55 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META name="generator" content="mm2html (AT&amp;T Research) 2012-01-11">
<TITLE> www/ksh/examples.mm mm document </TITLE>
<META name="author" content="gsf+dgk+kpv">
<STYLE type="text/css">
div.FI { padding-left:2em; text-indent:0em; }
div.HI { padding-left:4em; text-indent:-2em; }
dt { float:left; clear:both; }
dd { margin-left:3em; }
</STYLE>
</HEAD>
<BODY bgcolor=white link=slateblue vlink=teal >
<TABLE border=0 align=center width=96%>
<TBODY><TR><TD valign=top align=left>
<!--INDEX--><!--/INDEX-->
<P>
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="Sample Functions">Sample Functions</A></H3></FONT></FONT></CENTER>
<P></P><TABLE border=0 frame=void rules=none width=100%><TBODY><TR><TD>
<TABLE align=center bgcolor=papayawhip border=0 bordercolor=white cellpadding=2 cellspacing=2 frame=void rules=none >
<TBODY>
<TR><TD align=left>
<A href="functions/dirs.txt">dirs</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="functions/getopt.txt">getopt</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="functions/popd.txt">popd</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="functions/title.txt">title</A></TD></TR>
<TR><TD align=left>
<A href="functions/emacs_keybind.txt">emacs_keybind</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="functions/keybind.txt">keybind</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="functions/pushd.txt">pushd</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="functions/vi_keybind.txt">vi_keybind</A></TD></TR>
</TBODY></TABLE></TD></TR></TBODY></TABLE>
<P>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="Sample Scripts">Sample Scripts</A></H3></FONT></FONT></CENTER>
<P></P><TABLE border=0 frame=void rules=none width=100%><TBODY><TR><TD>
<TABLE align=center bgcolor=papayawhip border=0 bordercolor=white cellpadding=2 cellspacing=2 frame=void rules=none >
<TBODY>
<TR><TD align=left>
<A href="scripts/cgi-lib.ksh.txt">cgi-lib.ksh</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="scripts/env.txt">env</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="scripts/which.txt">which</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;&nbsp;</TD></TR>
<TR><TD align=left>
<A href="scripts/dump-cgi.ksh.txt">dump-cgi.ksh</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;<A href="scripts/line.txt">line</A>&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD align=left>&nbsp;&nbsp;&nbsp;</TD></TR>
</TBODY></TABLE></TD></TR></TBODY></TABLE>
<P>
<HR>
<TABLE border=0 align=center width=96%>
<TR>
<TD align=left></TD>
<TD align=center></TD>
<TD align=right>March 13, 2012</TD>
</TR>
</TABLE>
<P>
</TD></TR></TBODY></TABLE>
</BODY>
</HTML>
File diff suppressed because it is too large. Load diff
-207
View File
@@ -1,207 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META name="generator" content="mm2html (AT&amp;T Research) 2012-01-11">
<TITLE> www/ksh/features.mm mm document </TITLE>
<META name="author" content="gsf+dgk+kpv">
<STYLE type="text/css">
div.FI { padding-left:2em; text-indent:0em; }
div.HI { padding-left:4em; text-indent:-2em; }
dt { float:left; clear:both; }
dd { margin-left:3em; }
</STYLE>
</HEAD>
<BODY bgcolor=white link=slateblue vlink=teal >
<TABLE border=0 align=center width=96%>
<TBODY><TR><TD valign=top align=left>
<!--INDEX--><!--/INDEX-->
<P>
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh features">ksh features</A></H3></FONT></FONT></CENTER>
KSH-93 is the most recent version of the KornShell Language described in
<EM>The KornShell Command and Programming Language</EM>,
by Morris Bolsky and David Korn of AT&amp;T Research.
The KornShell is a shell programming language,
which is upward compatible with
<EM>sh</EM>
(the Bourne Shell),
and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and
Utilities standard.
KSH-93 provides an enhanced programming environment in
addition to the major command-entry features of the BSD
shell
<EM>csh</EM>.
With KSH-93, medium-sized programming tasks can be
performed at shell-level without a significant loss in performance.
In addition,
<EM>sh</EM>
scripts can be run on KSH-93 without modification.
<P>
The code should conform to the IEEE POSIX 1003.1 standard and to the
proposed ANSI C standard so that it should be portable to all
such systems.
Like the previous version, KSH-88,
it is designed to accept eight bit character sets
transparently, thereby making it internationally compatible.
It can support multi-byte characters sets with some characteristics
of the character set given at run time.
<P>
KSH-93 provides the following features, many of which were also inherent
in KSH-88:
<P>
<H4><A name="Enhanced Command Re-entry Capability">Enhanced Command Re-entry Capability</A></H4>
The KSH-93 history
function records commands entered at any shell level and stores
them, up to a user-specified limit, even after you log off.
This allows you to re-enter long commands with a few keystrokes
- even those commands you entered yesterday.
The history file allows for eight bit characters in
commands and supports essentially unlimited size histories.
<P>
<H4><A name="In-line Editing">In-line Editing</A></H4>
In
<EM>sh</EM>
the only way to fix mistyped
commands is to backspace or retype the line.
KSH-93 allows you
to edit a command line using a choice of EMACS-TC or
<EM>vi</EM>
functions.
You can use the in-line editors to complete filenames as
you type them.
You may also use this editing feature when entering
command lines from your history file.
A user can capture keystrokes and rebind keys to customize the
editing interface.
<P>
<H4><A name="Extended I/O Capabilities">Extended I/O Capabilities</A></H4>
KSH-93 provides several I/O
capabilities not available in
<EM>sh</EM>,
including the ability to:
<UL type=square>
<LI>
specify a file descriptor for input and output
<LI>
start up and run co-processes
<LI>
produce a prompt at the terminal before a read
<LI>
easily format and interpret responses to a menu
<LI>
echo lines exactly as output without escape processing
<LI>
format output using printf formats.
<LI>
read and echo lines ending in "&#0092;e".
</UL>
<P>
<H4><A name="Improved performance">Improved performance</A></H4>
KSH-93 executes many scripts faster
than the System V Bourne shell.
A major reason for this is
that many of the standard utilities are built-in.
To reduce the time to initiate a command, KSH-93 allows
commands to be added as built-ins at run time
on systems that support dynamic loading such as System V Release 4.
<P>
<H4><A name="Arithmetic">Arithmetic</A></H4>
KSH-93 allows you to do integer arithmetic in any
base from two to sixty-four.
You can also do double
precision floating point arithmetic.
Almost the complete set of C language operators are available
with the same syntax and precedence.
Arithmetic expressions can be used to as an argument expansion
or as a separate command.
In addition, there is an arithmetic for command that works
like the for statement in C.
<P>
<H4><A name="Arrays">Arrays</A></H4>
KSH-93 supports both indexed and associative arrays.
The subscript for an indexed array is an arithmetic expression,
whereas, the subscript for an associative array is a string.
<P>
<H4><A name="Functions and Aliases">Functions and Aliases</A></H4>
Two mechanisms - functions and
aliases - can be used to assign a user-selected identifier to
an existing command or shell script.
Functions allow local variables and provide scoping
for exception handling.
Functions can be searched for and loaded on first reference the
way scripts are.
<P>
<H4><A name="Substring Capabilities">Substring Capabilities</A></H4>
KSH-93 allows you to create a
substring of any given string either by specifying the starting
offset and length, or by stripping off leading
or trailing substrings during parameter substitution.
You can also specify attributes, such as upper and lower case,
field width, and justification to shell variables.
<P>
<H4><A name="Enhanced pattern matching capabilities">Enhanced pattern matching capabilities</A></H4>
KSH-93 allows you to specify
regular expressions for file and string matches.
<P>
<H4><A name="Improved debugging">Improved debugging</A></H4>
KSH-93 can generate line numbers on execution traces.
Also, I/O redirections are now traced.
There is a DEBUG trap that gets evaluated after each command
so that errors can be localized.
<P>
<H4><A name="Job Control">Job Control</A></H4>
On systems that support job control, including
System V Release 4, KSH-93
provides a job-control mechanism almost identical to that of
the BSD "csh", version 4.1.
This feature allows you
to stop and restart programs, and to move programs between the
foreground and the background.
<P>
<H4><A name="Added security">Added security</A></H4>
KSH-93 can execute scripts which do not have read permission
and scripts which have the setuid and/or setgid set when
invoked by name, rather than as an argument to the shell.
It is possible to log or control the execution of setuid and/or
setgid scripts.
The noclobber option prevents you from accidentally erasing
a file by redirecting to an existing file.
<P>
<H4><A name="Documentation">Documentation</A></H4>
Documentation for KSH-93 consists of an
<EM>Introduction to KSH-93,</EM>
<EM>Compatibility with the Bourne Shell</EM>,
a manual page and a
README file.
In addition, the
<EM>New KornShell Command and Programming Language</EM>
book is available from Prentice Hall.
<P>
<HR>
<TABLE border=0 align=center width=96%>
<TR>
<TD align=left></TD>
<TD align=center></TD>
<TD align=right>March 13, 2012</TD>
</TR>
</TABLE>
<P>
</TD></TR></TBODY></TABLE>
</BODY>
</HTML>
@@ -1,111 +0,0 @@
#
# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS
#
# Uses global parameters _push_max _push_top _push_stack
integer _push_max=100 _push_top=100
# Display directory stack -- $HOME displayed as ~
function dirs
{
typeset dir="${PWD#$HOME/}"
case $dir in
$HOME)
dir=\~
;;
/*) ;;
*) dir=\~/$dir
esac
print -r - "$dir ${_push_stack[@]}"
}
# Change directory and put directory on front of stack
function pushd
{
typeset dir= type=0
integer i
case $1 in
"") # pushd
if ((_push_top >= _push_max))
then print pushd: No other directory.
return 1
fi
type=1 dir=${_push_stack[_push_top]}
;;
+[1-9]|+[1-9][0-9]) # pushd +n
integer i=_push_top$1-1
if ((i >= _push_max))
then print pushd: Directory stack not that deep.
return 1
fi
type=2 dir=${_push_stack[i]}
;;
*) if ((_push_top <= 0))
then print pushd: Directory stack overflow.
return 1
fi
esac
case $dir in
\~*) dir=$HOME${dir#\~}
esac
cd "${dir:-$1}" > /dev/null || return 1
dir=${OLDPWD#$HOME/}
case $dir in
$HOME)
dir=\~
;;
/*) ;;
*) dir=\~/$dir
esac
case $type in
0) # pushd name
_push_stack[_push_top=_push_top-1]=$dir
;;
1) # pushd
_push_stack[_push_top]=$dir
;;
2) # push +n
type=${1#+} i=_push_top-1
set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}"
shift $type
for dir
do (((i=i+1) < _push_max)) || break
_push_stack[i]=$dir
done
esac
dirs
}
# Pops the top directory
function popd
{
typeset dir
if ((_push_top >= _push_max))
then print popd: Nothing to pop.
return 1
fi
case $1 in
"")
dir=${_push_stack[_push_top]}
case $dir in
\~*) dir=$HOME${dir#\~}
esac
cd "$dir" || return 1
;;
+[1-9]|+[1-9][0-9])
typeset savedir
integer i=_push_top$1-1
if ((i >= _push_max))
then print pushd: Directory stack not that deep.
return 1
fi
while ((i > _push_top))
do _push_stack[i]=${_push_stack[i-1]}
i=i-1
done
;;
*) print pushd: Bad directory.
return 1
esac
unset '_push_stack[_push_top]'
_push_top=_push_top+1
dirs
}
@@ -1,12 +0,0 @@
typeset -A Keytable
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
function emacs_keybind
{
keybind $'\E[A' $'\020' # Up key
keybind $'\E[B' $'\016' # Down key
keybind $'\E[C' $'\06' # Right key
keybind $'\E[D' $'\02' # Left key
keybind $'\E[H' $'\01' # Home key
keybind $'\E[Y' $'\05' # End key
keybind $'\t' $'\E\E' # Tab for command-line completion
}
@@ -1,28 +0,0 @@
function getopt
{
typeset c optstring=$1 options= sep=
shift
while getopts $optstring c
do case $c in
[:?])
exit 2
;;
*)
options="$options$sep-$c"
sep=' '
if [[ $optstring == *$c:* ]]
then options=" $options $OPTARG"
fi
#then print -rn -- " -$c" "$OPTARG"
#else print -rn -- " -$c"
;;
esac
done
print -rn -- "$options"
if [[ ${@:$OPTIND-1} != -- ]]
then print -rn -- " --"
fi
if [[ -n ${@:$OPTIND} ]]
then print -r -- " ${@:$OPTIND}"
fi
}
@@ -1,14 +0,0 @@
typeset -A Keytable
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
function keybind # key action
{
typeset key=$(print -f "%q" "$2")
case $# in
2) Keytable[$1]='.sh.edchar=${.sh.edmode}'"$key"
;;
1) unset Keytable[$1]
;;
*) print -u2 "Usage: $0 key [action]"
;;
esac
}
@@ -1,111 +0,0 @@
#
# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS
#
# Uses global parameters _push_max _push_top _push_stack
integer _push_max=100 _push_top=100
# Display directory stack -- $HOME displayed as ~
function dirs
{
typeset dir="${PWD#$HOME/}"
case $dir in
$HOME)
dir=\~
;;
/*) ;;
*) dir=\~/$dir
esac
print -r - "$dir ${_push_stack[@]}"
}
# Change directory and put directory on front of stack
function pushd
{
typeset dir= type=0
integer i
case $1 in
"") # pushd
if ((_push_top >= _push_max))
then print pushd: No other directory.
return 1
fi
type=1 dir=${_push_stack[_push_top]}
;;
+[1-9]|+[1-9][0-9]) # pushd +n
integer i=_push_top$1-1
if ((i >= _push_max))
then print pushd: Directory stack not that deep.
return 1
fi
type=2 dir=${_push_stack[i]}
;;
*) if ((_push_top <= 0))
then print pushd: Directory stack overflow.
return 1
fi
esac
case $dir in
\~*) dir=$HOME${dir#~}
esac
cd "${dir:-$1}" > /dev/null || return 1
dir=${OLDPWD#$HOME/}
case $dir in
$HOME)
dir=\~
;;
/*) ;;
*) dir=\~/$dir
esac
case $type in
0) # pushd name
_push_stack[_push_top=_push_top-1]=$dir
;;
1) # pushd
_push_stack[_push_top]=$dir
;;
2) # push +n
type=${1#+} i=_push_top-1
set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}"
shift $type
for dir
do (((i=i+1) < _push_max)) || break
_push_stack[i]=$dir
done
esac
dirs
}
# Pops the top directory
function popd
{
typeset dir
if ((_push_top >= _push_max))
then print popd: Nothing to pop.
return 1
fi
case $1 in
"")
dir=${_push_stack[_push_top]}
case $dir in
\~*) dir=$HOME${dir#~}
esac
cd "$dir" || return 1
;;
+[1-9]|+[1-9][0-9])
typeset savedir
integer i=_push_top$1-1
if ((i >= _push_max))
then print pushd: Directory stack not that deep.
return 1
fi
while ((i > _push_top))
do _push_stack[i]=${_push_stack[i-1]}
i=i-1
done
;;
*) print pushd: Bad directory.
return 1
esac
unset '_push_stack[_push_top]'
_push_top=_push_top+1
dirs
}
@@ -1,111 +0,0 @@
#
# DIRECTORY MANIPULATION FUNCTIONS PUSHD, POPD AND DIRS
#
# Uses global parameters _push_max _push_top _push_stack
integer _push_max=100 _push_top=100
# Display directory stack -- $HOME displayed as ~
function dirs
{
typeset dir="${PWD#$HOME/}"
case $dir in
$HOME)
dir=\~
;;
/*) ;;
*) dir=\~/$dir
esac
print -r - "$dir ${_push_stack[@]}"
}
# Change directory and put directory on front of stack
function pushd
{
typeset dir= type=0
integer i
case $1 in
"") # pushd
if ((_push_top >= _push_max))
then print pushd: No other directory.
return 1
fi
type=1 dir=${_push_stack[_push_top]}
;;
+[1-9]|+[1-9][0-9]) # pushd +n
integer i=_push_top$1-1
if ((i >= _push_max))
then print pushd: Directory stack not that deep.
return 1
fi
type=2 dir=${_push_stack[i]}
;;
*) if ((_push_top <= 0))
then print pushd: Directory stack overflow.
return 1
fi
esac
case $dir in
\~*) dir=$HOME${dir#\~}
esac
cd "${dir:-$1}" > /dev/null || return 1
dir=${OLDPWD#$HOME/}
case $dir in
$HOME)
dir=\~
;;
/*) ;;
*) dir=\~/$dir
esac
case $type in
0) # pushd name
_push_stack[_push_top=_push_top-1]=$dir
;;
1) # pushd
_push_stack[_push_top]=$dir
;;
2) # push +n
type=${1#+} i=_push_top-1
set -- "${_push_stack[@]}" "$dir" "${_push_stack[@]}"
shift $type
for dir
do (((i=i+1) < _push_max)) || break
_push_stack[i]=$dir
done
esac
dirs
}
# Pops the top directory
function popd
{
typeset dir
if ((_push_top >= _push_max))
then print popd: Nothing to pop.
return 1
fi
case $1 in
"")
dir=${_push_stack[_push_top]}
case $dir in
\~*) dir=$HOME${dir#\~}
esac
cd "$dir" || return 1
;;
+[1-9]|+[1-9][0-9])
typeset savedir
integer i=_push_top$1-1
if ((i >= _push_max))
then print pushd: Directory stack not that deep.
return 1
fi
while ((i > _push_top))
do _push_stack[i]=${_push_stack[i-1]}
i=i-1
done
;;
*) print pushd: Bad directory.
return 1
esac
unset '_push_stack[_push_top]'
_push_top=_push_top+1
dirs
}
@@ -1,54 +0,0 @@
# add to (+), delete from (-), print (.), or set ([=]) window title
# arguments are eval'd before printing
# title text string exported in TITLE_TEXT
function title # [+ | - | =] title ...
{
typeset x t="$TITLE_TEXT"
case $1 in
+) shift
case $# in
0) ;;
*) for x
do case " $t " in
*" $x "*) ;;
" ") t=$x ;;
*) t="$t $x" ;;
esac
done
case $t in
$TITLE_TEXT) return 1 ;;
esac
;;
esac
;;
-) shift
case $# in
0) ;;
*) for x
do case " $t " in
*" $x "*) t="${t%?( )$x*}${t##*$x?( )}" ;;
esac
done
case $t in
$TITLE_TEXT) return 1 ;;
esac
;;
esac
;;
.) print -r -- "$TITLE_TEXT"
return 0
;;
*) t="$*"
;;
esac
export TITLE_TEXT="$t"
eval x=\"$t\"
case $TERM in
630*) print -nr -- "[?${#x};0v$x" ;;
vt100|xterm*) print -nr -- "]0;$x" ;;
*) return 1 ;;
esac
return 0
}
@@ -1,10 +0,0 @@
typeset -A Keytable
trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
function vi_keybind
{
keybind $'\E[A' k # Up key
keybind $'\E[B' j # Down key
keybind $'\E[C' l # Right key
keybind $'\E[D' h # Left key
keybind $'\t' '\' # Tab for command-line completion
}
-10
View File
@@ -1,10 +0,0 @@
<html>
<head><title>KSH93</title></head>
<body>
<a href='ksh.html'>Overview</a><br>
<a href='faq.html'>FAQ</a><br>
<a href='features.html'>Features</a><br>
<a href='builtins.html'>Builtins</a><br>
<a href='examples.html'>Examples</a>
</body>
</html>
-118
View File
@@ -1,118 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META name="generator" content="mm2html (AT&amp;T Research) 2012-01-11">
<TITLE> www/ksh/ksh.mm mm document </TITLE>
<META name="author" content="gsf+dgk+kpv">
<STYLE type="text/css">
div.FI { padding-left:2em; text-indent:0em; }
div.HI { padding-left:4em; text-indent:-2em; }
dt { float:left; clear:both; }
dd { margin-left:3em; }
</STYLE>
</HEAD>
<BODY bgcolor=white link=slateblue vlink=teal >
<TABLE border=0 align=center width=96%>
<TBODY><TR><TD valign=top align=left>
<!--INDEX--><!--/INDEX-->
<P>
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh overview">ksh overview</A></H3></FONT></FONT></CENTER>
The
<STRONG>KornShell</STRONG>
language was designed and developed by David G. Korn at AT&amp;T Bell Laboratories and AT&amp;T Research.
It is an interactive command language that provides access to the UNIX system and to many other systems,
on the many different computers and workstations on which it is implemented.
The
<STRONG>KornShell</STRONG>
language is also a complete, powerful, high-level programming language for writing applications,
often more easily and quickly than with other high-level languages.
This makes it especially suitable for prototyping.
There are two other widely used shells, the Bourne shell developed by Steven Bourne at AT&amp;T Bell Laboratories,
and the C shell developed by Bill Joy at the University of California.
<STRONG>ksh</STRONG>
has the best features of both, plus many new features of its own.
Thus
<STRONG>ksh</STRONG>
can do much to enhance your productivity and the quality of your work,
both in interacting with the system, and in programming.
<STRONG>ksh</STRONG>
programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.
<P>
The new version of
<STRONG>ksh</STRONG>
has the functionality of other scripting languages such as awk, icon, perl, rexx, and tcl.
For this and many other reasons,
<STRONG>ksh</STRONG>
is a much better scripting language than any of the other popular shells.
The code size for
<STRONG>ksh</STRONG>
is larger than the Bourne shell or C shell programs.
The revised version is even larger.
<P>
In spite of its increased size,
<STRONG>ksh</STRONG>
provides better performance.
You can write programs to run faster with
<STRONG>ksh</STRONG>
than with either the Bourne shell or the C shell, sometimes an order of magnitude faster.
<STRONG>ksh</STRONG>
has evolved and matured with extensive user feedback.
It has been used by many thousands of people at AT&amp;T since 1982, and at many other companies and universities.
A survey conducted at one of the largest AT&amp;T Bell Laboratories computer centers showed that 80% of their customers, both programmers and non-programmers, use
<STRONG>ksh.</STRONG>
<STRONG>ksh</STRONG>
is compatible with the Bourne shell.
Virtually all programs written for the Bourne shell run with
<STRONG>ksh.</STRONG>
If you are familiar with the Bourne shell, you can use
<STRONG>ksh</STRONG>
immediately, without retraining.
The new version of
<STRONG>ksh</STRONG>
is compatible with earlier versions of
<STRONG>ksh.</STRONG>
<STRONG>ksh</STRONG>
is readily available.
It is sold (source and binary) by AT&amp;T and Novell, and by other companies under license from AT&amp;T both in the USA and abroad.
It has been purchased by dozens of major corporations, and by many individuals for use on home computers.
<STRONG>ksh</STRONG>
is extensible.
<P>
The
<STRONG>KornShell</STRONG>
language uses the same syntax for built-in commands as for non built-in commands.
Therefore, system developers can add new commands "transparently" to the
<STRONG>KornShell</STRONG>
language; that is, with minimum effort and with no differences visible to users other than faster execution.
On systems with dynamic linking, it is possible to add new built-in commands at run time.
Novell has extended the new version of
<STRONG>ksh</STRONG>
to enable X-windows programming for their desktop
<STRONG>ksh</STRONG>
product,
<STRONG>dtksh</STRONG>.
<STRONG>dtksh</STRONG>
is a standard part of CDE, the Common Desktop Environment defined by COSE (Common Operating System Environment), supported by most major UNIX system hardware vendors.
An extended version of
<STRONG>ksh</STRONG>
that enables Tk programming, called tksh, is available as well.
<P>
<STRONG>ksh</STRONG>
is intended to conform to the Shell Language Standard developed by the IEEE POSIX 1003.2 Shell and Utilities Language Committee.
<P>
<HR>
<TABLE border=0 align=center width=96%>
<TR>
<TD align=left></TD>
<TD align=center></TD>
<TD align=right>March 13, 2012</TD>
</TR>
</TABLE>
<P>
</TD></TR></TBODY></TABLE>
</BODY>
</HTML>
@@ -1,129 +0,0 @@
typeset -A COOKIE HEADER
typeset Cgi _CGI_c _CGI_multipart
function cgi_header
{
typeset h
for h in "${!HEADER[@]}"
do printf '%s: %s\n' "$h" "${HEADER[$h]}"
done
print
}
function cgi_url
{
if [[ $SERVER_PORT != 80 ]]
then print "http://$SERVER_NAME:$SERVER_PORT$SCRIPT_NAME"
else print "http://$SERVER_NAME$SCRIPT_NAME"
fi
}
function cgi_parse
{
if [[ $REQUEST_METHOD == POST ]]
then if [[ $CONTENT_TYPE == multipart/form-data* ]]
then _CGI_multipart=${TMPDIR-/tmp}/cgi-form-$$
trap 'rm -rf "$_CGI_multipart"' EXIT
mkdir $_CGI_multipart
unset -f Cgi.set
typeset -A Cgi.file
typeset i b v
pax --nosummary --read --edit ",.*/,," --edit ",^,$_CGI_multipart/,"
for i in $_CGI_multipart/*
do b=${i##*/}
if [[ $b == +([a-z]) ]]
then v=$(<$i)
eval Cgi.$b='$v'
else Cgi.file[$b]=$i
fi
done
else Cgi=$(<&0) # Read from stdin
fi
else Cgi="$QUERY_STRING"
fi
cgi_cookie "$HTTP_COOKIE"
HEADER["Content-type"]="text/html"
}
function cgi_cookie
{
typeset cookie=$1 name val c IFS=';'
set -- $cookie
for c
do
IFS='='
set -- $c
name=${1##' '} val=${2##' '} # trim white space
name=${name%%' '} val=${val%%' '}
COOKIE[$name]=$val
done
}
function cgi_setcookie # name value
{
HEADER["Set-Cookie"]="$1=$2; path=$SCRIPT_NAME"
}
## Cgi variable disciplines
function Cgi.set
{
set -f
typeset i j n val IFS='&'
set -- ${.sh.value}
for i
do n=${i%%=*}
[[ $n == [[:alpha:]_]*([[:alnum:]_]) ]] || continue
val=${i#$n=}
val=${val//+/ }
val=${val//@([\'\\])/'\'\1}
eval j=\${#${.sh.name}.${n}[@]} \
"${.sh.name}.${n}[j]=\$'${val//'%'@(??)/'\x'\1"'\$'"}'"
done
}
function cgi_C_init
{
integer i
for ((i=1; i < 256; i++))
do if (( i!=16#22 && i!=16#27 && i!=16#5C && i!=16#5B && i!=16#5D ))
then printf $'_CGI_c[$\'\\\\x%.2X\']=%%%.2X\n' $i $i
fi
done
print
}
function cgi_encode
{
typeset v=$1
var=${v//' '/+}
cbrace='}'
eval var=${var//@([!a-zA-Z0-9_+])/\${_CGI_c[\\\1]$cbrace}
print -r -- "$var"
}
function Cgi.get
{
typeset i val name vname
if [[ ! ${_CGI_c[\\]} ]]
then val='"'
_CGI_c[""]=%00
_CGI_c[$var]=%22
_CGI_c[\']=%27
_CGI_c[\]]=%5B
_CGI_c[\[]=%5D
_CGI_c[\\]=%5C
eval $(cgi_C_init)
unset -f cgi_C_init
fi
vname=${.sh.name} # .sh.name contains variable name
.sh.value= # .sh.value stores value
for i in ${!Cgi.@}
do
name=${i#$vname.}
nameref v=${i}
val=$(cgi_encode "$v")
.sh.value="${.sh.value}${.sh.value:+&}$name=$val"
done
}
@@ -1,17 +0,0 @@
#!/bin/ksh
. ./cgi-lib.ksh
cgi_parse
cgi_header
print "<html>"
print "<pre>"
print -r "Url: $(cgi_url)"
for i in ${!Cgi.*}
do
nameref val=$i
print -r "$i = $val"
done
print "</pre>"
print "</html>"
@@ -1,66 +0,0 @@
#! /usr/bin/ksh
# shell version of env command
case $(getopts '[-]' opt '--???man' 2>&1) in
version=[0-9]*)
usage=$'[-?@(#)env (AT&T Labs Research) 1999-05-20\n]
[-author?David Korn <dgkorn@gmail.com>]
[-license?http://www.research.att.com/sw/tools/reuse]
[+NAME?env - set environment for command invocation]
[+DESCRIPTION?\benv\b modifies the current environment according
to the \aname\a\b=\b\avalue\a arguments, and then
invokes \acommand\a with the modified environment.]
[+?If \acommand\a is not specified, the resulting environment
is written to standard output quoted as required for
reading by the \bsh\b.]
[i:ignore-environment?Invoke \acommand\a with the exact environment
specified by the \aname\a\b=\b\avalue\a arguments; inherited
environment variables are ignored. As an obsolete feature,
\b-\b by itself can be specified instead of \b-i\b.]
[u:unset]:[name?Unset the environment variable \aname\a if it was
in the environment. This option can be repeated to unset
additional variables.]
[name=value]... [command ...]
[+EXIT STATUS?If \acommand\a is invoked, the exit status of \benv\b
will be that of \acommand\a. Otherwise, it will be one of
the following:]{
[+0?\benv\b completed successfully.]
[+126?\acommand\a was found but could not be invoked.]
[+127?\acommand\a could not be found.]
}
[+SEE ALSO?\bsh\b(1), \bexport\b(1)]
'
;;
*)
usage='iu:[name] [name=value]... [command ...]'
;;
esac
clear=
while getopts "$usage" var
do case $var in
i) clear=1;;
u) command unset $OPTARG 2> /dev/null;;
esac
done
#[[ $var == "" ]] || exit 1
shift $((OPTIND-1))
if [[ $1 == - ]] # obsolete form
then clear=1
shift
fi
if [[ $clear == 1 ]]
then typeset +x $(typeset +x)
fi
while true
do case $1 in
*=*) export "$1";;
*) break;;
esac
shift
done
if (( $# >0 ))
then exec "$@"
else export
exit 0
fi
@@ -1,2 +0,0 @@
#! /bin/ksh
read -r && print -r -- "$REPLY"
@@ -1,2 +0,0 @@
#! /bin/ksh
whence -p "$@"
-15
View File
@@ -1,15 +0,0 @@
note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
make test
make install
make all
exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS}
done all virtual
done install virtual
done test virtual
-870
View File
@@ -1,870 +0,0 @@
:
### this script contains archaic constructs that work with all sh variants ###
# Glenn Fowler
# AT&T Research
#
# @(#)C probe (AT&T Research) 2012-02-29
#
# probe [ -d ] c-compiler-path [ attributes ]
#
# common C probe preamble for the tool specific probes
#
# NOTE: some cc -E's do syntax analysis!
#
# probe_* are first eval'd and then attempted from left to right
#
probe_binding="-dy -dn -Bdynamic -Bstatic '-Wl,-ashared -Wl,+s' -Wl,-aarchive -call_shared -non_shared -dynamic -static -bshared -bstatic '' -static"
probe_env="CC_OPTIONS CCOPTS LD_OPTIONS LDOPTS LIBPATH LPATH"
probe_include="stdio.h iostream.h complex.h ctype.h plot.h stdarg.h varargs.h ranlib.h hash.h sys/types.h stab.h cmath cstdio iostream string"
probe_longlong="long 'long long'"
probe_longlong_t="__int64_t _int64_t __int64 _int64 int64"
probe_l="l yyreject m sin mopt sin"
probe_lxx="C exit ++ exit g++ exit"
probe_ppprefix="a n"
probe_size="size"
probe_src="cxx C cc c"
probe_sa=".sa"
probe_sd=".dll .lib .dll .x"
probe_sdb=".pdb"
probe_so=".dylib .so .sl"
probe_symprefix="_"
probe_verbose="'-v -v' '-# -#' '-d -d' -dryrun '-V -V'"
probe_version="--version -V -version -v"
#
# the following are set by the preamble for the tool specific probe
#
cc=cc
debug=
dir=.
dll=.dll
dynamic=
exe=exe
executable="test -x"
hosted=
ifs=${IFS-'
'}
obj=o
ppenv=
ppopt=
predef=
prepred=
sa=
sd=
sdb=
so=
sov=
static=
stdlib=
stdpp=
suffix_command=
if test "" != "$TMPDIR" -a -d "$TMPDIR"
then tmpdir=$TMPDIR
else tmpdir=/tmp
fi
tmpdir=$tmpdir/probe$$
undef="define defined elif else endif error if ifdef ifndef include line pragma undef __STDC__ __ARGC__ __BASE__ __BASE_FILE__ __DATE__ __FILE__ __FUNCTION__ __INCLUDE_LEVEL__ __LINE__ __PATH__ __TIME__ __TIMESTAMP__ __VERSION__"
version_flags=
version_stamp=
version_string=
#
# constrain the environment
#
DISPLAY=
LC_ALL=C
export DISPLAY LC_ALL
#
# now the common probes
#
while :
do case $1 in
-d) debug=1 ;;
-*) set ''; break ;;
*) break ;;
esac
shift
done
cc=$1
case $cc in
[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*)
;;
*) echo "Usage: $0 [ -d ] c-compiler-path [ attributes ]" >&2
exit 1
;;
esac
ATTRIBUTES=
eval $2
_probe_PATH=$PATH
PATH=/usr/bin:/bin:$PATH
case $0 in
*[\\/]*) dir=`echo $0 | sed -e 's,[\\/][\\/]*[^\\/]*\$,,'` ;;
esac
$executable . 2>/dev/null || executable='test -r'
case $SHELL in
[\\/]*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\*)
sh=$SHELL
;;
*) sh=/bin/sh
;;
esac
trap 'code=$?; cd ..; rm -rf $tmpdir; exit $code' 0 1 2 3
mkdir $tmpdir
cd $tmpdir
exec 3>&1 4>&2 </dev/null
case $debug in
"") exec >/dev/null 2>&1
(ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0
;;
*) PS4='+$LINENO+ '
set -x
;;
esac
if (xxx=xxx; unset xxx)
then UNSET=1
else UNSET=
fi
eval set x $probe_env
while :
do shift
case $# in
0) break ;;
esac
eval x='$'$1
case $x in
'') continue ;;
esac
case $1 in
*PATH) _probe_export="$_probe_export $1='$x'" ;;
esac
case $UNSET in
'') eval $1=
export $1
;;
*) unset $1
;;
esac
done
if test -f "$dir/probe.ini"
then . "$dir/probe.ini"
IFS=$ifs
fi
mkdir suffix
cd suffix
for src in $probe_src
do echo "int main(){return 0;}" > ../test.$src
rm -f test*
if $cc -c ../test.$src
then set test.*
if test -f "$1"
then o="$*"
mv $* ..
for i in $o
do if $cc -o test.exe ../$i
then obj=`echo "$i" | sed -e 's,test.,,'`
$executable test.exe || executable="test -r"
set test*
rm *
if $cc -o test ../$i
then rm $*
set test.*
if $executable "$1"
then exe=`echo "$1" | sed -e 's,test.,,'`
suffix_command=.$exe
fi
fi
break 2
fi
done
fi
fi
done
cd ..
case $src in
c) ;;
*) echo '// (
int
main()
{
class { public: int i; } j;
j.i = 0;
int k = j.i + 1;
return k;
}' > dialect.$src
if $cc -c dialect.$src && $cc -o dialect.$exe dialect.$obj && $executable dialect.$exe
then mv dialect.$src dialect.c
rm -f dialect.$obj dialect.$exe
if $cc -c dialect.c && $cc -o dialect.$exe dialect.$obj && $executable dialect.$exe
then src=c
else set x $cc
while :
do shift
case $# in
0) break ;;
esac
case $1 in
*=*) continue ;;
esac
case `echo $1 | sed -e 's,.*/,,'` in
*CC*|*++*|*[xX][xX]*|*[pP][lL][uU][sS]*) ;;
*) src=c ;;
esac
break
done
fi
else src=c
fi
;;
esac
set x x '(' 1 'int x;' 0
while :
do shift
shift
case $# in
[01]) break ;;
esac
rm -f test.$obj
echo "$1" > test.$src
$cc -c test.$src
r=$?
case $r in
0) test -f test.$obj || r=1 ;;
*) r=1 ;;
esac
case $2:$r in
0:0) ;;
0:1) echo "$cc: not a C compiler: failed to compile \`\`$1''" >&4
exit 1
;;
1:0) echo "$cc: not a C compiler: successfully compiled \`\`$1''" >&4
exit 1
;;
esac
done
hosttype=`package CC="$cc" || $SHELL -c "package CC='$cc'"`
case $hosttype in
*[Uu][Ss][Aa][Gg][Ee]:*)
hosttype=`PATH=$_probe_PATH; export PATH; package CC="$cc" || $SHELL -c "package CC='$cc'"`
;;
esac
echo '#include <stdio.h>
int main(){printf("hello");return 0;}' > dynamic.$src
echo 'extern int sfclose() { return 0; }' > fun.$src
if $cc -c dynamic.$src && $cc -c fun.$src
then eval set x $probe_so
while :
do shift
case $# in
0) break ;;
esac
for i in foo junk
do rm -f dynamic.$exe
if $cc -L. -o dynamic.$exe dynamic.$obj -l$i
then : "there's really a -l$i"?
else rm -f dynamic.$exe
cat fun.$obj > lib$i$1
$cc -L. -o dynamic.$exe dynamic.$obj -l$i && $executable dynamic.$exe
x=$?
rm lib$i$1
case $x in
0) so=$1
rm -f dynamic.$exe > lib$i$1.1
$cc -L. -o dynamic.$exe dynamic.$obj -l$i && $executable dynamic.$exe
x=$?
rm lib$i$1.1
case $x in
0) sov=1 ;;
esac
break 2
;;
*) break
;;
esac
fi
done
k=
for i in "" .1 .2 .3 .4 .5 .6 .7 .8 .9
do rm -f dynamic.$exe > libc$1$i
$cc -L. -o dynamic.$exe dynamic.$obj && $executable dynamic.$exe
x=$?
(cd ..; rm $tmpdir/libc$1$i)
case $x in
0) ;;
*) k=X$k
case $k in
XXX) break ;;
esac
;;
esac
done
case $k in
XXX) so=$1
sov=1
break
;;
?*) so=$1
break
;;
esac
done
rm -f dynamic.$exe
if $cc -o dynamic.$exe dynamic.$obj 2>e && $executable dynamic.$exe
then e=`wc -l e`
maybe=
eval set x x $probe_binding
while :
do shift
shift
case $# in
0) break ;;
esac
rm -f dynamic.$exe
$cc -o dynamic.$exe $1 dynamic.$obj 2>e && $executable dynamic.$exe || continue
case $1 in
?*) case $maybe in
"") maybe=$1 ;;
*) maybe=-- ;;
esac
;;
esac
case `wc -l e` in
$e) ;;
*) continue ;;
esac
d=`ls -s dynamic.$exe`
rm -f dynamic.$exe
$cc -o dynamic.$exe $2 dynamic.$obj 2>e && $executable dynamic.$exe || continue
case `wc -l e` in
$e) ;;
*) continue ;;
esac
case `ls -s dynamic.$exe` in
$d) ;;
*) dynamic=$1
static=$2
maybe=
break
;;
esac
done
case $maybe in
""|--) ;;
*) rm -f dynamic.$exe
if $cc -o dynamic.$exe $maybe dynamic.$obj 2>e && $executable dynamic.$exe
then e=`wc -l e`
if $cc -o dynamic.$exe $maybe-bogus-bogus-bogus dynamic.$obj 2>e && $executable dynamic.$exe
then case `wc -l e` in
$e) ;;
*) dynamic=$maybe ;;
esac
else dynamic=$maybe
fi
fi
;;
esac
fi
fi
eval set x $probe_version
shift
for o in "$@"
do if $cc $o > version.out 2>&1
then version_string=`sed -e '/ is /d' -e 's/;/ /g' version.out | sed -e 1q`
case $version_string in
''|*[Ee][Rr][Rr][Oo][Rr]*|*[Ff][Aa][Tt][Aa][Ll]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*)
;;
*) version_flags=$o
version_stamp=";VERSION;$o;$version_string;PATH;$cc"
break
;;
esac
fi
done
case $version_stamp in
'') eval set x $probe_version
shift
echo 'int main() { return 0; }' > version.i
for o in "$@"
do if $cc -c $o version.i > version.out 2>&1
then version_string=`sed -e '/ is /d' -e 's/;/ /g' version.out | sed -e 1q`
case $version_string in
''|*[Ee][Rr][Rr][Oo][Rr]*|*[Ff][Aa][Tt][Aa][Ll]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*)
;;
*) version_flags=$o
break
;;
esac
fi
done
;;
esac
echo 'int main(){return 0;}' > hosted.$src
$cc -o hosted.$exe hosted.$src && ./hosted.$exe && hosted=1
echo '#!'$sh'
echo "" $@' > cpp
chmod +x cpp
case `./cpp -Dprobe` in
*-Dprobe*)
;;
*) cp /bin/echo cpp
chmod u+w cpp
;;
esac
for prefix in $probe_ppprefix `echo $cc | sed -e '/cc\$/!d' -e 's,cc\$,,' -e 's,.*/,,'`
do cp cpp ${prefix}cpp
done
echo "" > flags.$src
echo '#pragma pp:version' > libpp.$src
if test `realcppC=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppenv='realcppC=${ppcmd}'
elif test `cppC=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppenv='cppC=${ppcmd}'
elif test `_CPPNAME=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppenv='_CPPNAME=${ppcmd}'
elif test `_CPP=./cpp $cc -Dprobe -E flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppenv='_CPP=${ppcmd}'
elif test `$cc -Dprobe -E -%p+. flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 && test `$cc -Dprobe -E -%p+. flags.$src | wc -l` -eq 1
then ppopt='-%p+${ppdir}'
elif test `$cc -Dprobe -E -Yp,. flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppopt='-Yp,${ppdir}'
elif test `$cc -Dprobe -E -Qpath $tmpdir flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppopt='-Qpath ${ppdir}'
elif test `$cc -Dprobe -E -tp -B./ flags.$src 2>err.out | tee cpp.out | grep -c '[-]Dprobe'` -eq 1 -a ! -s err.out
then ppopt='-tp -B${ppdir}/'
elif test `$cc -Dprobe -E -B./ flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppopt='-B${ppdir}/'
elif test `$cc -Dprobe -E -tp -h./ -B flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppopt='-tp -h${ppdir}/ -B'
elif test `$cc -Dprobe -E -t p,./cpp flags.$src | tee cpp.out | grep -c '[-]Dprobe'` -eq 1
then ppopt='-t p,${ppcmd}'
else {
eval set x $probe_verbose
shift
for o in "$@"
do $cc -E $o flags.$src
done
} 2>&1 | sed -e "s/['\"]//g" > cpp.out
fi
set x `sed -e 's,[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:\\\\,/,g' -e 's,\\\\,/,g' cpp.out`
def=
definclude="-I+C -I-H"
stdinclude=$definclude
case $hosted in
"") usrinclude= ;;
esac
cmdinclude=
while :
do case $# in
0|1) break ;;
esac
shift
case $1 in
-A) case $2 in
*\(*\)) shift
prepred="$prepred `echo $1 | sed 's/\(.*\)(\(.*\))/\1 \2/'`"
;;
esac
;;
-A\(*\))
prepred="$prepred `echo $1 | sed 's/-A\(.*\)(\(.*\))/\1 \2/'`"
;;
-[DI][-+][ABCDEFGHIJKLMNOPQRSTUVWXYZ]*)
stdpp=1
case $1 in
-I?[CH]) case $def in
?*) definclude="$definclude $1" ;;
*) stdinclude="$stdinclude $1" ;;
esac
;;
-I-S*|-YI,*) usrinclude="`echo $1 | sed 's/....//'`" ;;
-Y?,*) ;;
-Y*) usrinclude="`echo $1 | sed 's/..//'`" ;;
esac
;;
-D) shift
case $1 in
[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*=*)
predef="$predef
`echo $1 | sed -e 's/=.*//'`"
;;
[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*)
predef="$predef
$1"
;;
esac
;;
-Dprobe);;
-D*) case $1 in
-D[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*=*)
predef="$predef
`echo $1 | sed -e 's/^-D//' -e 's/=.*//'`"
;;
-D[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*)
predef="$predef
`echo $1 | sed -e 's/^-D//'`"
;;
esac
;;
-I) shift
case $1 in
/*) case $def in
?*) definclude="$definclude $1" ;;
*) stdinclude="$stdinclude $1" ;;
esac
cmdinclude="$cmdinclude $1"
;;
esac
;;
-I/*) f=`echo X$1 | sed 's/X-I//'`
case $def in
?*) definclude="$definclude $f" ;;
*) stdinclude="$stdinclude $f" ;;
esac
cmdinclude="$cmdinclude $f"
;;
-U) shift
undef="$undef $1"
;;
-U*) undef="$undef `echo $1 | sed 's/^-U//'`"
;;
flags.$src)def=
;;
esac
done
stdinclude="$stdinclude $definclude"
case " $stdinclude " in
*\ $usrinclude\ *)
case $usrinclude in
/usr/include)
usrinclude=
;;
*) case " $stdinclude " in
*\ /usr/include\ *)
usrinclude=
;;
*) usrinclude=/usr/include
;;
esac
;;
esac
;;
esac
tstinclude=`$cc -v -E flags.$src 2>&1 | sed -e '1,/[iI][nN][cC][lL][uU][dD][eE][ ]*<[.][.][.]>/d' -e '/^[eE][nN][dD] [oO][fF] [sS][eE][aA][rR][cC][hH]/,\$d'`
j=$tstinclude
case $j in
*/*) ;;
*) j=$cmdinclude ;;
esac
tstinclude=
good=
nogood=
c_hdr="stdio.h ctype.h"
C_hdr="libc.h"
for i in $j
do if test -d "$i"
then tstinclude="$tstinclude $i"
h=
for f in $c_hdr
do if test -f "$i/$f"
then case $i in
*/CC) nogood=1 ;;
*) good=1 ;;
esac
else h="$h $f"
fi
done
c_hdr=$h
h=
for f in $C_hdr
do if test -f "$i/$f"
then case $i in
*/CC) nogood=1 ;;
*) good=1 ;;
esac
else h="$h $f"
fi
done
C_hdr=$h
fi
done
case $nogood in
1) good=0 ;;
esac
case $good in
1) case $c_hdr in
?*) bad=1
usrinclude=/usr/include
set '' $tstinclude /usr/include
;;
*) set '' $tstinclude
;;
esac
shift
stdinclude=$*
echo "#include <sys/types.h>" > include.$src
$cc -E include.$src | sed -e '/# 1 "[\\/]/!d' -e 's,[^"]*",,' -e 's,[\\/][^\\/]*".*,,' -e 's,[\\/]sys,,' > include.out
for f in `cat include.out`
do if test -d "$f"
then g=`echo $f | sed -e 's,[\\/][\\/]*[^\\/]*$,,'`
case " $stdinclude " in
*\ $f\ *|*\ $g\ *)
;;
*) stdinclude="$stdinclude $f"
case $f in
/usr/include) usrinclude=$f ;;
esac
bad=1
;;
esac
fi
done
;;
*) case $ppopt$ppenv in
?*) echo '#!'$sh'
echo $VIRTUAL_ROOT | sed "s/:.*//"' > cpp
chmod +x cpp
ppcmd=cpp
ppdir=.
eval x='`'$ppenv '$'cc -E $ppopt flags.$src'`'
case $x in
?*) tstinclude=$x/usr/include
;;
esac
cp /bin/echo cpp
chmod u+w cpp
;;
esac
eval set x $probe_include
while :
do shift
case $# in
0) break ;;
esac
echo "#include <$1>" > include.$src
$cc -E include.$src
done > include.out
ccinclude=
x=$stdinclude
stdinclude=
subinclude=
for f in $x $tstinclude `sed -e 's,\\\\,/,g' -e 's,///*,/,g' -e 's,"[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/,"/,g' -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[\\/]/!d' -e 's/^#[line ]*[0123456789][0123456789]*[ ][ ]*"\(.*\)[\\/].*".*/\1/' include.out | sort -u`
do case $f in
-*) ;;
*/) f=`echo $f | sed -e 's,//*\$,,'` ;;
*/.) f=`echo $f | sed -e 's,//*.\$,,'` ;;
esac
case $f in
-I*) ;;
*/cc) ccinclude=1
;;
*/sys) continue
;;
*/include/*/*)
;;
*/include/*)
subinclude="$subinclude $f"
continue
;;
esac
if test -d "$f"
then case " $stdinclude " in
*\ $f\ *) ;;
*) stdinclude="$stdinclude $f" ;;
esac
fi
done
rm include.out
case $ccinclude in
?*) eval set x $probe_include
while :
do shift
case $# in
0) break ;;
esac
echo "#include <cc/$1>" > include.$src
if $cc -E include.$src > /dev/null
then break
fi
done
case $# in
0) ;;
*) x=$stdinclude
stdinclude=
for f in $x
do case $f in
*/cc) ;;
*) stdinclude="$stdinclude $f" ;;
esac
done
;;
esac
;;
esac
case $subinclude in
?*) for i in $subinclude
do for j in $stdinclude
do case $i in
$j/*/*) ;;
$j/*) both=
eval set x $probe_include
while :
do shift
case $# in
0) for k in $both
do echo "#include <$k>" > include.$src
$cc -E include.$src > include.out
I=`grep -c $i/$k < include.out`
J=`grep -c $j/$k < include.out`
case $I:$J in
0:*) ;;
*:0) stdinclude="$i $stdinclude"
break
;;
esac
done
continue 3
;;
esac
if test -f $i/$1
then if test ! -f $j/$1
then break 2
fi
both="$both $1"
fi
done
;;
$j) continue 2
;;
esac
done
stdinclude="$i $stdinclude"
done
;;
esac
{
for i in $stdinclude
do
case $i in
$usrinclude) ;;
*) echo $i $i ;;
esac
done
eval set x $probe_include
while :
do shift
case $# in
0) break ;;
esac
echo "#include <$1>" > t.c
p=
for j in `$cc -E t.c | grep "$1" | sed -e 's,\\\\,/,g' -e 's,"[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/,"/,g' -e '/^#[line ]*1[ ][ ]*"[\\/]/!d' -e 's/^#[line ]*1[ ][ ]*"\(.*\)[\\/].*".*/\1/'`
do j=`echo $j | sed -e 's,///*,/,g' -e 's,/$,,'`
case $p in
?*) echo $p $j ;;
esac
p=$j
done
done
case $usrinclude in
?*) echo $usrinclude $usrinclude ;;
esac
} | tsort > tmp.tmp
tstinclude=`cat tmp.tmp`
bad=
for i in $stdinclude
do case "
$tstinclude
" in
*"
$i
"*) ;;
*) bad=1
break
;;
esac
done
;;
esac
case $bad in
"") x=$stdinclude
stdinclude=
z=
for i in $tstinclude
do case " $x " in
*" $i "*)
stdinclude="$stdinclude $i"
z=$i
;;
esac
done
case $usrinclude in
'') usrinclude=$z ;;
esac
;;
esac
case $hosted in
"") case $usrinclude in
/usr/include) usrinclude= ;;
esac
;;
esac
case $usrinclude in
?*) case " $stdinclude " in
*\ $usrinclude\ *)
x=$stdinclude
stdinclude=
for f in $x
do case $f in
$usrinclude) ;;
*) stdinclude="$stdinclude $f" ;;
esac
done
;;
esac
;;
esac
# drop dups -- they creep in somehow
x=$stdinclude
stdinclude=
for f in $x
do case " $stdinclude $usrinclude " in
*" $f "*) ;;
*) stdinclude="$stdinclude $f" ;;
esac
done
File diff suppressed because it is too large. Load diff
@@ -1,170 +0,0 @@
## mamake and the MAM language ##
MAM (Make Abstract Machine) is a simple rule-based make language
that is implemented in just six four-letter commands and five attributes,
yet allows unlimited flexibility as it can execute arbitrary shell code.
The program implementing MAM, `mamake`,
is a portable C90 program written in a single file, `mamake.c`.
This allows ksh 93u+m,
or other programs using this build system,
to be built using only a standard C compiler and utilities installation
without any other dependencies or complications.
MAM was designed by Glenn Fowler at AT&T.
The [original documentation](http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html)
for MAM specified a more extensive language than was actually implemented in `mamake.c`,
while the `ignore` attribute is not documented there.
This file documents the MAM implementation that we are actually using.
`mamake` processes make files called `Mamfile`.
These were originally generated by a complex AT&T make system called `nmake`.
The intention was for `mamake` to process generated Mamfiles only
and not for it to replace `make`.
Yet, we are using it as our `make` in the ksh 93u+m distribution.
`nmake` was slow, brittle, and did not work on some modern systems, e.g. macOS.
It was not worth fixing because it is about as complex as ksh itself --
whereas `mamake` is simple and portable, and offers all the same flexibility.
Compared to the 2012-08-01 AT&T distribution,
ksh 93u+m made a few minor changes to `mamake` that make it easier to maintain Mamfiles by hand:
* All Mamfiles have been indented for legibility. (See `bin/Mamfile_indent` in the distribution.)
* Indentation and word separators may use any whitespace (e.g. tabs), not only spaces.
* Unrecognized commands and rule attributes throw an error instead of being silently ignored.
* Fixed some crashing bugs and memory leaks.
## Commands ##
MAM commands have the following basic form:
*command* [ *argument* [ *operand string* ] ]
The *command* name consists of four lower-case letters.
Unrecognized commands or attributes are an error.
The *argument* is a single word.
The *operand string* is any arbitrary text until the end of the line.
### Comments ###
`note` is the comment command and is ignored.
For historical reasons, `info` and `meta` are also ignored.
### Rules ###
`make` *rule* [ *attribute* ... ]
`done` *rule* [ *attribute* ... ]
A `make`...`done` block defines the target rule named *rule* using the other commands described here.
Unless the `virtual` attribute is used, *rule* names the pathname of the file generated or referenced by the rule.
Dependencies may be defined in two ways:
1. By nesting `make`...`done` blocks:
the enclosing *rule* is the parent
and the enclosed *rule*s are the prerequisites.
2. By using the `prev` command (see **Referencing previously defined rules** below)
to reference a previous `make`...`done` block.
The dependency is defined as if that block were repeated at the `prev` command's location.
If the block contains one or more `exec` commands (see **Shell actions** below),
the `done` command executes the shell script defined by them.
One or more of the following *attribute*s may be specified
by appending them to the `make` or `done` command:
* `archive`: Ignored.
Historically used to mark the generation of an `ar`(1) archive.
* `dontcare`: Marks files that do not need to exist.
If the file exists then its last-modified timestamp is checked and propagated,
otherwise it is silently ignored.
* `generated`: Marks rules that produce output files generated by a shell action.
The `exec` command implicitly assigns this attribute, but it is customary to specify it regardless.
* `ignore`: The timestamp associated with *rule* is ignored in dependency resolution.
* `implicit`: Marks the current rule as an implicit prerequisite of the enclosing parent rule.
An implicit prerequisite can make the parent rule out of date without triggering the parent action.
Implicit prerequisites usually correspond to `#include` prerequisites.
For example, if `foo.o` is generated from `foo.c` and `foo.c` includes `foo.h`,
then `foo.h` should be marked as an implicit prerequisite of `foo.c`
so that touching `foo.h` does not make `foo.c` out of date while making `foo.o` out of date.
* `joint`: Ignored.
Historically used to mark one of a group of rules that are built by a single shell action.
* `virtual`: Marks a rule that is not associated with any file.
The commands within are executed every time the Mamfile is processed.
By convention, a virtual rule named `all` makes everything,
and a virtual rule named `install` performs installation.
### Referencing previously defined rules ###
`prev` *rule* [ *attribute* ... ]
This command references a rule that has previously been defined by `make`...`done`,
regardless of block nesting level.
It can be used to make a rule a prerequisite of multiple `make`...`done` blocks without repeating the rule.
By convention, the *attribute*s of the referenced block are repeated in the `prev` command.
However, `mamake` ignores anything after *rule*.
### MAM variables ###
`setv` *variable* [ *defaultvalue* ]
Defines a new MAM *variable*, optionally assigning the initial *defaultvalue*.
If the *defaultvalue* begins and ends with double quotes (`"`), those are discarded.
If the variable already has a value, the `setv` command is ignored; assigning a new value is not possible.
When `mamake` starts, it imports all environment variables as MAM variables,
so any variable's default value can be overridden by exporting an environment variable by its name.
MAM variables are referenced using the sh-style `${`...`}` syntax, though the braces are *not* optional.
Any reference to an undefined variable is silently left unexpanded (and not replaced by the empty string).
Expansion of MAM variable references is recursive, i.e., the value may itself contain other variable references.
Beware: there is no reference loop detection.
[`TODO`: figure out and document advanced expansion syntax supported by `substitute()` in `mamake.c`]
### Shell actions ###
`exec` `-` *code*
One or more `exec` commands within a `make`...`done` block
define a shell script that is executed for *rule*.
The word following `exec` is ignored; by convention it is `-`.
Each `exec` command appends a line of code to the shell script for the current rule.
It is customary for a rule's `exec` commands to be contiguous, but not necessary.
Before adding each line of code to the script,
MAM variable references (see **MAM variables** above)
are expanded; their literal values are inserted into the *code* line
(beware: no quoting is applied!).
When `mamake` encounters the `done` command,
the script is executed by the shell whose path is in the `SHELL` environment variable
or, absent that, by `/bin/sh`.
The `exec` command assigns the `generated` attribute to the current rule, even if it was not specified.
### Binding libraries ###
`bind` `-l`*libraryname* [ `dontcare` ]
An argument of `-l`*libraryname* (or `+l`*libraryname*)
causes a MAM variable `mam_lib`*libraryname* to be defined (see **MAM variables** above).
The variable will contain either the compiler argument for linking to the library *libraryname*
(either the `-l`*libraryname* flag, or the full path in case of a static library)
or, if the `dontcare` attribute is specified, possibly the empty string.
This can be used both for AST libraries shipped with the distribution and for system libraries.
If the library file is found in the distribution,
its time stamp is checked and the current target is marked as outdated if it is newer.
There is also a mechanism to communicate library dependency information across Mamfiles and `mamake` invocations.
If a file named *libraryname* in the current directory
or an `${INSTALLROOT}/lib/lib/`*libraryname*`.req` file
exists, `mamake` processes each of the words in the form `-l`*libraryname* in its contents
as if they were arguments to `bind` commands
and the resulting values are appended to the value of `mam_lib`*libraryname*
as dependencies separated by spaces.
`mamake` does not create these dependency files;
they are expected to be generated by Mamfile shell actions (see **Shell actions** above).
If no such dependency file exists, and the `dontcare` attribute is added,
then `mamake` compiles a small test program on the fly to check if the library exists;
if this fails, the `mam_lib`*libraryname* variable will be emptied.
Any `bind` command whose argument does not start with `-l` or `+l` is ignored.
[`TODO`: `bind` is not yet fully understood; more `mamake.c` code analysis is required.
In `require()` in `mamake.c` there is some special handling for dynamic libraries.
Note that the `bind` functionality implemented in `mamake.c`
is completely different from that described in the original documentation.]
-938
View File
@@ -1,938 +0,0 @@
This file is of historical interest only. For recent changes in both ksh 93u+m
and the accompanying libraries, see the file NEWS in the top-level directory.
____
12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output
12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo()
12-06-20 package.sh: use $KSH for rt in "results test"
12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
12-06-13 package.sh: handle admin.db column output
12-06-08 iffe.sh: fix 12-06-06 typo
12-06-06 iffe.sh: check for -l* in reverse and accumulative order (e.g., for -last & -lm)
12-06-04 package.sh: always check $INSTALLROOT/lib/package/profile
12-05-31 Makefile: ID=ast; $(INSTALLROOT)/prototyped.h => $(INSTALLROOT)/$(ID)/prototyped.h
12-05-28 iffe.sh: API foo YYYYMMDD => FOOAPI(rel) test macro
12-05-24 package.sh: change admin.db comment => owner attributes
12-04-25 ratz.c: add sear -k option to keep installation tmp dir on exit
12-04-17 package.sh: skip sh version logic for ``use''
12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features
12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE
12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness
12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list
12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH
12-02-29 package.sh: fix ksh vs -lcmd compatibility checks
12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics
12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static
12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE
12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts
12-02-07 package.sh: add { clean clobber } actions
12-02-02 regress.sh: fix ulimit -c defaults for --nokeep
12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison
12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib
12-01-21 Makefile: :PACKAGE: license=ast -- oops
12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs
11-12-13 iffe.sh: add /*<NOSTDIO>*/ test code comment to disable default #include <stdio.h>
11-11-11 C+probe: test for .so before .sl
11-10-26 package.sh: don't forget about *.pkg for admin update
11-10-18 cc.*-icc: update and add more
11-10-11 package.sh: handle package make|view when no source installed
11-09-11 package.sh: count admin '*** termination code' errors
11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps
11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...''
11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh
11-08-11 iffe.sh: handle ancient sort that doesn't have -k
11-06-01 make.probe: add more /lib64 logic
11-05-01 package.sh: fix admin ditto to sync LICENSES too
11-03-25 package.sh: initialize { $SED $TR } before first use!
11-03-21 package.sh: fix vpath probes
11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.*
11-02-24 package.sh: change curl usage to "curl -L ..."
11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archaic.*###
11-02-02 Makefile: add :MAPLIB: check for ancient -lw
11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64
11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ]
11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks
11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream
11-01-07 iffe.sh: check debug==3 for is_hdr() failure
10-11-22 ditto.sh: fix timing problem between |& and exec &p
10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path
10-10-10 package.sh: list main env vars at start of make action
10-10-10 ratz.c: tweak windows delays
10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC
10-09-01 package.sh: fix ratz from source logic
10-08-25 package.mk: consolidate license file search in .package.licenses.
10-08-22 ratz.c: run sear bootstrap command detached
10-08-20 C+probe: version_stamp only if version_flags works
10-08-17 package.sh: unset makerules *DIR variables in env
10-08-15 package.sh: "make" action now lists some env values
10-08-11 mktest.sh: add "DO command ..."
10-07-27 rt.sh: handle "rt X=Y ..."
10-06-29 ratz.c: non-option sear args passed to sear_exec()
10-06-25 iffe.sh: "api" op changed to not do "map-libc" type mappings
10-06-25 package.sh: "force admin ditto" => no ditto --update option
10-06-22 C+probe: handle cc that require .[ci] input for version info
10-06-21 ditto.sh: change default remote access to ssh (about time)
10-06-12 regress.sh: DIAGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all
10-06-09 package.sh: add AT&T to usable nmake check
10-06-06 iffe.sh,iffe.tst: add { api ver } ops
10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info
10-04-15 iffe.sh: don't forget candidate headers for hdr|sys!
10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1)
10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH
10-02-11 package.sh: fix package admin make report error count
10-02-02 package.sh: fix write binary bug that did scp on local fs
10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst
10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check
10-01-01 make.probe: handle ['"] in CC.VERSION.STRING
09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS
09-11-30 mktest.sh: change RESET to STATE.RESET to make it global
09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs }
09-11-11 package.sh: re-order and combine cc checks
09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG
09-10-21 iffe.sh,Makefile: test -e is not in ksh88!
09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi)
09-10-06 package.sh: stub in ar intercept checks -- not used yet
09-10-06 ar.ibm.risc: add ar intercept because some AIX require -Xfoo first!!
09-09-24 regress.sh: fix UMASK logic to create test support files before umask
09-08-28 release.c: change docs to mention stdin if no file operands
09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space
09-08-20 make.probe: add CC.SHARED.NAME
09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO }
09-08-11 package.sh: filter lines containing : for package results
09-07-31 make.probe: add CC.AR.ARFLAGS (for AIX ar -xany)
09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options
09-06-24 package.sh: fix admin.db output formatting
09-05-05 package.sh: export dll hackery environment vars
09-05-05 package.sh: handle non-identifier hostnames
09-05-05 mamake.c: pass undefined ${...} identifiers to the shell
09-05-05 mamake.rt: add macro expansion regression tests
09-05-01 iffe.sh: fix output initialization *again*
09-04-28 package.sh: handle admin.db contact field $9
09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops
09-03-31 regress.sh: EXPORT before test => global ENVIRON[]
09-03-26 package.sh: test fail pattern is 'fail[es]'
09-03-26 UNIT - ... appends (options) to command line
09-03-19 TEST.mk: x.tst => x only if x is command target
09-03-15 regress.sh: add ${MAIN} for base name of main unit
09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir
09-03-03 regress.sh: allow command line unit to override UNIT
09-03-03 mktest.sh: handle IO == $'\n'
09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs
09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."!
09-01-27 package.sh: add isascii() to use ratz instead of tar
09-01-20 hurl.sh: add --size=bytes option
09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding
09-01-03 regress.sh: fix UNIT to allow command line override
09-01-03 mktest.sh: handle TWD
08-12-24 package.sh: fix cross-compile HOSTTYPE logic
08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 }
08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!!
08-09-30 rt.sh: fix ksh93 regression test signal count
08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
08-09-20 make.probe: handle another /usr/bin/file shared lib description
08-09-20 regress.sh: add --pipefail for SET pipe-input ...
08-09-17 Makefile: add gdbm1.c for <gdbm-ndbm.h>
08-09-10 make.probe: add CC.NOPROTECT
08-08-08 mktest.sh: add --width=width
08-08-05 dbm.req: favor sleepycat ndbm compatibility
08-08-04 C+probe: fix stdlib initialization logic
08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo
08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh
08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2
08-06-11 regress.sh: fix bug that skipped the last test
08-05-20 regress.sh: add --local to put *.tmp dir in local fs
08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI
08-05-01 package.sh: package test => ulimit -c 0
08-04-28 regress.sh: fix EXPORT quoting
08-04-28 regress.sh: fix UNIT set check args too
08-04-24 rt.sh: exit code > 256 => signal termination
08-04-10 C+probe: change probe_so order to check .so last (Mac OS X ld workaround)
08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST
08-03-28 C+probe: add C++ #include <iostream> (no extension) dir probes
08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally
08-02-28 make.probe: fix probe_warn to include ld!
08-02-02 make.probe: add CC.RUNPATH to match default -L order
08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH
08-01-31 iffe.sh: tweak ancient /bin/sh workarounds
08-01-28 make.probe: Darwin ld export dynamic is -force_flat_namespace
08-01-28 C+probe: handle SGI cc error message but exit 0 botch(es)
08-01-23 package.sh: fix checksum doc typo
08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list
07-12-14 iffe.sh: add set nooptimize
07-12-03 package.sh: add LC_ALL=C
07-11-27 package.sh: fix overaggressive *.md5 cleanup
07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal
07-11-05 package.sh: fix write op error count pattern
07-11-05 package.mk: fix $(~req) .ver binding
07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
07-08-01 package.sh: handle 'package read lcl|tgz'
07-05-08 regress.sh: execute basename instead of absolute path for short $0
07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer
07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh
07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...}
07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG
07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe
07-03-28 package.sh: fix binary tgz architecture type duplication
07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst
07-03-28 iffe.sh: add -F header to mac test
07-03-23 make.probe: handle file(1) that returns 'archive' for .so
07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF
07-03-11 package.sh: add nocopyright and tst => nocopyright
07-03-11 package.mk: add copyright=0
07-03-08 C+probe: restore IFS after probe.ini
07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR}
07-01-05 package.sh: fix "admin write binary" logic
07-01-01 iffe.sh: add "cmd" --verbose trace
07-01-01 iffe.sh: sort => LC_ALL=C sort
07-01-01 C+probe: LC_ALL=C
06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local!
06-11-23 package.sh: *.md5 are not tarballs -- doh
06-11-23 iffe.sh: add -F, --features=feature-test-header
06-11-11 make.probe: favor lib64 over lib for hosttype==*64
06-10-31 make.probe: add "-ignore-source-dir -iquote" test
06-10-31 iffe.sh: add status{...} code block
06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?)
06-10-11 package.sh: handle already gunzip'd *.tgz
06-10-06 iffe.sh: add reference for header content tests
06-09-27 regress.sh: fix UMASK to do DO too (duh)
06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics)
06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together
06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too
06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io
06-09-05 C+probe: add { probe_version version_stamp version_string }
06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING]
06-08-27 regress.sh,mktest.sh: add UMASK
06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE
06-08-25 mktest.sh: add IGNORESPACE
06-08-24 mktest.sh: handle \000 in data
06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR
06-08-16 package.sh: fix 'install flat' logic
06-08-11 rt.sh: handle style=shell %K date format
06-07-17 ratz.c: fix __MVS__ FAR definition
06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe
06-07-17 package.sh: differentiate urls vs. assignments
06-06-27 rt.sh: add --failed, --heading
06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0'
06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance
06-06-25 mktest.sh: implement PROG
06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk
06-05-06 package.sh: add PACKAGE_admin_tail_timeout
06-05-22 ratz.c: upgrade to zlib-1.2.3
06-05-09 package.sh: fix admin.db docs
06-03-11 package.sh: fix `package use - command ...'
06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.`
06-02-14 package.sh: "results failed test" == "results test failed"
cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0
cc.linux.ia64-icc: add for Intel cc
06-02-02 package.sh: FreeBSD stuck with OS version for all arch
06-02-01 package.mk: fix locale logic (tw -d requires dir arg)
06-01-31 package.sh: require $CC only for make|test
06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd
package.sh: add more pdksh => /bin/sh checks
06-01-26 package.sh: wget --http-pass => --http-password
package.sh: fix wget error logic
hurl.sh: wget --http-pass => --http-password
06-01-11 package.mk: pass package.license.class to make --mam too
package.mk: variants=pattern => --variants=pattern
package.sh: Darwin rel<=7 => darwin7.ppc
package.sh: FreeBSD rel<=4 => freebsd4
package.sh: FreeBSD rel<=5 => freebsd5
05-12-07 iffe.sh: don't emit <stdio.h> if <sfio.h>|<ast.h> (XXX)
05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0
05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ]
05-09-21 mktest.sh: fix --style=shell compare to ignore \r
05-09-12 TEST.mk: all --force to force %.rt regeneration
05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst
05-08-25 mktest.sh: add
TEST.mk: add %.rt=>%.tst for mktest
05-08-18 package.sh: 'package host cpu' now checks $NPROC first
05-07-17 iffe.sh: add { define extern include print } ops
iffe.sh: accept output{...}end output on success only -- doh
05-07-01 package.sh: add TARPROBE for tar B flag probe
05-06-24 package.sh: fix binary read chmod via *.sum
05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types
05-06-01 make.probe: verify that cc_pic works for hosted cc
cc.lynxos.ppc: make -mshared the default
package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation
05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT
05-05-24 iffe.sh: really fix grouping logic -- with tests this time
package.sh: pipe/socket configuration mismatches => use /bin/sh
05-04-28 TEST.mk: add $(TESTS)
05-04-19 package.sh: package results test uses rt if possible
iffe.sh: fix 'op var - ... - ...' grouping logic
05-04-15 rt.sh: handle autom4ate style
05-04-11 regress.sh: fix unit name when command line unit also specified
rt.sh: handle all AST package test output formats
package.sh: fix make docs for options passed to underlying make
05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime
regress.sh: add "TITLE name" to change TEST output title
05-04-01 rt.sh: add pretty make test + regress.sh wrapper
05-03-29 package.sh: test -e path => test -f path -o -d path
05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh
05-03-19 mamake.c: command line name=var also defines name.FORCE=var
05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd
package.sh: old make.out saved in circular make.out.[1-9]
mamake.c: sync with nmake :W=O:
05-03-01 package.sh: fix flat hierarchy initialization
package.sh: admin action now properly resets sibling remote logs
package.mk: relax unknown/unwritten package messages to warnings
package.sh: handle space in command line name=value
make.probe: add MVS -Wc,dll,exportall,longname,rent to CC.DLL probe
05-02-24 package.sh: hosttype *.powerpc => *.ppc
cc.lynxos.ppc,ldd.lynxos.ppc: add
05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug
05-02-20 probe.win32: handle /platformsdk mount
05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir
05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 -
05-02-14 package.sh: handle multiple architectures per host in admin.db
Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides
package.sh: normalize trailing [-_]bits in host type
iffe.sh: some ksh-compatible shells don't do *(pattern)
05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack
cc.lynxos.i386: -dynamic instead of -static default
05-02-10 package.sh: cyg usr/doc => usr/share/doc
05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08
iffe.sh: work around old bash 0<... redirection bug
05-02-06 package.mk: source.tgz: update generated files only when they change
05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow
05-01-11 package.sh: update setup docs to include authorize+password
package.mk: fix .source.cyg final directory edit
package.mk: notice=1 for conspicuous empty NOTICE file
WWW.mk: fix *-index.html installation
filter.sh: retain input file suffix in tmp copy
mamexec.c: fix non-contiguous "exec" bug that skipped lines
iffe.sh: fix candidate lib test to try grouping subsequent libs
iffe.sh: fix child process stdin hijack that skipped input lines
iffe.sh: --shell=osh to force read -r compatibility command
iffe.sh: chop iffe input leading space before # for KnR compatibility
05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes
mamake.c: fix makefile scan to ignore lib*.[hH]
iffe.sh: immunize function/symbol tests from aggressive -O
04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator
04-12-21 ratz.c: make sure tmp dir is writable -- doh
04-12-08 iffe.sh: fix dat test for aggressive -O
04-12-01 iffe.sh: add `include file' to pull in #define's for `exp'
04-11-11 package.sh: default MAKESKIP is "*[-.]*"
04-10-22 ratz.c: change docs to note zlib license
mamake.c: handle --debug-symbols and --strip-symbols
package.sh: make (debug|strip)=1 => --(debug|strip)-symbols
package.mk: add :LICENSE: => package.license.class
mamake.c: fix recursive order logic
04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs
04-10-11 package.sh: add 'authorize name' and 'password password'
04-10-01 iffe.sh: double check $static link with ! $static
Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL}
package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
04-09-21 package.mk: $(init)$(name) is now an implicit prereq
04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok
04-09-01 package.mk,package.sh: rename *.txt => *.README
package.mk: add the runtime package type (no *.[ah])
iffe.sh: fix key test reports
04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] }
04-08-11 package.mk: handle HOSTTYPE for Solaris > 9
package.sh: add `checkaout proto' for { make view }
package.sh: check for { md5sum md5 }
iffe.sh: add {if|elif|else|endif} test ...
iffe.sh: add 'exp - expression' and '( expression )'
iffe.sh: add 'name = test ...' user defined macros
iffe.sh: add '! test ...' negation
TEST.mk: add implied { .c .sh } generated prereq
cc.darwin.ppc: handle 10.3 -dylib mess
04-08-01 package.mk: let include handle nested requirements -- duh
04-07-31 package.sh: attempt a second ping before admin assumes host down
04-07-26 package.sh: fix hp.ia64 HOSTTYPE
04-07-23 probe.win32: generalize #include dir order search
04-07-17 regress.sh: add INPUT -x for chmod +x
04-07-01 regress.sh: TMP => TWD
04-06-29 regress.sh: put COMMAND in $TWD too
04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs
TEST.mk: add :TEST: -- to disable .c .sh search
04-06-18 TEST.mk: add .SCAN.tst
04-06-17 regress.sh: TEST returns true if active, false otherwise
regress.sh: add CD to change test pwd from $TWD
04-06-16 regress.sh: add TWD for ./unit.tmp override
regress.sh: DO now flushes previous test
regress.sh: INPUT and OUTPUT handle -f for printf instead of print
04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH
package.sh: skip nmake if older than 2000-10-31
04-05-20 package.sh: fix arg vs. package parse with - or '' to disambiguate
04-05-11 package.sh: package verbose update lists closure for package setup
package.sh: add src/lib/libardir to nmake proto bootstrap
regress.sh: probe for rm -u vs. chmod -R u+rwx
04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH
04-04-15 make.probe: check probe_libdir false positives
package.sh: add lib/package/*.lic src package subdirs
package.mk: add mamfile=0 to inhibit Mamfile generation
iffe.sh: config name_DECLARED => HAVE_name_DECL
iffe.sh: fix mac to handle default value
04-04-11 iffe.sh: normalize sed [\\\\/] quoting
04-04-04 package.mk: only checksum generated tarballs
mamprobe.sh: add STDCHMOD
04-04-01 C+probe: set export LANG=C for uniform error messages
make.probe: another CC.STDLIB tweak
package.sh: fix regress core dump pattern, expand [a-z] match ranges
04-03-31 Makefile: add intl :MAPLIB: test
make.probe: fix CC.STDLIB search; drop CC.* path duplicates
04-03-28 iffe.sh: drop unused exec $stdin<&0 dup
04-03-25 Makefile: add iconv :MAPLIB:
package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override
04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
package.sh: update base change on md5 sum instead of size
iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh
04-03-22 probe.win32: ncc => nld
04-03-19 CONVERT.mk: change the instructions and old source dir default
package.mk: fix recurse=list check
package.mk: add *.md5 checksum for each *.(c|exe|tgz)
package.sh: fix update base/delta/sync existence check
04-03-18 iffe.sh: -d2 does not remove core dumps on exit
04-03-17 package.sh: fix make recurse arg/action order
04-02-29 package.sh: add regress action to compare current and previous tests
package.sh: fix sgi.mips[23] HOSTTYPE test for old IRIX cc
package.sh: add `export variable ...'
package.sh: admin action now handles host name with non-id chars
package.sh: non-numeric M T W in admin.db disables that action
package.sh: fix admin write binary local vs. shared clash
cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable
cc.hp.pa64: sync with cc.hp.pa
cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib
probe.win32: sync with make.probe
make.probe: fix last chance dynamic test
make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E
make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall
make.probe: move probe_dll_def to the end of probe_dll
package.mk: capture subcomponent mamfile recursion
04-02-24 make.probe: strip "..." from cc/ld traces
iffe.sh: add ``set [no]define'' to disable macro #define/#undef
04-02-23 make.probe: rework CC.LD search
04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export
make.probe: resurrect CC.PIC with separate semantics from CC.DLL
make.probe: add CC.SHARED.LD for CC.SHARED linker
C+probe: clear DISPLAY to stifle interactive windows
04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end
make.probe: add { CC.AR CC.SIZE }, fix cross command search
cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug
04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++
04-02-04 package.sh: fix cross compilation bug that mixed binary formats
04-02-02 package.sh: package admin now ditto's bin/package too
04-01-30 cc.sgi.mips3: drop warning 3421
04-01-11 regress.sh: output label#count for tests in loops
04-01-05 regress.sh: fix bug that ignored the first SAME
04-01-04 crossexec.sh: fix typo that did not recognize rcp
03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse()
03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency
03-09-23 ratz.c: fix tar header number parse bug that skipped to next number
regress.sh: rm cleanup now handles files matching -*
03-09-11 iffe.sh: add unnamed { ... } blocks
regress.sh: add COPY from to, like MOVE but comparison still done
regress.sh: rm -rfu to handle test dirs w/o u+rwx
03-08-14 Makefile: add hello.c to the manifest
03-08-11 package.sh: fix `html binary' generation
03-06-21 package.sh: fix INITROOT initialization bug
package.sh: make sure admin logs exists before tail'ing
03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make
cc.mvs.390: return code 4 yields exit code 3 but it's *really* ok
package.sh: fix onpath function global var conflict
make.probe: add CC.DIALECT { GNU -dD }
package.mk: add Mamfile to lcl manifest
03-06-10 package.sh: fix setup action typo that only checked the INIT package
package.sh: *.s390x => *.s390-64
03-06-09 package.mk: add cyg :POSTINSTALL:
03-06-08 make.probe: fix CC.STDLIB logic
hurl.sh: add User-Agent identification
package.sh: tweak source and binary installation instructions
cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths
ldd.hp.pa: add
03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check
make.probe: add CC.STDLIB verification
03-06-04 make.probe: add +forceread +noforceread
03-05-11 hurl.sh: handle http://host:port/path
03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic
03-05-05 package.mk: fix Cygwin tarball names
03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile
03-04-27 make.probe: fix MVS CC.PREFIX.SHARED "lib" => ""
make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR)
make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD }
probe.win32: sync with latest CC.*
03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh
03-04-23 package.mk: fix dup "covered by" licenses
03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's
package.sh: fix admin write binary tarball snarf
03-04-21 package.mk: package covered *.@(pkg|lic) too
03-04-15 package.mk: don't generate incremental archives for lcl
package.mk: add incremental=[source:1 binary:0] archive control
package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc
package.sh: admin must ditto lib/package/*.@(pkg|lic) too
mamake.c: ignore time of ignore prereqs
mamake.c: -D2 lists propagated times
03-04-11 package.mk: tidy up cyg tarballs
package.sh: fix old shell clash between get() and $get
03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions
package.sh: add pthread_num_processors_np() last resort for CPU count
package.sh: use `make believe' to accept mamake generated files
package.sh: handle `make [make-flags] [target ...]'
mamake.c: ignore -e
03-03-21 package.mk: fix cyg old make typo
package.sh: switch to `package setup' instructions
03-03-19 package.sh: add registry checks for `host cpu'
package.sh: `results failed' now lists core dump messages
03-03-17 package.sh: on Cygwin verify 'ntsec binmode' in $CYGWIN or die
Makefile: install gcc wrapper if no cc
package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops
03-03-12 package.mk: add :DETAILS: for style-specific details
03-03-11 package.sh: add beta setup/update support
TEST.mk: add (TESTCC) prereq for .sh tests
03-03-07 hurl.sh: add
03-03-06 iffe.sh: fix lib Win32 test Cygwin vs native incompatibility
iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro
03-03-03 package.sh: check for curl or wget for update
package.sh: add setup action == update read make
package.sh: fix packageroot() typo that showed up in non ~user shells
mamake.c: treat name+=value args like name=value
mamake.c: add ${var?*|value?match?no-match?}
mamake.c: fix archive vs. dynamic bind logic
03-02-28 package.sh: add the "cyg" (Cygwin) package type
package.mk: add "cyg" stubs, :CATEGORY: for category name(s)
03-02-25 mamake.c: add -D4 system(3) debug trace
03-02-24 package.mk: change --mismatch to --corrupt=accept
03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb"
03-02-12 Makefile: handle getconf LIBPATH with host pattern
03-01-31 package.mk: fix .lic search
03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere
package.sh: admin handles command outside of $PACKAGEROOT/bin
Makefile: install $(INSTALLROOT)/lib/make/package.mk
03-01-28 package.sh: admin remote commands on one line to please syslog
03-01-23 probe.win32: borland and mingw32 tweaks
03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh
03-01-16 ditto.sh: tw --chop on by default
03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/
package.sh: admin now initiates remote exec and copy from local host
03-01-12 package.sh: handle admin "xxx:" default root
03-01-03 probe.win32: add /usr/include/borland path truncation workaround
02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc
02-12-06 probe.win32: fix inlcude => include typo, add lcc lib
probe.win32: CC.MAKE.OPTIONS = nativepp=0
02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined
02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks
02-11-26 package.sh: package release now checks for second level files
02-11-22 package.sh: update action now uses HTTP/1.0
02-11-21 probe.win32: update the vc include dir test
02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var
02-11-13 packahe.mk: fix list.install => list.installed typo
02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search
make.probe: add CC.LD.STRIP for link time a.out strip
package.sh: fix package_use vs. PACKAGE_USE check
02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post
02-10-23 mamake.c: fix uninitialized time in make()
ratz.c: fix meter buffer overflow
02-10-20 package.sh: fix lib/probe/C/make/probe update test
02-10-18 probe.win32: update for mingw
make.probe: add bash workaround to SHELLMAGIC test
package.sh: work around yet another Cygwin hassle
02-10-17 iffe.sh: short circuit ID check for *[-+/\\]*
02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
package.sh: unset FIGNORE to avoid rm . errors
package.sh: $CC must at least compile and executable hello world
02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz
package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS)
iffe.sh: add identifier checks for tests that (implicitly) require them
iffe.sh: disambiguate a few --config macros
02-10-02 iffe.sh: fix shell=bsh `hdr a/b'
02-09-30 package.sh: handle chmod of -* files
package.sh: verify that $SHELL is Bourne compatible
package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation
iffe.sh: fix bug that didn't define mac variable on success
02-09-22 package.sh: handle admin_action=ditto
iffe.sh: --config sizeof(foo) macro is SIZEOF_foo
iffe.sh: fix long.long test so it doesn't defeat UWIN "typ long.long"
mamprobe.sh: convert $("foo") nmake string constants
02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout
02-09-11 make.probe: move from nmake src to be part of mamprobe.sh
mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end
mamake.c: pass cc absolute path to mamprobe
package.sh: generate mamprobe -- yuk (at least it's confined to INIT)
iffe.sh: lcl,nxt: drop default sys/ check
ditto.sh: tw --logical by default; add --physical
02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey
02-09-09 ditto.sh: test that remote .profile exists before sourcing
02-09-06 package.sh: don't ditto nfs junk
ditto.sh: --show now lists directory ops instead of enumerating all
02-09-05 ditto.sh: add --remote={rsh|ssh}
package.sh: add admin [[{rsh|ssh|-}]:]directory
02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility
02-09-01 cc.unix.mc68k: add for ancient 3b1
02-08-22 package.sh: fix component() to test for components -- duh
Makefile: add LICENSE:.DONTCARE to workaround mam
02-08-11 iffe.sh: provide defaults for LD_* additions
02-08-07 ratz.c: change -m to use * instead of non-portable inverse video
02-07-17 mamprobe.sh: close tmp file in trap before rm for Cygwin
package.sh: fix "type" to handle i1586 (P4)
package.sh: add the view action
02-06-28 package.sh: handle multiple packages for release action
02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc
02-06-14 package.sh: fix admin_action to not include qualifiers
package.sh: fix help/html doc typo
02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*'
02-06-07 WWW.mk: change substitute $("\n") to \n
02-06-06 package.sh: clarify output streams for help/html
02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH)
02-04-04 package.sh: fix update to differentiate *.sun4 and sun4
02-03-27 package.sh: yacc/bison warning only if both missing
02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems
02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package
package.sh: precheck $CC, not `cc'
package.sh: fix install to use pax -ps to preserve setuid/setgid
package.sh: fix install to use list.installed for existing files only
02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read
package.sh: fix update delta sync fetch
02-02-14 iffe.sh: fix macro{ }end docs to include "
iffe.sh: add dfn to extract #define from headers
iffe.sh: handle nxt #include ok but no line sync
iffe.sh: drop local header clash logic
iffe.sh: add -X, --exclude=dir to exclude -I dirs
iffe.sh: lcl,nxt now generate <...> headers instead of "..."
package.sh: admin.db root dir matching -* disables host
package.mk: fix package.src.pat typo -- too many )
package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: }
package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: }
Makefile: move proto.c generation to the proto component dir
02-02-02 execrate.sh: add for .exe challenged Win32 systems/commands
mamprobe.sh: add STD* commands/flags
mamake.c: update mamprobe info when older than mamprobe executable
package.sh: move ed/ex workaround to mamprobe.sh
package.sh: fix `host type' bug that incorrectly assumed sun4 for sol
package.sh: add execrate(1) hooks for challenged systems
package.sh: add check for { cc ar nm yacc/bison } before make
ratz.c: fix "rb" vs. "r" macro tests
iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include
iffe.sh,package.sh: remove variable from sccs,cvs ident strings -- duh
02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B*
iffe.sh: handle 'mem struct.a.b'
02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results
package.sh: uts.370 => uts.390
02-01-18 package.sh: fix uts hosttype
02-01-17 package.sh: add 'results failed ...' to list failures only
package.sh: change ARCH internal var to all_types to avoid env conflict
iffe.sh: fix hdr/lib precheck that missed some -- ouch
iffe.sh: fix noexecute test that forgot to check compile first!
02-01-15 ratz.c: fix path[] type typo
02-01-01 package.mk: tighten license search
02-01-08 package.sh: `pwd` => ${PWD:-`pwd`}
package.mk: expand license file pattern match
02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value"
iffe.sh: fix initial <sys/types.h> check to honor --config
01-12-25 iffe.sh: fix bug where -o file restored old file
01-12-23 package.mk: uniq the closure lists
01-12-07 ratz.c: fix --meter to retain paths containing " -- "
01-11-30 ratz.c: use sear_system() to execute; should work on all windows
01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status
01-11-26 ditto.sh: drop n+=v for ksh compatibility
01-11-21 ditto.sh: add rsync script replacement [hey, it works!]
package.sh: add [ditto]:directory notation to admin.db
01-10-31 package.sh: handle *.sum paths with embedded space
package.sh: change executable() to onpath()
package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack)
package.sh: add os2 fix to `host type'
mamake.c: add .exe hack
iffe.sh: fix intrinsic function lib test
mamprobe.sh: update pic probe to match make.probe for linux.ia64
01-10-30 package.sh: make action skeleton view now checks subdirs
01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP
package.mk: tarball package.notice replaces `license accepted' prompt
package.sh: eliminate `license accepted' prompt
package.sh: add update to download latest from a url
package.sh: use builtin arithmetic when we know it's ksh
iffe.sh: unkown -> unknown
01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN
package.mk: convert to YYYY-MM-DD delta releases instead of NNNN
ratz.c: fix -m for paths containing \f\n\r\v
01-10-16 ratz.c: _SEA_* => SEAR_*
ratz.c: preserve stdin for sear_exec()
ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup
01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC
package.sh: add nfs wakeup call to admin to avoid stale file handles
01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh)
01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH
package read: save cpy of bin/package when reading the INIT package
mamprobe.sh: allow cc path with optional arguments
01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization
01-09-19 package.mk: add recurse to list.package.*
package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32
01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives
01-09-07 package.mk: fix output capture to not generate files names with spaces
01-09-07 package.mk: fix delta release number search
01-08-11 package.mk: handle single gz executable packages (e.g., for ksh)
package.sh: fix package install to require nmake only if no *.sum
iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash
01-07-17 package: fix use cross compile test to generate files in /tmp
01-06-27 ratz: handle hard and soft links if possible
01-06-07 Makefile: fix :MAPLIB: for sco
01-05-31 crossexec.sh: add
iffe.sh: add -x crosstype to run crossexec
iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end
package.sh: add package host canon external-host-type-name
package.sh: fix `use USER' lookup for shells that support ~USER
cc.*: add -dumpmachine to dump target HOSTTYPE
01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops
01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command
01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes
iffe.sh: fix run *.sh for shells that don't $* across . command
cc.mvs.390: recode for /bin/sh
01-04-25 package.mk: include non cc-g variants by default
package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh
01-04-24 TEST.mk: no tests for VARIANT=="DLL"
01-04-22 package.mk,package.sh: tarball text members are ASCII encoded
01-04-18 package.mk: allow package name to be the same as one of its components
cc.mvs.390: handle .C .cpp .cxx
cc.mvs.390: compensate for -o that does not overwrite
01-04-01 regress: fix SAME that just skipped it -- we should regress regress!
iffe: fix bug that didn't emit _hdr_foo for internal hdr tests
iffe: fix lcl bug for cc -E that doesn't emit line syncs
ratz: add ASCII=>EBCDIC conversion for text archive members
mamake: fix buffer overlap bug that clobbered the probe file path
01-03-17 iffe: handle : separator as first arg
01-03-15 mamake.c,ratz.c,release.c: add <stdlib.h> and <string.h>
01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op
01-02-22 cc.ibm.risc: handle SF_CLOSE clash in <sfio.h>
01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc
C+probe: quote "$cc" when it's an argument!
mamake: execute actions with $SHELL, ignored signals back to default
package.sh: nmake check error output to /dev/null
package.sh: fix INIT a.out updates for knr cc
package.sh: package list now handles large tgz dirs
package.sh: *-ok executables moved to ok/* for *.dll systems
iffe.sh: change "exec >&-" to "exec >/dev/null" else Linux mkdir fails!
mamake: handle `bind -lx [dontcare]'
01-02-12 ratz.c: fix _PACKAGE_ast includes
package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/
package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE
iffe.sh: fix dat code that used previous $tmp.exe
iffe.sh: fix dat code for _DLL imports
01-02-09 iffe.sh: add copy() for shells with the disappearing here doc bug
01-02-08 Makefile: guard against null $(CC.HOSTTYPE)
01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged)
01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE
package.sh: create intermediate recursion makefiles when needed
package.sh: add $SECONDS to the DEBUG trace prompt
01-01-01 ratz.c: #ifdef for UWIN ncc
iffe.sh,package.sh: check PACKAGE_PATH for local installations
package.sh: add psrinfo for osf.alpha host cpu
package.sh: change pax --meter probe; some hang on /dev/tty
package.sh: fix `install flat ARCH'
mamake: eliminate loops from scan order
C+probe: add probe_verbose -V for AIX cc=xlc
cc.ibm.risc,ldd.ibm.risc: add
package.mk: list refs to top-level licenses only
package.mk: add local link table to change log html
00-12-25 package.sh: `no package archives' is a hard error, duh
package.sh: reorder host type logic for lame shells
mamake.c: getcwd => getwd for NeXT -- how about posix==default guys
iffe.sh: really gross workaround for NeXT -lposix stdout null's
iffe.sh: handle cc -E that insists on compiling
00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0
*.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh
package.sh: fix LD_LIBRARY*_PATH initialization
cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms
00-12-12 ratz: add --meter
package.sh: a few VPATH fixes
Makefile: don't override *.mips* cc if -version not accepted
00-12-11 package.mk: *.inx now contains name=value
00-12-07 package.sh: handle PC netscape . => _ pathname mangle
WWW.mk: .tar.gz => .tgz
00-11-27 package.sh: add checklicense() to do license checks at read time
package.mk: change component list from preformat to table
00-10-31 package.mk: *.pkg must assert closure
package.mk: add cc- variants to list.package.binary
package.sh: omit dups from package list
package.sh: invalid arg gives one line Usage
package.sh: relax checkaout checks for non-owners
package.sh: package use sets NPROC if not already set or [01]
proto.c: add $(INSTALLROOT)/include/ast hack
00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE:
00-10-25 package: fix install
package.mk: add list.install
00-10-22 regress: fix VIEW to skip empty dirs
00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake
iffe: validate #define identifiers
00-10-18 C+probe: Mac OS X additions
package: add DYLD_LIBRARY_PATH initialization
add ldd.$(CC.HOSTTYPE)
00-10-01 iffe: handle -I* -L* options
00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs
00-09-19 C+probe: add probe_longlong
00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake
00-09-08 iffe: verify that $cc is a C compiler
00-06-14 mamprobe: fix win32.* probe
mamake: fix bug that used lower view path for generation
package: don't clobber $PACKAGEROOT/bin/nmake
00-06-01 C+probe: fix stdinclude *again*
package: fix write delta source to use default pax format
package: add disambiguating bias for sgi.mips3 over sgi.mips4
package.mk: fix for directory content packages lib ast-locale
00-05-01 iffe: fix invalid _LIB_ macro identifier
00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude
00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected
00-03-17 package: all archives are .tgz for binary download
package: $(PACKAGEROOT)/LICENSES/* in source and binary archives
package: implement install and verify actions
iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb
iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk
package.mk: add *.pkg :INDEX:
00-03-07 package: add admin action
00-03-06 makefile: install optional make probe override script C+make+probe.lcl
00-02-14 --- release 1.0 ---
ratz: treat "foo/" as a dir, not a regular file
package: clarify source and binary installation instructions
package: fix so binary packages can install without cc
package: "ratz" now a non-archive package (the only one) for bootstrap
package: handle VPATH=a:b arg
package.mk: "ratz" package adjustments
Makefile: use :PACKAGE_INIT: to support binary INIT packages
WWW.mk: add :WWWALL:
C.probe: fix .so check that let .dll slip through
iffe: fix config sh var assignment for HAVE_member_IN_struct
iffe: fix config sh var assignment for symbol_DECLARED
package: delay PATH export until dll hack exports complete
package: don't forget binary package $(INSTALLROOT)/lib(32|64)
package: add delta change log for source packages
00-02-10 mamprobe: add mam_cc_DLLBIG
package: fix spelling typos
package: add html help output
package.mk: beef up source and binary help => html
00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug
00-01-28 package,release: add -rcount to release
package: fix Linux "host cpu" and "host rating"
package: copy *.lic to $PACKAGEBIN for "make" and "write binary"
package: fix 'release change log' case match
00-01-24 package: add copyright action
mamprobe: add -D_BLD_DLL to mam_cc_DLL
00-01-11 package: tsort for package write
package: early verification that $CC works
package: add non-interactive command arg for use action
proto: fix -C intermediate mkdir()
mamprobe: unixware.i386 ksh workaround
C.probe: move hosttype to C.probe (with unixware.i386 workaround)
WWW.mk: fix mm2html option quoting
WWW.mk: add .SCAN.mm
WWW.mk: don't force static=1; grab dll's instead
*.sh: fix getopts test to handle botched implementations like osf.alpha
iffe.sh: fix read -r test
99-12-25 iffe: tweak verbose messages
iffe: hand code non-optget getopts parse
iffe: fix bash quoting bug again
iffe: do test -w . after option parse
package: fix PACKAGEROOT search
99-11-19 --- release 0.2 ---
99-11-19 first working package & friends
99-10-31 change from lib0ast to INIT; add MAM and package bootstrap
hostinfo: gobbled by package
99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround
99-09-27 iffe: add --all --verbose, --* set options
99-09-22 regress: -v disables long line truncation
99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME)
99-08-11 hostinfo: fix type sgi.mips4
99-06-24 WWW.mk: add
99-06-08 hostinfo.sh: ${TMPDIR:-/tmp}
99-06-07 TEST.mk: add
99-06-01 iffe: add `siz type' for _siz_type == sizeof(type)
99-05-11 hostinfo,iffe,regress,use: long options
99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine
99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks
iffe: check that . is writable
99-03-17 hostinfo: fix for cc not found
dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE
C.probe: extra check for include dirs pulled in by <sys/types.h>
99-03-03 regress: add `UNIT - ...' for extra args
Makefile: add (_hosttype_) prereq for cc
99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there
99-01-11 C.probe: shlib before lib, /usr before /
98-12-25 iffe: work around win32.alpha intrinsic clash with -O
98-11-11 regress: fix UNIT PATH lookup
98-11-01 regress: add PROG
98-10-01 hostinfo: add unixware.*
use: export PACKAGE_*
98-08-11 C.probe: add /usr/include check (for sco CC)
hostinfo: handle UWIN uname update
98-05-01 regress: fix bug sometimes didn't list last test
98-04-01 hostinfo: add cc path arg
hostinfo: now works with /bin/sh
Makefile: strengthen -lm probe
98-01-23 Makefile: check for -ldl -lm
C.probe: handle gcc -v -E phony include dirs
iffe: fix lcl by dropping sort -u -- we need the real first
iffe: `mem x' to test if x is a non-opaque struct
98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3
$(INSTALLROOT)/lib64 for sgi.mips4
add cc.hp.pa
98-01-01 cc.sgi.mips*: turn off ld library multiply defined
97-10-11 regress: add VIEW function for locating data
97-10-01 Makefile: -ldl test moved to libdll Makefile
97-08-11 regress: add MOVE
regress: add SAME
regress: use getopts
regress: `EXEC' repeats previous test
97-07-17 use: tweak PATH and LIBPATH bootstrap order
iffe: fix lcl bug that botched pathnames with embedded spaces
97-06-12 iffe: add npt `needs prototype' test
97-05-09 hostinfo: mvs.* => mvs.390
Makefile: cc.$(_hosttype_) workaround installed here
iffe: fix nolink{ ... }end
iffe: add [no]static{ ... }end for static link test
C.probe: _probe_PATH => _probe_export which must be eval'd
97-04-01 use: _RLD_ROOT set too
97-03-17 mm2html: changed inner loop
mm2html: handle .if|.ie|.el, .so
mm2html: handle different man styles
mm2html: differentiate mm/man in some non-obvious cases
hostinfo: r5000 is not mips4
97-02-14 hostinfo: validate type with cc
96-12-25 C.probe: UWIN tweaks
iffe: use `...` instead of $(...) for alpha /bin/sh
iffe: fix `typ' divide by 0
iffe: `lcl' now drops X: prefix
iffe: +l* -> -l*
iffe: eval around ${...#%...} for BSD /bin/sh
use: add sgi.mips LD_LIBRARY<abi>_PATH variants
use: add -e to list exports
iffe: lcl leaves leading [a-zA-Z]: for DOS
iffe: fix no{link|output|execute} logic
C.probe: don't automatically add /usr/include for non-hosted compilers
C.probe: don't automatically place /usr/include last
C.probe: check gcc style -v -E for stdinclude usrinclude
96-11-28 iffe: check BASH_VERSION for IFS botch
iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx)
hostinfo: fix sgi.mips[234] tests
hostinfo: fix ncr.i386 tests
96-10-31 iffe: work around old bsh here doc bug by running separate sh
96-10-11 iffe: *.iffe and *.iff for iffe src files
hostinfo: tighten sgi.mips CPU type check
96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
96-09-17 iffe: fix typ bug that failed for single ID types!
96-08-31 hostinfo: handle recent SGI hinv CPU changes
96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
96-05-09 C.probe: drop multiple / in stdinclude
96-02-29 use: package root must have bin and lib subdir
mm2html: add
C.probe: probe_members += -whole-archive for gcc
iffe: add + fix the blasted `...'...\\...'...`
96-01-31 use: add pkg dir
hostinfo: add tandem
96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32
95-11-24 hostinfo: linux-aout.* for non-ELF Linux
95-11-11 use: add AIX LIBPATH
95-10-11 hostinfo: no args prints type
95-08-11 use: add
95-05-09 save original PATH in _probe_PATH
beef up library dir probe
95-04-01 use c source suffix if it still preserves the dialect
add hostinfo
add lib/hostinfo/typemap user type map
add sol.sun4 CPU count
fix C.probe to properly handle C/C++ combined compiler drivers
add NeXT to hostinfo
bummer: mach has /usr/bin/hostinfo
95-03-19 fix dialect executable test
95-03-19 --- release 0.0 ---
@@ -1,9 +0,0 @@
: ar requires a non-standard option to work : 2009-10-06 :
op=$1
shift
case $op in
-*) ;;
*) op=-$op ;;
esac
/usr/bin/ar -Xany "$op" "$@"
@@ -1,9 +0,0 @@
: ar requires a non-standard option to work : 2022-01-14 :
op=$1
shift
case $op in
-*) ;;
*) op=-$op ;;
esac
/usr/bin/ar -X64 "$op" "$@"
Loaded 100 of 1227 files, more files were not shown because too many files have changed in this diff. Show more