RTEMS CPU Kit with SuperCore  4.11.3
Macros | Functions | Variables
chat.c File Reference
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
#include <termios.h>
#include "pppd.h"
#include <varargs.h>
Include dependency graph for chat.c:

Macros

#define TERMIOS
 
#define STR_LEN   1024
 
#define __V(x)   (va_alist) va_dcl
 
#define const
 
#define O_NONBLOCK   O_NDELAY
 
#define OPTION(c, v)
 
#define OPTARG(c, v)
 
#define OPTONLYARG(c, v)   (_O&2&&**v?(_O=1,--c,*v++):(char*)0)
 
#define ARG(c, v)   (c?(--c,*v++):(char*)0)
 
#define MAX_ABORTS   16
 
#define MAX_REPORTS   16
 
#define DEFAULT_CHAT_TIMEOUT   45
 
#define MAX_TIMEOUTS   10
 
#define term_parms   struct termios
 
#define get_term_param(param)   tcgetattr(0, param)
 
#define set_term_param(param)   tcsetattr(0, TCSANOW, param)
 
#define isoctal(chr)   (((chr) >= '0') && ((chr) <= '7'))
 
#define isalnumx(chr)
 

Functions

void * dup_mem (void *b, size_t c)
 
void * copy_of (char *s)
 
void break_sequence (void)
 
void chat_send (register char *s)
 
void chat_expect (register char *s)
 
char * expect_strtok (char *, char *)
 
int chatmain (int, int, char *)
 
char * getnextcommand (char *string, char *buff)
 
void chat_expect (char *s)
 
void chat_send (char *s)
 

Variables

char temp2 [STR_LEN]
 
struct termios saved_tty_parameters
 
char * fail_reason = (char *)0
 
char fail_buffer [50]
 
char * abort_string [MAX_ABORTS] ={"BUSY","NO DIALTONE","NO CARRIER","NO ANSWER","RING\r\nRING"}
 
int n_aborts = 5
 
int abort_next = 0
 
int timeout_next = 0
 
int echo_next = 0
 
int clear_abort_next = 0
 
char * report_string [MAX_REPORTS]
 
char report_buffer [50]
 
int n_reports = 0
 
int report_next = 0
 
int report_gathering = 0
 
int clear_report_next = 0
 
int say_next = 0
 
int hup_next = 0
 

Macro Definition Documentation

◆ isalnumx

#define isalnumx (   chr)
Value:
((((chr) >= '0') && ((chr) <= '9')) \
|| (((chr) >= 'a') && ((chr) <= 'z')) \
|| (((chr) >= 'A') && ((chr) <= 'Z')) \
|| (chr) == '_')

◆ OPTARG

#define OPTARG (   c,
 
)
Value:
(_O&2?**v||(++v,--c)?(_O=1,--c,*v++): \
(_O=4,(char*)0):(char*)0)

◆ OPTION

#define OPTION (   c,
 
)
Value:
(_O&2&&**v?*(*v)++:!c||_O&4?0:(!(_O&1)&& \
(--c,++v),_O=4,c&&**v=='-'&&v[0][1]?*++*v=='-'\
&&!v[0][1]?(--c,++v,0):(_O=2,*(*v)++):0))