00001
00055 Tzoutgoing ?:= new_assoc();
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00078 func new_zoutgoing() [zout]
00079 {
00080 zout = alloc(10, Tzoutgoing);
00081 zout->class = 0;
00082 zout->instance = 0;
00083 zout->recip = 0;
00084 zout->opcode = 0;
00085 zout->body = 0;
00086 zout->sig = 0;
00087 zout->sender = 0;
00088 return zout;
00089 }
00090
00100 func zout_send(zout)
00101 {
00102 (*zout->sender)(zout);
00103 }
00104
00115 func zout_std_args(zout) [args, pos]
00116 {
00117 args = " -n";
00118 if (zout->class && *zout->class)
00119 args += " -c " + sh_quote(zout->class);
00120 if (zout->instance && *zout->instance)
00121 args += " -i " + sh_quote(zout->instance);
00122 if (zout->opcode && *zout->opcode)
00123 args += " -O " + sh_quote(zout->opcode);
00124 if (zout->recip && *zout->recip)
00125 {
00126
00127 if (strchr(zout->recip, ','))
00128 {
00129 args += " -C";
00130 while (pos = strrchr(zout->recip, ','))
00131 {
00132 args += " " + sh_quote(pos + 1);
00133 *pos = '\0';
00134 }
00135 args += " " + sh_quote(zout->recip);
00136 }
00137 else
00138 args += " " + sh_quote(zout->recip);
00139 }
00140 if (zout->sig && *zout->sig)
00141 args += " -s " + sh_quote(zout->sig);
00142 return args;
00143 }