/*
 *    stkrmsgs.h
 *
 *  This file defines the messages understood by STalker and the format
 *  each should have.
 *
 *  Messages should be sent to STalker using the following sequence:
 *
 *  1   First, determine if STalker is present using the call:
 *          stalker_id = appl_find("STALKER ");
 *      If the id returned is -1, STalker is not present.
 *
 *  2   Send the appropriate message to STalker:
 *          int     msg_buf[8];
 *
 *          msg_buf[0] = <message number>;
 *          msg_buf[1] = <your appl id (gl_apid)>;
 *          msg_buf[2] = # bytes in excess of the predefined 16 byte buf.
 *          msg_buf[3..7] depends on the message;
 *          appl_write(stalker_id, sizeof(msg_buf), (char *)msg_buf);
 *
 *  3   Wait for STalker to respond:
 *          for (;;) {
 *              evnt_mesag(msg_buf);
 *              if (msg_buf[1] == stalker_id) {
 *                  { check the response code & handle it }
 *                  break;
 *              } else {
 *                  { handle system or other messages if necessary }
 *              }
 *          }
 *
 *  Copyright (C) Eric Rosenquist 1988.
 *
 */

typedef struct {
	int junk[3];
	char *address;
} RESPONSE;

#define MSG_IDENTIFY	2000
			/* No parameters.                                              */
			/* Response in msg[0]: -2000                                   */
			/* msg[3]: STalker version number                              */

#define MSG_SLEEP		2001
			/* No parameters.                                              */
			/* Response in msg[0]: -2001                                   */
			/* Causes STalker to 'sleep'.  The same effect as the user     */
			/* hitting ALT-K, but no message on the info line.             */

#define MSG_WAKE		2002
			/* No parameters.                                              */
			/* Response in msg[0]: -2002                                   */
			/* The opposite of MSG_SLEEP.  Restore STalker to normal mode. */

#define MSG_DISPLAY		2003
			/* Parameters in msg[3]: high word of string address           */
			/* msg[4]: low word of string address                          */
			/* ex.   (char *)&msg[3] = string_address;                     */
			/* Response in msg[0]: -2003                                   */
			/* Displays the null terminated string in the STalker terminal */
			/* window.                                                     */

#define MSG_INFO		2004
			/* Parameters in msg[3]: high word of string address           */
			/* msg[4]: low word of string address                          */
			/* ex.   (char *)&msg[3] = string_address;                     */
			/* Response in msg[0]: -2004                                   */
			/* Displays the null terminated string in the STalker terminal */
			/* information line.                                           */

#define MSG_CONFIG		2005
			/* No parameters.                                              */
			/* Response in msg[0]: -2005                                   */
			/* msg[3..4]: Pointer to STalker's CONFIG struct.              */
			/* ex.  cfg = *((CONFIG **)&msg[3]);                           */
			/* if (cfg->rs232.rs_flow) ...                                 */

#define MSG_BUFFER		2006
			/* No parameters                                               */
			/* Response in msg[0]: -2006                                   */
			/* msg[3..4]: Pointer to STalker's file transfer               */
			/* buffer.                                                     */
			/* msg[5]: Size of buffer in K.                                */

#define MSG_RESOURCE	2007
			/* No parameters                                               */
			/* Response in msg[0]: -2007                                   */
			/* msg[3..4]: Pointer to STalker's resource tree               */
			/* as stored in global[5..6]                                   */

#define MSG_SENDSTRING	2008
			/* Parameters in msg[3]: high word of string address           */
			/* msg[4]: low word of string address                          */
			/* ex.   (char *)&msg[3] = string_address;                     */
			/* Response in msg[0]: -2008                                   */
			/* Sends the null terminated string to the remote host via the */
			/* serial port.                                                */

#define MSG_KEYSTROKE   2009
			/* Parameters in msg[3]: keycode.                              */
			/* msg[4]: shift keys                                          */

#define MSG_EXECUTE_SCRIPT	2010
			/* Parameters in msg[3]: high word of address of file name     */
			/* msg[4]: low word of address of file name                    */
			/* ex.   (char *)&msg[3] = full_pathname;                      */
			/* Response in msg[0]: -2010 if execution will be attempted,   */
			/* 0 if STalker is busy and won't try.                         */
			/* Executes the specified script file as long as STalker isn't */
			/* busy doing something else (like downloading a file).        */
			/* The filename should be fully-qualified in order to avoid    */
			/* potential ambiguity.  The filename is not checked in any    */
			/* way until STalker attempts to execute the script.           */

#define MSG_ENABLE	2011
			/* Parameters in msg[3]: TRUE/FALSE -> Enable or Disable STalker 
			 * msg[4]: Serial port in question (BIOS dev #) Response
			 * in msg[0]: -2011 
			 * msg[3]: STalker's new enabled/disabled status 
			 * msg[4]: STalker's serial port bios dev #
			 * 
			 * If STalker is currently using the specified BIOS device number, 
			 * this message will make it enable or disable itself
			 * as if the user had typed Alt-K.  If STalker is using a different 
			 * port, this message has no effect (although STalker
			 * still replies). If STalker is unable to change the status 
			 * (because it is busy executing a command for example), the
			 * reply in msg[0] will be a zero.
			 */
