/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* client line by line interaction
*/
#include "cslib.h"
#if !_lib_tcgetattr || !_lib_tcsetattr
#endif
#if _hdr_termios
#include <termios.h>
#endif
#if _hdr_termios
static struct State_s
{
} state;
static void
restore(void)
{
}
#endif
/*
* if fd<0 then establish client connection to service
* if argv specified then each is a command line to be executed
* if CS_CLIENT_ARGV not set then additional commands read from stdin
*/
int
csclient(Cs_t* cs, int fd, const char* service, const char* prompt, char** argv, unsigned int flags)
{
register int i;
char* s;
int done;
int promptlen;
int timeout;
ssize_t n;
{
else
}
#if _hdr_termios
if (flags & CS_CLIENT_RAW)
{
}
#endif
{
}
else
{
argv = 0;
}
done = 0;
tmp = 0;
for (i = 0; i < elementsof(fds); i++)
{
if (!i && argv)
{
if (!*argv)
{
argv = 0;
if (flags & CS_CLIENT_ARGV)
{
if (done++)
return 0;
timeout = 500;
}
continue;
}
for (;;)
{
s = *argv++;
break;
break;
}
}
if (!n)
{
if (done++)
return 0;
if (!i)
continue;
}
if (!i)
{
#if _hdr_termios
register char* u;
register int m;
s[n] = 0;
if ((u = strchr(s, 035)))
{
if (promptlen)
{
return 0;
}
buf[n - 1] = 0;
if (*u == 'q' || *u == 'Q')
return 0;
if (*u)
continue;
}
#endif
}
}
return error_info.errors != 0;
}
int
{
}