src/commands/simple/pr.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define DEF_LENGTH   66
#define DEF_WIDTH   79
#define NUM_WIDTH   8
#define TAB_WIDTH   8
#define TO_TAB(x)   (( (x) + TAB_WIDTH ) & ~07 )
#define FALSE   0
#define TRUE   1
#define EAT(fp)   while((c=getc(fp))!='\n' && c!=EOF)
#define L_BUF(i, j)   * (char **) (line_buf + (i + j*length)*sizeof(char *))

Typedefs

typedef char BOOL

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (static char *myalloc,(size_t size))
 _PROTOTYPE (char skip_page,(int lines, int width, FILE *filep))
 _PROTOTYPE (void format,(FILE *filep))
 _PROTOTYPE (void print_page,(int pagenr, int maxcol))
 _PROTOTYPE (void out_header,(int page))
 _PROTOTYPE (void print_time,(time_t t))
int main (int argc, argv)
char skip_page (int lines, int width, FILE *filep)
void format (FILE *filep)
void print_page (short pagenr, short maxcol)
void print (FILE *filep)
void out_header (short page)
void print_time (time_t t)

Variables

char * header
BOOL no_header
BOOL number = FALSE
BOOL minix_number = FALSE
BOOL ext_header_set = FALSE
BOOL back_space = TRUE
BOOL dont_fold = FALSE
short columns
short cwidth
short start_page = 1
short width = DEF_WIDTH
short length = DEF_LENGTH
short linenr
char * line_buf
char output [1024]
char * moname []


Define Documentation

#define DEF_LENGTH   66

Definition at line 60 of file pr.c.

#define DEF_WIDTH   79

Definition at line 61 of file pr.c.

#define EAT ( fp   )     while((c=getc(fp))!='\n' && c!=EOF)

Definition at line 74 of file pr.c.

#define FALSE   0

Definition at line 70 of file pr.c.

#define L_BUF ( i,
j   )     * (char **) (line_buf + (i + j*length)*sizeof(char *))

Definition at line 77 of file pr.c.

#define NUM_WIDTH   8

Definition at line 62 of file pr.c.

#define TAB_WIDTH   8

Definition at line 63 of file pr.c.

#define TO_TAB ( x   )     (( (x) + TAB_WIDTH ) & ~07 )

Definition at line 66 of file pr.c.

#define TRUE   1

Definition at line 71 of file pr.c.


Typedef Documentation

typedef char BOOL

Definition at line 68 of file pr.c.


Function Documentation

_PROTOTYPE ( void  print_time,
(time_t t  
)

_PROTOTYPE ( void  out_header,
(int page  
)

_PROTOTYPE ( void  print_page,
(int pagenr, int maxcol  
)

_PROTOTYPE ( void  format,
(FILE *filep)   
)

_PROTOTYPE ( char  skip_page,
(int lines, int width, FILE *filep)   
)

_PROTOTYPE ( static char *  myalloc,
(size_t size)   
)

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

void format ( FILE filep  ) 

Definition at line 263 of file pr.c.

int main ( int argc  ,
argv   
)

Definition at line 105 of file pr.c.

void out_header ( short  page  ) 

Definition at line 469 of file pr.c.

void print ( FILE filep  ) 

Definition at line 380 of file pr.c.

void print_page ( short  pagenr,
short  maxcol 
)

Definition at line 348 of file pr.c.

void print_time ( time_t  t  ) 

Definition at line 490 of file pr.c.

char skip_page ( int  lines,
int  width,
FILE filep 
)

Definition at line 229 of file pr.c.


Variable Documentation

BOOL back_space = TRUE

Definition at line 84 of file pr.c.

short columns

Definition at line 86 of file pr.c.

short cwidth

Definition at line 87 of file pr.c.

BOOL dont_fold = FALSE

Definition at line 85 of file pr.c.

Definition at line 83 of file pr.c.

char* header

Definition at line 79 of file pr.c.

short length = DEF_LENGTH

Definition at line 90 of file pr.c.

char* line_buf

Definition at line 92 of file pr.c.

short linenr

Definition at line 91 of file pr.c.

BOOL minix_number = FALSE

Definition at line 82 of file pr.c.

char* moname[]

Initial value:

 {
          "Jan", "Feb", "Mar", "Apr", "May", "Jun",
          "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}

Definition at line 484 of file pr.c.

Definition at line 80 of file pr.c.

BOOL number = FALSE

Definition at line 81 of file pr.c.

char output[1024]

Definition at line 94 of file pr.c.

short start_page = 1

Definition at line 88 of file pr.c.

short width = DEF_WIDTH

Definition at line 89 of file pr.c.


Generated on Tue Mar 9 04:36:42 2010 for Minix by  doxygen 1.5.8