*/
#ifndef lint
-static char rcsid[] = "$Id: chat.c,v 1.16 1997/11/27 06:00:06 paulus Exp $";
+static char rcsid[] = "$Id: chat.c,v 1.18 1998/02/04 01:35:49 paulus Exp $";
#endif
#include <stdio.h>
#include <termios.h>
#endif
-#if __STDC__
-#include <stdarg.h>
-#define __V(x) x
-#else
-#include <varargs.h>
-#define __V(x) (va_alist) va_dcl
-#define const
-#endif
-
#define STR_LEN 1024
#ifndef SIGTYPE
#define O_NONBLOCK O_NDELAY
#endif
+#ifdef SUNOS
+extern int sys_nerr;
+extern char *sys_errlist[];
+#define memmove(to, from, n) bcopy(from, to, n)
+#define strerror(n) ((unsigned)(n) < sys_nerr? sys_errlist[(n)] :\
+ "unknown error")
+#endif
+
/*************** Micro getopt() *********************************************/
#define OPTION(c,v) (_O&2&&**v?*(*v)++:!c||_O&4?0:(!(_O&1)&& \
- ((--c,++v),_O=4,c)&&**v=='-'&&v[0][1]?*++*v=='-'\
+ (--c,++v),_O=4,c&&**v=='-'&&v[0][1]?*++*v=='-'\
&&!v[0][1]?(--c,++v,0):(_O=2,*(*v)++):0))
#define OPTARG(c,v) (_O&2?**v||(++v,--c)?(_O=1,--c,*v++): \
(_O=4,(char*)0):(char*)0)
{
va_list args;
-#if __STDC__
+#ifdef __STDC__
va_start(args, fmt);
#else
char *fmt;
{
va_list args;
-#if __STDC__
+#ifdef __STDC__
va_start(args, fmt);
#else
int code;
if (clear_abort_next) {
char *s1;
- char *s2 = s;
int i;
int old_max;
int pack = 0;
if (clear_report_next) {
char *s1;
- char *s2 = s;
int i;
int old_max;
int pack = 0;
const char *f;
unsigned char *p;
char num[32];
- time_t t;
static char hexchars[] = "0123456789abcdef";
buf0 = buf;