Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
Sample User-Written Code for SPIFFY Subsystem 
Interface Process
D-26
109759—Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
Sample I Process Program Code
 FOR k := 0 to cx.r.response^things-1 DO 
 BEGIN
 IF (rc := normal^object (cx.r.thing[k])) <> _RC^NULL THEN
 RETURN rc;
 END;
 IF cx.r.cmd.response^context THEN 
 BEGIN
 ! Note: If _SEND^CI produces an error now, something happened
 ! to the SPIFFY manager after we last talked to it.
 ! Put object with error into output, even though it may
 ! have appeared earlier.
 IF (er := _SEND^CI (cx.spif, cx.cmd, $LEN (cx.cmd), $LEN (cx.r)))
 THEN RETURN error^object (er);
 RETURN _RC^WAIT;
 END;
 IF _OFF (inobj.cf,c^starobj) THEN
 _DISPATCH^THREAD (, st^exec^done, _EV^CONTINUE); ! Done with this
 ! obj
 ! Input was a star object. Input list now empty. Get next
 ! inobj to free the last inobj got, and to be sure it's
 ! really empty, then exchange the current input and
 ! output, which effectively replaces the star object with
 ! its expansion. See note in st^new^object state.
 IF _NOTNULL (@inobj := _GET^LM (cx.current^in)) THEN 
 BEGIN
 CALL _REPORT^INTERNAL^ERROR (1, _EMS^EVENT^INFO);
 RETURN _RC^ABORT (ZDSN^ERR^INTERNAL^ERR);
 END;
 @temp := @cx.current^in;
 @cx.current^in := @cx.current^out;
 @cx.current^out := @temp;
 _DISPATCH^THREAD (, st^new^object, _EV^CONTINUE);
 st^exec^done ->
 ! If this wasn't the command object, or if subordinates aren't
 ! wanted, enter new^object state to process next input;
 ! otherwise issue command to get subordinates and return to
 ! exec state to put on output.
 @inobj := @cx.currentobj;
 IF _ANYOFF (inobj.cf, c^fromcmd + c^subobj) THEN
 _DISPATCH^THREAD (, st^new^object, _EV^CONTINUE);
 _TURNOFF (inobj.cf,c^subobj);
 cx.cmd.cmd := tellabout;
 cx.cmd.response^context := 0;
 cx.cmd.type := anything;
 cx.cmd.name ':=' starname;
 cx.cmd.pop^name ':=' inobj.FOBJ.Z^OBJNAME FOR spiffy^name^len BYTES;
 IF (er := _SEND^CI (cx.spif, cx.cmd, $LEN(cx.cmd),$LEN(cx.r))) THEN
 RETURN error^object (er);
 _THREAD^STATE := st^exec;
 RETURN _RC^WAIT;
 END;
_END^THREAD^PROC;










