]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/libexec/uucp/libuuconf/runuxq.c
$Id$ -> $FreeBSD$
[FreeBSD/FreeBSD.git] / gnu / libexec / uucp / libuuconf / runuxq.c
1 /* maxuxq.c
2    Return how often to spawn a uuxqt process.
3
4    Copyright (C) 1994 Ian Lance Taylor
5
6    This file is part of the Taylor UUCP uuconf library.
7
8    This library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Library General Public License
10    as published by the Free Software Foundation; either version 2 of
11    the License, or (at your option) any later version.
12
13    This library is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Library General Public License for more details.
17
18    You should have received a copy of the GNU Library General Public
19    License along with this library; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21
22    The author of the program may be contacted at ian@airs.com or
23    c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
24    */
25
26 #include "uucnfi.h"
27
28 #if USE_RCS_ID
29 const char _uuconf_runuxq_rcsid[] = "$FreeBSD$";
30 #endif
31 \f
32 /* Return how often to spawn a uuxqt process.  This is either a
33    positive number representing the number of execution files to be
34    received between spawns, or a special code.  When using
35    TAYLOR_CONFIG, this is from the ``run-uuxqt'' command in config
36    (the default is UUCONF_RUNUUXQT_ONCE, for compatibility).
37    Otherwise, we return UUCONF_RUNUUXQT_PERCALL for HDB_CONFIG and 10
38    for V2_CONFIG, to emulate traditional HDB and V2 emulations.  */
39
40 int
41 uuconf_runuuxqt (pglobal, pirunuuxqt)
42      pointer pglobal;
43      int *pirunuuxqt;
44 {
45 #if HAVE_TAYLOR_CONFIG
46   {
47     struct sglobal *qglobal = (struct sglobal *) pglobal;
48     const char *zrun;
49
50     zrun = qglobal->qprocess->zrunuuxqt;
51     if (zrun == NULL
52         || strcasecmp (zrun, "once") == 0)
53       *pirunuuxqt = UUCONF_RUNUUXQT_ONCE;
54     else if (strcasecmp (zrun, "never") == 0)
55       *pirunuuxqt = UUCONF_RUNUUXQT_NEVER;
56     else if (strcasecmp (zrun, "percall") == 0)
57       *pirunuuxqt = UUCONF_RUNUUXQT_PERCALL;
58     else
59       {
60         char *zend;
61
62         *pirunuuxqt = strtol ((char *) qglobal->qprocess->zrunuuxqt,
63                               &zend, 10);
64         if (*zend != '\0' || *pirunuuxqt <= 0)
65           *pirunuuxqt = UUCONF_RUNUUXQT_ONCE;
66       }
67   }
68 #else /* ! HAVE_TAYLOR_CONFIG */
69 #if HAVE_HDB_CONFIG
70   *pirunuuxqt = UUCONF_RUNUUXQT_PERCALL;
71 #else /* ! HAVE_HDB_CONFIG */
72   *pirunuuxqt = 10;
73 #endif /* ! HAVE_HDB_CONFIG */
74 #endif /* ! HAVE_TAYLOR_CONFIG */
75
76   return UUCONF_SUCCESS;
77 }