Cogent API and Utilities: Version 4.1
Prev |  | Next

# lsend, gsend

lsend, gsend -- send commands to Cogent and Gamma programs.

## Synopsis

lsend [`-ghlVX`] [`task`]
gsend [`-ghlVX`] `task`

## Arguments

`task`

  A Cogent or Gamma program name (as a string, previously attached by `name_attach`, `init_ipc`, or `qnx_name_attach`), or a process ID (which is O/S dependent).

`-g`

  Accept Gamma input. This is generally used from lsend, and is the equivalent of running gsend. It is the default for gsend.

`-h`

  Print a help message and exit.

`-l`

  Accept Lisp input. This is generally used from gsend, and is the equivalent of running lsend. It is the default for lsend.

`-V`

  Print the version number.

`-X`

  Exit immediately (usually used with `-V`).

## Returns

A prompt with the `task` name displayed.

## Description

The lsend utility attaches to a running Gamma program and allows the user to send commands without exiting the event loop of the attached process. Any statement may be issued, including changing the definitions of existing functions. lsend statements use Lisp syntax, which consists of the name of the command or function, followed by a space-separated list of arguments, all enclosed in parentheses, like this:

        (command arg1 arg2 arg3 ...)
        (function arg1 arg2 arg3 ...)

The gsend utility is simply a symbolic link to lsend, and is the equivalent of calling lsend with the `-g` option. gsend statements use Gamma syntax, which is slightly different from Lisp syntax. The command or function name is outside the parentheses, and the arguments are separated by commas, like this:

        command (arg1, arg2, arg3, ...)
        function (arg1, arg2, arg3, ...)

To exit lsend or gsend, use Ctrl-C or Ctl-D. Anything else you type will be parsed and passed on to the task you have been communicating with.

| Event processing stops in the Gamma program for the duration of either of these commands.

## Example

Sending a Lisp command to an example Gamma process named `OtherProcess`:

        [sh]$ lsend "OtherProcess"
        OtherProcess> (cos 5.5)
        0.70866977429126
        OtherProcess>

Sending a Gamma command to the same process:

        [sh]$ gsend "OtherProcess"
        OtherProcess>cos (5.5)
        0.70866977429126
        OtherProcess>

The example process:

        Gamma> init_ipc ("OtherProcess");
        t
        Gamma> while(t) next_event();

Prev | Home | Next
Utilities | Up | nsnames

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.