src/console.c File Reference

#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include "rdd.h"
#include "rdd_internals.h"
#include "error.h"

Include dependency graph for console.c:

Go to the source code of this file.

Defines

#define MAX_LINE   80
#define MAX_WRITEBUF   256

Functions

static void cons_write (char *buf, unsigned buf_size)
int rdd_ask (char *fmt,...)
void rdd_cons_close (void)
void rdd_cons_open (void)
void rdd_cons_printf (char *fmt,...)
void rdd_cons_vprintf (char *fmt, va_list ap)
void rdd_quit_if (int quit_answer, char *fmt,...)
void rdd_set_quiet (int q)
static int rdd_vask (char *fmt, va_list ap)

Variables

static int console_fd = -1
static int quiet = 0


Define Documentation

#define MAX_LINE   80

Definition at line 48 of file console.c.

#define MAX_WRITEBUF   256

Definition at line 47 of file console.c.


Function Documentation

static void cons_write ( char *  buf,
unsigned  buf_size 
) [static]

Definition at line 61 of file console.c.

References console_fd, and unix_error().

Here is the call graph for this function:

int rdd_ask ( char *  fmt,
  ... 
)

Definition at line 142 of file console.c.

References rdd_vask().

Here is the call graph for this function:

void rdd_cons_close ( void   ) 

Definition at line 91 of file console.c.

References console_fd.

void rdd_cons_open ( void   ) 

Definition at line 81 of file console.c.

References console_fd, and unix_error().

Here is the call graph for this function:

void rdd_cons_printf ( char *  fmt,
  ... 
)

Definition at line 185 of file console.c.

References rdd_cons_vprintf().

Here is the call graph for this function:

void rdd_cons_vprintf ( char *  fmt,
va_list  ap 
)

Writes a formatted message to the console if the console is open. Be careful: do not (recursively) invoke any error routines here.

Definition at line 169 of file console.c.

References cons_write(), console_fd, and MAX_WRITEBUF.

Here is the call graph for this function:

void rdd_quit_if ( int  quit_answer,
char *  fmt,
  ... 
)

Definition at line 154 of file console.c.

References quiet, and rdd_vask().

Here is the call graph for this function:

void rdd_set_quiet ( int  q  ) 

Definition at line 54 of file console.c.

References quiet.

static int rdd_vask ( char *  fmt,
va_list  ap 
) [static]

Definition at line 105 of file console.c.

References console_fd, error(), MAX_LINE, rdd_cons_printf(), rdd_cons_vprintf(), RDD_NO, RDD_YES, and unix_error().

Here is the call graph for this function:


Variable Documentation

int console_fd = -1 [static]

Definition at line 50 of file console.c.

int quiet = 0 [static]

Definition at line 51 of file console.c.


Generated on Sun Feb 6 12:36:04 2011 for rdd by  doxygen 1.5.6