Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
Sample User-Written Code for SPIFFY Subsystem 
Interface Process
D-22
109759—Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
Sample I Process Program Code
 st^done ->
 ! Whatever objects resulted from executing the command on
 ! cx.inobj are now on the cx.current^out list. Build the
 ! thread output for return to the frame.
 CALL _CLOSE^CI (cx.spif);
 WHILE _NOTNULL (@outobj := _GET^LM (cx.current^out)) DO BEGIN
 IF outobj.er THEN rc := format^error^object (outobj)
 ELSE rc := format^normal^object (outobj);
 IF rc <> _RC^NULL THEN RETURN rc;
 END;
 ! Continue with next _input object.
 _DISPATCH^THREAD (, st^new^object, _EV^CONTINUE);
 END;
_END^THREAD^PROC;
_THREAD^PROC (info^cmd^proc); 
 BEGIN
 ! Process info commands, including a command preliminary to an
 ! action command. Generate output list of all objects resulting
 ! from expanding the input list through hierarchy and * object
 ! names, together with info about the object from the subsystem
 ! and its DSNM state.
 INT .EXT cx (cx^def) = _THREAD^CONTEXT^ADDRESS;
 INT .EXT inobj (object^lm^def), .EXT outobj (object^lm^def);
 STRUCT .tempobj (object^lm^def);
 _LISTPOINTER (temp);
 INT er,k;
 _RC^TYPE rc;
 _RC^TYPE SUBPROC error^object (erno, spiferno) VARIABLE;
 INT erno, spiferno;
 BEGIN
 ! Generate an output object for an input object in error.
 ! @Inobj must point to the object from which the error resulted.
 ! Create an output object and put error info into it.
 ! If everything works, put thread into new^object state and return
 ! _RC^WAIT; otherwise return appropriate return code to abort
 ! the thread.
 ! Note: We can fiddle with the thread's state in a subproc
 ! which makes handling the return simpler than in a proc
 ! such as format^error^object.
 ! Erno: DSNM or FS error
 ! Spiferno: Spiffy error number, if present
 IF _ISNULL (@outobj := _PUT^LM (cx.current^out,,$LEN (outobj))) THEN
 RETURN _RC^ABORT (ZDSN^ERR^MEMORY);
 IF er := _FOBJECT^INIT (outobj.FOBJ, inobj.FOBJ) THEN
 RETURN _RC^ABORT (er);
 outobj.cf := inobj.cf;
 outobj.thing ':=' inobj.thing FOR $LEN (outobj.thing) BYTES;
 outobj.er := erno;
 IF $PARAM (spiferno) THEN outobj.spifer := spiferno;
 _THREAD^STATE := st^new^object;
 RETURN _RC^WAIT;
 END;










