Main Page   Compound List   File List   Compound Members   File Members  

zsend.vtc

Go to the documentation of this file.
00001 /* -*- C -*- */
00055 Tzoutgoing ?:= new_assoc();
00056 /*?
00057 struct Tzoutgoing
00058 {
00059   class;
00060   instance;
00061   recip;
00062   opcode;
00063   body;
00064   sig;
00065   sender;
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     /* If there are commas in the recipient, deal specially. */
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 }

Generated at Mon Aug 13 16:45:52 2001 for dzm-vtc by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001