From: maqiyuan Date: Thu, 21 Aug 2014 17:10:07 +0000 (+0800) Subject: removed DOS-related codes. X-Git-Url: http://git.osdn.net/view?p=putex%2Fputex.git;a=commitdiff_plain;h=0e9d404831489e9013ff55565585e1f55359d2f6 removed DOS-related codes. --- diff --git a/src/texsourc/dpx.c b/src/texsourc/dpx.c index 3a866dc..b950946 100644 --- a/src/texsourc/dpx.c +++ b/src/texsourc/dpx.c @@ -15,8 +15,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* Y&Y TeX's DVIPDFMX backend. */ - #define EXTERN extern #include "dpx.h" @@ -42,8 +40,6 @@ void pdf_ship_out (pointer p) { integer page_loc; char j, k; - pool_pointer s; - char old_setting; if (tracing_output > 0) { @@ -82,8 +78,8 @@ void pdf_ship_out (pointer p) } if ((height(p) > max_dimen) || (depth(p) > max_dimen) || - (height(p) + depth(p) + v_offset > max_dimen) || - (width(p) + h_offset > max_dimen)) + (height(p) + depth(p) + v_offset > max_dimen) || + (width(p) + h_offset > max_dimen)) { print_err("Huge page cannot be shipped out"); help2("The page just created is more than 18 feet tall or", @@ -266,7 +262,7 @@ reswitch: pdf_dev_set_string(cur_h, -cur_v, cbuf, 1, char_width(f, char_info(f, c)), font_id[dvi_f], 1); { pdf_rect rect; - pdf_dev_set_rect(&rect, cur_h, -dvi_v, + pdf_dev_set_rect(&rect, cur_h, -cur_v, char_width (f, char_info(f, c)), char_height(f, height_depth(char_info(f, c))), char_depth (f, height_depth(char_info(f, c)))); @@ -307,12 +303,12 @@ reswitch: break; case rule_node: - { - rule_ht = height(p); - rule_dp = depth(p); - rule_wd = width(p); - goto fin_rule; - } + { + rule_ht = height(p); + rule_dp = depth(p); + rule_wd = width(p); + goto fin_rule; + } break; case whatsit_node: @@ -320,102 +316,102 @@ reswitch: break; case glue_node: - { - g = glue_ptr(p); - rule_wd = width(g) - cur_g; - - if (g_sign != normal) { - if (g_sign == stretching) + g = glue_ptr(p); + rule_wd = width(g) - cur_g; + + if (g_sign != normal) { - if (stretch_order(g) == g_order) + if (g_sign == stretching) + { + if (stretch_order(g) == g_order) + { + cur_glue = cur_glue + stretch(g); + vet_glue(glue_set(this_box) * cur_glue); + cur_g = round(glue_temp); + } + } + else if (shrink_order(g) == g_order) { - cur_glue = cur_glue + stretch(g); + cur_glue = cur_glue - shrink(g); vet_glue(glue_set(this_box) * cur_glue); cur_g = round(glue_temp); } } - else if (shrink_order(g) == g_order) - { - cur_glue = cur_glue - shrink(g); - vet_glue(glue_set(this_box) * cur_glue); - cur_g = round(glue_temp); - } - } - - rule_wd = rule_wd + cur_g; - if (subtype(p) >= a_leaders) - { - leader_box = leader_ptr(p); + rule_wd = rule_wd + cur_g; - if (type(leader_box) == rule_node) + if (subtype(p) >= a_leaders) { - rule_ht = height(leader_box); - rule_dp = depth(leader_box); - goto fin_rule; - } + leader_box = leader_ptr(p); - leader_wd = width(leader_box); + if (type(leader_box) == rule_node) + { + rule_ht = height(leader_box); + rule_dp = depth(leader_box); + goto fin_rule; + } - if ((leader_wd > 0) && (rule_wd > 0)) - { - rule_wd = rule_wd + 10; - edge = cur_h + rule_wd; - lx = 0; + leader_wd = width(leader_box); - if (subtype(p) == a_leaders) + if ((leader_wd > 0) && (rule_wd > 0)) { - save_h = cur_h; - cur_h = left_edge + leader_wd * ((cur_h - left_edge) / leader_wd); + rule_wd = rule_wd + 10; + edge = cur_h + rule_wd; + lx = 0; - if (cur_h < save_h) - cur_h = cur_h + leader_wd; - } - else - { - lq = rule_wd / leader_wd; - lr = rule_wd % leader_wd; + if (subtype(p) == a_leaders) + { + save_h = cur_h; + cur_h = left_edge + leader_wd * ((cur_h - left_edge) / leader_wd); - if (subtype(p) == c_leaders) - cur_h = cur_h + (lr / 2); + if (cur_h < save_h) + cur_h = cur_h + leader_wd; + } else { - lx = (2 * lr + lq + 1) / (2 * lq + 2); - cur_h = cur_h + ((lr - (lq - 1)* lx) / 2); + lq = rule_wd / leader_wd; + lr = rule_wd % leader_wd; + + if (subtype(p) == c_leaders) + cur_h = cur_h + (lr / 2); + else + { + lx = (2 * lr + lq + 1) / (2 * lq + 2); + cur_h = cur_h + ((lr - (lq - 1)* lx) / 2); + } } - } - while (cur_h + leader_wd <= edge) - { - cur_v = base_line + shift_amount(leader_box); - pdf_synch_v(); - save_v = dvi_v; - pdf_synch_h(); - save_h = dvi_h; - temp_ptr = leader_box; - outer_doing_leaders = doing_leaders; - doing_leaders = true; - - if (type(leader_box) == vlist_node) - pdf_vlist_out(); - else - pdf_hlist_out(); + while (cur_h + leader_wd <= edge) + { + cur_v = base_line + shift_amount(leader_box); + pdf_synch_v(); + save_v = dvi_v; + pdf_synch_h(); + save_h = dvi_h; + temp_ptr = leader_box; + outer_doing_leaders = doing_leaders; + doing_leaders = true; + + if (type(leader_box) == vlist_node) + pdf_vlist_out(); + else + pdf_hlist_out(); - doing_leaders = outer_doing_leaders; - dvi_v = save_v; - dvi_h = save_h; - cur_v = base_line; - cur_h = save_h + leader_wd + lx; - } + doing_leaders = outer_doing_leaders; + dvi_v = save_v; + dvi_h = save_h; + cur_v = base_line; + cur_h = save_h + leader_wd + lx; + } - cur_h = edge - 10; - goto next_p; + cur_h = edge - 10; + goto next_p; + } } - } - goto move_past; - } + goto move_past; + } break; case kern_node: @@ -424,12 +420,12 @@ reswitch: break; case ligature_node: - { - mem[lig_trick] = mem[lig_char(p)]; - link(lig_trick) = link(p); - p = lig_trick; - goto reswitch; - } + { + mem[lig_trick] = mem[lig_char(p)]; + link(lig_trick) = link(p); + p = lig_trick; + goto reswitch; + } break; default: diff --git a/src/texsourc/local.c b/src/texsourc/local.c index 8da8af4..29116ba 100644 --- a/src/texsourc/local.c +++ b/src/texsourc/local.c @@ -85,28 +85,6 @@ boolean mem_spec_flag = false; boolean format_spec = false; boolean reorder_arg_flag = true; /* put command line flags/arguments first */ -/* Mapping from Windows ANSI to DOS code page 850 96/Jan/20 */ - -unsigned char wintodos[128] = -{ - 0, 0, 0, 159, 0, 0, 0, 0, - 94, 0, 0, 0, 0, 0, 0, 0, - 0, 96, 39, 0, 0, 7, 0, 0, - 126, 0, 0, 0, 0, 0, 0, 0, - 32, 173, 189, 156, 207, 190, 221, 21, - 0, 184, 166, 174, 170, 45, 169, 0, - 248, 241, 253, 252, 0, 230, 20, 250, - 0, 251, 167, 175, 172, 171, 243, 168, - 183, 181, 182, 199, 142, 143, 146, 128, - 212, 144, 210, 211, 222, 214, 215, 216, - 209, 165, 227, 224, 226, 229, 153, 158, - 157, 235, 233, 234, 154, 237, 232, 225, - 133, 160, 131, 198, 132, 134, 145, 135, - 138, 130, 136, 137, 141, 161, 140, 139, - 208, 164, 149, 162, 147, 228, 148, 246, - 155, 151, 163, 150, 129, 236, 231, 152 -}; - void show_usage (void) { printf("\n" @@ -2189,7 +2167,6 @@ void knuthify (void) restrict_to_ascii = false; /* don't complain non ASCII */ allow_patterns = false; /* don't allow pattern redefinition */ show_in_hex = true; /* show character code in hex */ - show_in_dos = false; /* redundant with previous */ show_numeric = false; /* don't show character code decimal */ show_missing = false; /* don't show missing characters */ civilize_flag = false; /* don't reorder date fields */ @@ -2294,9 +2271,6 @@ int analyze_flag (int c, char * optarg) case 'w': show_in_hex = true; break; - case 'j': - show_in_dos = true; - break; case 'n': restrict_to_ascii = true; /* 0 - 127 1994/Jan/21 */ break; @@ -2578,7 +2552,6 @@ int read_command_line (int ac, char **av) int init_commands (int ac, char **av) { - shipout_flag = out_dvi_flag; is_initex = false; allow_patterns = false; reset_exceptions = false; @@ -2589,7 +2562,6 @@ int init_commands (int ac, char **av) verbose_flag = false; restrict_to_ascii = false; show_in_hex = false; /* default is not to show as hex code ^^ 00/Jun/18 */ - show_in_dos = false; /* default is not to translate to DOS 850 */ return_flag = true; // hard wired now trimeof = true; // hard wired now deslash = true; diff --git a/src/texsourc/macros.h b/src/texsourc/macros.h index b10dd3f..35b9d39 100644 --- a/src/texsourc/macros.h +++ b/src/texsourc/macros.h @@ -55,6 +55,14 @@ enum error_message_issued = 2, fatal_error_stop = 3, }; +/* sec 0079 */ +#define help0() tex_help(0) +#define help1(...) tex_help(1, __VA_ARGS__) +#define help2(...) tex_help(2, __VA_ARGS__) +#define help3(...) tex_help(3, __VA_ARGS__) +#define help4(...) tex_help(4, __VA_ARGS__) +#define help5(...) tex_help(5, __VA_ARGS__) +#define help6(...) tex_help(6, __VA_ARGS__) /* sec 0096 */ #define check_interrupt() \ do \ diff --git a/src/texsourc/makefile.txt b/src/texsourc/makefile.txt deleted file mode 100644 index 82b8b63..0000000 --- a/src/texsourc/makefile.txt +++ /dev/null @@ -1,17 +0,0 @@ -Copyright 2007 TeX Users Group. -Copyright 2014 Clerk Ma. -You may freely use, modify and/or distribute this file. - - makefile 9945 1-09-95 8:20a current selected - makefile.ms 9843 1-09-95 7:42a MS LINK - makefile.dbg 10449 1-09-95 8:11a debugging version MS LINK WINICE - makefile.tnt 9262 1-08-95 9:49a 386 | LINK - -Note: WINICE DBG2MAP only works on NT style PE files - -Note: WINICE MSYM needs loads of memory - -Note: MS LINK needs /DEBUG and /DEBUGSTYLE{CV|COFF|BOTH} for debugging info - -Note: Can't run as NT style because if INT 21h calls (_dos_find...) - or maybe other reasons also... (pharlap.h, pldos32.h) diff --git a/src/texsourc/tex0.c b/src/texsourc/tex0.c index 6974cc0..afeb00b 100644 --- a/src/texsourc/tex0.c +++ b/src/texsourc/tex0.c @@ -162,31 +162,10 @@ void print_ (integer s) nl = new_line_char; new_line_char = -1; - - /* translate ansi to dos 850 */ + if (!show_in_hex && s < 256 && s >= 32) { - if (show_in_dos && s > 127) - { - if (wintodos[s - 128] > 0) - { - print_char(wintodos[s - 128]); - } - else - { - j = str_start[s]; - - while (j < str_start[s + 1]) - { - print_char(str_pool[j]); - incr(j); - } - } - } - else - { - print_char(s); /* don't translate to hex */ - } + print_char(s); /* don't translate to hex */ } else { /* not just a character */ diff --git a/src/texsourc/tex4.c b/src/texsourc/tex4.c index 7f9e501..b931fe0 100644 --- a/src/texsourc/tex4.c +++ b/src/texsourc/tex4.c @@ -410,7 +410,7 @@ done: void special_out (pointer p) { char old_setting; - pool_pointer k; + //pool_pointer k; pdf_synch_h();//synch_h(); pdf_synch_h();//synch_v(); @@ -429,7 +429,7 @@ void special_out (pointer p) selector = old_setting; str_room(1); graphics_mode(); - spc_exec_special(str_pool + str_start[str_ptr], cur_length, cur_h * 0.000015202, -cur_v * 0.000015202, 1.0); + spc_exec_special((const char *)str_pool + str_start[str_ptr], cur_length, cur_h * 0.000015202, -cur_v * 0.000015202, 1.0); /* if (cur_length < 256) { diff --git a/src/texsourc/yandytex.c b/src/texsourc/yandytex.c index fefec3e..60dd334 100644 --- a/src/texsourc/yandytex.c +++ b/src/texsourc/yandytex.c @@ -21,8 +21,8 @@ #include "yandytex.h" -#define dump_ext_length 4 -#define edit_value tex_edit_value +#define dump_ext_length 4 +#define edit_value tex_edit_value extern char * replacement[]; int gargc; diff --git a/src/texsourc/yandytex.h b/src/texsourc/yandytex.h index ae073cd..0bc133b 100644 --- a/src/texsourc/yandytex.h +++ b/src/texsourc/yandytex.h @@ -30,10 +30,11 @@ #define block_size 1000 /* block_size for variable length node alloc */ -#define min_quarterword 0 #ifdef INCREASEFONTS + #define min_quarterword 0 #define max_quarterword 65535L #else + #define min_quarterword 0 #define max_quarterword 255 #endif @@ -121,7 +122,6 @@ EXTERN integer max_buf_stack; #define max_trie_op 500 #endif - #define dvi_buf_size 16384 #define hash_extra (255 - font_max) @@ -136,7 +136,7 @@ EXTERN integer max_buf_stack; #ifdef INCREASEFONTS typedef unsigned short quarterword; #else - typedef unsigned char quarterword; + typedef unsigned char quarterword; #endif /* typedef unsigned long halfword; NO NO: since mem_min may be < 0 */ @@ -485,7 +485,6 @@ EXTERN dvi_index half_buf; EXTERN dvi_index dvi_limit; EXTERN dvi_index dvi_ptr; EXTERN integer dvi_offset; -EXTERN integer pdf_offset; EXTERN integer dvi_gone; EXTERN pointer down_ptr, right_ptr; EXTERN scaled dvi_h, dvi_v; @@ -744,7 +743,6 @@ EXTERN int mem_extra_low; EXTERN int new_hyphen_prime; EXTERN int missing_characters; EXTERN boolean show_in_hex; -EXTERN boolean show_in_dos; EXTERN boolean show_fmt_flag; EXTERN boolean show_tfm_flag; EXTERN boolean truncate_long_lines; @@ -784,7 +782,6 @@ extern int current_buf_size; extern const char * banner; extern const char * application; extern const char * yandyversion; -extern unsigned char wintodos[128]; extern char log_line[256]; extern char * dvi_directory; extern char * log_directory; @@ -850,17 +847,7 @@ extern void flush_string (void); extern str_number load_pool_strings (integer spare_size); extern str_number make_string_pool (const char * s); extern void print_plus (int i, const char * s); -#define help0() tex_help(0) -#define help1(...) tex_help(1, __VA_ARGS__) -#define help2(...) tex_help(2, __VA_ARGS__) -#define help3(...) tex_help(3, __VA_ARGS__) -#define help4(...) tex_help(4, __VA_ARGS__) -#define help5(...) tex_help(5, __VA_ARGS__) -#define help6(...) tex_help(6, __VA_ARGS__) -extern char * md5_file_name(const char * file_name); extern void fget (void); extern str_number get_job_name (str_number job); extern void show_font_info (void); - -EXTERN int shipout_flag; -#endif +#endif \ No newline at end of file