DtclAppMainLoop - Provide a TCL user interface in a DRAMA task.

Function

Provide a TCL user interface in a DRAMA task.

Description

This routine can be used to give any Drama task a command line user interface based on Tcl. It should be called in place of DitsMainLoop.

For the user interface to work, DitsAppInit must have been called with the DITS_M_X_COMPATIBLE flag.

If argc is positive, then the following Tcl global variables are set

argv0
is set to argv[0]
argc
is set to argc
argv
is set to the argv[] (element 1 onwards)

DtclAppMainLoop adds the following actions and parameters to the task:

DTCL_COMMAND An action which causes a Tcl Command to be executed in the user interface's Tcl interpreter. It should have a single character string argument which is the Tcl command to be executed. It enables another task to issue any command which could be typed directly at the user interface.
DTCL_ENABLE An integer parameter which is 1 if the user interface is currently enabled and 0 if it is disabled.
DTCL_PROMPT A character string parameter which specifies the current prompt string for the user interface.

Options

The following options specfied in argv are used

-m n1:n2:n3
Overrides the message buffer sizes for connections to other tasks.

n1 Message bytes allowed for messages to be sent.
n2 Message bytes allowed for return messages
n3 Number of return messages which may occur.

-logging
Enable logging of DRAMA messages
-nostdin
Don't prompt for commands from stdin.
-globalnames
Force DRAMA names to be placed in the global namespace. For Tcl 8.0+ only. For prior versions of TCL, DRAMA names are always placed in the global namespace.
-noglobalnames
Force DRAMA names to not be placed in the global namespace. For Tcl 8.0+ only. For prior versions of TCL, DRAMA names are always placed in the global namespace.

Call

DtclAppMainLoop(argc, argv, MessageBytes, MaxMessages, ReplyBytes, MaxReplies, TclScript, enable, prompt, CommandDefn, clientData, status);

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

>argcintArgc as passed to the main function.
>argvchar **Argv as passed to the main function.
>MessageBytesintBytes to allocate to send message.
>MaxMessagesintMaximum number of messages to send.
>ReplyBytesintBytes to allocate for replies.
>MaxRepliesintMaximum number of replies.
>TclScriptchar *File name of a Tcl script to execute on initialization.
>enableint1 to enable the user interface, 0 to disable it.
>promptchar *Prompt string for the user interface.
>CommandDefnDtclAppCommandDefnTypeA routine which will be called after creation of the Tcl interpreter which can be used to define application specific Tcl commands. If zero, not used.
>clientDatavoid *Item passed to CommandDef routine
!statusStatusType *Modified status.

Language

C

Support

Jeremy Bailey, AAO

Prior Requirements

DitsAppInit and SdpInit must have been called. The DITS_M_X_COMPATIBLE flag must have been specified to DitsAppInit.

See Also

DTCL manual, dtcl(1), Dtcl_Init(3), tclsh(1), DtclTkAppMainLoop(3), DitsAppInit(3), SdpInit(3), Dits Specification.


Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tjf@aao.gov.au