EMS Manual
Example of Retrieving Event Messages
EMS Manual—426909-005
A-25
C Source File
#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,DEBUG,FILEINFO)>
nolist
#include <CEXTDECS(NEWPROCESS,OPEN,STOP,WRITE,WRITEREAD)>
nolist
#include <CEXTDECS(EMSGETTKN,EMSTEXT)>
nolist
#include <CEXTDECS(SSGETTKN,SSMOVETKN,SSPUTTKN,SSINIT,SSNULL)>
nolist
/* Change to refer to local DSV where ZSPIDEF subvol
exists */
#include "$System.Zspidef.ZSPIC" nolist
#include "$System.Zspidef.ZEMSC" nolist
#pragma PAGE "Globals and defines"
#include "MYAPC" /* Includes DDL generated from MYAPDDL */
/* These defines are used for zems structs to shorten
names */
#define EMSBUFDEF zems_ddl_msg_buffer_def
#define SPIERRDEF zspi_ddl_error_def
#define FALSE 0
#define TRUE (!FALSE)
/* The following struct is used to pass a startup message to
* the process started by newprocess. The C initialization
* code conveys this information as argc/argv information
* and disposes of the original startup message.
*/
typedef struct startup_msg {
int msgcode;
int defaults[8];
int infile[12];
int outfile[12];
char params[35]; /* leave room for some params */
} CISTART;
/* ---------- Globals ----------------- */
/* recfn; is not used in the C version. C processes startup
*/
int distr; /* distributor file number */