.title QPRINT Send a file to a queued printer .sbttl Documentation .ident /V1.03/ ; ; This subroutine will queue a file to a specified ; print queue. ; ; Calling format: ; ; status=SNDPRT('file_name','queue_name', ; delete_on_completion,'form_name', no_feed) ; ; CALL QPRINT(same parameters) for system error handling ; ; file_name - ASCII descriptor of the file name ; queue_name - ASCII descriptor of the queue name ; delete_on_completion - Boolean to tell wether the file should ; be deleted after being printed ; FALSE = don't delete, TRUE = delete ; form_name - ASCII descriptor of the form name ; no_feed - Boolean to tell wether the symbiont ; should insert form_feeds in the printout ; FALSE = insert form feeds, TRUE = don't ; ; Eric F. Richards ; Gould OSD VAXCluster VMS V4.2 ; 13-Jan-86 ; .sbttl Symbol Definitions $sjcdef ; job-controller offsets $ssdef ; system service codes fnam = 4 ; file name offset qnam = 8 ; queue name offset delflg = 12 ; print/delete? frmnam = 16 ; form name offset fedflg = 20 ; print/nofeed? .disable traceback, debug .psect $code, exe, long, nowrt, pic, shr .sbttl Main Code .entry qprint, 0 ; user entry point callg (ap), b^sndprt ; call main routine blbs r0, 10$ ; on success then skip pushl r0 ; ...the error sect. calls #1, g^lib$signal ; generate the error 10$: ret ; go back to the caller .align long .entry sndprt, ^m ; main entry point, r2 saved movzbl (ap), r2 ; save arg count cmpb #2, r2 ; do we have enough args? bleq 50$ ; if so, skip error section movzwl #ss$_insfarg, r0 ; signal error ret ; and get out ; ; Set queue name in item list ; 50$: clrq -(sp) ; mark list end movl qnam(ap), r0 ; get descriptor location movl (r0)+, r1 ; r1 has length of string pushl (r0) ; r0 points to address pushl #sjc$_queue@16 ; this is the queue we want movw r1, (sp) ; set string length ; ; Set file name in item list ; pushl #0 ; don't save return length movl fnam(ap), r0 ; get descriptor location beql 60$ ; skip if not specified movl (r0)+, r1 ; r1 has length of string pushl (r0) ; push address on stack pushl #sjc$_file_specification@16 ; this is the file we want movw r1, (sp) ; set string length ; ; Set delete flag, if necessary ; 60$: cmpl #3, r2 ; 3 args supplied? bgtr 90$ ; if not supplied, skip movl delflg(ap), r0 ; get address of third arg beql 70$ ; if null argument, skip blbc (r0), 70$ ; include this only if clrq -(sp) ; ...delete is specified pushl #sjc$_delete_file@16 ; set flag ; ; Set form name if specified ; 70$: cmpl #4, r2 ; 4 args supplied? bgtr 90$ ; if not supplied, skip movl frmnam(ap), r0 ; get descriptor location beql 80$ ; skip if not supplied pushl #0 ; don't save return length movl (r0)+, r1 ; r1 has length of string pushl (r0) ; push that on the stack pushl #sjc$_form_name@16 ; this is the form we want movw r1, (sp) ; set length of string ; ; Set flag to allow the user to insert his form-feeds, if specified ; 80$: cmpl #5, r2 ; 5 args supplied? bgtr 90$ ; if not supplied, skip movl fedflg(ap), r0 ; get address of fifth arg beql 90$ ; if null argument, skip blbc (r0), 90$ ; include this only if clrq -(sp) ; ...nofeed is specified pushl #sjc$_no_paginate@16 ; set flag for no_feed 90$: movl sp, r0 ; save address of item list clrq -(sp) ; make room for IOSB movl sp, r2 ; save address of IOSB $sndjbcw_s func=#sjc$_enter_file,- ; put the file on the queue itmlst=(r0),- ; with this item list iosb=(r2) ; save the status block blbc r0, 100$ ; on error get out movzwl (r2), r0 ; find the status 100$: ret ; go back to caller .end ; that's all!