w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ps.c File Reference
#include <stdio.h>
#include <ctype.h>
#include <X11/Xos.h>
#include "ps.h"
Include dependency graph for ps.c:

Go to the source code of this file.

Macros

#define SEEK_SET   0
 
#define BUFSIZ   1024
 
#define pserror(str)   fprintf(stderr,str)
 
#define fgets   psfgets
 
#define length(a)   (sizeof(a)-1)
 
#define iscomment(a, b)   (strncmp(a, b, length(b)) == 0)
 
#define DSCcomment(a)   (a[0] == '%' && a[1] == '%')
 

Functions

char * psfgets ()
 
static char * readline ()
 
static char * gettextline ()
 
static char * gettext ()
 
static int blank ()
 
struct documentpsscan (FILE *file)
 
void psfree (struct document *doc)
 
static char * gettextline (char *line)
 
static char * gettext (char *line, char **next_char)
 
static char * readline (char *line, int size, FILE *fp, unsigned long enddoseps, long *position, unsigned int *line_len, unsigned int *line_count, int imported)
 
void pscopy (FILE *from, FILE *to, long begin, long end)
 
char * pscopyuntil (FILE *from, FILE *to, long begin, long end, char *comment)
 
static int blank (char *line)
 
unsigned long reorder_dword (unsigned long val)
 
unsigned short reorder_word (unsigned short val)
 
unsigned long ps_read_doseps (FILE *file, DOSEPS *doseps)
 
char * psfgets (char *s, int n, FILE *stream)
 

Variables

struct documentmedia papersizes []
 
static unsigned long dsc_arch = 0x00000001
 

Macro Definition Documentation

◆ BUFSIZ

#define BUFSIZ   1024

Definition at line 61 of file ps.c.

◆ DSCcomment

#define DSCcomment (   a)    (a[0] == '%' && a[1] == '%')

Definition at line 104 of file ps.c.

◆ fgets

#define fgets   psfgets

Definition at line 92 of file ps.c.

◆ iscomment

#define iscomment (   a,
  b 
)    (strncmp(a, b, length(b)) == 0)

Definition at line 103 of file ps.c.

◆ length

#define length (   a)    (sizeof(a)-1)

Definition at line 102 of file ps.c.

◆ pserror

#define pserror (   str)    fprintf(stderr,str)

Definition at line 68 of file ps.c.

◆ SEEK_SET

#define SEEK_SET   0

Definition at line 58 of file ps.c.

Function Documentation

◆ blank() [1/2]

static int blank ( )
static

Referenced by psscan().

◆ blank() [2/2]

static int blank ( char *  line)
static

Definition at line 1632 of file ps.c.

References cp, and line.

◆ gettext() [1/2]

static char* gettext ( )
static

Referenced by gettextline(), and psscan().

◆ gettext() [2/2]

static char* gettext ( char *  line,
char **  next_char 
)
static

Definition at line 1219 of file ps.c.

References cp, exit(), level, line, malloc, next_char, NULL, pserror, PSLINELENGTH, strcpy(), strlen(), and text.

◆ gettextline() [1/2]

static char* gettextline ( )
static

Referenced by psscan().

◆ gettextline() [2/2]

static char* gettextline ( char *  line)
static

Definition at line 1192 of file ps.c.

References cp, exit(), gettext(), malloc, NULL, pserror, strlen(), and strncpy().

◆ ps_read_doseps()

◆ pscopy()

void pscopy ( FILE from,
FILE to,
long  begin,
long  end 
)

◆ pscopyuntil()

◆ psfgets() [1/2]

char* psfgets ( )

◆ psfgets() [2/2]

char* psfgets ( char *  s,
int  n,
FILE stream 
)

Definition at line 1701 of file ps.c.

References ch, EOF, ferror, fgetc, n, NULL, p, s, and ungetc.

◆ psfree()

void psfree ( struct document doc)

Definition at line 1164 of file ps.c.

References doc, free, and i.

Referenced by add_preview(), and main().

◆ psscan()

◆ readline() [1/2]

static char* readline ( )
static

Referenced by psscan(), and readline().

◆ readline() [2/2]

static char* readline ( char *  line,
int  size,
FILE fp,
unsigned long  enddoseps,
long *  position,
unsigned int line_len,
unsigned int line_count,
int  imported 
)
static

◆ reorder_dword()

unsigned long reorder_dword ( unsigned long  val)

Definition at line 1646 of file ps.c.

References dsc_arch, and val.

Referenced by extract_doseps(), and ps_read_doseps().

◆ reorder_word()

unsigned short reorder_word ( unsigned short  val)

Definition at line 1658 of file ps.c.

References dsc_arch, PS_WORD, and val.

Referenced by ps_read_doseps().

Variable Documentation

◆ dsc_arch

unsigned long dsc_arch = 0x00000001
static

Definition at line 1642 of file ps.c.

Referenced by reorder_dword(), and reorder_word().

◆ papersizes

struct documentmedia papersizes[]
Initial value:
= {
{"Letter", 612, 792},
{"LetterSmall", 612, 792},
{"Tabloid", 792, 1224},
{"Ledger", 1224, 792},
{"Legal", 612, 1008},
{"Statement", 396, 612},
{"Executive", 540, 720},
{"A3", 842, 1190},
{"A4", 595, 842},
{"A4Small", 595, 842},
{"A5", 420, 595},
{"B4", 729, 1032},
{"B5", 516, 729},
{"Folio", 612, 936},
{"Quarto", 610, 780},
{"10x14", 720, 1008},
{NULL, 0, 0}
}
#define NULL
Definition: ftobjs.h:61

Definition at line 96 of file ps.c.

Referenced by psscan().