OSI/AS Management Programming Manual
Event-Retrieval Example
Sample Programs
056785 Tandem Computers Incorporated C–39
Example in C The following pages give the source code for the event-retrieval program in C.
/*-----------------------------------------------------------
 *
 * File: EXEMSC1
 *
 * This program demonstrates how to retrieve an event
 * message produced by the OSI/AS subsystem and handle it
 * appropriately. It does the following:
 *
 * - Starts and opens an EMS consumer distributor.
 *
 * - Prompts you at your terminal for a filter file name.
 * The filter file name must be entered in full
 * path-name form, separated by spaces--for example,
 * "$myvol mysvol fltr1".
 *
 * - Connects the collector $0 and loads a filter file
 *
 * - Performs the following steps in a loop:
 * -- Issues a GETEVENT command
 * -- Displays an event message at your terminal
 *
 * The program waits for new event messages that pass the
 * specified filter and displays them as they arrive.
 *
 * To terminate the program, press the BREAK key
 * and type STOP.
 *
 */
#pragma INSPECT,SYMBOLS
#pragma NOMAP
#pragma NOLMAP
#pragma RUNNABLE
#pragma NOXMEM
#pragma HEAP 20 pages
#include <stdio.h> nolist
#include <string.h> nolist
#include <stdlib.h> nolist
#include <memory.h> nolist
#include <tal.h> nolist /* CCG, etc. */
#include <CEXTDECS(CLOSE,CREATEPROCESSNAME)> nolist
#include <CEXTDECS(DEBUG,FILEINFO)> nolist
#include <CEXTDECS(NEWPROCESS,OPEN,STOP)> nolist
#include <CEXTDECS(WRITE,WRITEREAD)> nolist
#include <CEXTDECS(EMSGETTKN,EMSTEXT)> nolist
#include <CEXTDECS(SSGETTKN,SSMOVETKN)> nolist
#include <CEXTDECS(SSPUTTKN,SSINIT,SSNULL)> nolist
/* Change to refer to local distribution subvolume where the
 * ZSPIDEF subvolume exists. */
#include "$system.zspidef.ZSPIC" nolist
#include "$system.zspidef.ZEMSC" nolist










