Copyright (C) 1991, 1992 Ian Lance Taylor
This file is part of the Taylor UUCP package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
The author of the program may be contacted at ian@airs.com or
c/o Infinity Development Systems, P.O. Box 520, Waltham, MA 02254.
/* Given a set of commands to execute for a remote system, create a
command file holding them. This creates a single command file
holding all the commands passed in. It returns a jobid. */
zsysdep_spool_commands (qsys
, bgrade
, ccmds
, pascmds
)
const struct uuconf_system
*qsys
;
const struct scmd
*pascmds
;
if (! UUCONF_GRADE_LEGAL (bgrade
))
ulog (LOG_FATAL
, "Bad grade %d", bgrade
);
z
= zscmd_file (qsys
, bgrade
);
e
= esysdep_fopen (z
, FALSE
, FALSE
, TRUE
);
for (i
= 0, q
= pascmds
; i
< ccmds
; i
++, q
++)
fprintf (e
, "S %s %s %s -%s %s 0%o %s\n", q
->zfrom
, q
->zto
,
q
->zuser
, q
->zoptions
, q
->ztemp
, q
->imode
,
q
->znotify
== NULL
? (const char *) "" : q
->znotify
);
fprintf (e
, "R %s %s %s -%s\n", q
->zfrom
, q
->zto
, q
->zuser
,
fprintf (e
, "X %s %s %s -%s\n", q
->zfrom
, q
->zto
, q
->zuser
,
fprintf (e
, "E %s %s %s -%s %s 0%o %s 0 %s\n", q
->zfrom
, q
->zto
,
q
->zuser
, q
->zoptions
, q
->ztemp
, q
->imode
,
"zsysdep_spool_commands: Unrecognized type %d",
ulog (LOG_ERROR
, "fclose: %s", strerror (errno
));
zjobid
= zsfile_to_jobid (qsys
, z
, bgrade
);