Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 54
Programming the Server
?NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS0 (INITIALIZER,
? PROCESS_GETINFO_,FILE_OPEN_,WRITEREADX,WRITEX,REPLYX,
? KEYPOSITION,PROCESS_STOP_,READX,FILE_GETINFO_,
? READUPDATEX,READUPDATELOCKX,WRITEUPDATEUNLOCKX,
? FILE_GETINFOLIST_,UNLOCKREC,DNUMOUT)
?LIST
!------------------------------------------------------------
! Here are a few DEFINEs to make it a little easier to format
! and print messages.
!------------------------------------------------------------
! Initialize for a new line:
DEFINE START^LINE = @S^PTR := @SBUFFER #;
! Put a string into the line:
DEFINE PUT^STR (S) = S^PTR ':=' S -> @S^PTR #;
! Put an integer into the line:
DEFINE PUT^INT (N) =
@S^PTR := @S^PTR '+' DNUMOUT(S^PTR,$DBL(N),10) #;
! Print a line:
DEFINE PRINT^LINE =
CALL WRITE^LINE(SBUFFER,@S^PTR '-' @SBUFFER) #;
! Print a blank line:
DEFINE PRINT^BLANK =
CALL WRITE^LINE(SBUFFER,0) #;
! Print a string:
DEFINE PRINT^STR (S) = BEGIN START^LINE;
PUT^STR(S);
PRINT^LINE; END #;