#include "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_tdnams_rcsid[] = "$Id: tdnams.c,v 1.9 2002/03/05 19:10:43 ian Rel $";
#endif
#include <errno.h>
static int indialer P((pointer pglobal, int argc, char **argv, pointer pvar,
pointer pinfo));
int
uuconf_taylor_dialer_names (pglobal, ppzdialers)
pointer pglobal;
char ***ppzdialers;
{
struct sglobal *qglobal = (struct sglobal *) pglobal;
struct uuconf_cmdtab as[2];
char **pz;
int iret;
*ppzdialers = NULL;
as[0].uuconf_zcmd = "dialer";
as[0].uuconf_itype = UUCONF_CMDTABTYPE_FN | 2;
as[0].uuconf_pvar = (pointer) ppzdialers;
as[0].uuconf_pifn = indialer;
as[1].uuconf_zcmd = NULL;
iret = UUCONF_SUCCESS;
for (pz = qglobal->qprocess->pzdialfiles; *pz != NULL; pz++)
{
FILE *e;
e = fopen (*pz, "r");
if (e == NULL)
{
if (FNO_SUCH_FILE ())
continue;
qglobal->ierrno = errno;
iret = UUCONF_FOPEN_FAILED | UUCONF_ERROR_ERRNO;
break;
}
iret = uuconf_cmd_file (pglobal, e, as, (pointer) NULL,
(uuconf_cmdtabfn) NULL,
UUCONF_CMDTABFLAG_BACKSLASH,
(pointer) NULL);
(void) fclose (e);
if (iret != UUCONF_SUCCESS)
break;
}
if (iret != UUCONF_SUCCESS)
{
qglobal->zfilename = *pz;
return iret | UUCONF_ERROR_FILENAME;
}
if (*ppzdialers == NULL)
iret = _uuconf_iadd_string (qglobal, (char *) NULL, FALSE, FALSE,
ppzdialers, (pointer) NULL);
return UUCONF_SUCCESS;
}
static int
indialer (pglobal, argc, argv, pvar, pinfo)
pointer pglobal;
int argc ATTRIBUTE_UNUSED;
char **argv;
pointer pvar;
pointer pinfo ATTRIBUTE_UNUSED;
{
struct sglobal *qglobal = (struct sglobal *) pglobal;
char ***ppzdialers = (char ***) pvar;
int iret;
iret = _uuconf_iadd_string (qglobal, argv[1], TRUE, TRUE, ppzdialers,
(pointer) NULL);
if (iret != UUCONF_SUCCESS)
iret |= UUCONF_CMDTABRET_EXIT;
return iret;
}