term.c File Reference

#include <sys/types.h>
#include <fcntl.h>
#include <termios.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/stat.h>

Include dependency graph for term.c:

Go to the source code of this file.

Data Structures

struct  param_s

Defines

#define CHUNK   1024
#define HOTKEY   '\035'
#define NIL   ((char *) NULL)

Functions

 _PROTOTYPE (int main,(int argc, char *argv[]))
 _PROTOTYPE (int isdialstr,(char *arg))
 _PROTOTYPE (void tell,(int fd,...))
 _PROTOTYPE (void reader,(int on))
 _PROTOTYPE (void shell,(char *cmd))
 _PROTOTYPE (void lock_device,(char *device))
 _PROTOTYPE (void fatal,(char *label))
 _PROTOTYPE (void setnum,(char *s, int n))
 _PROTOTYPE (void set_uart,(int argc, char *argv[], struct termios *tcp))
 _PROTOTYPE (void set_raw,(struct termios *tcp))
 _PROTOTYPE (void quit,(int code))
int main (int argc, argv)
int isdialstr (char *arg)
void tell (int fd,...)
void reader (int on)
void shell (char *cmd)
void lock_device (char *device)
void fatal (char *label)
void setnum (char *s, int n)
void set_uart (int argc, argv, struct termios *tcp)
void set_raw (struct termios *tcp)
void quit (int code)

Variables

char TERM_LINE [] = "/dev/modem"
char lockfile [] = "/usr/spool/locks/LK.iii.jjj.kkk"
char * commdev
int commfd
termios tccomm
termios tcstdin
termios tcsavestdin
param_s params []


Define Documentation

#define CHUNK   1024
 

Definition at line 66 of file term.c.

#define HOTKEY   '\035'
 

Definition at line 80 of file term.c.

#define NIL   ((char *) NULL)
 

Definition at line 114 of file term.c.


Function Documentation

_PROTOTYPE void  quit,
(int code
 

_PROTOTYPE void  set_raw,
(struct termios *tcp) 
 

_PROTOTYPE void  set_uart,
(int argc, char *argv[], struct termios *tcp) 
 

_PROTOTYPE void  setnum,
(char *s, int n
 

_PROTOTYPE void  fatal,
(char *label
 

_PROTOTYPE void  lock_device,
(char *device
 

_PROTOTYPE void  shell,
(char *cmd
 

_PROTOTYPE void  reader,
(int on) 
 

_PROTOTYPE void  tell,
(int fd,...) 
 

_PROTOTYPE int  isdialstr,
(char *arg
 

_PROTOTYPE int  main,
(int argc, char *argv[]) 
 

void fatal char *  label  ) 
 

Definition at line 460 of file term.c.

References errno, exit(), NIL, strerror(), and tell().

int isdialstr char *  arg  ) 
 

Definition at line 279 of file term.c.

void lock_device char *  device  ) 
 

Definition at line 393 of file term.c.

References EEXIST, ENOENT, errno, exit(), fatal(), lockfile, n, NIL, O_CREAT, O_EXCL, O_RDONLY, O_WRONLY, open, pid, S_ISCHR, setnum(), stat::st_dev, stat::st_mode, stat::st_rdev, stat, tell(), and umask.

int main int  argc,
argv 
 

Definition at line 128 of file term.c.

References commdev, exit(), i, key, NIL, NULL, and tell().

void quit int  code  ) 
 

Definition at line 531 of file term.c.

References exit(), lockfile, reader(), TCSANOW, tcsavestdin, tcsetattr, and unlink.

void reader int  on  ) 
 

Definition at line 301 of file term.c.

References _exit, CHUNK, commdev, commfd, errno, fork, getppid, kill, m, n, NIL, NULL, pid, quit, r, read, SIGKILL, SIGTERM, strerror(), tell(), waitpid, and write.

void set_raw struct termios tcp  ) 
 

Definition at line 518 of file term.c.

References ECHO, ECHONL, ICANON, ICRNL, IEXTEN, IGNCR, INLCR, ISIG, IXOFF, IXON, OPOST, VMIN, and VTIME.

void set_uart int  argc,
argv  ,
struct termios tcp
 

Definition at line 476 of file term.c.

References arg, BAD, BITS, termios::c_cflag, cfsetispeed, cfsetospeed, CSIZE, i, NIL, params, PARENB, param_s::PARITY, PARODD, param_s::pattern, quit, param_s::SPEED, strcmp, tell(), param_s::type, and param_s::value.

void setnum char *  s,
int  n
 

Definition at line 467 of file term.c.

References i.

Referenced by lock_device().

void shell char *  cmd  ) 
 

Definition at line 340 of file term.c.

References _exit, _PROTOTYPE, close, commdev, commfd, dup2, errno, execl, fork, getenv(), getgid, getuid, NIL, NULL, pid, setgid, setuid, SIG_IGN, SIGINT, signal(), SIGQUIT, SIGTERM, strerror(), strrchr(), tell(), and waitpid.

void tell int  fd,
  ...
 

Definition at line 289 of file term.c.

References NIL, s, strlen(), va_arg, va_end, va_start, and write.


Variable Documentation

char* commdev
 

Definition at line 73 of file term.c.

Referenced by main(), reader(), and shell().

int commfd
 

Definition at line 74 of file term.c.

Referenced by reader(), and shell().

char lockfile[] = "/usr/spool/locks/LK.iii.jjj.kkk"
 

Definition at line 71 of file term.c.

Referenced by lock_device(), and quit().

struct param_s params[]
 

Referenced by cstart(), exec_image(), get_parameters(), init_params(), process_params(), qp_export(), queryparam(), save_parameters(), and set_uart().

struct termios tccomm
 

Definition at line 75 of file term.c.

struct termios tcsavestdin
 

Definition at line 77 of file term.c.

Referenced by quit().

struct termios tcstdin
 

Definition at line 76 of file term.c.

char TERM_LINE[] = "/dev/modem"
 

Definition at line 68 of file term.c.


Generated on Fri Apr 14 23:07:37 2006 for minix by  doxygen 1.4.6