2 Find callout login name and password for a system.
4 Copyright (C) 1992 Ian Lance Taylor
6 This file is part of the Taylor UUCP uuconf library.
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
22 The author of the program may be contacted at ian@airs.com or
23 c/o Infinity Development Systems, P.O. Box 520, Waltham, MA 02254.
29 const char _uuconf_calout_rcsid[] = "$Id: calout.c,v 1.1 1993/08/04 19:33:45 jtc Exp $";
34 /* Find callout login name and password for a system. */
38 uuconf_callout (pglobal, qsys, pzlog, pzpass)
40 const struct uuconf_system *qsys;
44 #if HAVE_TAYLOR_CONFIG
46 return uuconf_taylor_callout (pglobal, qsys, pzlog, pzpass);
48 #else /* ! HAVE_TAYLOR_CONFIG */
50 struct sglobal *qglobal = (struct sglobal *) pglobal;
55 if (qsys->uuconf_zcall_login == NULL
56 && qsys->uuconf_zcall_password == NULL)
57 return UUCONF_NOT_FOUND;
59 if ((qsys->uuconf_zcall_login != NULL
60 && strcmp (qsys->uuconf_zcall_login, "*") == 0)
61 || (qsys->uuconf_zcall_password != NULL
62 && strcmp (qsys->uuconf_zcall_password, "*") == 0))
63 return UUCONF_NOT_FOUND;
65 if (qsys->uuconf_zcall_login != NULL)
67 *pzlog = strdup (qsys->uuconf_zcall_login);
70 qglobal->ierrno = errno;
71 return UUCONF_MALLOC_FAILED | UUCONF_ERROR_ERRNO;
75 if (qsys->uuconf_zcall_password != NULL)
77 *pzpass = strdup (qsys->uuconf_zcall_password);
80 qglobal->ierrno = errno;
83 free ((pointer) *pzlog);
86 return UUCONF_MALLOC_FAILED | UUCONF_ERROR_ERRNO;
90 return UUCONF_SUCCESS;
92 #endif /* ! HAVE_TAYLOR_CONFIG */