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)  

dvigen.c File Reference
#include "ptexlib.h"
Include dependency graph for dvigen.c:

Go to the source code of this file.

Macros

#define mode   cur_list.mode_field
 
#define set_char_0   0 /* typeset character 0 and move right */
 
#define set1   128 /* typeset a character and move right */
 
#define set_rule   132 /* typeset a rule and move right */
 
#define put1   133 /* typeset a character without moving */
 
#define put_rule   137 /* typeset a rule */
 
#define nop   138 /* no operation */
 
#define bop   139 /* beginning of page */
 
#define eop   140 /* ending of page */
 
#define push   141 /* save the current positions */
 
#define pop   142 /* restore previous positions */
 
#define right1   143 /* move right */
 
#define right4   146 /* move right, 4 bytes */
 
#define w0   147 /* move right by |w| */
 
#define w1   148 /* move right and set |w| */
 
#define x0   152 /* move right by |x| */
 
#define x1   153 /* move right and set |x| */
 
#define down1   157 /* move down */
 
#define down4   160 /* move down, 4 bytes */
 
#define y0   161 /* move down by |y| */
 
#define y1   162 /* move down and set |y| */
 
#define z0   166 /* move down by |z| */
 
#define z1   167 /* move down and set |z| */
 
#define fnt_num_0   171 /* set current font to 0 */
 
#define fnt1   235 /* set current font */
 
#define xxx1   239 /* extension to \.{DVI} primitives */
 
#define xxx4   242 /* potentially long extension to \.{DVI} primitives */
 
#define fnt_def1   243 /* define the meaning of a font number */
 
#define pre   247 /* preamble */
 
#define post   248 /* postamble beginning */
 
#define post_post   249 /* postamble ending */
 
#define id_byte   2
 
#define dvi_out(A)
 
#define dvi_set(A, B)
 
#define dvi_put(A)
 
#define none_seen   0 /* no |y_here| or |z_here| nodes have been encountered yet */
 
#define y_seen   6 /* we have seen |y_here| but not |z_here| */
 
#define z_seen   12 /* we have seen |z_here| but not |y_here| */
 
#define synch_h(p)
 
#define synch_v(p)
 
#define synch_dvi_with_pos(p)   do {synch_h(p); synch_v(p); } while (0)
 
#define location(A)   varmem[(A)+1].cint
 

Enumerations

enum  movement_codes {
  y_here = 1 , z_here = 2 , yz_OK = 3 , y_OK = 4 ,
  z_OK = 5 , d_fixed = 6
}
 

Functions

void movement (scaled w, eight_bits o)
 
static void write_dvi (int a, int b)
 
static void dvi_swap (void)
 
static void dvi_four (int x)
 
static void dvi_push (void)
 
static void dvi_pop (int l)
 
static void out_cmd (void)
 
static void dvi_font_def (internal_font_number f)
 
static void prune_movements (int l)
 
void dvi_place_rule (PDF pdf, halfword q, scaledpos size)
 
void dvi_place_glyph (PDF pdf, internal_font_number f, int c, int ex)
 
void dvi_special (PDF pdf, halfword p)
 
void dvi_write_header (PDF pdf)
 
void dvi_begin_page (PDF pdf)
 
void dvi_end_page (PDF pdf)
 
void dvi_open_file (PDF pdf)
 
void dvi_finish_file (PDF pdf, int fatal_error)
 
void dvi_push_list (PDF pdf, scaledpos *saved_pos, int *saved_loc)
 
void dvi_pop_list (PDF pdf, scaledpos *saved_pos, int *saved_loc)
 
void dvi_set_reference_point (PDF pdf, posstructure *refpoint)
 
int dvi_get_status_ptr (PDF pdf)
 
int dvi_get_status_gone (PDF pdf)
 

Variables

static int max_push = 0
 
static int last_bop = -1
 
static int oval
 
static int ocmd
 
pointer g
 
int dvi_buf_size = 800
 
eight_bitsdvi_buf
 
static int half_buf = 0
 
static int dvi_limit = 0
 
static int dvi_ptr = 0
 
static int dvi_offset = 0
 
static int dvi_gone = 0
 
static scaledpos dvi
 
static halfword down_ptr = null
 
static halfword right_ptr = null
 

Macro Definition Documentation

◆ bop

#define bop (   void)    139 /* beginning of page */

Definition at line 466 of file dvigen.c.

◆ down1

#define down1   157 /* move down */

Definition at line 476 of file dvigen.c.

◆ down4

#define down4   160 /* move down, 4 bytes */

Definition at line 477 of file dvigen.c.

◆ dvi_out

#define dvi_out (   A)
Value:
do { \
dvi_buf[dvi_ptr++]=(eight_bits)(A); \
} while (0)
static int dvi_ptr
Definition: dvigen.c:708
static int dvi_limit
Definition: dvigen.c:707
static void dvi_swap(void)
Definition: dvigen.c:848
#define A
Definition: fmt.h:35
uint8_t eight_bits
Definition: ctangleboot.c:165

Definition at line 717 of file dvigen.c.

◆ dvi_put

#define dvi_put (   A)
Value:
do { \
oval=A; ocmd=put1; out_cmd(); \
} while (0)
static int ocmd
Definition: dvigen.c:669
static void out_cmd(void)
Definition: dvigen.c:914
#define put1
Definition: dvigen.c:463

Definition at line 726 of file dvigen.c.

◆ dvi_set

#define dvi_set (   A,
  B 
)
Value:
do { \
oval=A; ocmd=set1; out_cmd(); dvi.h += (B); \
} while (0)
static scaledpos dvi
Definition: dvigen.c:809
#define set1
Definition: dvigen.c:461
#define B(x, y)
int64_t h
Definition: pdftypes.h:91

Definition at line 722 of file dvigen.c.

◆ eop

#define eop   140 /* ending of page */

Definition at line 467 of file dvigen.c.

◆ fnt1

#define fnt1   235 /* set current font */

Definition at line 483 of file dvigen.c.

◆ fnt_def1

#define fnt_def1   243 /* define the meaning of a font number */

Definition at line 486 of file dvigen.c.

◆ fnt_num_0

#define fnt_num_0   171 /* set current font to 0 */

Definition at line 482 of file dvigen.c.

◆ id_byte

#define id_byte   2

Definition at line 524 of file dvigen.c.

◆ location

#define location (   A)    varmem[(A)+1].cint

Definition at line 1032 of file dvigen.c.

◆ mode

#define mode   cur_list.mode_field

Definition at line 30 of file dvigen.c.

◆ none_seen

#define none_seen   0 /* no |y_here| or |z_here| nodes have been encountered yet */

Definition at line 772 of file dvigen.c.

◆ nop

#define nop   138 /* no operation */

Definition at line 465 of file dvigen.c.

◆ pop

#define pop (   void)    142 /* restore previous positions */

Definition at line 469 of file dvigen.c.

◆ post

#define post   248 /* postamble beginning */

Definition at line 488 of file dvigen.c.

◆ post_post

#define post_post   249 /* postamble ending */

Definition at line 489 of file dvigen.c.

◆ pre

#define pre   247 /* preamble */

Definition at line 487 of file dvigen.c.

◆ push

#define push   141 /* save the current positions */

Definition at line 468 of file dvigen.c.

◆ put1

#define put1   133 /* typeset a character without moving */

Definition at line 463 of file dvigen.c.

◆ put_rule

#define put_rule   137 /* typeset a rule */

Definition at line 464 of file dvigen.c.

◆ right1

#define right1   143 /* move right */

Definition at line 470 of file dvigen.c.

◆ right4

#define right4   146 /* move right, 4 bytes */

Definition at line 471 of file dvigen.c.

◆ set1

#define set1   128 /* typeset a character and move right */

Definition at line 461 of file dvigen.c.

◆ set_char_0

#define set_char_0   0 /* typeset character 0 and move right */

Definition at line 460 of file dvigen.c.

◆ set_rule

#define set_rule   132 /* typeset a rule and move right */

Definition at line 462 of file dvigen.c.

◆ synch_dvi_with_pos

#define synch_dvi_with_pos (   p)    do {synch_h(p); synch_v(p); } while (0)

Definition at line 825 of file dvigen.c.

◆ synch_h

#define synch_h (   p)
Value:
do { \
if (p.h != dvi.h) { \
movement(p.h - dvi.h, right1); \
dvi.h = p.h; \
} \
} while (0)
#define right1
Definition: dvigen.c:470
small capitals from c petite p
Definition: afcover.h:72

Definition at line 811 of file dvigen.c.

◆ synch_v

#define synch_v (   p)
Value:
do { \
if (p.v != dvi.v) { \
movement(dvi.v - p.v, down1); \
dvi.v = p.v; \
} \
} while (0)
#define down1
Definition: dvigen.c:476
int64_t v
Definition: pdftypes.h:92

Definition at line 818 of file dvigen.c.

◆ w0

#define w0   147 /* move right by |w| */

Definition at line 472 of file dvigen.c.

◆ w1

#define w1   148 /* move right and set |w| */

Definition at line 473 of file dvigen.c.

◆ x0

#define x0   152 /* move right by |x| */

Definition at line 474 of file dvigen.c.

◆ x1

#define x1   153 /* move right and set |x| */

Definition at line 475 of file dvigen.c.

◆ xxx1

#define xxx1   239 /* extension to \.{DVI} primitives */

Definition at line 484 of file dvigen.c.

◆ xxx4

#define xxx4   242 /* potentially long extension to \.{DVI} primitives */

Definition at line 485 of file dvigen.c.

◆ y0

#define y0   161 /* move down by |y| */

Definition at line 478 of file dvigen.c.

◆ y1

#define y1   162 /* move down and set |y| */

Definition at line 479 of file dvigen.c.

◆ y_seen

#define y_seen   6 /* we have seen |y_here| but not |z_here| */

Definition at line 773 of file dvigen.c.

◆ z0

#define z0   166 /* move down by |z| */

Definition at line 480 of file dvigen.c.

◆ z1

#define z1   167 /* move down and set |z| */

Definition at line 481 of file dvigen.c.

◆ z_seen

#define z_seen   12 /* we have seen |z_here| but not |y_here| */

Definition at line 774 of file dvigen.c.

Enumeration Type Documentation

◆ movement_codes

Enumerator
y_here 
z_here 
yz_OK 
y_OK 
z_OK 
d_fixed 

Definition at line 757 of file dvigen.c.

Function Documentation

◆ dvi_begin_page()

void dvi_begin_page ( PDF  pdf)

◆ dvi_end_page()

void dvi_end_page ( PDF  pdf)

Definition at line 1415 of file dvigen.c.

References dvi_out, eop, and void.

Referenced by init_dvi_backend_functions().

◆ dvi_finish_file()

◆ dvi_font_def()

◆ dvi_four()

static void dvi_four ( int  x)
static

◆ dvi_get_status_gone()

int dvi_get_status_gone ( PDF  pdf)

Definition at line 1555 of file dvigen.c.

References dvi_gone.

Referenced by get_dvi_gone().

◆ dvi_get_status_ptr()

int dvi_get_status_ptr ( PDF  pdf)

Definition at line 1550 of file dvigen.c.

References dvi_ptr.

Referenced by get_dvi_ptr().

◆ dvi_open_file()

void dvi_open_file ( PDF  pdf)

Definition at line 1430 of file dvigen.c.

References ensure_output_file_open().

Referenced by init_dvi_backend_functions().

◆ dvi_place_glyph()

void dvi_place_glyph ( PDF  pdf,
internal_font_number  f,
int  c,
int  ex 
)

◆ dvi_place_rule()

void dvi_place_rule ( PDF  pdf,
halfword  q,
scaledpos  size 
)

◆ dvi_pop()

static void dvi_pop ( int  l)
static

Definition at line 899 of file dvigen.c.

References decr, dvi_offset, dvi_out, dvi_ptr, cutout::l, and pop.

Referenced by dvi_pop_list().

◆ dvi_pop_list()

void dvi_pop_list ( PDF  pdf,
scaledpos saved_pos,
int saved_loc 
)

Definition at line 1534 of file dvigen.c.

References cur_s, dvi, dvi_pop(), and prune_movements().

Referenced by init_dvi_backend_functions().

◆ dvi_push()

static void dvi_push ( void  )
static

Definition at line 894 of file dvigen.c.

References dvi_out, and push.

Referenced by dvi_push_list().

◆ dvi_push_list()

void dvi_push_list ( PDF  pdf,
scaledpos saved_pos,
int saved_loc 
)

Definition at line 1522 of file dvigen.c.

References cur_s, dvi, dvi_offset, dvi_ptr, dvi_push(), and max_push.

Referenced by init_dvi_backend_functions().

◆ dvi_set_reference_point()

void dvi_set_reference_point ( PDF  pdf,
posstructure refpoint 
)

Definition at line 1543 of file dvigen.c.

References dvi, scaledpos_::h, one_true_inch, posstructure_::pos, and scaledpos_::v.

Referenced by init_dvi_backend_functions().

◆ dvi_special()

◆ dvi_swap()

static void dvi_swap ( void  )
static

Definition at line 848 of file dvigen.c.

References dvi_buf_size, dvi_gone, dvi_limit, dvi_offset, dvi_ptr, half_buf, and write_dvi().

◆ dvi_write_header()

◆ movement()

◆ out_cmd()

static void out_cmd ( void  )
static

Definition at line 914 of file dvigen.c.

References dvi_out, fnt1, fnt_num_0, ocmd, oval, and set1.

Referenced by dvi_font_def(), and dvi_place_glyph().

◆ prune_movements()

static void prune_movements ( int  l)
static

Definition at line 1240 of file dvigen.c.

References down_ptr, flush_node(), cutout::l, location, p, right_ptr, and vlink.

Referenced by dvi_pop_list().

◆ write_dvi()

static void write_dvi ( int  a,
int  b 
)
static

Definition at line 839 of file dvigen.c.

References a, b, dvi_buf, pdf_output_file_::file, k, and static_pdf.

Referenced by dvi_finish_file(), and dvi_swap().

Variable Documentation

◆ down_ptr

halfword down_ptr = null
static

Definition at line 1036 of file dvigen.c.

Referenced by movement(), and prune_movements().

◆ dvi

scaledpos dvi
static

Definition at line 809 of file dvigen.c.

Referenced by dvi_place_rule(), dvi_pop_list(), dvi_push_list(), and dvi_set_reference_point().

◆ dvi_buf

eight_bits* dvi_buf

Definition at line 705 of file dvigen.c.

Referenced by movement(), and write_dvi().

◆ dvi_buf_size

int dvi_buf_size = 800

Definition at line 704 of file dvigen.c.

Referenced by dvi_finish_file(), dvi_swap(), dvi_write_header(), and movement().

◆ dvi_gone

int dvi_gone = 0
static

Definition at line 710 of file dvigen.c.

Referenced by dvi_get_status_gone(), dvi_swap(), and movement().

◆ dvi_limit

int dvi_limit = 0
static

Definition at line 707 of file dvigen.c.

Referenced by dvi_finish_file(), dvi_swap(), and dvi_write_header().

◆ dvi_offset

int dvi_offset = 0
static

Definition at line 709 of file dvigen.c.

Referenced by dvi_begin_page(), dvi_finish_file(), dvi_pop(), dvi_push_list(), dvi_swap(), and movement().

◆ dvi_ptr

int dvi_ptr = 0
static

◆ g

Definition at line 670 of file dvigen.c.

◆ half_buf

int half_buf = 0
static

Definition at line 706 of file dvigen.c.

Referenced by dvi_finish_file(), dvi_swap(), and dvi_write_header().

◆ last_bop

int last_bop = -1
static

Definition at line 668 of file dvigen.c.

Referenced by dvi_begin_page(), and dvi_finish_file().

◆ max_push

int max_push = 0
static

Definition at line 667 of file dvigen.c.

Referenced by dvi_finish_file(), and dvi_push_list().

◆ ocmd

int ocmd
static

Definition at line 669 of file dvigen.c.

Referenced by dvi_font_def(), dvi_place_glyph(), and out_cmd().

◆ oval

◆ right_ptr

halfword right_ptr = null
static

Definition at line 1037 of file dvigen.c.

Referenced by movement(), and prune_movements().