1 /* extensions.h 2 3 Copyright 2009 Taco Hoekwater <taco@luatex.org> 4 5 This file is part of LuaTeX. 6 7 LuaTeX is free software; you can redistribute it and/or modify it under 8 the terms of the GNU General Public License as published by the Free 9 Software Foundation; either version 2 of the License, or (at your 10 option) any later version. 11 12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15 License for more details. 16 17 You should have received a copy of the GNU General Public License along 18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ 19 20 21 #ifndef EXTENSIONS_H 22 # define EXTENSIONS_H 23 24 extern alpha_file write_file[16]; 25 extern halfword write_file_mode[16]; 26 extern halfword write_file_translation[16]; 27 extern boolean write_open[18]; 28 extern scaled neg_wd; 29 extern scaled pos_wd; 30 extern scaled neg_ht; 31 32 extern halfword write_loc; 33 34 extern void do_extension(PDF pdf); 35 36 /* Three extra node types carry information from |main_control|. */ 37 38 /* 39 User defined whatsits can be inserted into node lists to pass data 40 along from one lua call to anotherb without interference from the 41 typesetting engine itself. Each has an id, a type, and a value. The 42 type of the value depends on the |user_node_type| field. 43 */ 44 45 extern void new_whatsit(int s); 46 extern void new_write_whatsit(int w); 47 extern void scan_pdf_ext_toks(void); 48 extern halfword prev_rightmost(halfword s, halfword e); 49 extern int pdf_last_xform; 50 extern int pdf_last_ximage; 51 extern int pdf_last_ximage_pages; 52 extern int pdf_last_ximage_colordepth; 53 extern int pdf_last_annot; 54 extern int pdf_last_link; 55 extern scaledpos pdf_last_pos; 56 extern halfword concat_tokens(halfword q, halfword r); 57 extern int pdf_retval; 58 59 extern halfword make_local_par_node(void); 60 61 62 /* 63 The \.{\\pagediscards} and \.{\\splitdiscards} commands share the 64 command code |un_vbox| with \.{\\unvbox} and \.{\\unvcopy}, they are 65 distinguished by their |chr_code| values |last_box_code| and 66 |vsplit_code|. These |chr_code| values are larger than |box_code| and 67 |copy_code|. 68 */ 69 70 extern boolean *eof_seen; /* has eof been seen? */ 71 extern void print_group(boolean e); 72 extern void group_trace(boolean e); 73 extern save_pointer *grp_stack; /* initial |cur_boundary| */ 74 extern halfword *if_stack; /* initial |cond_ptr| */ 75 extern void group_warning(void); 76 extern void if_warning(void); 77 extern void file_warning(void); 78 79 extern halfword last_line_fill; /* the |par_fill_skip| glue node of the new paragraph */ 80 81 # define get_tex_dimen_register(j) dimen(j) 82 # define get_tex_skip_register(j) skip(j) 83 # define get_tex_count_register(j) count(j) 84 # define get_tex_attribute_register(j) attribute(j) 85 # define get_tex_box_register(j) box(j) 86 87 extern int set_tex_dimen_register(int j, scaled v); 88 extern int set_tex_skip_register(int j, halfword v); 89 extern int set_tex_count_register(int j, scaled v); 90 extern int set_tex_box_register(int j, scaled v); 91 extern int set_tex_attribute_register(int j, scaled v); 92 extern int get_tex_toks_register(int l); 93 extern int set_tex_toks_register(int j, lstring s); 94 extern scaled get_tex_box_width(int j); 95 extern int set_tex_box_width(int j, scaled v); 96 extern scaled get_tex_box_height(int j); 97 extern int set_tex_box_height(int j, scaled v); 98 extern scaled get_tex_box_depth(int j); 99 extern int set_tex_box_depth(int j, scaled v); 100 101 /* Synctex variables */ 102 103 extern int synctexoption; 104 extern int synctexoffset; 105 106 /* Here are extra variables for Web2c. */ 107 108 extern pool_pointer edit_name_start; 109 extern int edit_name_length, edit_line; 110 extern int ipcon; 111 extern boolean stop_at_space; 112 extern int shellenabledp; 113 extern int restrictedshell; 114 extern char *output_comment; 115 extern boolean debug_format_file; 116 117 #endif 118