#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"
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 |
static void cons_write | ( | char * | buf, | |
unsigned | buf_size | |||
) | [static] |
Definition at line 61 of file console.c.
References console_fd, and unix_error().
int rdd_ask | ( | char * | fmt, | |
... | ||||
) |
Definition at line 142 of file console.c.
References rdd_vask().
void rdd_cons_close | ( | void | ) |
void rdd_cons_open | ( | void | ) |
Definition at line 81 of file console.c.
References console_fd, and unix_error().
void rdd_cons_printf | ( | char * | fmt, | |
... | ||||
) |
Definition at line 185 of file console.c.
References rdd_cons_vprintf().
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.
void rdd_quit_if | ( | int | quit_answer, | |
char * | fmt, | |||
... | ||||
) |
Definition at line 154 of file console.c.
References quiet, and rdd_vask().
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().
int console_fd = -1 [static] |