Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PIPE Source Codes

16 views
Skip to first unread message

Ferry Bolhar-Nordenkampf

unread,
Jan 6, 1997, 3:00:00 AM1/6/97
to

Submitted-by: Ferry Bolhar-Nordenkampf <b...@adv.magwien.gv.at>
Posting-number: Volume 8, Issue 3
Archive-name: adv_pipe/part01

Pipe is a tool that allows you to issue DCL commands with U*X shell
separation and redirection operators. You can specify more than one
DCL command in a command line, and for every command, you can control
where the output of the command is sent or received.

PIPE provides its functions by creating (SPAWNing) subprocesses.
Therefore, you must be able to create subprocesses (your subprocess
quota must be large enough). In addition, TMPMBX privilege is required.

This posting contains the following files:

ADV_PIPE.C the C source
ADV_PIPE.CLD CLD file for DCL
ADV_PIPE.HLP online help
ADV_PIPE_AXP.OPT linker options file for Alpha
ADV_PIPE_VAX.OPT linker options file for VAX
ADV_PIPE_STARTUP.COM startup command file
ADV_PIPE_SYSTARTUP.COM user-definable command file
INSTALL.COM installation procedure

After extracting all files from this message, type @INSTALL.
Note that a C (VAX C or DEC C) compiler is needed. For VAX,
please look at INSTALL.COM _before_ you invoke it; there are
some infos depending on whether you're using VAXC or DECC.

Hope you find it useful. Have fun with ADV_PIPE!

Greetings, Ferry

Ing. Ferry Bolhár-Nordenkampf
Magistrat der Stadt Wien (MD-ADV) A - 1010 Vienna (Austria)
Phone: 0222/4000/98632 E-Mail: b...@adv.magwien.gv.at

"Wenn hier einer schuld ist, dann immer nur der Computer."

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$! Name : ADV_PIPE
$! By : mark.b...@mvb.saic.com
$! Date : 6-JAN-1997 12:39:36.89
$! Using: VMS_SHARE 8.5-1, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$! James Gray, Michael Bednarek
$!
$! To unpack this archive:
$! Minimum of VMS 4.4 (VAX) / OpenVMS 1.0 (Alpha) is required.
$! Remove the headers of the first part, up to `cut here' line.
$! Execute file as a command procedure.
$!
$! The following file(s) will be created after unpacking:
$! 1. ADV_PIPE.C;1
$! 2. ADV_PIPE.CLD;1
$! 3. ADV_PIPE.HLP;1
$! 4. ADV_PIPE_AXP.OPT;1
$! 5. ADV_PIPE_STARTUP.COM;1
$! 6. ADV_PIPE_SYSTARTUP.COM;1
$! 7. ADV_PIPE_VAX.OPT;1
$! 8. INSTALL.COM;1
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f="SYS$SCRATCH:."+f$getjpi("","PID")+";"
$ if f$trnlnm("SHARE_UNPACK") .nes. "" then $ -
f=f$parse("SHARE_UNPACK_TEMP",f)
$ e="write sys$error ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$unpack:subroutine!P1=file,P2=chksum,P3=attrib,P4=size,P5=fileno,P6=filetotal
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'"
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
$ delete 'f'*
$ exit
$dirok:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped"
$ delete 'f'*
$ exit
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(CURRENT_BUFFER);DELETE(m);EXITIF INDEX(
ERASE_LINE,"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;
PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;s := ERASE_LINE;c := SUBSTR(s,1,1);s :=
s-c;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);l := LENGTH(s);p :=
1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1;CASE c FROM ' ' TO '`' ['`']
: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[' ']: p:=p+1;[INRANGE,OUTRANGE]
: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;PROCEDURE Decode(b)LOCAL m;
POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);EXITIF m=END_OF(b);DELETE(m);
IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine;
MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO(
COMMAND_LINE,"file_name");o:=CREATE_BUFFER(f,f);Decode(o);WRITE_FILE(o,
GET_INFO(COMMAND_LINE,"output_file"));QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl='f' 'f'-1 'f'
$ fa=f$getdvi(f$parse(f),"ALLDEVNAM")
$ Pa=f$getdvi(f$parse(P1),"ALLDEVNAM")
$ if fa .eqs. Pa then $ rename &f 'f$parse(P1)'
$ if fa .nes. Pa then $ copy &f 'f$parse(P1)'
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
X
X#module`20PIPE`20"BOL-V1.1/DEC-92"
X
X#include`20<string.h>
X#include`20<stdio.h>
X#include`20<stdlib.h>
X
X#include`20<clidef.h>
X#include`20<dvidef.h>
X#include`20<descrip.h>
X#include`20<jpidef.h>
X#include`20<lib$routines.h>
X#include`20<ssdef.h>
X#include`20<starlet.h>
X
X#define`20SS$_INVARG`20`20`20`20`20`200x0FCA
X#define`20INVARG`20`20`20`20`20`20`20`20`20`200x10000000`20+`20SS$_INVARG
X#define`20NOSLOT`20`20`20`20`20`20`20`20`20`200x10000000`20+`20SS$_NOSLOT
X#define`20RMS$_FNF`20`20`20`20`20`20`20`200x00018292
X
X#define`20C_BUFSIZ`20`20`20`20`20`20`20`20160
X#define`20C_CLIFLG`20`20`20`20`20`20`20`20CLI$M_NOKEYPAD`7CCLI$M_NOCONTROL
X#define`20C_NOMSG`20`20`20`20`20`20`20`20`200x10000000
X#define`20C_MAXPIPES`20`20`20`20`20`208
X
Xint`20`20`20spawn`20`20(char*,`20int,`20short,`20short);
Xint`20`20`20xpipe`20`20(char*,`20short*);
Xint`20`20`20getnam`20(short,`20char*);
Xchar*`20getflg`20(int);
Xchar*`20semick`20(char*);
Xint`20`20`20chklog`20(char*);
Xvoid`20`20delprc`20(void);
Xint`20`20`20strsub`20(char*,`20char*);
X
Xchar`20S_syn`20`5B`5D`20=`20"Syntax`20error",
X`20`20`20`20`20S_err`20`5B`5D`20=`20"Error`20opening`20%s`20as`20%s`5CnRMS`20S
Vtatus`20=`20%08X`5Cn",
X`20`20`20`20`20S_spn`20`5B`5D`20=`20"%%SPAWN-I-INFO,`20PID`20=`20%08X,`20STATU
VS`20=`20%08X";
X
Xint`20G_pidarr`20`5BC_MAXPIPES`5D,`20G_curpid,`20G_semi,`20G_debug,`20G_flg`20
V=`20C_CLIFLG,`20G_mode,
X`20`20`20`20G_parse;
X
Xint`20globalref`20CTL$AG_CLITABLE;
X
Xint`20main`20()
X`7B
X`20char`20inbuf`20`5BC_BUFSIZ`5D,`20sav_buf`20`5BC_BUFSIZ`5D,`20p_flg`20=`201,
V`20q_flg`20=`200,`20i;
X
X`20char`20*ptr`20=`20inbuf,`20*s_ptr`20=`20sav_buf;
X
X`20short`20len,`20outmbx;
X
X`20int`20x,`20stat;
X
X`20$DESCRIPTOR`20(in,`20inbuf);
X
X`20if`20(!((stat`20=`20lib$get_foreign`20(`26in,`200,`20`26len))`20`26`201))
V`20return`20stat;
X
X`20inbuf`20`5Blen`5D`20=`20'`5C0';
X
X`20x`20=`20lib$getjpi`20(`26JPI$_MODE,`200,0,`20`26G_mode,`200,0);
X
X`20if`20(chklog`20("ADV_PIPE_NOSYMBOLS")`20`26`201)`20`20G_flg`20`7C=`20CLI$M_
VNOCLISYM;
X
X`20if`20(chklog`20("ADV_PIPE_NOLOGICALS")`20`26`201)`20G_flg`20`7C=`20CLI$M_NO
VLOGNAM;
X
X`20if`20((chklog`20("ADV_PIPE_NOTIFY")`20`26`201)`20`26`26`20G_mode`20==`20JPI
V$K_INTERACTIVE)
X
X`20G_flg`20`7C=`20CLI$M_NOTIFY;
X
X`20G_semi`20=`20chklog`20("ADV_PIPE_DOUBLE_SEMI")`20`26`201;
X
X`20G_debug`20=`20chklog`20("ADV_PIPE_DEBUG")`20`26`201;
X
X`20G_parse`20=`20chklog`20("ADV_PIPE_DCL_PARSE")`20`26`201;
X
X`20while`20(*ptr)
X`20`7B
X`20`20if`20(!q_flg)
X`20`20`7B
X`20`20`20if`20(semick`20(ptr)`20!=`20NULL)
X`20`20`20`7B
X`20`20`20`20ptr`20=`20semick`20(ptr);
X
X`20`20`20`20if`20(p_flg)`20`7Bputs`20(S_syn);`20return`20INVARG;`7D
X
X`20`20`20`20*s_ptr`20=`20'`5C0';
X
X`20`20`20`20stat`20=`20spawn`20(sav_buf,`20G_flg,`200,0);
X
X`20`20`20`20if`20(!(stat`20`26`201))`20return`20stat`7CC_NOMSG;
X
X`20`20`20`20s_ptr`20=`20sav_buf;
X
X`20`20`20`20ptr++;
X
X`20`20`20`20p_flg`20=`201;
X`20`20`20`7D
X`20`20`20if`20(*ptr`20==`20'`26')
X`20`20`20`7B
X`20`20`20`20if`20(p_flg)`20`7Bputs`20(S_syn);`20return`20INVARG;`7D
X
X`20`20`20`20*s_ptr`20=`20'`5C0';
X
X`20`20`20`20stat`20=`20spawn`20(sav_buf,`20G_flg`7CCLI$M_NOWAIT,`200,0);
X
X`20`20`20`20if`20(!(stat`20`26`201))`20return`20stat`7CC_NOMSG;
X
X`20`20`20`20s_ptr`20=`20sav_buf;
X
X`20`20`20`20ptr++;
X
X`20`20`20`20p_flg`20=`201;
X`20`20`20`7D
X`20`20`20if`20(*ptr`20==`20'`7C')
X`20`20`20`7B
X`20`20`20`20if`20(p_flg)`20`7Bputs`20(S_syn);`20return`20INVARG;`7D
X
X`20`20`20`20*s_ptr`20=`20'`5C0';
X
X`20`20`20`20while`20(1)
X`20`20`20`20`7B
X`20`20`20`20`20stat`20=`20xpipe`20(++ptr,`20`26outmbx);
X
X`20`20`20`20`20if`20(!(stat`20`26`201))`20break;
X
X`20`20`20`20`20while`20(*ptr)
X`20`20`20`20`20`7B
X`20`20`20`20`20`20if`20(semick`20(ptr)`20!=`20NULL)`20`7Bptr`20=`20semick`20(p
Vtr);`20break;`7D
X
X`20`20`20`20`20`20if`20(*ptr++`20==`20'`26')
X`20`20`20`20`20`20`7B
X`20`20`20`20`20`20`20puts`20(S_syn);
X
X`20`20`20`20`20`20`20delprc`20();
X
X`20`20`20`20`20`20`20return`20INVARG;
X`20`20`20`20`20`20`7D
X`20`20`20`20`20`7D
X`20`20`20`20`20stat`20=`20spawn`20(sav_buf,`20G_flg,`200,`20outmbx);
X
X`20`20`20`20`20break;
X`20`20`20`20`7D
X`20`20`20`20delprc`20();
X
X`20`20`20`20if`20(!(stat`20`26`201))`20return`20stat`7CC_NOMSG;
X
X`20`20`20`20G_curpid`20=`200;
X
X`20`20`20`20s_ptr`20=`20sav_buf;
X
X`20`20`20`20if`20(*ptr)`20ptr++;
X
X`20`20`20`20p_flg`20=`201;
X`20`20`20`7D
X`20`20`7D
X`20`20if`20(*ptr`20==`20'"')`20q_flg`20=`20`7Eq_flg;
X
X`20`20if`20(*ptr`20==`20'`5C0')`20return`201;
X
X`20`20if`20(!q_flg)
X`20`20`7B
X`20`20`20switch`20(*ptr)
X`20`20`20`7B
X`20`20`20`20case`20'`20':
X`20`20`20`20case`20'`5Ct':`20`7B*s_ptr++`20=`20*ptr++;`20break;`7D
X
X`20`20`20`20case`20';':
X`20`20`20`20`7B
X`20`20`20`20`20if`20(semick`20(ptr)`20!=`20NULL)`20ptr`20=`20semick`20(ptr);
X
X`20`20`20`20`20else`20*s_ptr++`20=`20*ptr++;
X
X`20`20`20`20`20break;
X`20`20`20`20`7D
X`20`20`20`20case`20'`26':`20break;
X
X`20`20`20`20default:`20`7Bp_flg`20=`200;`20*s_ptr++`20=`20*ptr++;`20break;`7D
V
X`20`20`20`7D`20`20`20
X`20`20`7D
X`20`20else`20`7Bp_flg`20=`200;`20*s_ptr++`20=`20*ptr++;`7D
X`20`7D
X`20*s_ptr`20=`20'`5C0';
X
X`20return`20spawn`20(sav_buf,`20G_flg,`200,0)`7CC_NOMSG;
X`7D
X
Xint`20spawn`20(char`20*cmd_ptr,`20int`20flg,`20short`20inmbx,`20short`20outmbx
V)
X`7B
X`20char`20inp_buf`20`5B128`5D,`20out_buf`20`5B128`5D,`20ful_buf`20`5B128`5D,
V`20aux_buf`20`5BC_BUFSIZ`5D;
X
X`20char`20*x_ptr,`20*ptr`20=`20cmd_ptr,`20pid_flg`20=`200,`20q_flg`20=`200,`20
Vp_flg`20=`201,`20i;
X
X`20int`20x,`20pid,`20stat,`20retstat`20=`201,`20ctx`20=`200;
X
X`20$DESCRIPTOR`20(cmd,`20cmd_ptr);
X`20$DESCRIPTOR`20(inp,`20inp_buf);
X`20$DESCRIPTOR`20(out,`20out_buf);
X`20$DESCRIPTOR`20(ful,`20ful_buf);
X
X`20inp_buf`20`5B0`5D`20=`20out_buf`20`5B0`5D`20=`20'`5C0';
X
X`20if`20(inmbx)
X`20`7B
X`20`20if`20(!((stat`20=`20getnam`20(inmbx,`20inp_buf))`20`26`201))`20return`20
Vstat;
X
X`20`20inp.dsc$w_length`20=`20strlen`20(inp_buf);
X
X`20`20pid_flg`20=`201;
X`20`7D
X`20if`20(outmbx)
X`20`7B
X`20`20if`20(!((stat`20=`20getnam`20(outmbx,`20out_buf))`20`26`201))`20return
V`20stat;
X
X`20`20out.dsc$w_length`20=`20strlen`20(out_buf);
X`20`7D
X`20while`20(*ptr)
X`20`7B
X`20`20if`20(!q_flg)
X`20`20`7B
X`20`20`20if`20(*ptr`20==`20'>')
X`20`20`20`7B
X`20`20`20`20if`20(out_buf`20`5B0`5D`20`7C`7C`20p_flg)`20`7Bputs`20(S_syn);`20r
Veturn`20INVARG;`7D
X
X`20`20`20`20*ptr++`20=`20'`5C0';
X
X`20`20`20`20x_ptr`20=`20out_buf;
X
X`20`20`20`20while`20(1)
X`20`20`20`20`7B
X`20`20`20`20`20if`20(*ptr`20==`20'`20'`20`7C`7C`20*ptr`20==`20'`5Ct')`20`7Bptr
V++;`20continue;`7D
X
X`20`20`20`20`20if`20(*ptr`20==`20'>')`20`7Bputs`20(S_syn);`20return`20INVARG;
V`7D
X
X`20`20`20`20`20if`20(*ptr`20==`20'`5C0')`20break;
X
X`20`20`20`20`20if`20(*ptr`20==`20'<')`20break;
X
X`20`20`20`20`20*x_ptr++`20=`20*ptr++;
X`20`20`20`20`7D
X`20`20`20`20*x_ptr`20=`20'`5C0';`20p_flg`20=`200;
X
X`20`20`20`20if`20(!(out.dsc$w_length`20=`20strlen`20(out_buf)))`20`7Bputs`20(S
V_syn);`20return`20INVARG;`7D
X`20`20`20`7D
X`20`20`20if`20(*ptr`20==`20'<')
X`20`20`20`7B
X`20`20`20`20if`20(inp_buf`20`5B0`5D`20`7C`7C`20p_flg)`20`7Bputs`20(S_syn);`20r
Veturn`20INVARG;`7D
X
X`20`20`20`20*ptr++`20=`20'`5C0';
X
X`20`20`20`20x_ptr`20=`20inp_buf;
X
X`20`20`20`20while`20(1)
X`20`20`20`20`7B
X`20`20`20`20`20if`20(*ptr`20==`20'`20'`20`7C`7C`20*ptr`20==`20'`5Ct')`20`7Bptr
V++;`20continue;`7D
X
X`20`20`20`20`20if`20(*ptr`20==`20'<')`20`7Bputs`20(S_syn);`20return`20INVARG;
V`7D
X
X`20`20`20`20`20if`20(*ptr`20==`20'`5C0')`20break;
X
X`20`20`20`20`20if`20(*ptr`20==`20'>')`20break;
X
X`20`20`20`20`20*x_ptr++`20=`20*ptr++;
X`20`20`20`20`7D
X`20`20`20`20*x_ptr`20=`20'`5C0';`20p_flg`20=`200;
X
X`20`20`20`20if`20(!(inp.dsc$w_length`20=`20strlen`20(inp_buf)))`20`7Bputs`20(S
V_syn);`20return`20INVARG;`7D
X`20`20`20`7D
X`20`20`7D
X`20`20if`20(*ptr`20!=`20'`20'`20`26`26`20*ptr`20!=`20'`5Ct')`20p_flg`20=`200;
V
X
X`20`20if`20(*ptr`20==`20'"')`20q_flg`20=`20`7Eq_flg;
X
X`20`20if`20(*ptr)`20ptr++;
X`20`7D
X`20if`20(inp_buf`20`5B0`5D`20`26`26`20inp_buf`20`5B0`5D`20!=`20'_')
X`20`7B
X`20`20if`20(!((stat`20=`20lib$find_file`20(`26inp,`20`26ful,`20`26ctx))`20`26
V`201))
X`20`20`7B
X`20`20`20ful_buf`20`5Bstrcspn`20(ful_buf,`20"`20")`5D`20=`20'`5C0';
X
X`20`20`20printf`20(S_err,`20ful_buf,`20"input",`20stat);
X
X`20`20`20return`20stat;
X`20`20`7D
X`20`20x`20=`20lib$find_file_end`20(`26ctx);
X`20`7D
X`20ctx`20=`200;
X
X`20if`20(out_buf`20`5B0`5D`20`26`26`20out_buf`20`5B0`5D`20!=`20'_')
X`20`7B
X`20`20stat`20=`20lib$find_file`20(`26out,`20`26ful,`20`26ctx);
X
X`20`20if`20(stat`20==`20RMS$_FNF)`20stat`20=`201;
X
X`20`20if`20(!(stat`20`26`201))
X`20`20`7B
X`20`20`20ful_buf`20`5Bstrcspn`20(ful_buf,`20"`20")`5D`20=`20'`5C0';
X
X`20`20`20printf`20(S_err,`20ful_buf,`20"output",`20stat);
X
X`20`20`20return`20stat;
X`20`20`7D
X`20`20x`20=`20lib$find_file_end`20(`26ctx);
X`20`7D
X`20if`20(pid_flg`20`26`26`20G_curpid`20==`20C_MAXPIPES)
X`20`7B
X`20`20puts`20("Too`20many`20pipes`20-`20limit`20to`208");
X
X`20`20return`20NOSLOT;
X`20`7D
X`20while`20(*cmd_ptr`20==`20'`20')`20cmd_ptr++;
X
X`20cmd.dsc$w_length`20=`20strlen`20(cmd_ptr);
X
X`20if`20(!(flg`20`26`20CLI$M_NOWAIT))`20flg`20`26=`20`7ECLI$M_NOTIFY;
X
X`20if`20(G_debug)
X`20`7B
X`20`20printf`20("$`20SPAWN");
X
X`20`20ptr`20=`20inp_buf;`20if`20(*ptr`20==`20'_')`20ptr++;
X
X`20`20if`20(*ptr)`20printf`20("/INPUT=%s",`20ptr);
X
X`20`20ptr`20=`20out_buf;`20if`20(*ptr`20==`20'_')`20ptr++;
X
X`20`20if`20(*ptr)`20printf`20("/OUTPUT=%s",`20ptr);
X
X`20`20if`20(flg`20`26`20`7E(C_CLIFLG))`20printf`20("/FLAGS=(%s)",`20getflg`20(
Vflg));
X`20`7D
X`20x`20=`20strsub`20(cmd_ptr,`20aux_buf);
X`20`20
X`20cmd.dsc$a_pointer`20=`20aux_buf;
X
X`20cmd.dsc$w_length`20=`20strlen`20(aux_buf);
X
X`20if`20(G_debug)`20printf`20("`20%s`5Cn",`20aux_buf);
X
X`20if`20(G_parse)
X`20`7B
X`20`20if`20(x)`20if`20(!((stat`20=`20cli$dcl_parse`20(`26cmd,`20CTL$AG_CLITABL
VE))`20`26`201))`20return
Xstat;
X`20`7D
X`20stat`20=`20lib$spawn`20(`26cmd,`20inp_buf`20`5B0`5D`20?`20`26inp`20:`200,
V`20out_buf`20`5B0`5D`20?`20`26out`20:`200,
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`26flg,`200,`20`26pid
V,`20`26retstat);
X`20if`20(!(stat`20`26`201))
X`20`7B
X`20`20delprc`20();
X
X`20`20return`20stat;
X`20`7D
X`20if`20(G_debug)
X`20`7B
X`20`20printf`20(S_spn,`20pid,`20retstat);
X
X`20`20if`20(pid_flg)`20printf`20(",`20CNT`20=`20%d",`20G_curpid`20+`201);
X
X`20`20printf`20("`5Cn");
X`20`7D
X`20if`20(pid_flg)`20G_pidarr`20`5BG_curpid++`5D`20=`20pid;
X
X`20return`20retstat;
X`7D
X
Xint`20xpipe`20(char`20*com,`20short`20*retmbx)
X`7B
X`20char`20q_flg`20=`200,`20cmd_buf`20`5BC_BUFSIZ`5D,`20sav_buf`20`5BC_BUFSIZ
V`5D,`20nam_buf`20`5B10`5D;
X
X`20char`20*c_ptr`20=`20cmd_buf,`20*s_ptr`20=`20sav_buf;
X
X`20short`20chan`20=`200;
X
X`20int`20x,`20stat;
X
X`20strcpy`20(cmd_buf,`20com);
X
X`20while`20(*c_ptr)
X`20`7B
X`20`20if`20(!q_flg)
X`20`20`7B
X`20`20`20if`20(*c_ptr`20==`20'`26')`20break;
X
X`20`20`20if`20(semick`20(c_ptr)`20!=`20NULL)`20`7Bc_ptr`20=`20semick`20(c_ptr)
V;`20break;`7D
X
X`20`20`20if`20(*c_ptr`20==`20'`7C')
X`20`20`20`7B
X`20`20`20`20*c_ptr++`20=`20'`5C0';
X
X`20`20`20`20stat`20=`20xpipe`20(c_ptr,`20`26chan);
X
X`20`20`20`20if`20(!(stat`20`26`201))`20return`20stat;
X
X`20`20`20`20break;
X`20`20`20`7D
X`20`20`7D
X`20`20if`20(*c_ptr`20==`20'"')`20q_flg`20=`20`7Eq_flg;
X
X`20`20*s_ptr++`20=`20*c_ptr++;
X`20`7D
X`20*s_ptr`20=`20'`5C0';
X
X`20if`20(!strlen`20(sav_buf))`20`7Bputs`20(S_syn);`20return`20INVARG;`7D
X
X`20if`20(!((stat`20=`20sys$crembx`20(0,`20retmbx,`200,0,`200xFF0F,`200,0,0))
V`20`26`201))`20return`20stat;
X
X`20if`20(G_debug)
X`20`7B`20
X`20`20x`20=`20getnam`20(*retmbx,`20nam_buf);
X
X`20`20printf`20("$`20CREATE/MAILBOX`20%s`5Cn",`20`26nam_buf`20`5B1`5D);
X`20`7D
X`20return`20spawn`20(sav_buf,`20(G_flg`7CCLI$M_NOWAIT)`20`26`20`7ECLI$M_NOTIFY
V,`20*retmbx,`20chan);
X`7D
X
Xint`20getnam`20(short`20chan,`20char*`20retbuf)
X`7B
X`20short`20len;
X
X`20int`20stat;
X
X`20$DESCRIPTOR`20(dscr,`20retbuf);
X
X`20dscr.dsc$w_length`20=`2010;
X
X`20stat`20=`20lib$getdvi`20(`26DVI$_DEVNAM,`20`26chan,`200,0,`20`26dscr,`20`26
Vlen);
X
X`20retbuf`20`5Blen`5D`20=`20'`5C0';
X
X`20return`20stat;
X`7D
X
Xchar`20*getflg`20(int`20flg)
X`7B
X`20static`20char`20retbuf`20`5B40`5D;
X
X`20retbuf`20`5B0`5D`20=`20'`5C0';
X
X`20if`20(flg`20`26`20CLI$M_NOWAIT)`20strcat`20(retbuf,`20"NOWAIT,");
X
X`20if`20(flg`20`26`20CLI$M_NOCLISYM)`20strcat`20(retbuf,`20"NOSYMBOLS,");
X
X`20if`20(flg`20`26`20CLI$M_NOLOGNAM)`20strcat`20(retbuf,`20"NOLOGICALS,");
X
X`20if`20(flg`20`26`20CLI$M_NOTIFY)`20strcat`20(retbuf,`20"NOTIFY,");
X
X`20if`20(retbuf`20`5B0`5D)`20retbuf`20`5Bstrlen`20(retbuf)`20-`201`5D`20=`20'
V`5C0';
X
X`20return`20retbuf;
X`7D
X
Xchar*`20semick`20(char`20*ptr)
X`7B
X`20char`20*p;
X
X`20if`20(!G_semi)
X`20`7B
X`20`20if`20(*ptr`20==`20';')`20return`20ptr;
X
X`20`20else`20return`20NULL;
X`20`7D
X`20if`20(*ptr`20!=`20';')`20return`20NULL;
X
X`20p`20=`20ptr`20-`201;
X
X`20if`20(*p`20==`20'`20'`20`7C`7C`20*p`20==`20'`5Ct')
X`20`7B
X`20`20p`20=`20ptr`20+`201;
X
X`20`20if`20(*p`20==`20';')`20ptr++;
X
X`20`20return`20ptr;
X`20`7D
X`20ptr++;
X
X`20if`20(*ptr`20!=`20';')`20return`20NULL;
X
X`20else`20return`20ptr;
X`7D
X
Xint`20chklog`20(char*`20nambuf)
X`7B
X`20char`20retbuf`20`5B8`5D;
X
X`20int`20stat;
X
X`20$DESCRIPTOR`20(nam,`20nambuf);
X`20$DESCRIPTOR`20(ret,`20retbuf);
X
X`20nam.dsc$w_length`20=`20strlen`20(nambuf);
X
X`20stat`20=`20lib$sys_trnlog`20(`26nam,`20NULL,`20`26ret);
X
X`20if`20(stat`20!=`20SS$_NORMAL)`20return`200;
X
X`20return`20retbuf`20`5B0`5D`20==`20'1';
X`7D
X
Xvoid`20delprc`20(void)
X`7B
X`20int`20i,`20x;
X
X`20for`20(i`20=`200;`20i`20!=`20C_MAXPIPES;`20i++)
X`20`7B
X`20`20if`20(G_pidarr`20`5Bi`5D)`20x`20=`20sys$delprc`20(`26G_pidarr`20`5Bi`5D,
V`200);
X
X`20`20G_pidarr`20`5Bi`5D`20=`200;
X`20`7D
X`7D
X
Xint`20strsub`20(char*`20in_buf,`20char*`20out_buf)
X`7B
X`20char`20symnam`20`5B16`5D,`20symval`20`5B64`5D,`20*i_ptr,`20*o_ptr;
X
X`20short`20len;
X
X`20int`20stat;
X
X`20$DESCRIPTOR`20(nam,`20symnam);
X`20$DESCRIPTOR`20(val,`20symval);
X
X`20i_ptr`20=`20in_buf;`20o_ptr`20=`20symnam;
X
X`20while`20(*i_ptr)
X`20`7B
X`20`20if`20(*i_ptr`20==`20'`20'`20`7C`7C`20*i_ptr`20==`20'`5Ct'`20`7C`7C`20*i_
Vptr`20==`20'/')`20break;
X
X`20`20*o_ptr++`20=`20*i_ptr++;
X`20`7D
X`20*o_ptr`20=`20'`5C0';
X
X`20nam.dsc$w_length=`20strlen`20(symnam);
X
X`20stat`20=`20lib$get_symbol`20(`26nam,`20`26val,`20`26len);
X
X`20if`20(!(stat`20`26`201))`20strcpy`20(out_buf,`20in_buf);
X
X`20else
X`20`7B
X`20`20symval`20`5Blen`5D`20=`20'`5C0';
X
X`20`20strcpy`20(out_buf,`20symval);
X
X`20`20strcat`20(out_buf,`20i_ptr);
X`20`7D
X`20if`20(out_buf`20`5B0`5D`20==`20'$')
X`20`7B
X`20`20strcpy`20(symval,`20"MCR`20");
X
X`20`20strcat`20(symval,`20`26out_buf`20`5B1`5D);
X
X`20`20strcpy`20(out_buf,`20symval);
X`20`7D
X`20if`20(out_buf`20`5B0`5D`20==`20'm')`20out_buf`20`5B0`5D`20=`20'M';
X
X`20if`20(out_buf`20`5B1`5D`20==`20'c')`20out_buf`20`5B1`5D`20=`20'C';
X
X`20if`20(out_buf`20`5B0`5D`20==`20'M'`20`26`26`20out_buf`20`5B1`5D`20==`20'C')
V`20return`200;
X
X`20else`20return`201;
X`7D
$ call unpack ADV_PIPE.C;1 1294203529 "" 22 1 8
$!
$ create 'f'
Xdefine`20verb`20$`20image`20adv_pipe
Xsynonym`20P
Xparameter`20p1,`20prompt`20=`20"Command(s)",`20value`20(required,`20type`20=
V`20$rest_of_line)
$ call unpack ADV_PIPE.CLD;1 219155208 "" 1 2 8
$!
$ create 'f'
X1`20PIPE
X
X`20`20Pipe`20is`20a`20tool`20that`20allows`20you`20issuing`20DCL`20commands`20
Vwith`20U*X`20shell
X`20`20separation`20and`20redirection`20operators.`20You`20can`20specify`20more
V`20than`20one
X`20`20DCL`20command`20in`20a`20command`20line,`20and`20for`20every`20command,
V`20you`20can`20control
X`20`20where`20the`20output`20of`20the`20command`20is`20sent`20or`20received.
X
X`20`20PIPE`20provides`20its`20functions`20by`20creating`20(SPAWNing)`20subproc
Vesses.
X`20`20Therefore,`20you`20must`20be`20able`20to`20create`20subprocesses`20(your
V`20subprocess
X`20`20quota`20must`20be`20large`20enough).`20In`20addition,`20TMPMBX`20privile
Vge`20is`20required.
X
X`20`20See`20the`20subtopics`20for`20more`20information.
X
X2`20Author
X
X`20`20PIPE`20was`20written`20by`20Ing.`20Ferry`20Bolhar,`20MD-ADV/MA,`20Vienna
V,`20Austria.
X`20`20Please`20send`20any`20suggestions`20to:`20...@adv.magwien.gv.at.
X
X2`20Invokation
X
X`20`20PIPE`20is`20invoked`20with`20the`20'P'`20command.`20Following`20this`20c
Vommand,`20you
X`20`20specify`20your`20DCL`20commands,`20separators`20and`20redirectors.`20The
V`20syntax
X`20`20is:
X
X`20`20$`20P`20<cmd>`20`5B<red>`5D`20`5B<sep>`5D`20`5B<cmd>`20`5B<red>`5D`20`5B
V<sep>`5D...`5D
X
X`20`20where:
X
X`20`20<cmd>`20is`20a`20valid`20DCL`20command`20or`20a`20symbol`20containing`20
Va`20command.
X`20
X`20`20<red>`20is`20one`20or`20more`20of`20PIPE's`20redirectors`20(see`20topic
V`20"Redirectors"
X`20`20`20`20`20`20`20`20for`20more`20information).
X
X`20`20<sep>`20is`20one`20of`20PIPE's`20command`20separators`20(see`20topic`20"
VSeparators").
X
X`20`20Blanks`20beetween`20DCL`20commands,`20separators`20and`20redirectors`20a
Vre
X`20`20optional.
X
X`20`20When`20using`20in`20DCL`20procedures,`20you`20can`20force`20the`20execut
Vion`20of`20PIPE
X`20`20in`20a`20command`20line`20by`20specifying`20two`20dollars`20signs`20inst
Vead`20of`20one
X`20`20at`20the`20beginning`20of`20the`20line.
X
X2`20Logical_Names
X
X`20`20There`20are`20six`20logical`20names`20which`20you`20can`20use`20to`20con
Vtrol`20some
X`20`20of`20PIPE's`20behaviour.`20All`20names`20may`20be`20defined`20in`20any
V`20logical`20name
X`20`20table`20(PROCESS,`20JOB,`20GROUP,`20SYSTEM).`20If`20the`20equivalence`20
Vstring`20of
X`20`20a`20name`20is`20"1",`20its`20function`20is`20enabled,`20any`20other`20va
Vlue`20explicitly
X`20`20disables`20the`20function.`20In`20addition,`20if`20the`20name`20does`20n
Vot`20exist,
X`20`20the`20function`20is`20disabled.
X
X`20`20All`20names`20are`20described`20in`20the`20following`20topics.
X
X3`20ADV_PIPE_NOSYMBOLS
X
X`20`20When`20set,`20DCL`20symbols`20are`20not`20copied`20to`20the`20subprocess
V`20(similar
X`20`20to`20SPAWN/NOSYMBOLS).`20When`20cleared,`20symbols`20are`20copied.`20Not
Ve`20that
X`20`20defining`20this`20name`20can`20improve`20process`20creation.`20Note`20in
V`20addition,
X`20`20that,`20since`20symbol`20substitution`20in`20the`20command`20line`20occu
Vrs`20in`20the
X`20`20parent`20process,`20there`20is`20usually`20no`20need`20to`20pass`20DCL
V`20symbols`20to
X`20`20PIPE's`20subprocesses.
X`20`20
X3`20ADV_PIPE_NOLOGICALS
X
X`20`20When`20set,`20per-process`20logical`20names`20are`20not`20copied`20to`20
Vthe`20subprocess
X`20`20(similar`20to`20SPAWN/NOLOGICALS).`20When`20cleared,`20they`20are`20copi
Ved.`20Note
X`20`20that`20defining`20this`20name`20can`20improve`20process`20creation.
X
X`20`20If`20the`20subprocess`20must`20access`20logical`20names`20within`20your
V`20job,`20you
X`20`20should`20place`20the`20logicals`20into`20the`20job-wide`20name`20table
V`20(DEFINE/JOB).
X
X3`20ADV_PIPE_NOTIFY
X
X`20`20When`20set,`20a`20notification`20message`20is`20displayed`20if`20a`20pro
Vcess`20started
X`20`20in`20background`20completes`20(similar`20to`20SPAWN/NOTIFY).`20This`20na
Vme`20is`20used
X`20`20only`20for`20background`20jobs`20(`26).`20In`20addition,`20it`20is`20ign
Vored`20when`20using
X`20`20PIPE`20non-interactively.
X
X3`20ADV_PIPE_DOUBLE_SEMI
X
X`20`20This`20name`20controls`20PIPE's`20interpretation`20of`20the`20semicolon
V`20(;):
X
X`20`20If`20set,`20a`20single`20semicolon`20character`20is`20not`20treated`20as
V`20separator;
X`20`20you'll`20have`20to`20specify`202`20semicolons`20instead`20(no`20space`20
Vis`20allowed
X`20`20beetween`20them).`20This`20allows`20you`20use`20the`20semicolon`20in`20R
VMS`20file`20names
X`20`20as`20usual.
X
X`20`20If`20not`20set,`20a`20single`20semicolon`20is`20treated`20as`20sequentia
Vl`20operator;
X`20`20when`20specifying`20a`20version`20number`20in`20an`20RMS`20file`20name,
V`20you`20must`20use
X`20`20the`20dot`20(.)`20character`20instead.
X
X`20`20Note`20that`20a`20single`20semicolon`20is`20always`20recognized`20as`20s
Veparator
X`20`20when`20it`20is`20preeceded`20by`20one`20or`20more`20blanks`20or`20tabs.
V
X
X3`20ADV_PIPE_DCL_PARSE
X
X`20`20If`20set,`20PIPE`20calls`20DCL`20to`20parse`20every`20command`20before
V`20a`20subprocess
X`20`20is`20created`20and`20the`20command`20string`20is`20passed`20to`20it.`20I
Vf`20not`20set,`20the
X`20`20commands`20are`20passed`20without`20checks.
X
X`20`20Note`20that,`20in`20a`20pipe,`20if`20DCL`20rejects`20a`20command,`20the
V`20executing
X`20`20subprocess`20dies`20and`20the`20pipe`20is`20broken.`20This`20can`20cause
V`20PIPE`20to`20hang.
X
X3`20ADV_PIPE_DEBUG
X
X`20`20If`20set,`20PIPE`20displays`20debugging`20information.`20If`20cleared,
V`20this
X`20`20information`20is`20not`20displayed.`20This`20name`20is`20intended`20for
V`20PIPE's
X`20`20developers`20only,`20should`20not`20set`20normally.
X
X2`20Redirectors
X
X`20`20Redirectors`20are`20used`20to`20change`20a`20programs`20input`20(SYS$INP
VUT,`20stdin)
X`20`20and`20output`20(SYS$OUTPUT,`20stdout)`20device.`20PIPE`20supports`20thes
Ve
X`20`20redirectors:
X
X`20`20<`20name...Input`20of`20the`20preceeding`20command`20is`20taken`20from
V`20'name'.`20This
X`20`20`20`20`20`20`20`20`20`20`20may`20be`20a`20file,`20terminal,`20mailbox`20
Vor`20any`20other`20device`20capable
X`20`20`20`20`20`20`20`20`20`20`20of`20sending`20data.
X
X`20`20>`20name...Output`20of`20the`20preceeding`20command`20is`20sent`20to`20'
Vname'.`20This
X`20`20`20`20`20`20`20`20`20`20`20may`20be`20a`20file,`20terminal,`20mailbox`20
Vor`20any`20other`20device`20capable
X`20`20`20`20`20`20`20`20`20`20`20of`20receiving`20data.
X
X`20`20The`20space`20beetween`20the`20redirector`20and`20'name'`20is`20optional
V.
X
X`20`20If`20you`20specify`20a`20redirector`20and`20a`20command`20separator,`20t
Vhe`20redirector
X`20`20must`20be`20specified`20first.
X
X`20`20Note`20that`20redirectors`20are`20not`20allowed`20if`20the`20input/outpu
Vt`20of`20a`20program
X`20`20is`20piped`20to`20another`20program.
X
X3`20Example
X
X`20`20$`20P`20RUN`20TEST`20>`20X.X
X
X`20`20The`20output`20generated`20by`20the`20program`20TEST`20is`20written`20in
Vto`20file`20X.X.
X
X
X2`20Restrictions
X
X`20`20o)`20The`20entire`20command`20line`20may`20not`20exceed`20132`20characte
Vrs.
X
X`20`20o)`20When`20starting`20subprocesses`20in`20background`20(`26),`20they`20
Vare`20deleted
X`20`20`20`20`20when`20the`20parent`20process`20dies.`20This`20is`20the`20behav
Viour`20of`20OpenVMS,
X`20`20`20`20`20there`20is`20no`20way`20to`20change`20it.
X
X`20`20o)`20There`20is`20a`20maximum`20of`208`20pipes`20in`20a`20single`20comma
Vnd`20line.
X
X`20`20o)`20Implementing`20Pipes`20is`20done`20with`20mailboxes.`20The`20creati
Von`20of
X`20`20`20`20`20mailboxes`20requires`20non-paged`20pool`20and`20may`20be`20limi
Vted`20by`20your
X`20`20`20`20`20pooled`20byte`20quota`20(BYTLM).`20In`20addition,`20TMPMBX`20pr
Vivilege`20is
X`20`20`20`20`20required.
X
X`20`20o)`20When`20piping`20or`20starting`20subprocesses`20in`20background,`20y
Vou`20must`20have
X`20`20`20`20`20sufficient`20subprocess`20quota`20(PRCLM).
X
X`20`20o)`20You`20cannot`20start`20pipes`20in`20background,`20a`20piped`20comma
Vnd`20group
X`20`20`20`20`20must`20not`20be`20terminated`20with`20`26.
X
X`20`20o)`20The`20logical`20name`20DCL$PATH`20(VMS`20V6.2`20or`20higher)`20is
V`20not`20supported
X`20`20`20`20`20in`20PIPE's`20command`20line.`20You`20must`20define`20every`20f
Voreign`20command`20as
X`20`20`20`20`20DCL`20symbol`20prior`20to`20use`20it`20in`20a`20PIPE`20command
V`20line.
X
X2`20Separators
X
X`20`20Command`20Operators`20(also`20called`20"Separators")`20are`20used`20to
V`20separate
X`20`20DCL`20commands`20in`20a`20command`20line.`20PIPE`20supports`20these`20se
Vparators:
X
X`20`20cmd1`20;`20cmd2...`20Sequential`20execution.`20Start`20of`20'cmd2'`20beg
Vins`20when
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20'cmd1'`20completes.
X
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20Depending`20on`20the`20logi
Vcal`20name`20ADV_PIPE_DOUBLE_SEMI,
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20PIPE`20recognizes`20either
V`20one`20or`20two`20semicolons`20as
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20separator.`20This`20allows
V`20you`20to`20use`20the`20single`20semi-
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20colon`20als`20version`20num
Vber`20delimiter`20in`20RMS`20file`20names.
X
X`20`20cmd1`20`26`20cmd2....Concurrent`20(background)`20execution.`20'cmd2'`20i
Vs`20started
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20immediately`20after`20'cmd1
V'.`20'cmd1'`20is`20executed`20in
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20background,`20asynchronuous
V`20to`20'cmd2'.
X
X`20`20cmd1`20`7C`20cmd2....Piped`20commands.`20Output`20of`20'cmd1'`20is`20tak
Ven`20as`20input
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20for`20'cmd2'.`20You`20can
V`20build`20a`20command`20chain`20with`20up
X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20to`20eight`20pipes.
X
X3`20Examples
X
X`20`20$`20P`20RUN`20TEST`20`26`20DIR/OUTPUT=Z.Z`20;`20SHOW`20LOGICAL`20A
X
X`20`20TEST`20is`20started`20and`20is`20placed`20in`20background`20for`20execut
Vion.`20Next,
X`20`20the`20DIR`20command`20is`20executed.`20Finally,`20after`20execution`20of
V`20DIR,`20the
X`20`20SHOW`20LOGICAL`20command`20runs.
X
X`20`20$`20P`20SHOW`20SYSTEM`20`7C`20SEARCH`20SYS$INPUT`20UCX`20>`20UCX.LOG
X
X`20`20The`20output`20of`20SHOW`20SYSTEM`20is`20sent`20to`20the`20SEARCH`20comm
Vand`20which`20looks
X`20`20for`20the`20string`20'UCX'`20and`20writes`20all`20lines`20containing`20t
Vhis`20string`20to
X`20`20the`20file`20UCX.LOG.`20Note`20that`20you`20must`20tell`20SEARCH`20to`20
Vread`20its`20data
X`20`20from`20stdin`20by`20specifying`20SYS$INPUT`20as`20file`20parameter.
$ call unpack ADV_PIPE.HLP;1 1751923625 "" 15 3 8
$!
$ create 'f'
Xadv_pipe_axp
Xstack=16
$ call unpack ADV_PIPE_AXP.OPT;1 523117910 "" 1 4 8
$!
$ create 'f'
X$`20!
X$`20!`20ADV_PIPE_STARTUP.COM
X$`20!`20====================
X$`20!
X$`20!`20PIPE`20Version`20V1.1
X$`20!
X$`20!`20(P)`201993`20by`20BOL
X$`20!
X$`20!`20This`20procedure`20`20follows`20the`20standard`20DEC`20/`20ADV`20guide
Vlines`20and`20conventions
X$`20!`20in`20designing`20software`20products.
X$`20!
X$`20!
X$`20!`20Revision`20history:
X$`20!
X$`20!`2020-OCT-1993`20BOL`20`20`20`20V1.0`20created.
X$`20!`2010-DEC-1995`20BOL`20`20`20`20V1.1`20created.
X$`20!
X$`20prod_vers`20=`20"011"
X$`20!
X$`20i_v`20=`20"V1.1"
X$`20put`20=`20"writ`20sys$output"
X$`20sysdef`20=`20"defi/syst/exec/nolog"
X$`20on`20warn`20then`20goto`20ERROR_EXIT
X$`20!
X$`20put`20"%PIPE-I-START_BEG,`20startup`20for`20ADV_PIPE`20''i_v'`20is`20runni
Vng,`20please
Xwait..."
X$`20prvprv`20=`20f$setp`20("SYSPRV,SYSNAM,CMKRNL")
X$`20if`20.not.`20f$priv`20("SYSPRV,SYSNAM,CMKRNL")`20then`20goto`20NO_PRIV
X$`20sysdef`20ADV_PIPE_ISHI`201
X$`20file`20=`20"SYS$COMMON:`5BSYSEXE`5DADV_PIPE.EXE"
X$`20gosu`20CHECK_INS
X$`20deas/syst/exec`20ADV_PIPE_ISHI
X$`20sysdef`20ADV_PIPE_ISDO`20"''prod_vers'"
X$`20ERROR_EXIT:
X$`20if`20f$trnl`20("ADV_PIPE_ISDO")`20.eqs.`20""
X$`20then`20put`20"%PIPE-E-NOTSTARTED,`20ADV_PIPE`20''i_v'`20was`20not`20starte
Vd!"
X$`20else`20put`20"%PIPE-I-START_END,`20startup`20for`20ADV_PIPE`20''i_v'`20com
Vpleted
Xsuccessfully"
X$`20endi
X$`20x`20=`20f$setp`20(prvprv)
X$`20file`20=`20f$sear`20("SYS$MANAGER:ADV_PIPE_SYSTARTUP.COM")
X$`20if`20file`20.nes.`20""`20then`20@'file'
X$`20exit
X$`20!
X$`20CHECK_INS:
X$`20if`20f$sear`20(file)`20.eqs.`20""`20then`20goto`20NO_FILE
X$`20if`20f$file`20(file,`20"KNOWN")`20then`20inst`20remo`20'file'
X$`20inst`20add/open/head`20'file'
X$`20retu
X$`20NO_FILE:
X$`20put`20"%PIPE-F-ACCFAIL,`20failed`20to`20access`20''file'"
X$`20goto`20ERROR_EXIT
X$`20NO_PRIV:
X$`20put`20"%PIPE-F-NOPRIV,`20insufficient`20privileges`20for`20startup"
X$`20goto`20ERROR_EXIT
$ call unpack ADV_PIPE_STARTUP.COM;1 1493205095 "" 4 5 8
$!
$ create 'f'
X$`20!
X$`20!`20ADV_PIPE_SYSTARTUP.COM
X$`20!`20======================
X$`20!
X$`20!`20This`20file`20contains`20user-settable`20logicals`20to`20control`20PIP
VE's`20working
X$`20!`20behaviour.`20If`20you`20want`20to`20define`20a`20logical,`20remove`20t
Vhe`20leading`20exclamation
X$`20!`20point`20(!).`20If`20you`20want`20to`20undefine`20it,`20place`20the`20l
Veading`20exclamation`20point
X$`20!`20before`20the`20approbiate`20DEFINE`20command.`20The`20initial`20settin
Vgs`20in`20this`20file`20are
X$`20!`20a`20good`20choice`20to`20work`20with`20PIPE.
X$`20!
X$`20!
X$`20!`201)`20ADV_PIPE_NOSYMBLS`20-`20do`20not`20pass`20DCL`20symbols`20to`20su
Vbprocesses.`20Same`20as
X$`20!`20`20`20`20SPAWN/NOSYMBOLS`20in`20DCL.`20Recommended,`20since`20subproce
Vss`20creation`20is
Xfaster.
X$`20!`20`20`20`20Note`20that`20symbol`20substitution`20in`20PIPE's`20command
V`20line`20occurs`20in`20the
X$`20!`20`20`20`20context`20of`20the`20main`20process,`20so`20there`20is`20no
V`20need`20to`20pass`20them`20to`20any
X$`20!`20`20`20`20subprocess.
X$`20!
X$`20DEFINE/SYSTEM/NOLOG`20ADV_PIPE_NOSYMBOLS`201
X$`20!
X$`20!
X$`20!`202)`20ADV_PIPE_NOLOGICALS`20-`20do`20not`20pass`20per-process`20logical
V`20names`20to`20sub-
X$`20!`20`20`20`20processes.`20Same`20as`20SPAWN/NOLOGICALS`20in`20DCL.`20Recom
Vmended,`20since`20sub-
X$`20!`20`20`20`20process`20creation`20isfaster.`20If`20you`20want`20to`20share
V`20logical`20names`20within
X$`20!`20`20`20`20your`20subprocesses,`20place`20them`20in`20the`20job`20logica
Vl`20name`20table
X(DEFINE/JOB).
X$`20!
X$`20DEFINE/SYSTEM/NOLOG`20ADV_PIPE_NOLOGICALS`201
X$`20!
X$`20!
X$`20!`203)`20ADV_PIPE_NOTIFY`20-`20request`20notification`20whenever`20an`20as
Vynchronuous`20sub-
X$`20!`20`20`20`20process`20created`20by`20PIPE`20completes.`20Same`20as`20SPAW
VN/NOWAIT/NOTIFY`20in`20DCL.
X$`20!`20`20`20`20This`20name`20is`20used`20only`20for`20subprocesses`20running
V`20in`20background`20(specified
X$`20!`20`20`20`20with`20the`20'`26'`20operator).`20It`20is`20ignored`20for`20s
Vequential`20subprocess
X$`20!`20`20`20`20operations`20(';'`20operator)`20and`20when`20using`20PIPE`20n
Von-interactively.
X$`20!
X$`20DEFINE/SYSTEM/NOLOG`20ADV_PIPE_NOTIFY`201
X$`20!
X$`20!
X$`20!`204)`20ADV_PIPE_DOUBLE_SEMI`20-`20controls`20PIPE's`20interpretation`20o
Vf`20the`20semicolon
X$`20!`20`20`20`20(;)`20character:
X$`20!
X$`20!`20`20`20`20If`20this`20name`20is`20*not*`20defined,`20a`20single`20semic
Volon`20is`20treated`20as`20se-
X$`20!`20`20`20`20quential`20operator;`20when`20specifying`20a`20version`20numb
Ver`20in`20an`20RMS`20file`20name,
X$`20!`20`20`20`20you`20must`20use`20the`20dot`20(.)`20character`20instead`20(t
Vhis`20is`20a`20supported,`20but
X$`20!`20`20`20`20undocumented`20feature`20of`20the`20RMS`20filename`20parsing
V`20routine).
X$`20!`20
X$`20!`20`20`20`20If`20this`20name`20*is*`20defined,`20a`20single`20semicolon
V`20character`20is`20not`20treated
X$`20!`20`20`20`20as`20sequential`20operator;`20you'll`20have`20to`20specify`20
V2`20semicolons`20instead`20(no
X$`20!`20`20`20`20space`20is`20allowed`20beetween`20them).`20This`20allows`20yo
Vu`20use`20the`20semicolon`20in
X$`20!`20`20`20`20RMS`20file`20names`20as`20habitual.
X$`20!
X$`20!`20`20`20`20Note`20that`20a`20single`20semicolon`20is`20always`20recogniz
Ved`20as`20sequential`20operator
X$`20!`20`20`20`20when`20it`20is`20preeceded`20by`20one`20or`20more`20blanks`20
Vor`20tabs.
X$`20!
X$`20!DEFINE/SYSTEM/NOLOG`20ADV_PIPE_DOUBLE_SEMI`201
X$`20!
X$`20!
X$`20!`205)`20ADV_PIPE_DCL_PARSE`20-`20if`20set,`20PIPE`20calls`20DCL`20to`20pa
Vrse`20every`20command
X$`20!`20`20`20`20before`20the`20subprocess`20is`20created`20and`20the`20comman
Vd`20is`20passed`20to`20it.`20This
X$`20!`20`20`20`20prevents`20the`20user`20to`20supply`20unknown`20commands`20to
V`20piped`20subprocesses
X$`20!`20`20`20`20which`20can`20result`20in`20unexpected`20loops`20or`20hangups
V`20when`20the`20pipe`20is`20broken.
X$`20!`20`20`20`20Note`20that`20with`20this`20feature,`20the`20DCL$PATH`20logic
Val`20(VMS`20V6.2`20or`20higher)
X$`20!`20`20`20`20will`20not`20work;`20you`20must`20define`20every`20command`20
Vwhich`20is`20not`20a`20"real"`20DCL
X$`20!`20`20`20`20command`20(not`20defined`20in`20the`20DCLTABLES).
X$`20!
X$`20!`20`20`20`20If`20you`20do`20not`20use`20pipes,`20you`20can`20disable`20th
Vis`20feature.
X$`20!
X$`20DEFINE/SYSTEM/NOLOG`20ADV_PIPE_DCL_PARSE`201
X$`20!
X$`20!
X$`20!`206)`20ADV_PIPE_DEBUG`20-`20print`20debugging`20information.`20For`20PIP
VE's`20developers
X$`20!`20`20`20`20only.`20Do`20not`20set`20it`20unless`20you`20want`20to`20rece
Vive`20many`20messages`20;-)
X$`20!
X$`20!DEFINE/SYSTEM/NOLOG`20ADV_PIPE_DEBUG`201
X$`20!
X$`20exit
$ call unpack ADV_PIPE_SYSTARTUP.COM;1 1343932330 "" 7 6 8
$!
$ create 'f'
Xadv_pipe_vax
Xsys$share:vaxcrtl/shar`20`20`20`20`20`20`20`20`20`20!`20Remove`20this`20if`20y
Vou're`20using`20DEC`20C
Xsys$system:sys.stb/sele
Xstack=16
$ call unpack ADV_PIPE_VAX.OPT;1 1313545168 "" 1 7 8
$!
$ create 'f'
X$`20!
X$`20!`20INSTALL`20File`20for`20ADV_PIPE
X$`20!`20=========================
X$`20!
X$`20!`20(P)`201995`20by`20ADVBOL
X$`20!
X$`20priv`20=`20"CMKRNL,SYSNAM,SYSPRV"
X$`20x`20=`20f$setp`20(priv)
X$`20if`20.not.`20f$priv`20(priv)`20then`20exit`2036
X$`20!
X$`20put`20:=`20writ`20sys$output
X$`20if`20f$gets`20("HW_MODEL")`20.lt.`201024
X$`20then
X$`20!
X$`20put`20"Building`20ADV_PIPE`20V1.1`20on`20OpenVMS`20VAX:"
X$`20!
X$`20!`20For`20VAXC,`20remove`20the`20/DECC/STAND=VAXC`20qualifiers`20in`20the
V`20next`20command:
X$`20!
X$`20cc/decc/stand=vaxc/nodebu/opti/obje=adv_pipe_vax`20adv_pipe
X$`20link/notrac/exec=sys$common:`5Bsysexe`5Dadv_pipe`20adv_pipe_vax/opt
X$`20else
X$`20put`20"Building`20ADV_PIPE`20V1.1`20on`20OpenVMS`20AXP:"
X$`20cc/nodebu/opti/stan=vaxc/obje=adv_pipe_axp`20adv_pipe
X$`20link/notrac/exec=sys$common:`5Bsysexe`5Dadv_pipe/syse`20adv_pipe_axp/opt
X$`20endi
X$`20!
X$`20put`20"`20o`20-`20Copying`20Files..."
X$`20copy`20adv_pipe_startup.com`20sys$common:`5Bsys$startup`5D
X$`20copy`20adv_pipe_systartup.com`20sys$common:`5Bsysmgr`5D
X$`20!
X$`20put`20"`20o`20-`20Modifying`20DCLTABLES..."
X$`20set`20comm`20adv_pipe
X$`20set`20comm`20adv_pipe/tabl=sys$share:dcltables/outp=sys$common:`5Bsyslib
V`5Ddcltables
X$`20inst`20repl/open/head/shar`20sys$share:dcltables
X$`20!
X$`20put`20"`20o`20-`20Providing`20online`20help.."
X$`20libr/help`20sys$help:helplib`20adv_pipe
X$`20!
X$`20put`20"`20o`20-`20Modifying`20Startup`20Database..."
X$`20mc`20sysman`20start`20add`20file`20adv_pipe_startup.com/phas=lpmain/mod=di
Vrect
X$`20!
X$`20put`20"`20o`20-`20Executing`20Product`20Startup`20Procedure..."
X$`20@sys$startup:adv_pipe_startup
X$`20!
X$`20put`20"Installation`20completed`20successfully!"
X$`20exit
X$`20!
$ call unpack INSTALL.COM;1 1311475612 "" 3 8 8
$ v=f$verify(v)
$ exit

0 new messages