.title NOTIFY - send a message to yourself .ident /V1.00/ .sbttl Documentation ; ; Routine allows a user to send himself a single line of text ; from any other process with that username -- useful for the ; plotting software, batch jobs, etc... ; ; Eric F. Richards ; 12-Nov-85 ; Gould OSD VAX 8600 VAXcluster, VMS V4.2, VAX Macro V04-000 ; .enable suppression .disable traceback, debug ; .sbttl Macros and constants $brkdef ; define breakthrough offsets $jpidef ; set GETJPI codes buffer = 256 ; get-foreign buffer length jpi$s_username = 12 ; username length .macro clrsp space, fill=#0 ; macro for clearing space subl space, sp ; on stack for a data area. movc5 #0, (sp), fill, space, (sp) ; fill ares is init'd, too... .endm clrsp ; ...that's it! ; .sbttl Main code .psect $code, long, exe, nowrt, pic, shr .entry notify, ^m ; ...entry point NOTIFY clrsp #buffer, <#^a/ /> ; make room for text buffer movl sp, r7 ; get address of this buffer pushl sp ; build descriptor for buffer pushl #buffer ; length needed for descr movl sp, r6 ; save address of descr clrsp #jpi$s_username, <#^a/ /> ; make room for username movl sp, r4 ; save pointer to buffer pushl sp ; build descriptor pushl #jpi$s_username ; for $BRKTHRU to use movl sp, r5 ; save addr of descriptor pushl #jpi$c_listend ; build getjpi item list pushl r5 ; write length here pushl r4 ; write username here pushl #!jpi$s_username; request code, length for it movl sp, r3 ; save address of item list $getjpiw_s itmlst=(r3) ; get the information blbc r0, 10$ ; on error then exit pushl r6 ; build arg list for pushl #0 ; ...call to get message as a pushl r6 ; ...foreign command calls #3, g^lib$get_foreign ; get the foreign command blbc r0, 10$ ; on error exit w/ status subl3 #1, (r6), r1 ; get char count beql 5$ ; display line if it's one char blss 10$ ; exit if zero length string cmpb #^a/"/, (r7) ; is our first char a quote? bneq 5$ ; if so, keep going cmpb #^a/"/, (r7)[r1] ; is our last char a quote? bneq 5$ ; if so, keep going incl 4(r6) ; remove the end quotes from subw #2, (r6) ; the input string 5$: clrq -(sp) ; make an I/O stat block movl sp, r3 ; save addr of IOSB $brkthruw_s - ; broadcast the message msgbuf=(r6), - ; from the out buf sendto=(r5), - ; to the user sndtyp=#brk$c_username, - ; send by username reqid=#brk$c_user1, - ; the type of message sent flags=#brk$m_cluster, - ; send it cluster-wide iosb=(r3), - ; ...I/O status block timout=#15 ; wait 15 seconds blbc r0, 10$ ; on error exit movzwl (r3), r0 ; look at IOSB status 10$: ret ; return with (error) status .end notify ; th-th-that's all, folks!