.title CD - Change directory AKA Unix/MSDOS .ident 'CD V4.7D' ; ; Program: CD.MAR V4.7D ; ; Author: David G. North, CCP ; 1333 Maywood Ct ; Plano, Texas 75023-1914 ; (214) 902-3957 ; ; Date: 91.11.13 ; ; Revisions: ; Who Date Description ; D.North 901116 DECUS release (V4.2) ; D.North 911113 DECUS release (V4.7D) ; ; License: ; Ownership of and rights to these programs is retained by the author(s). ; Limited license to use and distribute the software in this library is ; hereby granted under the following conditions: ; 1. Any and all authorship, ownership, copyright or licensing ; information is preserved within any source copies at all times. ; 2. Under absolutely *NO* circumstances may any of this code be used ; in any form for commercial profit without a written licensing ; agreement from the author(s). This does not imply that such ; a written agreement could not be obtained. ; 3. Except by written agreement under condition 2, source shall ; be freely provided with all binaries. ; 4. Library contents may be transferred or copied in any form so ; long as conditions 1, 2, and 3 are met. Nominal charges may ; be assessed for media and transferral labor without such charges ; being considered 'commercial profit' thereby violating condition 2. ; ; Warranty: ; These programs are distributed in the hopes that they will be useful, but ; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ; or FITNESS FOR A PARTICULAR PURPOSE. ; $libdef ;LIB$ routine return codes $lnmdef ;Logical name translation codes $rmsdef ;RMS return codes etc. $ssdef ;System return codes $stsdef ;status bits .psect $local,pic,noshr,noexe,rd,wrt,long .long 80 buf: .long 80 .address .+4 .blkb 80 retblk: .long cmdstr: .ascid /if f$search("cd.com").nes."" then @cd/ .psect $code,pic,shr,exe,rd,nowrt ; Parser setup & call .entry cd, ^m clrb @buf+4 pushaw buf clrl -(SP) ;no prompt... don't prompt user pushaq buf calls #3,G^LIB$GET_FOREIGN ; Get caller's argument line blbs r0,10$ ret 10$: pushl #3 ;do set, don't signal, allow help pushal retblk pushaq buf calls #3,g^CD_PARSE ;Go for it! blbs r0,20$ ret ;return any errors to DCL 20$: moval @retblk,r2 ;get junk from retblk moval @9*4(r2),r3 ;get vector address $PUTMSG_S - msgvec = (r3) bisl3 #STS$M_INHIB_MSG,4(r3),r0 ;return status silently cmpl #CD_DIRSET!STS$M_INHIB_MSG,r0 ;was a dir set ok? beql 30$ ;jmp if so, else return what we got ret 30$: moval @10*4(r2),r4 ;point to CDPARSE returned flags bbc #SW_V_COM,(r4),40$ ;skip the DO if no /COM switch spec'd pushaq cmdstr calls #1,g^LIB$DO_COMMAND 40$: ret .end cd