Go to the first, previous, next, last section, table of contents.


Program usage

Command line options

The command line syntax for the LaSt engine is very simple, and reflects the two possible modes of operation -- as a stand-alone application or as a server.

Usage: lastengine - | -f filename | -s [port]
  -             -- read from standard input
  -f filename   -- read from filename
  -s [port]     -- server mode with optional port

The options - and -f launches the LaSt engine in stand-alone mode, whereas the option -s starts the server operation. If none of the three options is given, or if an unknown option is present on the command line, an error message is printed and the program terminates.

Stand-alone operation

The stand-alone operation of the LaSt engine permits using the LaSt engine in command pipes, batch jobs, and the like. Basically the LaSt engine reads the inputs, processes the document, outputs the results and exits.

In stand-alone mode, error messages are printed to standard error and the results to standard output. In some occasions the error messages will be duplicated in the result, as defined by the LaSt engine input and output protocols (see those sections).

Server operation

The server operation of the LaSt engine permits using the LaSt engine from any other machine, connecting via a TCP connection. The server listens for connections on a port given at startup, or on the first available port returned by the operating system. When a client connects, the server reads the inputs, processes the document, returns the results, and closes the connection. After closing the connection the server starts listening for new connections.

An important issue in the server operation mode is the way to send or receive input and output. The protocols for input and output remain the same, but inputs are only read until the string "</last>" is sent. Outputs will in server operation mode always be terminated by a null or zero byte. Both of these conventions are unique for the server operation mode, and are not present in stand-alone operation mode.

In server mode the error messages are still printed to the server standard error, which can be useful for logging purposes. The standard error should be redirected to an error log file when starting the LaSt engine in server mode. Depending on if full outputs are produced or not, the errors and warnings will also be sent over the connection embedded in the result. This is further specified in the section on LaSt engine outputs.


Go to the first, previous, next, last section, table of contents.