ARB
Macros | Enumerations | Functions | Variables
arb_a2ps.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <strings.h>
#include <sys/time.h>
Include dependency graph for arb_a2ps.c:

Go to the source code of this file.

Macros

#define BSD   1
 
#define FALSE   0
 
#define TRUE   1
 
#define NULp   0
 
#define NUL   '\0'
 
#define EXIT_SUCCESS   0
 
#define EXIT_FAILURE   1
 
#define VERSION   "4.3"
 
#define LPR_PRINT   1
 
#define WIDTH   8.27
 
#define HEIGHT   11.0
 
#define MARGIN   .5
 
#define DIR_SEP   '/'
 
#define LPR_COMMAND   "lpr"
 
#define LPR_OPT   "-l"
 
#define PORTRAIT_HEADER   0.29
 
#define LANDSCAPE_HEADER   0.22
 
#define PIXELS_INCH   72
 
#define MAXFILENAME   32
 
#define MAX_LINES   320
 
#define MAN_LINES   66
 
#define IS_ROMAN   0
 
#define IS_BOLD   1
 
#define MAX_HOSTNAME   40
 
#define BUFFER_SIZE   512
 

Enumerations

enum  WEIGHT { BOLD, NORMAL }
 

Functions

static void print_page_prologue (int side)
 
static void print_standard_prologue (char *datestring)
 
static void startpage ()
 
static void endpage ()
 
chargetlogin ()
 
int gethostname (char *name, int namelen)
 
static void usage (int failure)
 
static void set_global_option (char *arg)
 
static void set_positional_option (char *arg)
 
static int mygetc (int *statusp)
 
static int is_binaryfile (char *name)
 
static void cut_filename (char *old_name, char *new_name)
 
static int printchar (unsigned char c)
 
static void skip_page ()
 
static int fold_line (char *name)
 
static int cut_line ()
 
static void printpage ()
 
static void cleanup ()
 
static void init_file_printing (char *name, char *title)
 
static void print_file (char *name, char *header)
 
static void print_prologue ()
 
int ARB_main (int argc, char *cargv[])
 

Variables

static int numbering = FALSE
 
static int folding = TRUE
 
static int restart = FALSE
 
static int only_printable = FALSE
 
static int interpret = TRUE
 
static int print_binaries = FALSE
 
static int landscape = TRUE
 
static int new_landscape = TRUE
 
static int twinpages = TRUE
 
static int new_twinpages = TRUE
 
static int twinfiles = FALSE
 
static int no_header = FALSE
 
static int no_border = FALSE
 
static int printdate = FALSE
 
static int filename_footer = TRUE
 
static int no_summary = FALSE
 
static WEIGHT fontweight = NORMAL
 
static WEIGHT new_fontweight = NORMAL
 
int login_id = TRUE
 
static int lpr_print = TRUE
 
static int ISOlatin1 = FALSE
 
static int column = 0
 
static int line = 0
 
static int line_number = 0
 
static int pages = 0
 
static int sheets = 0
 
static int old_pages
 
static int old_sheets
 
static int sheetside = 0
 
static int linesperpage
 
static int lines_requested = 0
 
static int new_linesrequest = 0
 
static int columnsperline
 
static int nonprinting_chars
 
static int chars
 
static int copies_number = 1
 
static int column_width = 8
 
static int first_page
 
static int no_files = TRUE
 
static int prefix_width
 
static float fontsize = 0.0
 
static float new_fontsize = 0.0
 
static charcommand
 
static charlpr_opt = NULp
 
static charheader_text = NULp
 
static float header_size
 
static charprologue = NULp
 
static char current_filename [MAXFILENAME+1]
 
static char currentdate [18]
 
static char filedate [18]
 
charlogin = NULp
 
static double page_height = HEIGHT
 
static double page_width = WIDTH
 

Macro Definition Documentation

#define BSD   1

Definition at line 129 of file arb_a2ps.c.

#define FALSE   0
#define TRUE   1
#define NULp   0

Definition at line 148 of file arb_a2ps.c.

Referenced by ARB_main(), cut_filename(), and print_prologue().

#define NUL   '\0'

Definition at line 151 of file arb_a2ps.c.

Referenced by ARB_main(), cut_filename(), set_global_option(), and set_positional_option().

#define EXIT_SUCCESS   0
#define EXIT_FAILURE   1
#define VERSION   "4.3"

Definition at line 164 of file arb_a2ps.c.

Referenced by print_standard_prologue(), and usage().

#define LPR_PRINT   1

Definition at line 165 of file arb_a2ps.c.

#define WIDTH   8.27

Definition at line 171 of file arb_a2ps.c.

Referenced by ARB_main(), and print_prologue().

#define HEIGHT   11.0

Definition at line 175 of file arb_a2ps.c.

Referenced by ARB_main(), and print_prologue().

#define MARGIN   .5

Definition at line 179 of file arb_a2ps.c.

Referenced by ARB_main(), and print_prologue().

#define DIR_SEP   '/'

Definition at line 187 of file arb_a2ps.c.

Referenced by cut_filename().

#define LPR_COMMAND   "lpr"

Definition at line 197 of file arb_a2ps.c.

Referenced by ARB_main().

#define LPR_OPT   "-l"

Definition at line 201 of file arb_a2ps.c.

Referenced by ARB_main(), and usage().

#define PORTRAIT_HEADER   0.29

Definition at line 217 of file arb_a2ps.c.

Referenced by init_file_printing(), and print_page_prologue().

#define LANDSCAPE_HEADER   0.22

Definition at line 218 of file arb_a2ps.c.

Referenced by init_file_printing(), and print_page_prologue().

#define PIXELS_INCH   72

Definition at line 219 of file arb_a2ps.c.

Referenced by ARB_main(), and init_file_printing().

#define MAXFILENAME   32

Definition at line 220 of file arb_a2ps.c.

Referenced by cut_filename().

#define MAX_LINES   320

Definition at line 221 of file arb_a2ps.c.

Referenced by set_positional_option().

#define MAN_LINES   66

Definition at line 222 of file arb_a2ps.c.

Referenced by set_positional_option().

#define IS_ROMAN   0

Definition at line 223 of file arb_a2ps.c.

Referenced by mygetc(), and print_file().

#define IS_BOLD   1

Definition at line 224 of file arb_a2ps.c.

Referenced by mygetc().

#define MAX_HOSTNAME   40

Definition at line 226 of file arb_a2ps.c.

Referenced by print_prologue().

#define BUFFER_SIZE   512

Referenced by mygetc().

Enumeration Type Documentation

enum WEIGHT
Enumerator
BOLD 
NORMAL 

Definition at line 240 of file arb_a2ps.c.

Function Documentation

void print_page_prologue ( int  side)
static

Definition at line 1046 of file arb_a2ps.c.

References fontsize, fontweight, header_size, LANDSCAPE_HEADER, NORMAL, and PORTRAIT_HEADER.

Referenced by print_file(), and skip_page().

void print_standard_prologue ( char datestring)
static

Definition at line 1444 of file arb_a2ps.c.

References VERSION.

Referenced by print_prologue().

void startpage ( )
static

Definition at line 885 of file arb_a2ps.c.

References FALSE.

Referenced by skip_page().

void endpage ( )
static

Definition at line 933 of file arb_a2ps.c.

References printpage().

Referenced by fold_line(), and print_file().

char* getlogin ( )

Referenced by print_prologue().

int gethostname ( char name,
int  namelen 
)

Referenced by arb_gethostname(), and print_prologue().

static void usage ( int  failure)
static

Definition at line 347 of file arb_a2ps.c.

References LPR_OPT, and VERSION.

Referenced by set_global_option(), and set_positional_option().

static void set_global_option ( char arg)
static

Definition at line 402 of file arb_a2ps.c.

References EXIT_FAILURE, EXIT_SUCCESS, FALSE, NUL, TRUE, and usage().

Referenced by ARB_main().

static void set_positional_option ( char arg)
static

Definition at line 555 of file arb_a2ps.c.

References BOLD, EXIT_FAILURE, FALSE, MAN_LINES, MAX_LINES, new_fontsize, new_fontweight, NORMAL, NUL, TRUE, and usage().

Referenced by ARB_main().

static int mygetc ( int statusp)
static

Definition at line 683 of file arb_a2ps.c.

References buffer, BUFFER_SIZE, IS_BOLD, and IS_ROMAN.

Referenced by cut_line(), and print_file().

static int is_binaryfile ( char name)
static

Definition at line 725 of file arb_a2ps.c.

References FALSE, and TRUE.

Referenced by fold_line(), and print_file().

static void cut_filename ( char old_name,
char new_name 
)
static

Definition at line 739 of file arb_a2ps.c.

References DIR_SEP, MAXFILENAME, NUL, and NULp.

Referenced by init_file_printing().

static int printchar ( unsigned char  c)
static

Definition at line 770 of file arb_a2ps.c.

Referenced by print_file().

static void skip_page ( )
static

Definition at line 813 of file arb_a2ps.c.

References FALSE, print_page_prologue(), and startpage().

Referenced by fold_line(), and print_file().

static int fold_line ( char name)
static

Definition at line 826 of file arb_a2ps.c.

References endpage(), FALSE, is_binaryfile(), skip_page(), and TRUE.

Referenced by print_file().

static int cut_line ( )
static

Definition at line 847 of file arb_a2ps.c.

References mygetc(), and status.

Referenced by print_file().

static void printpage ( )
static

Definition at line 863 of file arb_a2ps.c.

References FALSE.

Referenced by cleanup(), and endpage().

static void cleanup ( )
static

Definition at line 916 of file arb_a2ps.c.

References printpage().

Referenced by ARB_main(), getparamlist(), init_file_printing(), and Output::~Output().

static void init_file_printing ( char name,
char title 
)
static
static void print_file ( char name,
char header 
)
static
static void print_prologue ( )
static

Definition at line 1325 of file arb_a2ps.c.

References EXIT_FAILURE, gethostname(), getlogin(), HEIGHT, MARGIN, MAX_HOSTNAME, NULp, print_standard_prologue(), and WIDTH.

Referenced by ARB_main().

int ARB_main ( int  argc,
char cargv[] 
)

Variable Documentation

int numbering = FALSE
static

Definition at line 262 of file arb_a2ps.c.

int folding = TRUE
static

Definition at line 263 of file arb_a2ps.c.

Referenced by ED4_calc_terminal_extentions().

int restart = FALSE
static
int only_printable = FALSE
static

Definition at line 265 of file arb_a2ps.c.

int interpret = TRUE
static

Definition at line 266 of file arb_a2ps.c.

Referenced by NoSuchCommand::call(), and FINAL_TYPE< SEQTYPE >::call().

int print_binaries = FALSE
static

Definition at line 267 of file arb_a2ps.c.

int landscape = TRUE
static
int new_landscape = TRUE
static

Definition at line 269 of file arb_a2ps.c.

Referenced by init_file_printing().

int twinpages = TRUE
static

Definition at line 270 of file arb_a2ps.c.

int new_twinpages = TRUE
static

Definition at line 271 of file arb_a2ps.c.

Referenced by init_file_printing().

int twinfiles = FALSE
static

Definition at line 272 of file arb_a2ps.c.

int no_header = FALSE
static

Definition at line 273 of file arb_a2ps.c.

int no_border = FALSE
static

Definition at line 274 of file arb_a2ps.c.

int printdate = FALSE
static

Definition at line 275 of file arb_a2ps.c.

int filename_footer = TRUE
static

Definition at line 276 of file arb_a2ps.c.

int no_summary = FALSE
static

Definition at line 277 of file arb_a2ps.c.

WEIGHT fontweight = NORMAL
static

Definition at line 278 of file arb_a2ps.c.

Referenced by init_file_printing(), and print_page_prologue().

WEIGHT new_fontweight = NORMAL
static

Definition at line 279 of file arb_a2ps.c.

Referenced by init_file_printing(), and set_positional_option().

int login_id = TRUE

Definition at line 281 of file arb_a2ps.c.

int lpr_print = TRUE
static

Definition at line 284 of file arb_a2ps.c.

int ISOlatin1 = FALSE
static

Definition at line 289 of file arb_a2ps.c.

int column = 0
static
int line = 0
static
int line_number = 0
static

Definition at line 297 of file arb_a2ps.c.

Referenced by MessageAttachable::attached_message().

int pages = 0
static

Definition at line 298 of file arb_a2ps.c.

Referenced by ARB_main(), fit_pages(), get_physical_memory(), and page_size_check_cb().

int sheets = 0
static

Definition at line 299 of file arb_a2ps.c.

Referenced by ARB_main().

int old_pages
static

Definition at line 300 of file arb_a2ps.c.

Referenced by ARB_main().

int old_sheets
static

Definition at line 300 of file arb_a2ps.c.

int sheetside = 0
static

Definition at line 301 of file arb_a2ps.c.

Referenced by ARB_main().

int linesperpage
static

Definition at line 302 of file arb_a2ps.c.

int lines_requested = 0
static

Definition at line 303 of file arb_a2ps.c.

Referenced by init_file_printing().

int new_linesrequest = 0
static

Definition at line 304 of file arb_a2ps.c.

int columnsperline
static

Definition at line 305 of file arb_a2ps.c.

Referenced by print_file().

int nonprinting_chars
static

Definition at line 306 of file arb_a2ps.c.

int chars
static

Definition at line 306 of file arb_a2ps.c.

int copies_number = 1
static

Definition at line 307 of file arb_a2ps.c.

int column_width = 8
static

Definition at line 308 of file arb_a2ps.c.

int first_page
static

Definition at line 314 of file arb_a2ps.c.

int no_files = TRUE
static

Definition at line 315 of file arb_a2ps.c.

int prefix_width
static

Definition at line 316 of file arb_a2ps.c.

float fontsize = 0.0
static
float new_fontsize = 0.0
static

Definition at line 318 of file arb_a2ps.c.

Referenced by init_file_printing(), and set_positional_option().

char* command
static
char* lpr_opt = NULp
static

Definition at line 320 of file arb_a2ps.c.

Referenced by ARB_main().

char* header_text = NULp
static

Definition at line 321 of file arb_a2ps.c.

Referenced by ED4_text_terminal::draw().

float header_size
static

Definition at line 322 of file arb_a2ps.c.

Referenced by init_file_printing(), and print_page_prologue().

char* prologue = NULp
static

Definition at line 323 of file arb_a2ps.c.

char current_filename[MAXFILENAME+1]
static

Definition at line 324 of file arb_a2ps.c.

char currentdate[18]
static

Definition at line 325 of file arb_a2ps.c.

char filedate[18]
static

Definition at line 326 of file arb_a2ps.c.

char* login = NULp

Definition at line 328 of file arb_a2ps.c.

double page_height = HEIGHT
static

Definition at line 335 of file arb_a2ps.c.

Referenced by ARB_main(), and init_file_printing().

double page_width = WIDTH
static

Definition at line 336 of file arb_a2ps.c.

Referenced by ARB_main(), and init_file_printing().