OSI/TS Management Programming Manual
Sample Programs
056786 Tandem Computers Incorporated C–27
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/TS 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". *
* *
* - Issues SPI CONTROL commands to: *
* Connect the collector $0 *
* Load a filter file *
* *
* - Performs the following steps in a loop: *
* Issues an SPI 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