Writing Monitors for the Event Monitoring Service (December 1999)

86 Chapter3
Creating a Resource Monitor
Processing a Subclass Request Event
Sample Code
This code fragment shows how a resource monitor might respond to a
Subclass Request Event. This resource monitor supports only one
resource class, called /samples, with several resource instances under
that resource class.
RmSubclass
Name
char * A pointer to a null-terminated string of up
to 256 characters that identifies the
resource class or instance. The
RmResourceName may contain either
the full path name of the resource class or
instance or the portion immediately
following the resource class. The EMS
API will prepend the name of the
resource class if the RmSubclassName
does not begin with “/”. See the section,
“The Resource Dictionary for more
details.
Table 3-5 Subclass List Object Fields
Field Name Type Description
/*****************************************************************************/
/* File: send_subclass_reply.c */
/* */
/* Process a Subclass Request Event. */
/*****************************************************************************/
#include <monitor.h>
/*
* Resource monitor: send_subclass_reply
* Desc:
* Receives an event and, if it is a Subclass Request Event,
* defines the resources that are supported. Only the /samples
* resource class is supported.
* Parms:
* obj The object that was created by rm_get_next_event().
* This object is destroyed outside of this function.
* Returns:
* 0 Upon success
* !=0 Otherwise
*/