Debian Codegraph @

texk/tex4htk/tex4ht.c

raw
1
2 #line 231 "./tex4ht-c.tex"
3
4 /* tex4ht.c (2023-10-13-15:32), generated from tex4ht-c.tex
5 Copyright 2009-2023 TeX Users Group
6 Copyright 1996-2009 Eitan M. Gurari
7
8 #line 1 "./tex4ht-c.tex"
9
10 %
11 % This work may be distributed and/or modified under the
12 % conditions of the LaTeX Project Public License, either
13 % version 1.3c of this license or (at your option) any
14 % later version. The latest version of this license is in
15 % http://www.latex-project.org/lppl.txt
16 % and version 1.3c or later is part of all distributions
17 % of LaTeX version 2005/12/01 or later.
18 %
19 % This work has the LPPL maintenance status "maintained".
20 %
21 % The Current Maintainer of this work
22 % is the TeX4ht Project <http://tug.org/tex4ht>.
23 %
24 % If you modify this program, changing the
25 % version identification would be appreciated.
26 */
27
28 #line 245 "./tex4ht-c.tex"
29
30 /* Compiler options (uncommented | command line), as comments:
31
32 Classic C (CC) default
33 #define ANSI ansi-c, c++
34 #define DOS_C
35 #define HAVE_STRING_H <string.h>
36 #define HAVE_DIRENT_H <dirent.h>
37 #define HAVE_SYS_NDIR_H <sys/ndir.h>
38 #define HAVE_SYS_DIR_H <sys/dir.h>
39 #define HAVE_NDIR_H <ndir.h>
40 #define HAVE_IO_H <io.h>
41 #define HAVE_UNISTD_H <unistd.h>
42 #define WIN32
43 #define KPATHSEA
44 #define CDECL .......
45 #define BCC32 bordland c++
46
47 *************************************************
48 Tex4ht variables *
49 (uncommented | command line) *
50 ----------------------------------------------- */
51
52 #line 8848 "./tex4ht-c.tex"
53
54 #ifndef LGFNT
55 #define LGFNT "Font(\"%s\",\"%s\",\"%d\",\"%d\")\n"
56 #endif
57
58
59 #line 10845 "./tex4ht-c.tex"
60
61 #ifndef LGCLS
62 #define LGCLS "Font_Class(%d,\"%s\"): %s\n"
63 #endif
64
65
66 #line 11069 "./tex4ht-c.tex"
67
68 #ifndef LGPIC
69 #define LGPIC "--- needs --- %%1.idv[%%2] ==> %%3 ---\n%"
70 #endif
71
72
73 #line 11106 "./tex4ht-c.tex"
74
75 #ifndef LGSEP
76 #define LGSEP "--- characters ---\n"
77 #endif
78
79
80 #line 11134 "./tex4ht-c.tex"
81
82 #ifndef LGTYP
83 #define LGTYP ".png"
84 #endif
85
86
87 #line 13174 "./tex4ht-c.tex"
88
89 #ifndef ENVFILE
90
91 #endif
92
93
94 #line 13556 "./tex4ht-c.tex"
95
96 #ifndef TFMDIR
97
98 #endif
99
100
101 #line 13928 "./tex4ht-c.tex"
102
103 #ifndef HTFDIR
104
105 #endif
106
107
108 /* ******************************************** */
109
110
111 #line 294 "./tex4ht-c.tex"
112
113 #ifdef BCC32
114 #define DOS_WIN32
115 #define ANSI
116 #define HAVE_DIRENT_H
117 #define PLATFORM "ms-win32"
118 #endif
119
120
121
122 #line 305 "./tex4ht-c.tex"
123
124 #ifdef BCC
125 #define DOS_C
126 #define ANSI
127 #define HAVE_DIRENT_H
128 #define PLATFORM "ms-dos"
129 #ifndef PATH_MAX
130 #define PATH_MAX 256
131 #endif
132 #endif
133
134
135
136 #line 615 "./tex4ht-c.tex"
137
138 #ifdef __DJGPP__
139 #define DOS_WIN
140 #define ANSI
141 #ifndef HAVE_STRING_H
142 #define HAVE_STRING_H 1
143 #endif
144 #endif
145
146
147 #ifdef DOS_C
148 #define DOS
149 #endif
150 #ifdef DOS
151 #define DOS_WIN32
152 #define HAVE_STRING_H <string.h>
153 #endif
154 #ifdef WIN32
155 #define DOS_WIN32
156 #ifndef KPATHSEA
157 #define HAVE_STRING_H <string.h>
158 #endif
159 #endif
160
161 #line 15689 "./tex4ht-c.tex"
162
163 #ifdef DOS_WIN32
164 #define STRUCT_DIRENT
165 #endif
166
167
168
169 #line 441 "./tex4ht-c.tex"
170
171 #ifdef KPATHSEA
172 #ifdef WIN32
173 #define KWIN32
174 #endif
175 #endif
176
177
178
179 #line 361 "./tex4ht-c.tex"
180
181 #ifdef KPATHSEA
182 #include <kpathsea/config.h>
183 #endif
184 #include <stdio.h>
185 #include <stdlib.h>
186
187
188 #line 375 "./tex4ht-c.tex"
189
190 #ifdef HAVE_STRING_H
191 #include <string.h>
192 #endif
193
194
195 #line 457 "./tex4ht-c.tex"
196
197 #ifdef WIN32
198 #ifdef KPATHSEA
199 #undef CDECL
200 #define CDECL __cdecl
201 #else
202 #include <windows.h>
203 #endif
204 #else
205 #ifdef KPATHSEA
206 #define CDECL
207 #endif
208 #endif
209
210
211 #line 1036 "./tex4ht-c.tex"
212
213 #include <limits.h>
214
215
216 #line 1120 "./tex4ht-c.tex"
217
218 #include <signal.h>
219
220
221 #line 13771 "./tex4ht-c.tex"
222
223 #ifndef F_OK
224 #ifdef DOS_WIN32
225 #define F_OK 0
226 #endif
227 #ifndef KPATHSEA
228 #ifndef DOS_WIN32
229 #define HAVE_UNISTD_H
230 #endif
231 #endif
232 #endif
233 #ifdef HAVE_IO_H
234 #include <io.h>
235 #endif
236 #ifndef KPATHSEA
237 #ifdef HAVE_UNISTD_H
238 #include <unistd.h>
239 #endif
240 #endif
241
242
243 #line 14876 "./tex4ht-c.tex"
244
245
246 #line 1231 "./tex4ht-c.tex"
247
248 #ifdef KPATHSEA
249 #include <kpathsea/c-errno.h>
250 #include <kpathsea/c-ctype.h>
251 #include <kpathsea/c-fopen.h>
252 #include <kpathsea/c-pathmx.h>
253 #include <kpathsea/proginit.h>
254 #include <kpathsea/tex-file.h>
255 #include <kpathsea/tex-make.h>
256 #include <kpathsea/variable.h>
257 #include <signal.h>
258 #if !defined(_AMIGA) && !defined(WIN32)
259 #include <sys/time.h>
260 #endif
261 #include <fcntl.h>
262 #include <setjmp.h>
263 #endif
264
265
266
267
268 #line 15627 "./tex4ht-c.tex"
269
270 #ifdef DOS_WIN32
271 #include <io.h>
272 #endif
273
274
275 #line 15678 "./tex4ht-c.tex"
276
277 #include <sys/stat.h>
278
279
280
281 #line 15696 "./tex4ht-c.tex"
282
283 #ifdef HAVE_DIRENT_H
284
285 #line 15711 "./tex4ht-c.tex"
286
287 #include <dirent.h>
288
289
290 #else
291 #ifndef STRUCT_DIRENT
292 #define STRUCT_DIRECT
293 #endif
294
295 #line 15716 "./tex4ht-c.tex"
296
297 #ifdef HAVE_SYS_NDIR_H
298 #include <sys/ndir.h>
299 #endif
300 #ifdef HAVE_SYS_DIR_H
301 #include <sys/dir.h>
302 #endif
303 #ifdef HAVE_NDIR_H
304 #include <ndir.h>
305 #endif
306
307
308 #endif
309
310
311
312 #line 10881 "./tex4ht-c.tex"
313
314 #ifdef DOS
315 #define HTM
316 #endif
317
318
319
320
321 #line 17276 "./tex4ht-c.tex"
322
323 #ifdef DOS
324 #define PROTOTYP
325 #endif
326 #ifdef ANSI
327 #define PROTOTYP
328 #endif
329 #ifdef KWIN32
330 #define PROTOTYP
331 #endif
332
333
334
335
336 #line 1308 "./tex4ht-c.tex"
337
338
339 #line 369 "./tex4ht-c.tex"
340
341 #ifndef EXIT_FAILURE
342 #define EXIT_FAILURE 1
343 #endif
344
345
346 #line 1015 "./tex4ht-c.tex"
347
348 #if INT_MAX < 2147483647L
349 #define LONG L
350 #endif
351
352
353 #line 1040 "./tex4ht-c.tex"
354
355 #ifdef LONG
356 #define INTEGER long
357 #else
358 #define INTEGER int
359 #endif
360 #define U_CHAR char
361
362
363 #line 1396 "./tex4ht-c.tex"
364
365 #define m_alloc(typ,n) (typ *) malloc_chk((int) ((n) * sizeof(typ)))
366
367
368 #line 1558 "./tex4ht-c.tex"
369
370 #ifndef PATH_MAX
371 #define PATH_MAX 512
372 #endif
373
374
375 #line 4280 "./tex4ht-c.tex"
376
377 #define IGNORED void
378
379
380 #line 4572 "./tex4ht-c.tex"
381
382 struct files_rec{
383 FILE *file, *prev_file;
384 char* name;
385 struct files_rec *next, *prev;
386 };
387
388
389 #line 4673 "./tex4ht-c.tex"
390
391 struct sys_call_rec{
392 char* filter;
393 struct sys_call_rec *next;
394 };
395
396
397 #line 4854 "./tex4ht-c.tex"
398
399 #define HEIGHT 120
400
401
402 #line 4896 "./tex4ht-c.tex"
403
404 #define NULL_MAP (struct map_line_type*) 0
405
406
407 #line 4956 "./tex4ht-c.tex"
408
409 #define XRESOLUTION MARGINSP
410 #ifdef LONG
411 #define YRESOLUTION 786432L
412 #else
413 #define YRESOLUTION 786432
414 #endif
415
416
417 #line 5088 "./tex4ht-c.tex"
418
419 #define MAX_MAP_LINE 500
420
421
422 #line 6042 "./tex4ht-c.tex"
423
424 #define idv_int(val) int_to_dvi((long int) val,4)
425
426
427 #line 6297 "./tex4ht-c.tex"
428
429 struct halign_rec{
430 char * str;
431 int refs;
432 };
433
434
435 #line 8640 "./tex4ht-c.tex"
436
437 #define design_size_to_pt(n) ((double)n / (double)(1L<<20))
438
439
440 #line 8719 "./tex4ht-c.tex"
441
442 #define new_font font_tbl[font_tbl_size]
443
444
445 #line 9738 "./tex4ht-c.tex"
446
447 #ifdef LONG
448 #define MARGINSP 344061L
449 #else
450 #define MARGINSP 344061
451 #endif
452
453
454 #line 10128 "./tex4ht-c.tex"
455
456 #define HTF_ALIAS 10000000
457
458
459 #line 10631 "./tex4ht-c.tex"
460
461 #ifndef TRUE
462 #define TRUE 1
463 #endif
464 #ifndef FALSE
465 #define FALSE 0
466 #endif
467 #ifndef BOOL
468 #define BOOL int
469 #endif
470
471
472 #line 10873 "./tex4ht-c.tex"
473
474 #define GIF_I "-%x%s"
475 #define GIF_II "-%x-%x%s"
476 #define GIF_VII "%s"
477
478
479 #line 10887 "./tex4ht-c.tex"
480
481 #ifdef HTM
482 #define DOS_GIF_FILE
483 #endif
484
485
486 #line 11314 "./tex4ht-c.tex"
487
488 #define BASE 36
489
490
491 #line 11334 "./tex4ht-c.tex"
492
493 #define store_bit_I(ch,i) ch[(i)/8]|=(1<<((i)%8));
494 #define store_bit_Z(ch,i) ch[(i)/8]&=~(1<<((i)%8))
495 #define add_bit(ch,i,b) ch[(i)/8] |= ((b) << ((i)%8))
496 #define get_bit(ch,i) ((ch[(i)/8] >> ((i)%8)) & 1)
497
498
499 #line 11679 "./tex4ht-c.tex"
500
501 #define gif_open span_open
502 #define gif_alt span_name
503 #define gif_class span_size
504 #define gif_size span_mag
505 #define gif_mag span_ord
506 #define gif_ord span_ch
507 #define gif_end end_span
508
509
510 #line 13418 "./tex4ht-c.tex"
511
512 struct env_c_rec{
513 char *option;
514 struct env_c_rec *next;
515 };
516
517
518 #line 13500 "./tex4ht-c.tex"
519
520 #ifndef MAXFDIRS
521 #define MAXFDIRS 100
522 #endif
523
524
525 #line 15572 "./tex4ht-c.tex"
526
527 #if defined(__DJGPP__)
528 #define dir_path_slash(str) (is_forward_slash(str)? '/' : '\\')
529 #else
530 #define dir_path_slash(str) '/'
531 #endif
532
533
534 #line 15637 "./tex4ht-c.tex"
535
536 #ifndef S_ISDIR
537 #define S_ISDIR(M) (((M) & _S_IFMT)==_S_IFDIR)
538 #endif
539
540 #ifndef _S_IFDIR
541 #define _S_IFDIR S_IFDIR
542 #endif
543
544 #ifndef _S_IFMT
545 #define _S_IFMT S_IFMT
546 #endif
547
548
549 #line 15667 "./tex4ht-c.tex"
550
551 #if defined(DOS_WIN32) || !defined(S_ISLNK)
552 #define LSTAT stat
553 #else
554 #define LSTAT lstat
555 #endif
556 #define STSTAT stat
557
558
559 #line 15887 "./tex4ht-c.tex"
560
561 #define MAX_UNI_CODE 20
562
563
564 #line 16080 "./tex4ht-c.tex"
565
566 #define BASE_A 55
567 #define BASE_a 87
568
569
570 #line 16746 "./tex4ht-c.tex"
571
572 #define get_unt(n) fget_unt(dvi_file,n)
573
574
575 #line 16770 "./tex4ht-c.tex"
576
577 #define get_int(n) fget_int(dvi_file,n)
578
579
580 #line 16836 "./tex4ht-c.tex"
581
582 #define eq_str(x,y) (!strcmp(x,y))
583 #define gt_str(x,y) (strcmp(x,y)>0)
584
585
586 #line 17016 "./tex4ht-c.tex"
587
588 #define bad_arg err_i(0)
589 #define bad_in_file(name) err_i_str(1,name)
590 #define bad_out_file(name) err_i_str(2,name)
591 #define bad_special(name) warn_i_str(3,name)
592 #define bad_mem err_i(4)
593 #define bad_char(chr) warn_i_int(5,chr)
594 #define bad_dvi err_i(7)
595
596
597 #line 17240 "./tex4ht-c.tex"
598
599 #if defined(DOS_WIN32) || defined(__MSDOS__)
600 #define READ_BIN_FLAGS "rb"
601 #define READ_TEXT_FLAGS "r"
602 #define WRITE_BIN_FLAGS "wb"
603 #ifdef WIN32
604 #define WRITE_TEXT_FLAGS "wb"
605 #else
606 #define WRITE_TEXT_FLAGS "w"
607 #endif
608 #else
609 #define READ_BIN_FLAGS "r"
610 #define READ_TEXT_FLAGS "r"
611 #define WRITE_BIN_FLAGS "w"
612 #define WRITE_TEXT_FLAGS "w"
613 #endif
614
615
616 #line 17288 "./tex4ht-c.tex"
617
618 #ifdef PROTOTYP
619 #define MYVOID void
620 #define ARG_I(x) x
621 #define ARG_II(x,y) x,y
622 #define ARG_III(x,y,z) x,y,z
623 #define ARG_IV(x,y,z,w) x,y,z,w
624 #define ARG_V(x,y,z,w,v) x,y,z,w,v
625 #define ARG_VI(x,y,z,w,v,u) x,y,z,w,v,u
626 #define ARG_VII(x,y,z,w,v,u,t) x,y,z,w,v,u,t
627 #else
628 #define MYVOID
629 #define ARG_I(x)
630 #define ARG_II(x,y)
631 #define ARG_III(x,y,z)
632 #define ARG_IV(x,y,z,w)
633 #define ARG_V(x,y,z,w,v)
634 #define ARG_VI(x,y,z,w,v,u)
635 #define ARG_VII(x,y,z,w,v,u,t)
636 #endif
637
638
639
640 #line 4216 "./tex4ht-c.tex"
641
642 struct hcode_repl_typ { char *str;
643 struct hcode_repl_typ *next; };
644
645
646 #line 4742 "./tex4ht-c.tex"
647
648 struct count_rec{
649 char* str;
650 int i, depth, max;
651 int* stack;
652 struct count_rec* next;
653 };
654
655
656 #line 4834 "./tex4ht-c.tex"
657
658 struct ch_map_rec{
659 char* line;
660 int max, chars;
661 };
662
663
664 #line 6673 "./tex4ht-c.tex"
665
666 struct stack_entry{
667 long int x_val, y_val;
668 INTEGER dx_1, dx_2, dy_1, dy_2;
669 BOOL text_on;
670 BOOL
671 #line 12468 "./tex4ht-c.tex"
672
673 accented
674
675 ;
676
677 #line 6352 "./tex4ht-c.tex"
678
679 struct halign_rec *halign[8];
680 BOOL halign_on, halign_info, row_no, col_no;
681
682
683 #line 6701 "./tex4ht-c.tex"
684
685 int stack_id;
686 struct group_info * begin;
687 struct stack_end_entry * end;
688
689
690 #line 7793 "./tex4ht-c.tex"
691
692 struct group_path * path_start, * path_end;
693
694
695 #line 12876 "./tex4ht-c.tex"
696
697 char *class_open, *class_close,
698 *temp_class_open, *temp_class_close;
699 BOOL temp_class_del, ignore_subclass_del, active_class_del,
700 no_left_del, sv_no_left_del;
701
702
703 };
704
705
706 #line 6708 "./tex4ht-c.tex"
707
708 struct group_info{
709 int stack_id;
710 U_CHAR *info;
711 struct group_info* next;
712 };
713
714
715 #line 6766 "./tex4ht-c.tex"
716
717 struct stack_end_entry{
718 struct stack_end_entry *next;
719 U_CHAR *send;
720 };
721
722
723 #line 7448 "./tex4ht-c.tex"
724
725 struct del_stack_entry{
726 struct del_stack_entry *next;
727 U_CHAR ch;
728 int fnt, id;
729 };
730
731
732 #line 7534 "./tex4ht-c.tex"
733
734 struct send_back_entry{
735 struct send_back_entry *next;
736 U_CHAR *send;
737 int id;
738 };
739
740
741 #line 7798 "./tex4ht-c.tex"
742
743 struct group_path{
744 U_CHAR action;
745 U_CHAR *path;
746 U_CHAR *info;
747 struct group_path * next;
748 };
749
750
751 #line 8624 "./tex4ht-c.tex"
752
753 struct font_entry {
754 INTEGER num;
755 INTEGER scale;
756 INTEGER design_sz;
757
758 #line 8776 "./tex4ht-c.tex"
759
760 INTEGER mag;
761
762
763
764 #line 8780 "./tex4ht-c.tex"
765
766 char *family_name, *font_size;
767
768
769
770 #line 9450 "./tex4ht-c.tex"
771
772 INTEGER design_pt;
773 int char_f, char_l;
774 U_CHAR *char_wi;
775 U_CHAR *char_hidp;
776 int wtbl_n;
777 int htbl_n;
778 int dtbl_n;
779 INTEGER *wtbl;
780 INTEGER *htbl;
781 INTEGER *dtbl;
782 INTEGER word_sp;
783 INTEGER it;
784 INTEGER ex;
785
786
787
788 #line 9958 "./tex4ht-c.tex"
789
790 char *name, *gif_on, *ch_str, ch255;
791 unsigned U_CHAR **str, *ch, *gif1;
792
793
794 #line 12077 "./tex4ht-c.tex"
795
796 unsigned U_CHAR *accent, *accented;
797 unsigned int *accent_array, *accented_array, accent_N, accented_N;
798
799
800
801 #line 12768 "./tex4ht-c.tex"
802
803 char *math, *math_closing;
804
805
806
807 #line 8945 "./tex4ht-c.tex"
808
809 INTEGER layout_dir;
810 unsigned long rgba_color;
811
812
813 };
814
815
816 #line 10278 "./tex4ht-c.tex"
817
818 struct html_font_rec{ char* name;
819 int i; };
820
821
822 #line 11226 "./tex4ht-c.tex"
823
824
825 struct gif_file_rec{
826 U_CHAR code[4];
827 U_CHAR *name;
828 struct gif_file_rec *next; };
829
830
831
832 #line 11867 "./tex4ht-c.tex"
833
834 struct css_ext_rec{ char* name;
835 struct css_ext_rec *next; };
836
837
838 #line 11977 "./tex4ht-c.tex"
839
840 struct visited_file_rec{ char *name;
841 struct visited_file_rec *next; };
842
843
844 #line 13659 "./tex4ht-c.tex"
845
846 struct env_var_rec{ char* base;
847 struct env_var_rec *next; };
848
849
850 #line 13737 "./tex4ht-c.tex"
851
852 struct cache_font_rec{ char* dir;
853 struct cache_file_rec * cache_file;
854 struct cache_font_rec* next; };
855 struct cache_file_rec{ struct cache_file_rec* next;
856 U_CHAR * file; };
857
858
859 #line 13858 "./tex4ht-c.tex"
860
861 struct htf_com_rec{ char* name;
862 struct htf_com_rec* next; };
863
864
865 #line 16046 "./tex4ht-c.tex"
866
867 struct charset_rec{ int ch;
868 char* str; };
869
870
871 #line 16458 "./tex4ht-c.tex"
872
873 struct htf_4hf_rec { int ch, type1, type2;
874 char* str; };
875
876
877
878 #line 528 "./tex4ht-c.tex"
879
880 #ifdef WIN32
881 static U_CHAR dirname[PATH_MAX];
882 #endif
883
884
885 #line 625 "./tex4ht-c.tex"
886
887 static BOOL dos_file_names =
888 #ifdef DOS_GIF_FILE
889 TRUE
890 #else
891 FALSE
892 #endif
893 ;
894
895
896 #line 1381 "./tex4ht-c.tex"
897
898 static FILE* dot_file;
899
900
901 #line 1572 "./tex4ht-c.tex"
902
903 static FILE* dvi_file;
904
905
906 #line 1629 "./tex4ht-c.tex"
907
908 static U_CHAR *ext = NULL;
909
910
911 #line 1670 "./tex4ht-c.tex"
912
913 static char* job_name;
914 static int job_name_n;
915
916
917 #line 1779 "./tex4ht-c.tex"
918
919 static U_CHAR *no_root_file;
920
921
922 #line 1840 "./tex4ht-c.tex"
923
924 static FILE *out_file = (FILE *) 0,
925 *root_file = (FILE *) 0,
926 *cur_o_file = (FILE *) 0;
927
928
929 #line 2166 "./tex4ht-c.tex"
930
931 static int version_id;
932
933
934 #line 2213 "./tex4ht-c.tex"
935
936 static int stack_len;
937
938
939 #line 2581 "./tex4ht-c.tex"
940
941 static BOOL start_span = FALSE, in_span_ch = FALSE;
942
943
944 #line 2730 "./tex4ht-c.tex"
945
946 static BOOL in_trace_char = FALSE, block_start = FALSE;
947 static int trace_dvi_P = 0, trace_dvi_C = 0,
948 trace_dvi_H = 0, trace_dvi_R = 0, trace_dvi_V = 0;
949 static U_CHAR *trace_dvi_del_P, *end_trace_dvi_del_P,
950 *trace_dvi_del_p, *end_trace_dvi_del_p,
951 *trace_dvi_del_C, *end_trace_dvi_del_C,
952 *trace_dvi_del_c, *end_trace_dvi_del_c,
953 *trace_dvi_del_H, *end_trace_dvi_del_H,
954 *trace_dvi_del_h, *end_trace_dvi_del_h,
955 *trace_dvi_del_R, *end_trace_dvi_del_R,
956 *trace_dvi_del_r, *end_trace_dvi_del_r,
957 *trace_dvi_del_V, *end_trace_dvi_del_V,
958 *trace_dvi_del_v, *end_trace_dvi_del_v;
959 static int push_depth=0, push_id=0, push_st[256];
960
961
962 #line 2963 "./tex4ht-c.tex"
963
964 static long int x_val = 0, max_x_val = -10000,
965 max_y_val = 0, prev_y_val = 0;
966
967
968 #line 3075 "./tex4ht-c.tex"
969
970 static INTEGER dx_1 = 0, dx_2 = 0;
971
972
973 #line 3176 "./tex4ht-c.tex"
974
975 static INTEGER dy_1 = 0, dy_2 = 0;
976 static long int y_val = 0;
977
978
979 #line 3419 "./tex4ht-c.tex"
980
981 static U_CHAR *eoln_str = (char *)0;
982
983
984 #line 3440 "./tex4ht-c.tex"
985
986 static U_CHAR *space_str = (char *)0;
987
988
989 #line 3451 "./tex4ht-c.tex"
990
991 static int ignore_chs=0, ignore_spaces=0, recover_spaces=0;
992
993
994 #line 3604 "./tex4ht-c.tex"
995
996 static BOOL text_on = FALSE;
997
998
999 #line 3677 "./tex4ht-c.tex"
1000
1001 static U_CHAR rule_ch = '_';
1002 static BOOL
1003 #line 3743 "./tex4ht-c.tex"
1004
1005 rule_ch_off
1006
1007 = FALSE;
1008
1009
1010 #line 3823 "./tex4ht-c.tex"
1011
1012 static int cur_fnt = -1;
1013
1014
1015 #line 3941 "./tex4ht-c.tex"
1016
1017 static U_CHAR special_hd[10];
1018
1019
1020 #line 4222 "./tex4ht-c.tex"
1021
1022 static struct hcode_repl_typ *hcode_repl
1023 = (struct hcode_repl_typ*) 0;
1024
1025
1026 #line 4274 "./tex4ht-c.tex"
1027
1028 static BOOL nomargin = FALSE;
1029 static int next_char = -1;
1030 static U_CHAR *next_str = (char *) 0;
1031
1032
1033 #line 4361 "./tex4ht-c.tex"
1034
1035 static BOOL keepChar = FALSE;
1036
1037
1038 #line 4567 "./tex4ht-c.tex"
1039
1040 static struct files_rec
1041 *opened_files = (struct files_rec *) 0, *p;
1042
1043
1044 #line 4681 "./tex4ht-c.tex"
1045
1046 static BOOL system_yes;
1047 static struct sys_call_rec *system_calls = (struct sys_call_rec *) 0;
1048
1049
1050 #line 4751 "./tex4ht-c.tex"
1051
1052 static struct count_rec *counter = (struct count_rec *) 0;
1053
1054
1055 #line 4842 "./tex4ht-c.tex"
1056
1057 static struct ch_map_rec ch_map[HEIGHT];
1058 static int max_map_line, min_map_line;
1059
1060
1061 #line 4888 "./tex4ht-c.tex"
1062
1063 static BOOL ch_map_flag = FALSE;
1064
1065
1066 #line 4943 "./tex4ht-c.tex"
1067
1068 static INTEGER xresolution, yresolution;
1069
1070
1071 #line 5043 "./tex4ht-c.tex"
1072
1073 static U_CHAR ok_map = TRUE;
1074
1075
1076 #line 5082 "./tex4ht-c.tex"
1077
1078 static int prevcol = -1, prevrow;
1079 static double prev_x;
1080
1081
1082 #line 5389 "./tex4ht-c.tex"
1083
1084 static BOOL dvi_flag = FALSE, dvi_page = FALSE;
1085 static FILE *idv_file;
1086
1087
1088 #line 5430 "./tex4ht-c.tex"
1089
1090 static int errCode = 0;
1091
1092
1093 #line 5489 "./tex4ht-c.tex"
1094
1095 static int id_version = -1;
1096
1097
1098 #line 5968 "./tex4ht-c.tex"
1099
1100 static FILE* log_file;
1101
1102
1103 #line 5977 "./tex4ht-c.tex"
1104
1105 static INTEGER mid_page_y, mid_page_x;
1106
1107
1108 #line 6110 "./tex4ht-c.tex"
1109
1110 static int page_n, file_n;
1111
1112
1113 #line 6293 "./tex4ht-c.tex"
1114
1115 static struct halign_rec *halign[8];
1116
1117
1118 #line 6378 "./tex4ht-c.tex"
1119
1120 static BOOL new_halign = FALSE;
1121
1122
1123 #line 6604 "./tex4ht-c.tex"
1124
1125 static BOOL group_dvi = FALSE;
1126
1127
1128 #line 6668 "./tex4ht-c.tex"
1129
1130 static int stack_n = 0;
1131 static struct stack_entry* stack;
1132
1133
1134 #line 6802 "./tex4ht-c.tex"
1135
1136 static int ignore_end_group;
1137
1138
1139 #line 7439 "./tex4ht-c.tex"
1140
1141 static struct del_stack_entry *del_stack;
1142
1143
1144 #line 7464 "./tex4ht-c.tex"
1145
1146 static int ch_id, sv_id, id_latex, back_id_off;
1147
1148
1149 #line 7543 "./tex4ht-c.tex"
1150
1151 static struct send_back_entry *back_token, *back_group;
1152
1153
1154 #line 8446 "./tex4ht-c.tex"
1155
1156 static BOOL pos_dvi = FALSE;
1157 static U_CHAR *pos_body, * pos_text, * pos_line,
1158 *end_pos_body, * end_pos_text;
1159 static double pos_x_A, pos_x_B, pos_y_C, pos_y_D, pos_y_E;
1160 static long int base_pos_x, base_pos_y, min_pos_x,
1161 max_pos_x, min_pos_y, max_pos_y;
1162 static short rect_pos;
1163
1164
1165 #line 8644 "./tex4ht-c.tex"
1166
1167 static struct font_entry* font_tbl;
1168 static int font_tbl_size = 0;
1169
1170
1171 #line 8713 "./tex4ht-c.tex"
1172
1173 static char* new_font_name;
1174
1175
1176 #line 8855 "./tex4ht-c.tex"
1177
1178 static U_CHAR *lg_font_fmt = NULL;
1179
1180
1181 #line 9746 "./tex4ht-c.tex"
1182
1183 static double word_sp = 999999.0, margin_sp;
1184
1185
1186 #line 9980 "./tex4ht-c.tex"
1187
1188 static int ignore_ch = 0;
1189
1190
1191 #line 10024 "./tex4ht-c.tex"
1192
1193 static unsigned U_CHAR null_str = '\0';
1194
1195
1196 #line 10490 "./tex4ht-c.tex"
1197
1198 static short dump_htf_files = 0;
1199 static BOOL dump_env_files = FALSE;
1200
1201
1202 #line 10540 "./tex4ht-c.tex"
1203
1204 static BOOL dumped_env = FALSE;
1205
1206
1207 #line 10697 "./tex4ht-c.tex"
1208
1209 static BOOL verb_ch = FALSE;
1210
1211
1212 #line 10852 "./tex4ht-c.tex"
1213
1214 static U_CHAR *class_fmt = NULL;
1215
1216
1217 #line 11076 "./tex4ht-c.tex"
1218
1219 static U_CHAR *font_gif = NULL;
1220
1221
1222 #line 11113 "./tex4ht-c.tex"
1223
1224 static U_CHAR *begin_char_gif = NULL;
1225
1226
1227 #line 11141 "./tex4ht-c.tex"
1228
1229 static U_CHAR *gif = NULL;
1230
1231
1232 #line 11239 "./tex4ht-c.tex"
1233
1234
1235 static struct gif_file_rec * gif_file = (struct gif_file_rec *) 0;
1236
1237
1238
1239 #line 11318 "./tex4ht-c.tex"
1240
1241
1242 static U_CHAR xeh[]="0123456789abcdefghijklmnopqrstuvxyz";
1243
1244
1245
1246 #line 11390 "./tex4ht-c.tex"
1247
1248 static BOOL gif_ch = TRUE;
1249 static int design_ch = 0;
1250
1251
1252 #line 11440 "./tex4ht-c.tex"
1253
1254 static int pause_style = 0, default_font = -1, base_font_size=6533;
1255 static BOOL
1256 span_name_on = FALSE,
1257 span_on = FALSE;
1258
1259
1260 #line 11642 "./tex4ht-c.tex"
1261
1262 static BOOL not_notify = FALSE;
1263
1264
1265 #line 11658 "./tex4ht-c.tex"
1266
1267 static U_CHAR * span_name[256], * span_open[256], * span_size[256],
1268 * span_mag[256], * span_ch[256], * end_span[256],
1269 * span_ord[256], * gif_id[256];
1270 static U_CHAR class_on[32];
1271
1272
1273 #line 12338 "./tex4ht-c.tex"
1274
1275 static BOOL needs_accent_sym = FALSE, needs_end_accent = FALSE;
1276 static char * t_accent_template = (char *) 0,
1277 * t_accent_first, * t_accent_second,
1278 * t_accent_third, * t_accent_fourth, * t_accent_fifth,
1279 * m_accent_template = (char *) 0,
1280 * m_accent_first, * m_accent_second,
1281 * m_accent_third, * m_accent_fourth, * m_accent_fifth;
1282
1283
1284 #line 12439 "./tex4ht-c.tex"
1285
1286 static BOOL needs_accented_sym = 0;
1287 static char * a_accent_template = (char *) 0,
1288 * a_accent_first, * a_accent_second,
1289 * a_accent_third, * a_accent_fourth, * a_accent_fifth;
1290
1291
1292 #line 12455 "./tex4ht-c.tex"
1293
1294 static char * i_accent_template = (char *) 0,
1295 * i_accent_first, * i_accent_second,
1296 * i_accent_third, * i_accent_fourth, * i_accent_fifth;
1297
1298
1299 #line 12557 "./tex4ht-c.tex"
1300
1301 static BOOL math_class_on = FALSE, show_class = FALSE;
1302 static int open_del = 256, math_class, pause_class, ignore_subclass_del;
1303
1304
1305 #line 12565 "./tex4ht-c.tex"
1306
1307 static int sv_group_dvi, sv_trace_dvi_C, sv_in_trace_char, sv_span_on,
1308 sv_in_span_ch;
1309
1310
1311 #line 12711 "./tex4ht-c.tex"
1312
1313 static U_CHAR *open_class[
1314 #line 12747 "./tex4ht-c.tex"
1315
1316 82
1317
1318 ],
1319 *close_class[
1320 #line 12747 "./tex4ht-c.tex"
1321
1322 82
1323
1324 ];
1325
1326
1327 #line 13062 "./tex4ht-c.tex"
1328
1329 static BOOL dump_env_search = FALSE;
1330
1331
1332 #line 13425 "./tex4ht-c.tex"
1333
1334 static struct env_c_rec *envChoice
1335 = (struct env_c_rec*) 0;
1336
1337
1338 #line 13493 "./tex4ht-c.tex"
1339
1340 static U_CHAR *fontdir[MAXFDIRS];
1341 static int fontdir_count = 0;
1342
1343
1344 #line 13728 "./tex4ht-c.tex"
1345
1346 static struct cache_font_rec *cache_font, *cur_cache_font;
1347
1348
1349 #line 14144 "./tex4ht-c.tex"
1350
1351 #ifndef KPATHSEA
1352 static BOOL tex4ht_fls = FALSE;
1353 static char *tex4ht_fls_name = (char *) 0;
1354 #endif
1355
1356
1357 #line 14207 "./tex4ht-c.tex"
1358
1359 static U_CHAR *HOME_DIR;
1360
1361
1362 #line 14336 "./tex4ht-c.tex"
1363
1364 #ifndef KPATHSEA
1365 static FILE* cache_files;
1366 #endif
1367
1368
1369 #line 14660 "./tex4ht-c.tex"
1370
1371
1372 #ifdef KPATHSEA
1373 static char * export_str_chars = (char *) 0;
1374 #endif
1375
1376
1377 #line 15066 "./tex4ht-c.tex"
1378
1379 static BOOL dump_htf_search = FALSE;
1380
1381
1382 #line 15880 "./tex4ht-c.tex"
1383
1384 static FILE* put_4ht_file = (FILE *) 0;
1385 static int put_4ht_off = 1;
1386 static char uni_code[MAX_UNI_CODE];
1387 static short uni_code_p = 0;
1388
1389
1390 #line 16051 "./tex4ht-c.tex"
1391
1392 static int charset_n = 0, max_charset_n;
1393 static struct charset_rec *charset;
1394
1395
1396 #line 16219 "./tex4ht-c.tex"
1397
1398 static BOOL u10 = FALSE;
1399
1400
1401 #line 16362 "./tex4ht-c.tex"
1402
1403 static BOOL utf8 = FALSE;
1404
1405
1406 #line 16463 "./tex4ht-c.tex"
1407
1408 static int htf_4hf_n = 0, max_htf_4hf_n;
1409 static struct htf_4hf_rec *htf_4hf;
1410
1411
1412 #line 16642 "./tex4ht-c.tex"
1413
1414 static BOOL special_on = FALSE;
1415
1416
1417 #line 16910 "./tex4ht-c.tex"
1418
1419 static const U_CHAR *warn_err_mssg[]={
1420 #line 16851 "./tex4ht-c.tex"
1421
1422
1423 #line 1530 "./tex4ht-c.tex"
1424
1425 "improper command line\ntex4ht [-f<path-separator-ch>]in-file[.dvi]\n"
1426 " [-.<ext>] replacement to default file extension name .dvi\n"
1427 " [-c<tag name>] choose named segment in env file\n"
1428 " [-e<env-file>]\n"
1429 " [-f<path-separator-ch>] remove path from the file name\n"
1430 " [-F<ch-code>] replacement for missing font characters; 0--255; default 0\n"
1431 " [-g<bitmap-file-ext>]\n"
1432 " [-h[efFgsvVA]] trace: e-errors/warnings, f-htf, F-htf search\n"
1433 " g-groups, s-specials, v-env, V-env search, A-all\n"
1434 " [-i<htf-font-dir>]\n"
1435 " [-l<bookkeeping-file>]\n"
1436 " [-P(*|<filter>)] permission for system calls: *-always, filter\n"
1437 " [-S<image-script>]\n"
1438 " [-s<css-file-ext>] default: -s4cs; multiple entries allowed\n"
1439 " [-t<tfm-font-dir>]\n"
1440 " [-u10] base 10 for unicode characters\n"
1441 " [-utf8] utf-8 encoding for unicode characters\n"
1442 " [-v<idv version>] replacement for the given dvi version\n"
1443 " [-xs] ms-dos file names for automatically generated gifs\n"
1444
1445 ,
1446 "Can't find/open file `%s'\n",
1447 "Can't open output file for `%s'\n",
1448 "Can't close file `%s' (file is not open)\n",
1449 "Insufficient memory\n",
1450 "Bad character code: %d\n",
1451 "Can't find font number %d\n",
1452 "Improper dvi file\n",
1453 "Improper op while scanning font defs in postamble\n",
1454 "Problem with command line\n",
1455 "Font definition repeated in postamble\n",
1456 "Empty entry in font environment variable\n",
1457 "Can't access directory `%s\n'",
1458 "Too many directories in font environment variable\n",
1459 "Missing fonts, can't proceed\n",
1460 "Invalid header in file `%s'\n",
1461 "Checksum inconsistent\n",
1462 "MAXFONTS too small: %d\n",
1463 "Improper signature at end of file `%s.htf'\n",
1464 "Improper signature at start of file `%s.htf'\n",
1465 "Improper file `%s.htf'\n",
1466 "Couldn't find font `%s.htf' (char codes: ",
1467 "File `%s.htf' starts/ends with character code %d (instead of %d)\n",
1468 "Implementation problem\n",
1469 "Improper groups in \\special{t4ht+}... idv[%d]\n",
1470 "Too many characters (> %d) for map line: `%c'\n",
1471 "Extra characters in \\special{t4ht%c...",
1472 "Page break within a ch map/picture\n",
1473 "Char code >255 in htf file: %d\n",
1474 "Improper char for code in htf file: %c\n",
1475
1476 #line 1220 "./tex4ht-c.tex"
1477
1478 "Illegal storage address\n",
1479 "Floating-point\n",
1480 "Interrupt with Cntr-C\n",
1481
1482
1483 #ifdef DOS_WIN32
1484 "%c-script too long in tex4ht.env \n",
1485 #else
1486 "%c-script too long in tex4ht.env (.tex4ht)\n",
1487 #endif
1488 "Too many rows (> %d) for map: `%c'\n",
1489 "More than 256 strings in font\n",
1490 "\\special{t4ht;%c...}?\n",
1491 "\\special{t4ht;|%s}?\n",
1492 "\\special{t4ht~!%s}?\n",
1493 "\\special{t4ht\"...%s}?\n",
1494 "System error 40\n",
1495 "`%c' in \\special{t4ht@...} or \\special{t4ht@-...}?\n",
1496 "\\special{t4ht~...} without \\special{t4ht~}\n",
1497 "Ignoring \\special{t4ht.%s}\n",
1498 "PUSH for \\special{t4ht<...%s}?\n",
1499 "Bad character code (%d) in \\special{t4h~}...\n",
1500 "Page break in \\special{t4h~}...\n",
1501 "tex4ht.fls: Couldn't find file `%s'\n",
1502 "Improper entry (line %d)\n",
1503 "Improper environment variable %s: `%s'\n",
1504 "Missing %s\n",
1505 "Can't back from file `%s\n'",
1506 "\\special{t4ht%s}?\n",
1507 "Improper -v option\n",
1508
1509 "" };
1510
1511
1512 #line 17141 "./tex4ht-c.tex"
1513
1514 static BOOL err_context = FALSE;
1515
1516
1517 #line 17158 "./tex4ht-c.tex"
1518
1519 static U_CHAR *err_mark = (char *) 0;
1520
1521
1522 #line 17178 "./tex4ht-c.tex"
1523
1524 static BOOL trace_special = FALSE;
1525
1526
1527
1528 #line 482 "./tex4ht-c.tex"
1529
1530 #ifdef WIN32
1531 static BOOL sigint_handler(ARG_I(DWORD));
1532 #endif
1533
1534
1535 #line 1124 "./tex4ht-c.tex"
1536
1537 static void
1538
1539 #line 507 "./tex4ht-c.tex"
1540
1541 #ifdef CDECL
1542 CDECL
1543 #endif
1544
1545
1546 sig_err(ARG_I(int));
1547
1548
1549 #line 1402 "./tex4ht-c.tex"
1550
1551 static void* malloc_chk(ARG_I(int));
1552
1553
1554 #line 1418 "./tex4ht-c.tex"
1555
1556 static void* r_alloc(ARG_II(void *, size_t));
1557
1558
1559 #line 1681 "./tex4ht-c.tex"
1560
1561 static void strct( ARG_II(char *, const U_CHAR *) );
1562
1563
1564 #line 1720 "./tex4ht-c.tex"
1565
1566 static void open_o_file( ARG_I(void) );
1567
1568
1569 #line 1820 "./tex4ht-c.tex"
1570
1571 static FILE* open_html_file( ARG_I(char*) );
1572
1573
1574 #line 2802 "./tex4ht-c.tex"
1575
1576 static void set_del( ARG_II(char **, U_CHAR **) );
1577
1578
1579 #line 2993 "./tex4ht-c.tex"
1580
1581 static void try_new_line( ARG_I(void) );
1582
1583
1584 #line 3082 "./tex4ht-c.tex"
1585
1586 static INTEGER move_x( ARG_I(register INTEGER) );
1587
1588
1589 #line 3181 "./tex4ht-c.tex"
1590
1591 static INTEGER move_y( ARG_I(register INTEGER) );
1592
1593
1594 #line 3651 "./tex4ht-c.tex"
1595
1596 static void rule_x( ARG_I(BOOL) );
1597
1598
1599 #line 3881 "./tex4ht-c.tex"
1600
1601 static BOOL tex4ht_special( ARG_II( int*, long int*) );
1602
1603
1604 #line 4966 "./tex4ht-c.tex"
1605
1606 static void init_ch_map( ARG_I(void) );
1607
1608
1609 #line 5003 "./tex4ht-c.tex"
1610
1611 static void insert_ch_map( ARG_II(char,BOOL) );
1612
1613
1614 #line 5293 "./tex4ht-c.tex"
1615
1616 static void dump_ch_map( ARG_I(void) );
1617
1618
1619 #line 5787 "./tex4ht-c.tex"
1620
1621 static void set_loc( ARG_II(int, long int) );
1622
1623
1624 #line 6006 "./tex4ht-c.tex"
1625
1626 static void idv_char( ARG_I(int) );
1627
1628
1629 #line 6019 "./tex4ht-c.tex"
1630
1631 static void cond_idv_char( ARG_I(int) );
1632
1633
1634 #line 6034 "./tex4ht-c.tex"
1635
1636 static void idv_copy( ARG_I(void) );
1637
1638
1639 #line 6049 "./tex4ht-c.tex"
1640
1641 static void cond_idv_int( ARG_II(long int, int) );
1642
1643
1644 #line 6063 "./tex4ht-c.tex"
1645
1646 static void int_to_dvi( ARG_II(long int, int) );
1647
1648
1649 #line 6085 "./tex4ht-c.tex"
1650
1651 static void cond_string( ARG_II(int, int) );
1652
1653
1654 #line 6115 "./tex4ht-c.tex"
1655
1656 static INTEGER advance_idv_page( ARG_II( INTEGER,char*) );
1657
1658
1659 #line 6158 "./tex4ht-c.tex"
1660
1661 static void store_mv( ARG_II( int, INTEGER) );
1662
1663
1664 #line 7241 "./tex4ht-c.tex"
1665
1666 static void push_stack( ARG_I(void) );
1667
1668
1669 #line 7288 "./tex4ht-c.tex"
1670
1671 static void pop_stack( ARG_I(void) );
1672
1673
1674 #line 7389 "./tex4ht-c.tex"
1675
1676 static struct del_stack_entry* push_del( ARG_II(char, int) );
1677
1678
1679 #line 7410 "./tex4ht-c.tex"
1680
1681 static struct del_stack_entry* pop_del( ARG_III(char,int,int) );
1682
1683
1684 #line 7622 "./tex4ht-c.tex"
1685
1686 static
1687 struct send_back_entry * rev_list( ARG_I(struct send_back_entry *) );
1688
1689
1690 #line 7676 "./tex4ht-c.tex"
1691
1692 static struct send_back_entry *
1693 back_insert( ARG_II(struct send_back_entry *, int) );
1694
1695
1696 #line 8550 "./tex4ht-c.tex"
1697
1698 static double pos_dbl( ARG_I(long int *) );
1699
1700
1701 #line 9270 "./tex4ht-c.tex"
1702
1703 static void doGlyphArray( ARG_I(BOOL) );
1704
1705
1706 #line 9318 "./tex4ht-c.tex"
1707
1708 static int search_font_tbl( ARG_I(int) );
1709
1710
1711 #line 10419 "./tex4ht-c.tex"
1712
1713 static int get_html_ch( ARG_I(FILE*) );
1714
1715
1716 #line 10440 "./tex4ht-c.tex"
1717
1718 static FILE* f_open( ARG_II(const char*,const char*) );
1719
1720
1721 #line 10464 "./tex4ht-c.tex"
1722
1723 static void dump_htf( ARG_I(FILE*) );
1724
1725
1726 #line 10516 "./tex4ht-c.tex"
1727
1728 static void dump_env( ARG_I(void) );
1729
1730
1731 #line 10549 "./tex4ht-c.tex"
1732
1733 static void htf_to_lg( ARG_IV(struct html_font_rec*,char*,int,FILE*));
1734
1735
1736 #line 10599 "./tex4ht-c.tex"
1737
1738 static INTEGER get_html_file_id( ARG_IV(FILE*, int, int, int) );
1739
1740
1741 #line 10733 "./tex4ht-c.tex"
1742
1743 static void notify_class_info( ARG_I(int) );
1744
1745
1746 #line 10957 "./tex4ht-c.tex"
1747
1748 static void script( ARG_IV(char *, U_CHAR *, int, U_CHAR *) );
1749
1750
1751 #line 11179 "./tex4ht-c.tex"
1752
1753
1754 static void dos_gif_file( ARG_III(char *, int, int) );
1755
1756
1757
1758 #line 11348 "./tex4ht-c.tex"
1759
1760 static void put_alt_ch( ARG_II( int, BOOL) );
1761
1762
1763 #line 12351 "./tex4ht-c.tex"
1764
1765 static void get_open_accent(
1766 ARG_VII(char**, char**, char**, char**, char**, char**, long int*));
1767
1768
1769 #line 12593 "./tex4ht-c.tex"
1770
1771 static int scan_class( ARG_I(int) );
1772
1773
1774 #line 12633 "./tex4ht-c.tex"
1775
1776 static INTEGER set_ch_class( ARG_I(int) );
1777
1778
1779 #line 12688 "./tex4ht-c.tex"
1780
1781 static int math_class_of( ARG_II(int,int) );
1782
1783
1784 #line 13294 "./tex4ht-c.tex"
1785
1786 static char* get_script( ARG_III(char *, const U_CHAR *, int) );
1787
1788
1789 #line 13344 "./tex4ht-c.tex"
1790
1791 static BOOL search_dot_file( ARG_I( int) );
1792
1793
1794 #line 13584 "./tex4ht-c.tex"
1795
1796 static struct env_var_rec * get_env_var( ARG_I(const char *) );
1797
1798
1799 #line 13887 "./tex4ht-c.tex"
1800
1801 static void com_dir( ARG_I(char*) );
1802
1803
1804 #line 14578 "./tex4ht-c.tex"
1805
1806 #ifdef KPATHSEA
1807 static void export_htf( ARG_II(char**, char[]) );
1808 #endif
1809
1810
1811 #line 15308 "./tex4ht-c.tex"
1812
1813 static FILE* search_in_dot_file( ARG_IV( int, const U_CHAR *, const U_CHAR *,
1814 struct env_var_rec *) );
1815
1816
1817 #line 15353 "./tex4ht-c.tex"
1818
1819 static FILE* search_file_base( ARG_IV( const U_CHAR *, const U_CHAR *, const U_CHAR *,
1820 struct env_var_rec *) );
1821
1822
1823 #line 15385 "./tex4ht-c.tex"
1824
1825 static char * abs_addr( ARG_II( const U_CHAR *, const U_CHAR *) );
1826
1827
1828 #line 15426 "./tex4ht-c.tex"
1829
1830 static FILE* search_file( ARG_III(const char *, const U_CHAR *, const U_CHAR *) );
1831
1832
1833 #line 15486 "./tex4ht-c.tex"
1834
1835 static void add_to_cache( ARG_III(const char*,const char*,int) );
1836
1837
1838 #line 15507 "./tex4ht-c.tex"
1839
1840 static FILE* search_file_ext( ARG_III(const char *, const U_CHAR *, const U_CHAR *) );
1841
1842
1843 #line 15582 "./tex4ht-c.tex"
1844
1845 #if defined(__DJGPP__)
1846 static BOOL is_forward_slash( ARG_I(const char*) );
1847 #endif
1848
1849
1850 #line 15806 "./tex4ht-c.tex"
1851
1852 static FILE* f_open_pathed_filename( ARG_II(const char*,const char*) );
1853
1854
1855 #line 15840 "./tex4ht-c.tex"
1856
1857 static INTEGER put_4ht_ch( ARG_II(int,FILE *) );
1858
1859
1860 #line 15914 "./tex4ht-c.tex"
1861
1862 static void flush_uni( ARG_I(void) );
1863
1864
1865 #line 16582 "./tex4ht-c.tex"
1866
1867 static INTEGER insert_ch( ARG_I(int) );
1868
1869
1870 #line 16620 "./tex4ht-c.tex"
1871
1872 static void put_char( ARG_I(int) );
1873
1874
1875 #line 16653 "./tex4ht-c.tex"
1876
1877 static void print_f( ARG_I(const char*) );
1878
1879
1880 #line 16673 "./tex4ht-c.tex"
1881
1882 static void print_f_4ht( ARG_I(const char*) );
1883
1884
1885 #line 16698 "./tex4ht-c.tex"
1886
1887 static int get_char( ARG_I(void) );
1888
1889
1890 #line 16710 "./tex4ht-c.tex"
1891
1892 static int get_noop( ARG_I(void) );
1893
1894
1895 #line 16726 "./tex4ht-c.tex"
1896
1897 static char* get_str( ARG_I(int) );
1898
1899
1900 #line 16750 "./tex4ht-c.tex"
1901
1902 static long fget_unt( ARG_II(FILE*, int) );
1903
1904
1905 #line 16774 "./tex4ht-c.tex"
1906
1907 static long fget_int( ARG_II(FILE *, int) );
1908
1909
1910 #line 16810 "./tex4ht-c.tex"
1911
1912 static long cond_int( ARG_I(register INTEGER) );
1913
1914
1915 #line 16917 "./tex4ht-c.tex"
1916
1917 static void warn_i( ARG_I(int) );
1918
1919
1920 #line 16941 "./tex4ht-c.tex"
1921
1922 static void warn_i_int( ARG_II(int,int) );
1923
1924
1925 #line 16957 "./tex4ht-c.tex"
1926
1927 static void warn_i_int_2( ARG_III(int,int,int) );
1928
1929
1930 #line 16973 "./tex4ht-c.tex"
1931
1932 static void warn_i_str( ARG_II(int,const char *) );
1933
1934
1935 #line 16993 "./tex4ht-c.tex"
1936
1937 static void warn_i_str2( ARG_III(int,const char *,const char *) );
1938
1939
1940 #line 17027 "./tex4ht-c.tex"
1941
1942 static void err_i( ARG_I(int) );
1943
1944
1945 #line 17044 "./tex4ht-c.tex"
1946
1947 static void err_i_int( ARG_II(int,int) );
1948
1949
1950 #line 17060 "./tex4ht-c.tex"
1951
1952 static void err_i_str( ARG_II(int,char *) );
1953
1954
1955 #line 17107 "./tex4ht-c.tex"
1956
1957 static void show_err_context( ARG_I(void) );
1958
1959
1960
1961 #line 488 "./tex4ht-c.tex"
1962
1963 #ifdef WIN32
1964
1965
1966
1967 static BOOL sigint_handler
1968 #ifdef ANSI
1969 #define SEP ,
1970 ( DWORD dwCtrlType
1971 )
1972 #undef SEP
1973 #else
1974 #define SEP ;
1975 (dwCtrlType) DWORD dwCtrlType
1976 ;
1977 #undef SEP
1978 #endif
1979 {
1980
1981 #line 502 "./tex4ht-c.tex"
1982
1983 if( dwCtrlType ){ (IGNORED) printf(" "); }
1984
1985
1986 err_i(32);
1987 return FALSE;
1988 }
1989 #endif
1990
1991
1992 #line 1133 "./tex4ht-c.tex"
1993
1994
1995 static void
1996
1997 #line 507 "./tex4ht-c.tex"
1998
1999 #ifdef CDECL
2000 CDECL
2001 #endif
2002
2003
2004 sig_err
2005 #ifdef ANSI
2006 #define SEP ,
2007 ( int s
2008 )
2009 #undef SEP
2010 #else
2011 #define SEP ;
2012 (s) int s
2013 ;
2014 #undef SEP
2015 #endif
2016 {
2017 (void) signal(s,SIG_IGN);
2018 switch( s ){
2019 #ifdef SIGSEGV
2020 case SIGSEGV: err_i(30);
2021 #endif
2022 case SIGFPE : err_i(31);
2023 #if defined(SIGINT) && !defined(WIN32)
2024 case SIGINT : err_i(32);
2025 #endif
2026 }
2027
2028 #line 750 "./tex4ht-c.tex"
2029
2030 #ifdef __DJGPP__
2031 if (s != SIGINT && s != SIGQUIT)
2032 exit(EXIT_FAILURE);
2033 #endif
2034
2035
2036 }
2037
2038
2039 #line 1406 "./tex4ht-c.tex"
2040
2041
2042 static void* malloc_chk
2043 #ifdef ANSI
2044 #define SEP ,
2045 ( int n
2046 )
2047 #undef SEP
2048 #else
2049 #define SEP ;
2050 ( n ) int n
2051 ;
2052 #undef SEP
2053 #endif
2054 { void* p;
2055 if((p = (void *) malloc( (size_t) n)) == NULL ) bad_mem;
2056 return p;
2057 }
2058
2059
2060 #line 1422 "./tex4ht-c.tex"
2061
2062
2063 static void* r_alloc
2064 #ifdef ANSI
2065 #define SEP ,
2066 (
2067 void *q SEP
2068 size_t n
2069 )
2070 #undef SEP
2071 #else
2072 #define SEP ;
2073 ( q, n )
2074 void *q SEP
2075 size_t n
2076 ;
2077 #undef SEP
2078 #endif
2079 { void* p;
2080 if((p = (void *) realloc( q, (size_t) n)) == NULL) bad_mem;
2081 return p;
2082 }
2083
2084
2085 #line 1685 "./tex4ht-c.tex"
2086
2087
2088 static void strct
2089 #ifdef ANSI
2090 #define SEP ,
2091 (
2092 U_CHAR * str1 SEP
2093 const U_CHAR * str2
2094
2095 )
2096 #undef SEP
2097 #else
2098 #define SEP ;
2099 ( str1, str2 )
2100 U_CHAR * str1 SEP
2101 const U_CHAR * str2
2102
2103 ;
2104 #undef SEP
2105 #endif
2106 { U_CHAR * ch;
2107 ch = str1 + (int) strlen((char *) str1);
2108 (IGNORED) strcpy((char *) ch, str2 );
2109 }
2110
2111
2112 #line 1724 "./tex4ht-c.tex"
2113
2114 static void open_o_file(MYVOID)
2115 {
2116
2117 #line 1735 "./tex4ht-c.tex"
2118
2119 struct files_rec* p;
2120 p = m_alloc(struct files_rec, 1);
2121 if( opened_files != (struct files_rec*) 0 ) opened_files->prev = p;
2122 p->prev = (struct files_rec *) 0;
2123 p->next = opened_files; opened_files = p;
2124 p->name = no_root_file;
2125 p->file =
2126
2127
2128 cur_o_file = root_file = open_html_file(no_root_file);
2129 no_root_file = (char *) 0;
2130 }
2131
2132
2133 #line 1824 "./tex4ht-c.tex"
2134
2135
2136 static FILE* open_html_file
2137 #ifdef ANSI
2138 #define SEP ,
2139 (
2140 char* name
2141 )
2142 #undef SEP
2143 #else
2144 #define SEP ;
2145 (name)
2146 char* name
2147 ;
2148 #undef SEP
2149 #endif
2150 { FILE* file;
2151 char* str;
2152 str = m_alloc(char, (int) strlen((char *) name) + 1);
2153 (IGNORED) strcpy((char *) str, (char *) name);
2154 (IGNORED) printf(" file %s\n", str);
2155 (IGNORED) fprintf(log_file, "File: %s\n", str);
2156 if( (file = fopen(str, WRITE_TEXT_FLAGS)) == NULL ) bad_in_file(str);
2157 free((void *) str);
2158 return file;
2159 }
2160
2161
2162 #line 2806 "./tex4ht-c.tex"
2163
2164
2165 static void set_del
2166 #ifdef ANSI
2167 #define SEP ,
2168 (
2169 U_CHAR ** del SEP
2170 U_CHAR ** end_del
2171 )
2172 #undef SEP
2173 #else
2174 #define SEP ;
2175 ( del, end_del )
2176 U_CHAR ** del SEP
2177 U_CHAR ** end_del
2178 ;
2179 #undef SEP
2180 #endif
2181 {
2182 *del = m_alloc(char, 1); **del = '\0';
2183 *end_del = m_alloc(char, 1); **end_del = '\0';
2184 }
2185
2186
2187 #line 2997 "./tex4ht-c.tex"
2188
2189 static void try_new_line(MYVOID)
2190 { long int v;
2191 double dy;
2192 dy = (cur_fnt == -1)? 0.0 : (
2193 #line 3020 "./tex4ht-c.tex"
2194
2195 (
2196 #line 9909 "./tex4ht-c.tex"
2197
2198 design_size_to_pt( 1.7 * (double) font_tbl[cur_fnt].ex )
2199 * (double) font_tbl[cur_fnt].scale
2200
2201 < 0? -1 : 1)
2202
2203 *
2204 #line 9909 "./tex4ht-c.tex"
2205
2206 design_size_to_pt( 1.7 * (double) font_tbl[cur_fnt].ex )
2207 * (double) font_tbl[cur_fnt].scale
2208
2209 ) ;
2210 v = y_val - prev_y_val;
2211 if( !text_on && (y_val > max_y_val) ){
2212 if( v > dy/2.5 ){
2213
2214 #line 1748 "./tex4ht-c.tex"
2215
2216 if( !no_root_file ){
2217
2218 #line 12285 "./tex4ht-c.tex"
2219
2220 if( needs_end_accent && t_accent_template ){
2221
2222 #line 2613 "./tex4ht-c.tex"
2223
2224 if( span_on && in_span_ch ){
2225 if( *end_span[0] ){
2226 in_span_ch = FALSE;
2227
2228 #line 1715 "./tex4ht-c.tex"
2229
2230 if( no_root_file ){ open_o_file(); }
2231
2232
2233 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
2234 } }
2235
2236
2237 (IGNORED) fprintf(cur_o_file, "%s", t_accent_fifth);
2238 needs_end_accent = FALSE;
2239 #line 12428 "./tex4ht-c.tex"
2240
2241 needs_accented_sym--;
2242
2243
2244 }
2245
2246
2247 if( !
2248 #line 3743 "./tex4ht-c.tex"
2249
2250 rule_ch_off
2251
2252 ){ put_char('\n'); }
2253 }
2254
2255 max_x_val = -10000;
2256 prev_y_val = max_y_val = stack_n? y_val : 0;
2257 }
2258 }else{
2259 if( v > dy ){
2260 #line 1748 "./tex4ht-c.tex"
2261
2262 if( !no_root_file ){
2263
2264 #line 12285 "./tex4ht-c.tex"
2265
2266 if( needs_end_accent && t_accent_template ){
2267
2268 #line 2613 "./tex4ht-c.tex"
2269
2270 if( span_on && in_span_ch ){
2271 if( *end_span[0] ){
2272 in_span_ch = FALSE;
2273
2274 #line 1715 "./tex4ht-c.tex"
2275
2276 if( no_root_file ){ open_o_file(); }
2277
2278
2279 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
2280 } }
2281
2282
2283 (IGNORED) fprintf(cur_o_file, "%s", t_accent_fifth);
2284 needs_end_accent = FALSE;
2285 #line 12428 "./tex4ht-c.tex"
2286
2287 needs_accented_sym--;
2288
2289
2290 }
2291
2292
2293 if( !
2294 #line 3743 "./tex4ht-c.tex"
2295
2296 rule_ch_off
2297
2298 ){ put_char('\n'); }
2299 }
2300
2301 max_x_val = x_val;
2302 prev_y_val = stack_n? y_val : 0;
2303 }else if( v < -(dy / 1.4) ) prev_y_val = stack_n? y_val : 0;
2304 } }
2305
2306
2307 #line 3086 "./tex4ht-c.tex"
2308
2309
2310 static INTEGER move_x
2311 #ifdef ANSI
2312 #define SEP ,
2313 (
2314 register INTEGER d
2315 )
2316 #undef SEP
2317 #else
2318 #define SEP ;
2319 ( d )
2320 register INTEGER d
2321 ;
2322 #undef SEP
2323 #endif
2324 { register long i, dx;
2325 x_val += d;
2326 if( (x_val > max_x_val) && x_val ){
2327 if( max_x_val == -10000) max_x_val = x_val - d;
2328
2329 #line 3241 "./tex4ht-c.tex"
2330
2331 i = (INTEGER) ( (double) (dx = x_val - max_x_val)
2332 / (text_on? word_sp : margin_sp)
2333 + 0.5 );
2334
2335 #line 3256 "./tex4ht-c.tex"
2336
2337 if( i==0 ){
2338 i = (INTEGER) ( (double) dx
2339 / word_sp
2340 + 0.5 );
2341 }
2342
2343
2344 if( i<0 ) i=0;
2345 if( i==0 ){
2346 #line 3461 "./tex4ht-c.tex"
2347
2348 long curr_pos;
2349 BOOL done;
2350 int ch, cr_fnt;
2351 curr_pos = ftell(dvi_file);
2352 done = FALSE;
2353 while( !done ){
2354 ch = get_char();
2355 switch( ch ){
2356
2357
2358
2359 #line 3768 "./tex4ht-c.tex"
2360
2361 case
2362 #line 17469 "./tex4ht-c.tex"
2363
2364 246
2365 : (void) get_char();
2366 case
2367 #line 17466 "./tex4ht-c.tex"
2368
2369 245
2370 : (void) get_char();
2371 case
2372 #line 17463 "./tex4ht-c.tex"
2373
2374 244
2375 : (void) get_char();
2376 case
2377 #line 17460 "./tex4ht-c.tex"
2378
2379 243
2380 : {
2381 for( i=0; i<14; i++ ){ ch = get_char(); }
2382 for( i=ch + get_char(); i>0; i--) (void) get_char();
2383 break;
2384 }
2385
2386
2387 case
2388 #line 17335 "./tex4ht-c.tex"
2389
2390 141
2391 :
2392 case
2393 #line 17338 "./tex4ht-c.tex"
2394
2395 142
2396 : { break; }
2397 default: {
2398 if( (ch <
2399 #line 17426 "./tex4ht-c.tex"
2400
2401 171
2402 ) || (ch >
2403 #line 17432 "./tex4ht-c.tex"
2404
2405 234
2406 ) ){
2407 done = TRUE;
2408 } else {
2409
2410 #line 3486 "./tex4ht-c.tex"
2411
2412 double word_sp;
2413 cr_fnt = ch -
2414 #line 17426 "./tex4ht-c.tex"
2415
2416 171
2417 ;
2418 cr_fnt = search_font_tbl( cr_fnt );
2419 word_sp = design_size_to_pt( font_tbl[cr_fnt].word_sp )
2420 * (double) font_tbl[cr_fnt].scale;
2421 i = (INTEGER) ( (double) dx
2422 / (text_on? word_sp : margin_sp)
2423 + 0.5 );
2424
2425 #line 3256 "./tex4ht-c.tex"
2426
2427 if( i==0 ){
2428 i = (INTEGER) ( (double) dx
2429 / word_sp
2430 + 0.5 );
2431 }
2432
2433
2434 if( i>0 ){ i =1; }
2435
2436
2437 } } } }
2438 (IGNORED) fseek(dvi_file, curr_pos,
2439 #line 2174 "./tex4ht-c.tex"
2440
2441 0
2442 );
2443
2444 }
2445 if( i ){
2446 #line 2826 "./tex4ht-c.tex"
2447
2448 if( trace_dvi_H && !ch_map_flag ){
2449 if( *trace_dvi_del_H != '\0' ){
2450 (IGNORED) fprintf(cur_o_file, "%s%d", trace_dvi_del_H, (int) dx);
2451 }
2452 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_H);
2453 }
2454
2455 }
2456 if( !ignore_spaces ){
2457
2458 #line 12285 "./tex4ht-c.tex"
2459
2460 if( needs_end_accent && t_accent_template ){
2461
2462 #line 2613 "./tex4ht-c.tex"
2463
2464 if( span_on && in_span_ch ){
2465 if( *end_span[0] ){
2466 in_span_ch = FALSE;
2467
2468 #line 1715 "./tex4ht-c.tex"
2469
2470 if( no_root_file ){ open_o_file(); }
2471
2472
2473 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
2474 } }
2475
2476
2477 (IGNORED) fprintf(cur_o_file, "%s", t_accent_fifth);
2478 needs_end_accent = FALSE;
2479 #line 12428 "./tex4ht-c.tex"
2480
2481 needs_accented_sym--;
2482
2483
2484 }
2485
2486
2487 while( i-- ) { text_on=TRUE; put_char(' '); }
2488 } else { recover_spaces = (int) i; }
2489 max_x_val = x_val;
2490
2491
2492 } else if( d && text_on && (x_val != max_x_val) ){
2493
2494 #line 3132 "./tex4ht-c.tex"
2495
2496 if( !ignore_spaces ){
2497 i = (INTEGER) ( (double) (dx = d) / word_sp + 0.5 );
2498 if( i<0 ) i=0;
2499 if( !i ) i = dx>99999L;
2500 if( i ){ put_char(' '); }
2501 }
2502
2503
2504 }
2505 return d;
2506 }
2507
2508
2509 #line 3185 "./tex4ht-c.tex"
2510
2511
2512 static INTEGER move_y
2513 #ifdef ANSI
2514 #define SEP ,
2515 ( register INTEGER d
2516 )
2517 #undef SEP
2518 #else
2519 #define SEP ;
2520 ( d ) register INTEGER d
2521 ;
2522 #undef SEP
2523 #endif
2524 { y_val += d;
2525
2526 #line 2835 "./tex4ht-c.tex"
2527
2528 if( trace_dvi_V && !ch_map_flag ){
2529 if( *trace_dvi_del_V != '\0' ){
2530 (IGNORED) fprintf(cur_o_file, "%s%d", trace_dvi_del_V, d);
2531 }
2532 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_V);
2533 }
2534
2535
2536 return d;
2537 }
2538
2539
2540 #line 3656 "./tex4ht-c.tex"
2541
2542
2543 static void rule_x
2544 #ifdef ANSI
2545 #define SEP ,
2546 (
2547 BOOL tag
2548 )
2549 #undef SEP
2550 #else
2551 #define SEP ;
2552 ( tag )
2553 BOOL tag
2554 ;
2555 #undef SEP
2556 #endif
2557 { long i, right, up;
2558 up = (INTEGER) get_int(4);
2559 right = (INTEGER) get_int(4);
2560 if( ch_map_flag ){
2561 #line 5250 "./tex4ht-c.tex"
2562
2563 long int sv_x_val, sv_y_val, sv_right, sv;
2564 int ch;
2565 sv_x_val = x_val;
2566 sv_y_val = y_val;
2567 sv_right = right;
2568 y_val-=up;
2569 if( right < 0 ){ x_val += right; right = -right; }
2570 if( up < 0 ){ y_val += up; up = -up; }
2571 ch = ( (right > xresolution) && (up > yresolution) ) ?
2572
2573 #line 4865 "./tex4ht-c.tex"
2574
2575 3
2576 : ( ( right > up )?
2577 #line 4859 "./tex4ht-c.tex"
2578
2579 1
2580 :
2581 #line 4862 "./tex4ht-c.tex"
2582
2583 2
2584 );
2585 right += x_val;
2586 up += sv = y_val;
2587 for( ; x_val < right; x_val += xresolution )
2588 for( y_val = sv ; y_val < up; y_val += yresolution )
2589 insert_ch_map((char) ch, FALSE);
2590 x_val = sv_x_val;
2591 y_val = sv_y_val;
2592 if( sv_x_val + sv_right > max_x_val ) max_x_val = sv_x_val + sv_right;
2593 if(
2594 #line 4998 "./tex4ht-c.tex"
2595
2596 tag
2597 ) x_val += sv_right;
2598
2599 }
2600 else if( pos_dvi ){
2601
2602 #line 8355 "./tex4ht-c.tex"
2603
2604 long int d;
2605 if( (up > 0) && (right > 0) ){
2606 if( *pos_line ){
2607 double from_x, from_y;
2608
2609 #line 1715 "./tex4ht-c.tex"
2610
2611 if( no_root_file ){ open_o_file(); }
2612
2613
2614 from_x = pos_x_A * (x_val - base_pos_x) + pos_x_B;
2615 from_y = pos_y_C * (y_val - pos_y_E * up - base_pos_y) + pos_y_D;
2616 switch (rect_pos){
2617 case 1: {
2618 (IGNORED) fprintf(cur_o_file, pos_line,
2619 from_x, from_y,
2620 pos_x_A * right + pos_x_B + from_x,
2621 pos_y_C * up + pos_y_D + from_y );
2622 break; }
2623 case 2: {
2624 (IGNORED) fprintf(cur_o_file, pos_line,
2625 from_x, from_y,
2626 pos_x_A * right + pos_x_B + from_x,
2627 from_y,
2628 pos_y_C * up + pos_y_D );
2629 break; }
2630 default: {
2631 (IGNORED) fprintf(cur_o_file, pos_line,
2632 from_x, from_y,
2633 pos_x_A * right,
2634 pos_y_C * up);
2635 }
2636 }
2637 }
2638 if( x_val < min_pos_x ) min_pos_x = x_val;
2639 if( (d = x_val + right) > max_pos_x ) max_pos_x = d;
2640 if( (d = y_val - up) < min_pos_y ) min_pos_y = d;
2641 if( y_val > max_pos_y ) max_pos_y = y_val;
2642 }
2643
2644
2645 if( tag ) x_val += right;
2646 } else if( (up>0) && (right>0) ) {
2647
2648 #line 3707 "./tex4ht-c.tex"
2649
2650 if( (x_val + right) &&
2651 ( ((x_val + right) > max_x_val)
2652 || ( !text_on && !ignore_chs )
2653 )
2654 ){
2655 if( (max_x_val == -10000) || ((x_val + right) <= max_x_val) )
2656 { max_x_val = x_val; }
2657 i = (INTEGER) ( (double) (x_val + right - max_x_val)
2658 / (text_on? word_sp : margin_sp)
2659 + 0.5 );
2660
2661 #line 3732 "./tex4ht-c.tex"
2662
2663 if( i==0 ){
2664 i = (INTEGER) ( (double) (x_val + right - max_x_val)
2665 / word_sp
2666 + 0.5 );
2667 }
2668
2669
2670 if( i && !text_on ) try_new_line();
2671
2672 #line 2848 "./tex4ht-c.tex"
2673
2674 if( trace_dvi_R && !ch_map_flag ){
2675 if( *trace_dvi_del_R != '\0' ){
2676 (IGNORED) fprintf(cur_o_file, "%s%d %d",
2677 trace_dvi_del_R, (int) x_val, (int) y_val);
2678 }
2679 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_R);
2680 }
2681
2682
2683 while( i-- ) { text_on=TRUE;
2684 if( rule_ch && !
2685 #line 3743 "./tex4ht-c.tex"
2686
2687 rule_ch_off
2688
2689 ){ put_char(rule_ch); }
2690 }
2691
2692 #line 2859 "./tex4ht-c.tex"
2693
2694 if( trace_dvi_R && !ch_map_flag ){
2695 if( *trace_dvi_del_r != '\0' ){
2696 (IGNORED) fprintf(cur_o_file, "%s%d %d",
2697 trace_dvi_del_R, (int) right, (int) up);
2698 }
2699 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_r);
2700 }
2701
2702
2703 max_x_val = x_val + right;
2704 }
2705
2706
2707 if( tag ) x_val += right;
2708 } else {
2709
2710 #line 3750 "./tex4ht-c.tex"
2711
2712
2713 #line 2848 "./tex4ht-c.tex"
2714
2715 if( trace_dvi_R && !ch_map_flag ){
2716 if( *trace_dvi_del_R != '\0' ){
2717 (IGNORED) fprintf(cur_o_file, "%s%d %d",
2718 trace_dvi_del_R, (int) x_val, (int) y_val);
2719 }
2720 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_R);
2721 }
2722
2723
2724
2725 #line 2859 "./tex4ht-c.tex"
2726
2727 if( trace_dvi_R && !ch_map_flag ){
2728 if( *trace_dvi_del_r != '\0' ){
2729 (IGNORED) fprintf(cur_o_file, "%s%d %d",
2730 trace_dvi_del_R, (int) right, (int) up);
2731 }
2732 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_r);
2733 }
2734
2735
2736
2737
2738 if( tag ) x_val += right;
2739 } }
2740
2741
2742 #line 3885 "./tex4ht-c.tex"
2743
2744
2745 static BOOL tex4ht_special
2746 #ifdef ANSI
2747 #define SEP ,
2748 (
2749 int *chr SEP
2750 long int *special_n
2751
2752 )
2753 #undef SEP
2754 #else
2755 #define SEP ;
2756 ( chr, special_n)
2757 int *chr SEP
2758 long int *special_n
2759
2760 ;
2761 #undef SEP
2762 #endif
2763 { BOOL tex4ht;
2764 int i;
2765 long unsigned N;
2766 tex4ht = FALSE;
2767
2768 #line 3934 "./tex4ht-c.tex"
2769
2770 *special_n = (long int) (N = get_unt(*chr -
2771 #line 17450 "./tex4ht-c.tex"
2772
2773 239
2774 + 1));
2775 for(i=4; i--; ){
2776 special_hd[i] = (unsigned char) (N & 0xFF);
2777 N = N >> 8; }
2778
2779
2780 if( *special_n > (long int) 4 ){
2781 for(i=4; i<9; i++) special_hd[i]=get_char();
2782 special_hd[9]='\0';
2783
2784 #line 3922 "./tex4ht-c.tex"
2785
2786 tex4ht = (special_hd[4] == 't') || (special_hd[4] == 'T');
2787 tex4ht = tex4ht && special_hd[5] == '4';
2788 tex4ht = tex4ht && ((special_hd[6] == 'h') || (special_hd[6] == 'H'));
2789 tex4ht = tex4ht && ((special_hd[7] == 't') || (special_hd[7] == 'T'));
2790 if( tex4ht && trace_special ){
2791
2792 #line 17190 "./tex4ht-c.tex"
2793
2794 { long curr_pos;
2795 int n, i;
2796 U_CHAR ch;
2797
2798 curr_pos = ftell(dvi_file);
2799 print_f("\nSPECIAL: "); ch = special_hd[8]; i=60;
2800 for( n=*special_n - 3; n--;){
2801 if( !i ){ (IGNORED) putc( '\n', cur_o_file ); i=70; }
2802 else i--;
2803 (IGNORED) putc(( (ch>31) && (ch<127))? ch : ' ', cur_o_file);
2804 ch = get_char();
2805 }
2806 (IGNORED) putc( '\n', cur_o_file );
2807 (IGNORED) fseek(dvi_file, curr_pos,
2808 #line 2174 "./tex4ht-c.tex"
2809
2810 0
2811 );
2812 }
2813
2814
2815 }
2816
2817
2818 *chr = special_hd[8];
2819 tex4ht = tex4ht && ( (*chr == '=') || (*chr == '<') ||
2820 (*chr == '>') || (*chr == '*') || (*chr == '@') ||
2821 (*chr == ':') || (*chr == '"') || (*chr == '~') ||
2822 (*chr == ';') || (*chr == '.') || (*chr == '^') ||
2823 (*chr == '|') || (*chr == '+') || (*chr == '!') );
2824 *special_n -= 5; }
2825 else{ special_hd[4]='\0'; }
2826 return tex4ht;
2827 }
2828
2829
2830 #line 4970 "./tex4ht-c.tex"
2831
2832 static void init_ch_map(MYVOID)
2833 { int i;
2834 for( i=0; i<HEIGHT; i++ ){
2835 ch_map[i].max = 0; ch_map[i].chars = 0; ch_map[i].line = NULL; }
2836 max_map_line = -1;
2837 min_map_line = HEIGHT;
2838 }
2839
2840
2841 #line 5007 "./tex4ht-c.tex"
2842
2843
2844 static void insert_ch_map
2845 #ifdef ANSI
2846 #define SEP ,
2847 (
2848 U_CHAR ch SEP
2849 BOOL
2850 #line 4998 "./tex4ht-c.tex"
2851
2852 tag
2853
2854
2855 )
2856 #undef SEP
2857 #else
2858 #define SEP ;
2859 ( ch,
2860 #line 4998 "./tex4ht-c.tex"
2861
2862 tag
2863 )
2864 U_CHAR ch SEP
2865 BOOL
2866 #line 4998 "./tex4ht-c.tex"
2867
2868 tag
2869
2870
2871 ;
2872 #undef SEP
2873 #endif
2874 { int row, col;
2875
2876 #line 5049 "./tex4ht-c.tex"
2877
2878 { double x;
2879 row = (int) ( (y_val>0? y_val : 0.0) / (double) yresolution + 0.5);
2880 if( row >= HEIGHT ){
2881 if( ok_map ){ warn_i_int_2( 34, row, ch); ok_map = FALSE; }
2882 return; }
2883 x = (x_val>0? x_val : 0.0 ) / (double) xresolution + 0.75;
2884 col = (int) x;
2885 if( (ch > ' ') && (ch != '-') && (ch != '|') ){
2886 if( row == prevrow ){
2887 if( (col == prevcol + 1) && (x > prev_x + 0.5) )
2888 insert_ch_map(' ', TRUE);
2889 else if( (col > prevcol + 1) && (x < prev_x+0.2)
2890 && ( ch != '&' ))
2891 col = prevcol + 1;
2892 }else prevrow = -1;
2893 prev_x = x
2894 + (
2895 #line 9825 "./tex4ht-c.tex"
2896
2897 design_size_to_pt( *(font_tbl[cur_fnt].wtbl
2898 + (int) (
2899 #line 9832 "./tex4ht-c.tex"
2900
2901 *(font_tbl[cur_fnt].char_wi + (int)
2902 ( (design_ch? design_ch : ch) - font_tbl[cur_fnt].char_f)% 256)
2903
2904 )) )
2905 * (double) font_tbl[cur_fnt].scale
2906
2907 )
2908 / (double) xresolution;
2909 prevcol = col;
2910 }else prevrow = -1;
2911 prevrow = row;
2912 }
2913
2914
2915 if(ch != 10){
2916 if( (ch_map[row].max > MAX_MAP_LINE) || (col > MAX_MAP_LINE) ){
2917 if( ok_map ){ warn_i_int_2( 25, MAX_MAP_LINE, ch);
2918 ok_map = FALSE; }
2919 }else{
2920 if( row < min_map_line ) min_map_line = row;
2921 if( row > max_map_line ) max_map_line = row;
2922 if( ch_map[row].max ){
2923 #line 5126 "./tex4ht-c.tex"
2924
2925 int n;
2926 char* p;
2927 if( ch_map[row].chars > col ){
2928
2929 #line 5177 "./tex4ht-c.tex"
2930
2931 if(
2932 #line 4998 "./tex4ht-c.tex"
2933
2934 tag
2935 ){
2936 if( *(ch_map[row].line + ch_map[row].max - 1)
2937 || (ch_map[row].chars - col == 1) ){
2938 #line 5222 "./tex4ht-c.tex"
2939
2940 ch_map[row].max += 5;
2941 ch_map[row].line = (char *)
2942 r_alloc((void *) ch_map[row].line,
2943 (size_t) ch_map[row].max + 1 );
2944 for( n = 0; n<5; n++ )
2945 *(ch_map[row].line + ch_map[row].max - n) = 0;
2946 ch_map[row].chars += 5;
2947
2948 }
2949 col = (ch_map[row].chars--) - col;
2950 p = ch_map[row].line + ch_map[row].max;
2951 while( col ){ unsigned char temp_ch;
2952 if( ((unsigned char) (*p)) <
2953 #line 4868 "./tex4ht-c.tex"
2954
2955 4
2956 ) col--;
2957 temp_ch = *(--p); *(p+1) = temp_ch; }
2958 } else {
2959 col = ch_map[row].chars - col;
2960 p = ch_map[row].line + ch_map[row].max;
2961 while( col ){
2962 if( ((unsigned char) (*p)) <
2963 #line 4868 "./tex4ht-c.tex"
2964
2965 4
2966 ) col--; p--; }
2967 }
2968 *(++p) = ch;
2969
2970 }
2971 else{
2972 #line 5140 "./tex4ht-c.tex"
2973
2974 n = (col - ch_map[row].chars + 8) / 5 * 5;
2975 ch_map[row].chars += n -
2976 #line 4998 "./tex4ht-c.tex"
2977
2978 tag
2979 ;
2980 ch_map[row].max += n;
2981 ch_map[row].line = (char *)
2982 r_alloc((void *) ch_map[row].line,
2983 (size_t) ch_map[row].max + 1);
2984 while( n-- ) *(ch_map[row].line + ch_map[row].max - n) = 0;
2985 *(ch_map[row].line + ch_map[row].max
2986 - (ch_map[row].chars - col) + !
2987 #line 4998 "./tex4ht-c.tex"
2988
2989 tag
2990 ) = ch;
2991
2992 }
2993
2994 }
2995 else {
2996 #line 5095 "./tex4ht-c.tex"
2997
2998 int n;
2999 char* p;
3000 ch_map[row].chars = (n = (col + 2 + 5) / 5 * 5) -
3001 #line 4998 "./tex4ht-c.tex"
3002
3003 tag
3004 ;
3005 ch_map[row].max = n - 1;
3006 ch_map[row].line = p = m_alloc(char, n);
3007 while( n-- ){ *(p++) = 0; }
3008 *(ch_map[row].line + col) = ch;
3009
3010 }
3011 } } }
3012
3013
3014 #line 5301 "./tex4ht-c.tex"
3015
3016 static void dump_ch_map(MYVOID)
3017 { int n, i, min, k, extra_sp;
3018 U_CHAR *p;
3019
3020
3021 #line 5331 "./tex4ht-c.tex"
3022
3023 { int max;
3024 min = 100; max = 0;
3025 for( i=min_map_line; i<=max_map_line; i++ ){
3026 p = ch_map[i].line;
3027 n = ch_map[i].max; if( max < n ) max = n;
3028 k = 0; while( n-- ){ if(*(p++)) break; k++; }
3029 if( ch_map[i].max && (k < min) ) min = k; }
3030 if( (max < 78) && !nomargin ) min = 0;
3031 }
3032
3033
3034 for( i=min_map_line; i<=max_map_line; i++ ){
3035 if( ( n = ch_map[i].max) > 0 ){
3036 p = ch_map[i].line; k = min; extra_sp = 0;
3037
3038 #line 5344 "./tex4ht-c.tex"
3039
3040 { U_CHAR *s;
3041 s = p + n;
3042 while( n && !(*s) && !(*(s-1)) ){ n--; s--; }
3043 if( n && !(*s) && (((unsigned char) *(s-1)) <
3044 #line 4868 "./tex4ht-c.tex"
3045
3046 4
3047 ) ) n--;
3048 }
3049
3050
3051 while( 1 + n-- ){
3052 if( --k < 0 ){
3053 if( extra_sp && (((unsigned char) *p) <
3054 #line 4868 "./tex4ht-c.tex"
3055
3056 4
3057 )
3058 && (((unsigned char) *(p+1)) <
3059 #line 4868 "./tex4ht-c.tex"
3060
3061 4
3062 ) )
3063 { extra_sp--;
3064 } else { switch( *p ){
3065 #line 5352 "./tex4ht-c.tex"
3066
3067 case 0: { put_char(' '); break; }
3068 case
3069 #line 4859 "./tex4ht-c.tex"
3070
3071 1
3072 : { put_char('-'); break; }
3073 case
3074 #line 4862 "./tex4ht-c.tex"
3075
3076 2
3077 : { put_char('|'); break; }
3078 case
3079 #line 4865 "./tex4ht-c.tex"
3080
3081 3
3082 : { put_char('#'); break; }
3083 case ' ': { extra_sp++; }
3084 default: {
3085 #line 5361 "./tex4ht-c.tex"
3086
3087 BOOL tag;
3088 INTEGER count;
3089 tag = TRUE; count = 0;
3090 do{ if( *p == '<' ) tag = FALSE;
3091 else if( *p == '>' ) tag = TRUE;
3092 else count += tag;
3093 put_char( *p ); n--;
3094 }while( ((unsigned char) *(++p)) >=
3095 #line 4868 "./tex4ht-c.tex"
3096
3097 4
3098 );
3099 if( !count ){ n++; p--; }
3100
3101 break; }
3102
3103 } }
3104 }
3105 p++;
3106 }
3107 free((void *) ch_map[i].line );
3108 }
3109 if( i<max_map_line ) put_char('\n');
3110 }
3111 nomargin = FALSE;
3112 }
3113
3114
3115 #line 5791 "./tex4ht-c.tex"
3116
3117
3118 static void set_loc
3119 #ifdef ANSI
3120 #define SEP ,
3121 (
3122 int op SEP
3123 long int d
3124
3125 )
3126 #undef SEP
3127 #else
3128 #define SEP ;
3129 ( op, d )
3130 int op SEP
3131 long int d
3132
3133 ;
3134 #undef SEP
3135 #endif
3136 {
3137 idv_char( op + 3 ); int_to_dvi( d, 4 ); file_n += 5;
3138 }
3139
3140
3141 #line 6010 "./tex4ht-c.tex"
3142
3143
3144 static void idv_char
3145 #ifdef ANSI
3146 #define SEP ,
3147 ( int n
3148 )
3149 #undef SEP
3150 #else
3151 #define SEP ;
3152 ( n ) int n
3153 ;
3154 #undef SEP
3155 #endif
3156 { (IGNORED) putc( n, idv_file ); }
3157
3158
3159 #line 6023 "./tex4ht-c.tex"
3160
3161
3162 static void cond_idv_char
3163 #ifdef ANSI
3164 #define SEP ,
3165 ( int n
3166 )
3167 #undef SEP
3168 #else
3169 #define SEP ;
3170 ( n ) int n
3171 ;
3172 #undef SEP
3173 #endif
3174 {
3175 if( dvi_flag ){ (IGNORED) putc( n, idv_file ); file_n++; }
3176 }
3177
3178
3179 #line 6038 "./tex4ht-c.tex"
3180
3181 static void idv_copy( MYVOID )
3182 { idv_char( get_char() ); file_n++; }
3183
3184
3185 #line 6053 "./tex4ht-c.tex"
3186
3187
3188 static void cond_idv_int
3189 #ifdef ANSI
3190 #define SEP ,
3191 ( long int val SEP
3192 int n
3193 )
3194 #undef SEP
3195 #else
3196 #define SEP ;
3197 ( val, n ) long int val SEP
3198 int n
3199 ;
3200 #undef SEP
3201 #endif
3202 {
3203 if( dvi_flag ){ int_to_dvi((long int) val, n ); file_n += n; }
3204 }
3205
3206
3207 #line 6067 "./tex4ht-c.tex"
3208
3209
3210 static void int_to_dvi
3211 #ifdef ANSI
3212 #define SEP ,
3213 ( long int val SEP
3214 int n
3215
3216 )
3217 #undef SEP
3218 #else
3219 #define SEP ;
3220 ( val, n ) long int val SEP
3221 int n
3222
3223 ;
3224 #undef SEP
3225 #endif
3226 { unsigned U_CHAR ch2, ch3, ch4;
3227 ch4 = (unsigned char) (val & 0xFF); val = val >> 8;
3228 ch3 = (unsigned char) (val & 0xFF); val = val >> 8;
3229 ch2 = (unsigned char) (val & 0xFF); val = val >> 8;
3230 switch( n ){
3231 case 4: idv_char( (int) val );
3232 case 3: idv_char( ch2 );
3233 case 2: idv_char( ch3 );
3234 case 1: idv_char( ch4 ); }
3235
3236 }
3237
3238
3239 #line 6089 "./tex4ht-c.tex"
3240
3241
3242 static void cond_string
3243 #ifdef ANSI
3244 #define SEP ,
3245 ( int ch SEP int n
3246
3247 )
3248 #undef SEP
3249 #else
3250 #define SEP ;
3251 (ch, n) int ch SEP int n
3252
3253 ;
3254 #undef SEP
3255 #endif
3256 { cond_idv_char( ch );
3257 while( n-- ) cond_idv_char( get_char() );
3258 }
3259
3260
3261 #line 6119 "./tex4ht-c.tex"
3262
3263
3264 static INTEGER advance_idv_page
3265 #ifdef ANSI
3266 #define SEP ,
3267 (
3268 INTEGER bop_addr SEP
3269 char* cur_font
3270
3271 )
3272 #undef SEP
3273 #else
3274 #define SEP ;
3275 ( bop_addr, cur_font )
3276 INTEGER bop_addr SEP
3277 char* cur_font
3278
3279 ;
3280 #undef SEP
3281 #endif
3282 { int i;
3283 if( page_n++ ){
3284 idv_char(
3285 #line 17338 "./tex4ht-c.tex"
3286
3287 142
3288 ); file_n++;
3289 idv_char(
3290 #line 17332 "./tex4ht-c.tex"
3291
3292 140
3293 ); file_n++;
3294 idv_char(
3295 #line 17329 "./tex4ht-c.tex"
3296
3297 139
3298 );
3299 idv_int( page_n ); for( i=36; i--; ) idv_char( 0);
3300 idv_int( bop_addr ); bop_addr = file_n; file_n += 45;
3301 idv_char(
3302 #line 17335 "./tex4ht-c.tex"
3303
3304 141
3305 ); file_n++;
3306 for( i=1; i<=cur_font[0]; i++ ){
3307 idv_char( cur_font[i] ); file_n++;
3308 } }
3309
3310 #line 6151 "./tex4ht-c.tex"
3311
3312 store_mv(
3313 #line 17365 "./tex4ht-c.tex"
3314
3315 151
3316 , dx_1);
3317 store_mv(
3318 #line 17380 "./tex4ht-c.tex"
3319
3320 156
3321 , dx_2);
3322 store_mv(
3323 #line 17407 "./tex4ht-c.tex"
3324
3325 165
3326 , dy_1);
3327 store_mv(
3328 #line 17422 "./tex4ht-c.tex"
3329
3330 170
3331 , dy_2);
3332
3333
3334 return bop_addr;
3335 }
3336
3337
3338 #line 6176 "./tex4ht-c.tex"
3339
3340
3341 static void store_mv
3342 #ifdef ANSI
3343 #define SEP ,
3344 ( int op SEP INTEGER d
3345
3346 )
3347 #undef SEP
3348 #else
3349 #define SEP ;
3350 (op, d) int op SEP INTEGER d
3351
3352 ;
3353 #undef SEP
3354 #endif
3355 {
3356 if( dvi_flag ){
3357 cond_idv_char(op); idv_int( (INTEGER) -d);
3358 cond_idv_char(op); idv_int( (INTEGER) d); file_n += 8; }
3359 }
3360
3361
3362 #line 7245 "./tex4ht-c.tex"
3363
3364 static void push_stack(MYVOID)
3365 {
3366 stack[stack_n].x_val = x_val;
3367 stack[stack_n].dx_1 = dx_1;
3368 stack[stack_n].dx_2 = dx_2;
3369 stack[stack_n].y_val = y_val;
3370 stack[stack_n].dy_1 = dy_1;
3371 stack[stack_n].dy_2 = dy_2;
3372
3373 #line 7263 "./tex4ht-c.tex"
3374
3375 stack[stack_n+1].sv_no_left_del = stack[stack_n+1].no_left_del;
3376 stack[stack_n+1].no_left_del = stack[stack_n].no_left_del;
3377
3378
3379 stack_n++;
3380 if( stack_n >
3381 #line 6688 "./tex4ht-c.tex"
3382
3383 ((int) stack_len + 2)
3384
3385 ){
3386 warn_i(40);
3387 }
3388
3389 #line 12479 "./tex4ht-c.tex"
3390
3391 stack[stack_n].accented = FALSE;
3392
3393
3394 }
3395
3396
3397 #line 7292 "./tex4ht-c.tex"
3398
3399 static void pop_stack(MYVOID)
3400 {
3401
3402 #line 12472 "./tex4ht-c.tex"
3403
3404 if( stack[stack_n].accented ){
3405
3406 #line 12423 "./tex4ht-c.tex"
3407
3408 needs_accented_sym--;
3409
3410
3411 stack[stack_n].accented=FALSE;
3412 }
3413
3414
3415
3416 #line 7268 "./tex4ht-c.tex"
3417
3418 stack[stack_n].no_left_del = stack[stack_n].sv_no_left_del;
3419
3420
3421 --stack_n;
3422 x_val = stack[stack_n].x_val;
3423 dx_1 = stack[stack_n].dx_1;
3424 dx_2 = stack[stack_n].dx_2;
3425 y_val = stack[stack_n].y_val;
3426 dy_1 = stack[stack_n].dy_1;
3427 dy_2 = stack[stack_n].dy_2;
3428 }
3429
3430
3431 #line 7393 "./tex4ht-c.tex"
3432
3433
3434 static struct del_stack_entry* push_del
3435 #ifdef ANSI
3436 #define SEP ,
3437 ( U_CHAR ch SEP
3438 int cr_fnt
3439 )
3440 #undef SEP
3441 #else
3442 #define SEP ;
3443 (ch, cr_fnt) U_CHAR ch SEP
3444 int cr_fnt
3445 ;
3446 #undef SEP
3447 #endif
3448 { struct del_stack_entry *p;
3449 p = m_alloc(struct del_stack_entry,1);
3450 p->next = del_stack;
3451 p->ch = ch;
3452 p->fnt = cr_fnt;
3453 p->id = ch_id;
3454 return p;
3455 }
3456
3457
3458 #line 7414 "./tex4ht-c.tex"
3459
3460
3461 static struct del_stack_entry* pop_del
3462 #ifdef ANSI
3463 #define SEP ,
3464 (
3465 U_CHAR ch SEP
3466 int id_hide SEP
3467 int cr_fnt
3468 )
3469 #undef SEP
3470 #else
3471 #define SEP ;
3472 (ch, id_hide, cr_fnt)
3473 U_CHAR ch SEP
3474 int id_hide SEP
3475 int cr_fnt
3476 ;
3477 #undef SEP
3478 #endif
3479 {
3480 if( del_stack != (struct del_stack_entry*) 0 ){
3481 if( (cr_fnt == del_stack->fnt) &&
3482 ( *(font_tbl[cr_fnt].math + (ch - font_tbl[cr_fnt].char_f))
3483 == del_stack->ch) ){
3484 struct del_stack_entry * p;
3485 if( !id_hide && !id_latex ){ sv_id = del_stack->id; }
3486 del_stack = (p = del_stack)->next; free((void *) p );
3487 } }
3488 return del_stack;
3489 }
3490
3491
3492 #line 7627 "./tex4ht-c.tex"
3493
3494
3495 static struct send_back_entry * rev_list
3496 #ifdef ANSI
3497 #define SEP ,
3498 (
3499 struct send_back_entry *back_group
3500 )
3501 #undef SEP
3502 #else
3503 #define SEP ;
3504 (back_group)
3505 struct send_back_entry *back_group
3506 ;
3507 #undef SEP
3508 #endif
3509 { struct send_back_entry *p, *q, *t;
3510 if( back_group->id == -1 ){ return back_group; }
3511 p = back_group; q = p->next;
3512 while( p->id != -1 ){
3513 t = q->next; q->next = p; p = q; q = t;
3514 }
3515 back_group->next = p;
3516 return p->next;
3517 }
3518
3519
3520 #line 7681 "./tex4ht-c.tex"
3521
3522
3523 static struct send_back_entry * back_insert
3524 #ifdef ANSI
3525 #define SEP ,
3526 (
3527 struct send_back_entry *back SEP
3528 int id
3529 )
3530 #undef SEP
3531 #else
3532 #define SEP ;
3533 (back, id)
3534 struct send_back_entry *back SEP
3535 int id
3536 ;
3537 #undef SEP
3538 #endif
3539 {
3540 while( back->id == id ){
3541 struct send_back_entry *p;
3542 print_f( back->send );
3543 back = (p = back)->next;
3544 free((void *) p->send );
3545 free((void *) p );
3546 }
3547 return back;
3548 }
3549
3550
3551 #line 8554 "./tex4ht-c.tex"
3552
3553
3554 static double pos_dbl
3555 #ifdef ANSI
3556 #define SEP ,
3557 ( long int * special_n
3558 )
3559 #undef SEP
3560 #else
3561 #define SEP ;
3562 ( special_n ) long int * special_n
3563 ;
3564 #undef SEP
3565 #endif
3566 {
3567 U_CHAR ch;
3568 double v;
3569 int d;
3570 v = 0.0; d = 10;
3571 while( --(*special_n) > 0 ){
3572 ch = get_char();
3573 if( ('0' <= ch ) && (ch <= '9' ) ){
3574 v += (double) (ch -'0') / d; d *= 10; }
3575 else break;
3576 }
3577 return v;
3578 }
3579
3580
3581 #line 9274 "./tex4ht-c.tex"
3582
3583
3584 static void doGlyphArray
3585 #ifdef ANSI
3586 #define SEP ,
3587 (
3588 BOOL yLocs
3589 )
3590 #undef SEP
3591 #else
3592 #define SEP ;
3593 (yLocs)
3594 BOOL yLocs
3595 ;
3596 #undef SEP
3597 #endif
3598 { int i, glyphCount;
3599 (void) get_unt(4);
3600 glyphCount = (INTEGER) get_unt(2);
3601 for( i = 0; i < glyphCount; ++i ){
3602 (void) get_int(4);
3603 if( yLocs ){ (void) get_int(4); }
3604 }
3605 for (i = 0; i < glyphCount; ++i){
3606 (void) get_unt(2);
3607 }
3608 }
3609
3610
3611 #line 9322 "./tex4ht-c.tex"
3612
3613
3614 static int search_font_tbl
3615 #ifdef ANSI
3616 #define SEP ,
3617 (
3618 int cur_fnt
3619 )
3620 #undef SEP
3621 #else
3622 #define SEP ;
3623 ( cur_fnt )
3624 int cur_fnt
3625 ;
3626 #undef SEP
3627 #endif
3628 { int i;
3629 for( i=0; i<font_tbl_size; i++){
3630 if( font_tbl[i].num == cur_fnt ){ return i; }
3631 }
3632 err_i_int( 6,cur_fnt );
3633 return 0;
3634 }
3635
3636
3637 #line 10423 "./tex4ht-c.tex"
3638
3639
3640 static int get_html_ch
3641 #ifdef ANSI
3642 #define SEP ,
3643 ( FILE* file
3644
3645 )
3646 #undef SEP
3647 #else
3648 #define SEP ;
3649 ( file ) FILE* file
3650
3651 ;
3652 #undef SEP
3653 #endif
3654 { int ch;
3655 if( (ch = (int) getc(file)) == EOF ) {
3656 dump_htf( file );
3657 err_i_str(20, new_font_name);
3658 }
3659 return ch;
3660 }
3661
3662
3663 #line 10444 "./tex4ht-c.tex"
3664
3665
3666 static FILE* f_open
3667 #ifdef ANSI
3668 #define SEP ,
3669 (
3670 const char* name SEP
3671 const char* flags
3672 )
3673 #undef SEP
3674 #else
3675 #define SEP ;
3676 ( name, flags )
3677 const char* name SEP
3678 const char* flags
3679 ;
3680 #undef SEP
3681 #endif
3682 { FILE* file;
3683 if( (file = fopen(name,flags) ) != NULL ) {
3684 (IGNORED) printf("(%s)\n",name);
3685 }
3686 return file;
3687 }
3688
3689
3690 #line 10468 "./tex4ht-c.tex"
3691
3692
3693 static void dump_htf
3694 #ifdef ANSI
3695 #define SEP ,
3696 ( FILE* file
3697
3698 )
3699 #undef SEP
3700 #else
3701 #define SEP ;
3702 ( file ) FILE* file
3703
3704 ;
3705 #undef SEP
3706 #endif
3707 { int i, j, ch, chr=0;
3708 (IGNORED) fseek(file, 0L, 0);
3709 i=-1; j=0;
3710 while( (ch = getc(file)) != EOF ){
3711 if( !j ){ chr = ch; }
3712 j += ch==chr;
3713 (IGNORED) putc(ch,stderr);
3714 if( ch == '\n' ){
3715 if( (i>-1 ) && (j<4) && (dump_htf_files<2) ){
3716 (IGNORED) printf("missing delimiter \n");
3717 }
3718 (IGNORED) fprintf(stderr,"%d: ",++i);
3719 j=0;
3720 } } }
3721
3722
3723 #line 10520 "./tex4ht-c.tex"
3724
3725 static void dump_env( MYVOID )
3726 {
3727 int ch;
3728 if( !dumped_env ){
3729 dumped_env = TRUE;
3730 (IGNORED) fseek(dot_file, 0L,
3731 #line 2174 "./tex4ht-c.tex"
3732
3733 0
3734 );
3735 (IGNORED) fprintf(stderr,
3736 "\n----------------------------------------------------\n");
3737 (IGNORED) fprintf(stderr, "environment file\n");
3738 (IGNORED) fprintf(stderr,
3739 "----------------------------------------------------\n");
3740 while( (ch = getc(dot_file)) != EOF ){
3741 (IGNORED) putc(ch,stderr);
3742 }
3743 (IGNORED) fprintf(stderr,
3744 "----------------------------------------------------\n");
3745 } }
3746
3747
3748 #line 10553 "./tex4ht-c.tex"
3749
3750
3751 static void htf_to_lg
3752 #ifdef ANSI
3753 #define SEP ,
3754 (
3755
3756 struct html_font_rec* html_font SEP
3757 char* new_font_name SEP
3758 int fonts_n SEP
3759 FILE* file
3760 )
3761 #undef SEP
3762 #else
3763 #define SEP ;
3764 (html_font, new_font_name, fonts_n, file)
3765
3766 struct html_font_rec* html_font SEP
3767 char* new_font_name SEP
3768 int fonts_n SEP
3769 FILE* file
3770 ;
3771 #undef SEP
3772 #endif
3773 {
3774 int ch, i;
3775 for( i = 0 ; i<fonts_n; ){
3776 if( eq_str(html_font[i].name, new_font_name) ){ break; }
3777 i++;
3778 }
3779 if( i == fonts_n ){
3780 BOOL content;
3781 int prev_ch;
3782 prev_ch = '\n'; content = FALSE;
3783 while( (ch = (int) getc(file)) != EOF ) {
3784 if( (ch != '\n') || (prev_ch != '\n') ){
3785 (void) putc( ch, log_file );
3786 prev_ch = ch; content = TRUE;
3787 } }
3788 if( content && (prev_ch != '\n') ){
3789 (void) putc( '\n', log_file );
3790 }
3791 } }
3792
3793
3794 #line 10603 "./tex4ht-c.tex"
3795
3796
3797 static INTEGER get_html_file_id
3798 #ifdef ANSI
3799 #define SEP ,
3800 (
3801 FILE* file SEP
3802 int first SEP int last SEP int n
3803
3804 )
3805 #undef SEP
3806 #else
3807 #define SEP ;
3808 (file, first, last, n)
3809 FILE* file SEP
3810 int first SEP int last SEP int n
3811
3812 ;
3813 #undef SEP
3814 #endif
3815 { int ch, i, bound, cnt;
3816 INTEGER diff;
3817 char* name;
3818 name = new_font_name;
3819 while( *name == (ch = get_html_ch(file)) ) name++;
3820
3821 #line 10120 "./tex4ht-c.tex"
3822
3823 if( ( name == new_font_name ) && (n == 19) && (ch=='.') ){
3824 return HTF_ALIAS;
3825 }
3826
3827
3828 if( (*name != '\0') || (ch != ' ') ) warn_i_str(n, name);
3829 bound = first; diff = 0;
3830 for( cnt = 0; cnt < 2; cnt++ ){
3831 while( ch == ' ' ) ch = get_html_ch(file);
3832 i = 0;
3833 while( (ch >= '0') && (ch <= '9') ){
3834 i = i * 10 + ch - '0'; ch = get_html_ch(file); }
3835 if( i != bound ){
3836
3837 #line 16930 "./tex4ht-c.tex"
3838
3839 (IGNORED) fprintf(stderr,"--- warning --- ");
3840 (IGNORED) fprintf(stderr, warn_err_mssg[22]
3841
3842 , new_font_name, i, bound); show_err_context();
3843 diff = diff * 1000 + i - bound; }
3844 bound = last; }
3845 while( ch != '\n' ) ch = get_html_ch(file);
3846 return diff;
3847 }
3848
3849
3850 #line 10737 "./tex4ht-c.tex"
3851
3852
3853 static void notify_class_info
3854 #ifdef ANSI
3855 #define SEP ,
3856 ( int gif_flag
3857 )
3858 #undef SEP
3859 #else
3860 #define SEP ;
3861 ( gif_flag ) int gif_flag
3862 ;
3863 #undef SEP
3864 #endif
3865 { U_CHAR str[256], *p;
3866 str[0] = '\0';
3867 p = gif_open[gif_flag];
3868 if( p )
3869 if( *p ) (IGNORED) strct(str,p);
3870 p = gif_alt[gif_flag];
3871 if( p )
3872 if( *p ) (IGNORED) strct(str,p);
3873 p = gif_class[gif_flag];
3874 if( p )
3875 if( *p ) (IGNORED) strct(str,p);
3876 p = gif_size[gif_flag];
3877 if( p )
3878 if( *p ) (IGNORED) strct(str,p);
3879 p = gif_mag[gif_flag];
3880 if( p )
3881 if( *p ) (IGNORED) strct(str,p);
3882 p = gif_ord[gif_flag];
3883 if( p )
3884 if( *p ) (IGNORED) strct(str,p);
3885 p = gif_end[gif_flag];
3886 if( p )
3887 if( *p ) (IGNORED) strct(str,p);
3888 p = str;
3889 while( *p ){
3890 if( *p == '\n' ) *p = ' ';
3891 p++;
3892 }
3893 (IGNORED) fprintf(log_file, class_fmt,
3894 gif_flag,
3895 gif_id[gif_flag]? gif_id[gif_flag] : "",
3896 str);
3897 }
3898
3899
3900 #line 10961 "./tex4ht-c.tex"
3901
3902
3903 static void script
3904 #ifdef ANSI
3905 #define SEP ,
3906 (
3907 U_CHAR *templt SEP
3908 U_CHAR *job SEP
3909 int page SEP
3910 U_CHAR *font
3911
3912 )
3913 #undef SEP
3914 #else
3915 #define SEP ;
3916 (templt, job, page, font)
3917 U_CHAR *templt SEP
3918 U_CHAR *job SEP
3919 int page SEP
3920 U_CHAR *font
3921
3922 ;
3923 #undef SEP
3924 #endif
3925 { U_CHAR *ch, *p;
3926 U_CHAR fmt[256];
3927 job[ (int) strlen((char *) job) - 1 ] ='\0';
3928 p = ch = templt;
3929 while( TRUE ){
3930 if( *ch == '%' ){
3931
3932 #line 10995 "./tex4ht-c.tex"
3933
3934 *ch = '\0'; (IGNORED) fprintf(log_file, "%s", p);
3935 *(ch++) = '%';
3936
3937
3938
3939 #line 11006 "./tex4ht-c.tex"
3940
3941 p=fmt; *(p++) = '%';
3942 if( *ch == '\0' ){ job[ (int) strlen((char *) job) ] ='.'; return; }
3943 while( *ch != '%' ){ *(p++) = *(ch ++); }
3944 *(p+1) = '\0';
3945
3946
3947 switch( *(++ch) ){
3948 case '1':{ *p = 's';
3949 (IGNORED) fprintf(log_file, fmt, job); break;}
3950 case '2':{ *p = 'd';
3951 (IGNORED) fprintf(log_file, fmt, page); break;}
3952 case '3':{ *p = 's';
3953 (IGNORED) fprintf(log_file, fmt, font); break;}
3954 case '%':{ *p = 'c';
3955 (IGNORED) fprintf(log_file, fmt, '%'); break;}
3956 default:{ job[ (int) strlen((char *) job) ] ='.'; return;}
3957 }
3958 p = ++ch;
3959 }else ch++;
3960 } }
3961
3962
3963 #line 11189 "./tex4ht-c.tex"
3964
3965
3966
3967 static void dos_gif_file
3968 #ifdef ANSI
3969 #define SEP ,
3970 (
3971 U_CHAR *str SEP
3972 int mag SEP
3973 int design_ch
3974
3975 )
3976 #undef SEP
3977 #else
3978 #define SEP ;
3979 (str, mag, design_ch)
3980 U_CHAR *str SEP
3981 int mag SEP
3982 int design_ch
3983
3984 ;
3985 #undef SEP
3986 #endif
3987 { int n, m, i;
3988 struct gif_file_rec * p, * q;
3989 U_CHAR *ch;
3990 m = n = (int) strlen((char *) str);
3991 if( n > 4 ){
3992
3993 #line 11249 "./tex4ht-c.tex"
3994
3995 if( (p = gif_file) != NULL ){
3996 while( TRUE ){
3997 if( eq_str( str, p->name ) ) break;
3998 if( (p = p->next) == gif_file ){ p = NULL; break; }
3999 } }
4000
4001
4002 if( p == NULL ){
4003 #line 11262 "./tex4ht-c.tex"
4004
4005 p = m_alloc(struct gif_file_rec, 1);
4006
4007 #line 11282 "./tex4ht-c.tex"
4008
4009 for(i=str[n]; n; ){ i+=str[--n]; if( i > (INT_MAX / 8) ) i/=2; }
4010 if( (n=i % BASE) <10 ) n+= 10 + i%(BASE-20);
4011 *(ch = p->code)= n; n += i;
4012 ch[1] = n%BASE; n += i;
4013 ch[2] = n%BASE; n += i;
4014 ch[3] = n%BASE;
4015
4016
4017
4018 #line 11296 "./tex4ht-c.tex"
4019
4020 if( gif_file ){
4021 q = gif_file->next;
4022 while( TRUE ){
4023 if( (*(q->code) == *ch) && (*(q->code+1) == ch[1]) &&
4024 (*(q->code) == ch[2]) && (*(q->code+2) == ch[3]) ){
4025 ch[3] ++; ch[2] += ch[3]/ BASE; ch[3] = ch[3] % BASE;
4026 ch[1] += ch[2]/ BASE; ch[2] = ch[2] % BASE;
4027 ch[1] = ch[1] % BASE;
4028 q = gif_file;
4029 } else if( q == gif_file ) break;
4030 q = q->next;
4031 } }
4032
4033
4034 (IGNORED) printf("\nRenaming `%s____%s' to `%c%c%c%c____%s'\n",
4035 str, gif,
4036 xeh[(int)(ch[0])], xeh[(int)(ch[1])],
4037 xeh[(int)(ch[2])], xeh[(int)(ch[3])]
4038 , gif);
4039 p->name = m_alloc(char,m+1);
4040 (IGNORED) strcpy((char *) p->name, (char *) str );
4041 if( gif_file ){ p->next = gif_file->next; gif_file->next = p; }
4042 else p->next = p;
4043
4044 }
4045 gif_file = p;
4046 for( n=0; n<4; n++ ) str[n] = xeh[(int)(*(p->code + n))];
4047 }
4048 str[n++] = xeh[mag<16? 0: mag / 16];
4049 str[n++] = xeh[mag % 16];
4050 str[n++] = xeh[design_ch<16? 0: design_ch / 16];
4051 str[n++] = xeh[design_ch % 16];
4052 str[n] = '\0';
4053 }
4054
4055
4056
4057 #line 11352 "./tex4ht-c.tex"
4058
4059
4060 static void put_alt_ch
4061 #ifdef ANSI
4062 #define SEP ,
4063 (
4064 int chr SEP
4065 BOOL ch_str_flag
4066 )
4067 #undef SEP
4068 #else
4069 #define SEP ;
4070 (chr,ch_str_flag)
4071 int chr SEP
4072 BOOL ch_str_flag
4073 ;
4074 #undef SEP
4075 #endif
4076 {
4077 if( !ch_str_flag ) put_char( chr );
4078 else if( chr > 0 ){
4079 #line 11369 "./tex4ht-c.tex"
4080
4081 unsigned U_CHAR * p;
4082 p = font_tbl[cur_fnt].str[chr-1];
4083 if( gif_ch ) print_f( (char *) p );
4084 else while( *p ){
4085 switch( *p ){
4086 case '<': { while( *p && (*p != '>') ) p++; break; }
4087 case '>':
4088 case '"': { p++; break; }
4089 case '\'': { p++; break; }
4090 default: { put_char( (int) *p ) ; p++; }
4091 } }
4092
4093 }
4094 }
4095
4096
4097 #line 12356 "./tex4ht-c.tex"
4098
4099
4100 static void get_open_accent
4101 #ifdef ANSI
4102 #define SEP ,
4103 (
4104 char **all SEP
4105 char **first SEP
4106 char **second SEP
4107 char **third SEP
4108 char **fourth SEP
4109 char **fifth SEP
4110 long int *n
4111 )
4112 #undef SEP
4113 #else
4114 #define SEP ;
4115 (all,first,second,third,fourth,fifth,n)
4116 char **all SEP
4117 char **first SEP
4118 char **second SEP
4119 char **third SEP
4120 char **fourth SEP
4121 char **fifth SEP
4122 long int *n
4123 ;
4124 #undef SEP
4125 #endif
4126 { char *p, *q;
4127 int i;
4128 if( *all ){ free((void *) *all); }
4129 *all = p = get_str( (int) *n ); *n=0;
4130 i = 2;
4131 *first = q = p + 1;
4132 while ( TRUE ){
4133 if( *q == *p ){
4134 *q = '\0';
4135 switch( i ){
4136 case 2:{ *second = q+1; break; }
4137 case 3:{ *third = q+1; break; }
4138 case 4:{ *fourth = q+1; break; }
4139 case 5:{ *fifth = q+1; break; }
4140 }
4141 if( i++ == 5 ){ break; }
4142 } else if( !*q ){
4143 free((void *) *all); *all = (char *) 0; break;
4144 }
4145 q++;
4146 } }
4147
4148
4149 #line 12597 "./tex4ht-c.tex"
4150
4151
4152 static int scan_class
4153 #ifdef ANSI
4154 #define SEP ,
4155 (
4156 int flag
4157 )
4158 #undef SEP
4159 #else
4160 #define SEP ;
4161 ( flag )
4162 int flag
4163 ;
4164 #undef SEP
4165 #endif
4166 { int math_class;
4167 math_class = get_char();
4168 if( (math_class >= '0' )
4169 && (math_class < '0' +
4170 #line 12723 "./tex4ht-c.tex"
4171
4172 79
4173
4174 ) ){
4175 { math_class -= '0'; }
4176 } else {
4177 if( flag== 1 ) {
4178 switch( math_class ){
4179 case '-': { math_class =
4180 #line 12723 "./tex4ht-c.tex"
4181
4182 79
4183
4184 ;
4185 pause_class++; break; }
4186 case '+': { math_class =
4187 #line 12723 "./tex4ht-c.tex"
4188
4189 79
4190
4191 ;
4192 pause_class--; break; }
4193 default: { math_class = 0; }
4194 } } else if( flag== 2 ) {
4195 switch( math_class ){
4196 case
4197 #line 12730 "./tex4ht-c.tex"
4198
4199 ')'
4200
4201 : {
4202 math_class =
4203 #line 12738 "./tex4ht-c.tex"
4204
4205 (
4206 #line 12723 "./tex4ht-c.tex"
4207
4208 79
4209
4210 + 1)
4211
4212 ; break; }
4213 case
4214 #line 12734 "./tex4ht-c.tex"
4215
4216 '('
4217
4218 :
4219 { math_class =
4220 #line 12742 "./tex4ht-c.tex"
4221
4222 (
4223 #line 12723 "./tex4ht-c.tex"
4224
4225 79
4226
4227 + 2)
4228
4229 ; break; }
4230 default: { math_class = 0; }
4231 }
4232 } else { math_class = 0; }
4233 }
4234 return math_class;
4235 }
4236
4237
4238 #line 12637 "./tex4ht-c.tex"
4239
4240
4241 static INTEGER set_ch_class
4242 #ifdef ANSI
4243 #define SEP ,
4244 ( int ch
4245 )
4246 #undef SEP
4247 #else
4248 #define SEP ;
4249 (ch) int ch
4250 ;
4251 #undef SEP
4252 #endif
4253 { int r_ch;
4254 r_ch = ch - font_tbl[cur_fnt].char_f;
4255 if( math_class ==
4256 #line 7373 "./tex4ht-c.tex"
4257
4258 5
4259
4260 ){
4261 store_bit_I( font_tbl[cur_fnt].math_closing, r_ch );
4262 *(font_tbl[cur_fnt].math + r_ch) =
4263 (char) ((open_del == 256)? ch : open_del);
4264 } else {
4265 store_bit_Z( font_tbl[cur_fnt].math_closing, r_ch );
4266 *(font_tbl[cur_fnt].math + r_ch) = math_class;
4267 }
4268 open_del = ( math_class ==
4269 #line 7377 "./tex4ht-c.tex"
4270
4271 4
4272
4273 )? ch : 256;
4274
4275 #line 9804 "./tex4ht-c.tex"
4276
4277 return (INTEGER)(
4278
4279 #line 9841 "./tex4ht-c.tex"
4280
4281 design_size_to_pt( *(font_tbl[cur_fnt].wtbl
4282 + (int) (
4283 #line 9849 "./tex4ht-c.tex"
4284
4285 *(font_tbl[cur_fnt].char_wi + (int)
4286 ( ch - font_tbl[cur_fnt].char_f)% 256)
4287
4288 ) )
4289 )
4290 * (double) font_tbl[cur_fnt].scale
4291
4292
4293 );
4294
4295
4296 }
4297
4298
4299 #line 12692 "./tex4ht-c.tex"
4300
4301
4302 static int math_class_of
4303 #ifdef ANSI
4304 #define SEP ,
4305 ( int ch SEP int cur_fnt
4306 )
4307 #undef SEP
4308 #else
4309 #define SEP ;
4310 (ch,cur_fnt) int ch SEP int cur_fnt
4311 ;
4312 #undef SEP
4313 #endif
4314 { int math_class;
4315 math_class = ch - font_tbl[cur_fnt].char_f;
4316 return ((get_bit( font_tbl[cur_fnt].math_closing, math_class))?
4317
4318 #line 7373 "./tex4ht-c.tex"
4319
4320 5
4321
4322 : *( math_class + font_tbl[cur_fnt].math));
4323
4324 }
4325
4326
4327 #line 13229 "./tex4ht-c.tex"
4328
4329 #if defined(__MSDOS__)
4330
4331 #line 13238 "./tex4ht-c.tex"
4332
4333
4334 static char *get_env_dir
4335 #ifdef ANSI
4336 #define SEP ,
4337 (
4338 U_CHAR *progname
4339
4340 )
4341 #undef SEP
4342 #else
4343 #define SEP ;
4344 (progname)
4345 U_CHAR *progname
4346
4347 ;
4348 #undef SEP
4349 #endif
4350 { int i;
4351 U_CHAR *p;
4352 if(! progname || ! *progname) return NULL;
4353 i = (int) strlen((char *) progname);
4354 while( (progname[--i] != (int) dir_path_slash(progname) )
4355 && (i > 0) ) ;
4356 if(i == 0) return NULL;
4357 p = (char *) malloc(i+12);
4358 if(p == NULL) return NULL;
4359 strncpy(p, progname, i+1);
4360 (IGNORED) strcpy((char *) &p[i+1], "tex4ht.env");
4361 return p;
4362 }
4363
4364
4365 #endif
4366
4367
4368 #line 13298 "./tex4ht-c.tex"
4369
4370
4371 static char* get_script
4372 #ifdef ANSI
4373 #define SEP ,
4374 (
4375 char * name SEP
4376 const U_CHAR * inln SEP
4377 int x
4378
4379 )
4380 #undef SEP
4381 #else
4382 #define SEP ;
4383 (name, inln,x)
4384 char * name SEP
4385 const U_CHAR * inln SEP
4386 int x
4387
4388 ;
4389 #undef SEP
4390 #endif
4391 {
4392 if( !name )
4393 { U_CHAR str[256], *ch;
4394 (IGNORED) fseek(dot_file, 0L,
4395 #line 2174 "./tex4ht-c.tex"
4396
4397 0
4398 );
4399 if( search_dot_file( x ) ){
4400
4401 #line 13322 "./tex4ht-c.tex"
4402
4403 ch = str; str[254] = '\0';
4404 do{ int int_ch;
4405 while((*(ch++) = (char)
4406 (int_ch = (int) getc(dot_file))
4407 ) != '\n'){
4408 if( int_ch == EOF ){ *(ch-1)='\n'; break; }
4409 if( str[254] ){ warn_i_int(33, x); break; }
4410 }
4411 }while( (int) getc(dot_file) == x );
4412 *ch = '\0';
4413
4414
4415 } else {(IGNORED) strcpy((char *) str, inln); }
4416 ch = m_alloc(char, (int) strlen((char *) str)+2);
4417 (IGNORED) strcpy((char *) ch, (char *) str);
4418 return ch;
4419 }else return name;
4420 }
4421
4422
4423 #line 13348 "./tex4ht-c.tex"
4424
4425
4426 static BOOL search_dot_file
4427 #ifdef ANSI
4428 #define SEP ,
4429 (
4430 int ch
4431 )
4432 #undef SEP
4433 #else
4434 #define SEP ;
4435 ( ch )
4436 int ch
4437 ;
4438 #undef SEP
4439 #endif
4440 { int chr;
4441
4442 while( TRUE ){
4443 chr = getc(dot_file);
4444 if( chr == ch ){ return TRUE; }
4445 if( chr == '<' ) {
4446
4447 #line 13371 "./tex4ht-c.tex"
4448
4449 U_CHAR match[256];
4450 int i;
4451 for( i = 0; (chr != '\n') && (chr != EOF ) ; i++){
4452 chr = (int) getc(dot_file);
4453 match[i] = (U_CHAR) chr;
4454 }
4455 match[i-1] = '\0';
4456 if( match[0] != '/' ){
4457 BOOL env_skip;
4458 for( i = 0;
4459 (match[i] != '>') && (match[i] != '\n') && (match[i] != EOF );
4460 i++){}
4461 if( match[i] == '>' ){ match[i] = '\0'; }
4462
4463 #line 13439 "./tex4ht-c.tex"
4464
4465 if( envChoice == (struct env_c_rec*) 0 ){
4466 env_skip = !eq_str(match, "default" );
4467 } else {
4468 struct env_c_rec *p;
4469 env_skip = TRUE;
4470 for( p=envChoice; p!=(struct env_c_rec*) 0 ; p = p->next ){
4471 if( eq_str(match, p->option ) ){ env_skip = FALSE; }
4472 } }
4473
4474
4475 if( env_skip ){
4476
4477 #line 13391 "./tex4ht-c.tex"
4478
4479 U_CHAR cur_block[90];
4480 BOOL status;
4481 (IGNORED) strcpy((char *) cur_block, (char *) match);
4482 status = FALSE;
4483 while( !status && (chr != EOF) ){
4484 chr = 'x';
4485 for( i = 0; (chr != '\n') && (chr != EOF ) ; i++){
4486 chr = (int) getc(dot_file);
4487 match[i] = (U_CHAR) chr;
4488 }
4489 match[i-1] = '\0';
4490 for(i=0; match[i]!='\0'; i++){
4491 if( match[i] == '>' ){ break; }
4492 }
4493 if( (match[0] == '<') && (match[1] == '/')
4494 && (match[i] == '>') ){
4495 match[i]='\0';
4496 status = eq_str(match+2, cur_block);
4497 } else { status = FALSE; }
4498 }
4499
4500
4501 } }
4502
4503
4504 continue;
4505 }
4506 if( chr == '\n' ){ continue; }
4507 do
4508 if( chr == EOF ) return FALSE;
4509 while( (chr = getc(dot_file)) != '\n' );
4510 } }
4511
4512
4513 #line 13588 "./tex4ht-c.tex"
4514
4515
4516 static struct env_var_rec * get_env_var
4517 #ifdef ANSI
4518 #define SEP ,
4519 (
4520 const char *env_var
4521 )
4522 #undef SEP
4523 #else
4524 #define SEP ;
4525 ( env_var )
4526 const char *env_var
4527 ;
4528 #undef SEP
4529 #endif
4530 { U_CHAR *TEX4HTTFM, *from;
4531 struct env_var_rec *tfm_dirs, *p;
4532 int env_var_len;
4533 tfm_dirs = (struct env_var_rec *) 0;
4534 TEX4HTTFM = getenv( env_var );
4535 if( TEX4HTTFM ){
4536 env_var_len = (int) strlen((char *) TEX4HTTFM);
4537 if ( *TEX4HTTFM == *(TEX4HTTFM + env_var_len - 1 ) ){
4538 from = TEX4HTTFM + env_var_len - 1;
4539 *from = '\0';
4540 do{
4541 from--;
4542 if( *from == *TEX4HTTFM ){ char * base;
4543 *from = '\0';
4544 base = from + 1;
4545
4546 #line 13630 "./tex4ht-c.tex"
4547
4548 { U_CHAR *str;
4549 if( *(from+1) == '~' ){
4550 if( HOME_DIR ){
4551 str = m_alloc(char, strlen((char *) HOME_DIR)+strlen((char *) base));
4552 (IGNORED) sprintf(str,"%s%s", HOME_DIR, base+1);
4553 if( access(str,F_OK) ) {
4554 warn_i_str2(49, env_var, str); base = NULL; }
4555 free((void *) str);
4556 } else {
4557 if( access(base,F_OK) ) {
4558 warn_i_str2(49, env_var, base); base = NULL; }
4559 }
4560 } else {
4561 if( access(base,F_OK) ) {
4562 warn_i_str2(49, env_var, base); base = NULL; }
4563 } }
4564
4565
4566 if( base ){
4567
4568 #line 13622 "./tex4ht-c.tex"
4569
4570 p = m_alloc(struct env_var_rec, 1);
4571 p->next = tfm_dirs;
4572 p->base = base;
4573 tfm_dirs = p;
4574
4575
4576 } }
4577 } while (from > TEX4HTTFM );
4578 } else { warn_i_str2( 49, env_var, TEX4HTTFM); }
4579 }
4580 return tfm_dirs;
4581 }
4582
4583
4584 #line 13891 "./tex4ht-c.tex"
4585
4586
4587 static void com_dir
4588 #ifdef ANSI
4589 #define SEP ,
4590 (
4591 char* p
4592 )
4593 #undef SEP
4594 #else
4595 #define SEP ;
4596 (p)
4597 char* p
4598 ;
4599 #undef SEP
4600 #endif
4601 { int i; U_CHAR str[256];
4602 (IGNORED) strcpy((char *) str, (char *) p+2 );
4603 i = (int) strlen((char *) str) - 1;
4604 if( str[i] == '!' ) str[i] = '\0';
4605 }
4606
4607
4608 #line 14584 "./tex4ht-c.tex"
4609
4610 #ifdef KPATHSEA
4611
4612 static void export_htf
4613 #ifdef ANSI
4614 #define SEP ,
4615 (
4616 char** export_str SEP
4617 char str[]
4618 )
4619 #undef SEP
4620 #else
4621 #define SEP ;
4622 (export_str, str)
4623 char** export_str SEP
4624 char str[]
4625 ;
4626 #undef SEP
4627 #endif
4628 { int i;
4629 char* p;
4630 BOOL found;
4631 i = (int) strlen((char *) str) - 1;
4632 while( (i>=0) && (str[i] == '\n') ){ str[i--] = '\0'; }
4633 while( (i>=0) && (str[i] == ' ') ) { str[i--] = '\0'; }
4634 if( (i>=0) && (str[i] == '!') ){ str[i--] = '\0'; }
4635 if( (i>=0) && ((str[i] == '/') || (str[i] == '\\')) ){
4636 str[i--] = '\0'; }
4637 i -= 8; found = FALSE;
4638 while( --i>=0 ){
4639 if( ((str[i] == '/') || (str[i] == '\\')) && (str[i+1]== 'h')
4640 && (str[i+2]=='t') && (str[i+3]=='-')
4641 && (str[i+4]=='f') && (str[i+5]=='o')
4642 && (str[i+6]=='n') && (str[i+7]=='t')
4643 && (str[i+8]=='s')
4644 && ((str[i+9] == '/') || (str[i+9] == '\\'))
4645 ){
4646 p = str + i + 10; i=0;
4647 while( *p ){ str[i++] = *(p++); }
4648 str[i] = '\0';
4649 found = TRUE; break;
4650 } }
4651 if( found ){
4652 *export_str = (char *) r_alloc((void *) *export_str,
4653 (int) strlen((char *) *export_str) + (int) strlen((char *) str) + 2 );
4654 if( (int) strlen((char *) *export_str) > 0 ){
4655 (IGNORED) strcat((char *) *export_str, ",");
4656 }
4657 (IGNORED) strcat((char *) *export_str, (char *) str);
4658 }
4659 }
4660 #endif
4661
4662
4663 #line 15313 "./tex4ht-c.tex"
4664
4665
4666 static FILE* search_in_dot_file
4667 #ifdef ANSI
4668 #define SEP ,
4669 (
4670 int typ SEP
4671 const U_CHAR *name SEP
4672 const U_CHAR *flags SEP
4673 struct env_var_rec *env_dirs
4674
4675 )
4676 #undef SEP
4677 #else
4678 #define SEP ;
4679 ( typ, name, flags, env_dirs)
4680 int typ SEP
4681 const U_CHAR *name SEP
4682 const U_CHAR *flags SEP
4683 struct env_var_rec *env_dirs
4684
4685 ;
4686 #undef SEP
4687 #endif
4688 { U_CHAR *ch, dir[256];
4689 FILE* file;
4690 #ifndef KPATHSEA
4691 if( cache_files != (FILE *) 0 ){
4692
4693 #line 14023 "./tex4ht-c.tex"
4694
4695 U_CHAR cache_dir[256], dot_dir[256], *p, *q;
4696 BOOL flag;
4697 int n, ch;
4698 (IGNORED) fseek(cache_files, 0L,
4699 #line 2174 "./tex4ht-c.tex"
4700
4701 0
4702 );
4703 ch = (int) getc(cache_files);
4704 while ( ch != EOF ){
4705 if ( ch == ' ' ) {
4706 #line 14040 "./tex4ht-c.tex"
4707
4708 q = cache_dir;
4709 do
4710 *(q++) = ch = (int) getc(cache_files);
4711 while( (ch !='\n') && (ch != EOF) );
4712 *(q-1 - (*(q-2) ==
4713 #line 15562 "./tex4ht-c.tex"
4714
4715 #if defined(__DJGPP__)
4716 '\\'
4717 #else
4718 '/'
4719 #endif
4720
4721 )
4722 #ifdef DOS_WIN32
4723 - (*(q-2) == '/')
4724 #endif
4725 ) = '\0';
4726
4727 }
4728 else {
4729 #line 14052 "./tex4ht-c.tex"
4730
4731 p = name; flag = FALSE;
4732 while( *(p++) == ch ){
4733 ch = (int) getc(cache_files);
4734 }
4735 if( (*(p-1) == '\0') && ((ch == '\n') || (ch == EOF)) ){ flag = TRUE; }
4736 else{
4737 while( (ch != '\n') && (ch != EOF) ) { ch = (int) getc(cache_files); }
4738 }
4739
4740
4741 if( flag ){
4742
4743 #line 14063 "./tex4ht-c.tex"
4744
4745 flag = FALSE;
4746 (IGNORED) fseek(dot_file, 0L,
4747 #line 2174 "./tex4ht-c.tex"
4748
4749 0
4750 );
4751 while( search_dot_file( typ ) && !flag ){ U_CHAR *q, save_ch;
4752 int n, m;
4753 q = dot_dir;
4754 do
4755 *(q++) = ch = (int) getc(dot_file);
4756 while( (ch !='\n') && (ch != EOF) );
4757 flag = *(q - 2) = '!';
4758 q -= (flag? 2 : 1);
4759 *(q - (*(q-1) ==
4760 #line 15562 "./tex4ht-c.tex"
4761
4762 #if defined(__DJGPP__)
4763 '\\'
4764 #else
4765 '/'
4766 #endif
4767
4768 )
4769 #ifdef DOS_WIN32
4770 - (*(q-1) == '/')
4771 #endif
4772 ) = '\0';
4773 if( (n = strlen((char *) dot_dir)) > (m = strlen((char *) cache_dir)) ){ flag = FALSE; }
4774 else {
4775 save_ch = *(cache_dir + n);
4776 *(cache_dir + n) = '\0';
4777 flag = eq_str(dot_dir,cache_dir) && ( flag || (m == n) );
4778 *(cache_dir + n) = save_ch;
4779 }
4780 }
4781
4782
4783 if( flag ){
4784 #line 14089 "./tex4ht-c.tex"
4785
4786 n = (int) strlen((char *) cache_dir);
4787 cache_dir[n] = dir_path_slash(cache_dir);
4788 cache_dir[n+1] = '\0';
4789 (IGNORED) strcat((char *) cache_dir, (char *) name);
4790
4791 }
4792 } }
4793 if ( ch != EOF ){ ch = (int) getc(cache_files); }
4794 }
4795
4796
4797 }
4798 #endif
4799 (IGNORED) fseek(dot_file, 0L,
4800 #line 2174 "./tex4ht-c.tex"
4801
4802 0
4803 );
4804 while( search_dot_file( typ ) ){
4805 ch = dir;
4806 while((*(ch++) = (int) getc(dot_file)) > ' ');
4807 while(*(ch-1) != '\n'){
4808 *(ch-1) = (int) getc(dot_file);
4809 }
4810 *(ch-1) = '\0';
4811 file = search_file_base(name, dir, flags, env_dirs);
4812 if( file != NULL ){
4813 #ifndef KPATHSEA
4814 tex4ht_fls = TRUE;
4815 #endif
4816 return file;
4817 } }
4818 return NULL;
4819 }
4820
4821
4822 #line 15358 "./tex4ht-c.tex"
4823
4824
4825 static FILE* search_file_base
4826 #ifdef ANSI
4827 #define SEP ,
4828 (
4829 const U_CHAR *name SEP
4830 const U_CHAR *dir SEP
4831 const U_CHAR *flags SEP
4832 struct env_var_rec *env_dirs
4833
4834 )
4835 #undef SEP
4836 #else
4837 #define SEP ;
4838 ( name, dir, flags, env_dirs)
4839 const U_CHAR *name SEP
4840 const U_CHAR *dir SEP
4841 const U_CHAR *flags SEP
4842 struct env_var_rec *env_dirs
4843
4844 ;
4845 #undef SEP
4846 #endif
4847 { U_CHAR *p;
4848 FILE* file;
4849 if( *dir == '~' ){
4850 while( TRUE ){
4851 p = abs_addr(dir, env_dirs? env_dirs->base : NULL);
4852 file = search_file(name, p, flags);
4853 free((void *) p);
4854 if( file || !env_dirs ){ return file; }
4855 env_dirs = env_dirs->next;
4856 }
4857 } else {
4858 file = search_file(name, dir, flags);
4859 }
4860 return file;
4861 }
4862
4863
4864 #line 15389 "./tex4ht-c.tex"
4865
4866
4867 static char * abs_addr
4868 #ifdef ANSI
4869 #define SEP ,
4870 (
4871 const U_CHAR *dir SEP
4872 const U_CHAR *base
4873
4874 )
4875 #undef SEP
4876 #else
4877 #define SEP ;
4878 ( dir, base)
4879 const U_CHAR *dir SEP
4880 const U_CHAR *base
4881
4882 ;
4883 #undef SEP
4884 #endif
4885 { U_CHAR *p;
4886 p = m_alloc(char, (int) strlen( dir ) +
4887 (base? (int) strlen( base ):0) +
4888 (int) strlen((char *) HOME_DIR ) + 1 );
4889 *p = '\0';
4890 if( (*(dir+1) == '~') && base ){
4891 if( *base == '~' ){
4892 (IGNORED) strct(p, HOME_DIR);
4893 (IGNORED) strct(p, base+1);
4894 } else {
4895 (IGNORED) strct(p, base);
4896 }
4897 (IGNORED) strct(p, dir+2);
4898 } else {
4899 (IGNORED) strct(p, HOME_DIR);
4900 (IGNORED) strct(p, dir+1);
4901 }
4902 return p;
4903 }
4904
4905
4906 #line 15430 "./tex4ht-c.tex"
4907
4908
4909 static FILE* search_file
4910 #ifdef ANSI
4911 #define SEP ,
4912 (
4913 const char *name SEP
4914 const U_CHAR *dir SEP
4915 const U_CHAR *flags
4916
4917 )
4918 #undef SEP
4919 #else
4920 #define SEP ;
4921 ( name, dir, flags )
4922 const char *name SEP
4923 const U_CHAR *dir SEP
4924 const U_CHAR *flags
4925
4926 ;
4927 #undef SEP
4928 #endif
4929 { FILE* file;
4930 U_CHAR str[256];
4931 int i;
4932 BOOL subs;
4933
4934 #line 15471 "./tex4ht-c.tex"
4935
4936 if( (file = f_open(name, flags)) != NULL ){
4937 return file; }
4938
4939
4940 (IGNORED) strcpy((char *) str, dir);
4941 i = (int) strlen((char *) str) - 1;
4942 subs = str[i] == '!';
4943 if( subs ) str[i] = '\0'; else i++;
4944
4945 #line 15455 "./tex4ht-c.tex"
4946
4947 (IGNORED) strct(str,
4948 #if defined(__DJGPP__)
4949 (( dir[i-1] == '/') || ( dir[i-1] == '\\'))
4950 ? ""
4951 : (is_forward_slash(dir)? "/" : "\\" )
4952 #else
4953 (dir[i-1] == '/')? "" : "/"
4954 #endif
4955 );
4956
4957
4958
4959
4960 #line 15476 "./tex4ht-c.tex"
4961
4962 (IGNORED) strct(str,name);
4963 if( (file = f_open(str, flags)) != NULL ){
4964 str[i] = '\0'; add_to_cache(str,name,i);
4965 return file; }
4966
4967
4968 str[i] = '\0';
4969 return subs? search_file_ext( name, str, flags):
4970 NULL;
4971 }
4972
4973
4974 #line 15490 "./tex4ht-c.tex"
4975
4976
4977 static void add_to_cache
4978 #ifdef ANSI
4979 #define SEP ,
4980 (
4981 const char* dir SEP const char* name SEP int n
4982
4983 )
4984 #undef SEP
4985 #else
4986 #define SEP ;
4987 (dir,name,n)
4988 const char* dir SEP const char* name SEP int n
4989
4990 ;
4991 #undef SEP
4992 #endif
4993 {
4994 struct cache_font_rec *cur_cache_font;
4995
4996
4997 #line 13685 "./tex4ht-c.tex"
4998
4999 { int found;
5000 found = FALSE;
5001 for( cur_cache_font = cache_font;
5002 cur_cache_font;
5003 cur_cache_font = cur_cache_font->next )
5004 { found = found || eq_str(cur_cache_font->dir, dir ) ;
5005 if( found ) break; }
5006 if( !found ){
5007 cur_cache_font = m_alloc(struct cache_font_rec, 1);
5008
5009 #line 13948 "./tex4ht-c.tex"
5010
5011 cur_cache_font->cache_file = (struct cache_file_rec *) 0;
5012
5013
5014 cur_cache_font->dir = m_alloc(char, n+1);
5015 (IGNORED) strcpy((char *) cur_cache_font->dir, dir);
5016 if( !cache_font ){
5017 cur_cache_font->next = cache_font;
5018 cache_font = cur_cache_font;
5019 } else if ( gt_str(cache_font->dir, dir) ) {
5020 cur_cache_font->next = cache_font;
5021 cache_font = cur_cache_font;
5022 } else {
5023 struct cache_font_rec * after_cache_font;
5024 after_cache_font = cache_font;
5025 while( after_cache_font->next ){
5026 if ( gt_str(after_cache_font->next->dir, dir) ) { break; }
5027 after_cache_font = after_cache_font->next;
5028 }
5029 cur_cache_font->next = after_cache_font->next;
5030 after_cache_font->next = cur_cache_font;
5031 } } }
5032
5033
5034
5035 #line 13952 "./tex4ht-c.tex"
5036
5037 {
5038 struct cache_file_rec *file_rec, *prev_file_rec;
5039 prev_file_rec = (struct cache_file_rec *) 0;
5040 file_rec = cur_cache_font->cache_file;
5041 while( file_rec ) {
5042 if( !gt_str(name,file_rec->file) ) break;
5043 prev_file_rec = file_rec;
5044 file_rec = file_rec->next;
5045 }
5046 {
5047 struct cache_file_rec * file_entry;
5048 BOOL flag;
5049 flag = TRUE;
5050 if( file_rec ) {
5051 if( eq_str(name,file_rec->file) ){ flag = FALSE; }
5052 }
5053 if( flag ) {
5054
5055 #line 13977 "./tex4ht-c.tex"
5056
5057 file_entry = m_alloc(struct cache_file_rec, 1);
5058 file_entry->file = m_alloc(char, strlen(name)+1);
5059 (IGNORED) strcpy((char *) file_entry->file, name);
5060 if( ! cur_cache_font->cache_file ){
5061 cur_cache_font->cache_file = file_entry;
5062 file_entry->next = (struct cache_file_rec *) 0;
5063 } else if( !prev_file_rec ){
5064 file_entry->next = cur_cache_font->cache_file;
5065 cur_cache_font->cache_file = file_entry;
5066 } else {
5067 file_entry->next = prev_file_rec->next;
5068 prev_file_rec->next = file_entry;
5069 }
5070
5071
5072 }
5073 }
5074 }
5075
5076
5077 }
5078
5079
5080 #line 15511 "./tex4ht-c.tex"
5081
5082
5083 static FILE* search_file_ext
5084 #ifdef ANSI
5085 #define SEP ,
5086 (
5087 const char *name SEP
5088 const U_CHAR *dir SEP
5089 const U_CHAR *flags
5090
5091 )
5092 #undef SEP
5093 #else
5094 #define SEP ;
5095 ( name, dir, flags )
5096 const char *name SEP
5097 const U_CHAR *dir SEP
5098 const U_CHAR *flags
5099
5100 ;
5101 #undef SEP
5102 #endif
5103 { U_CHAR str[256];
5104 FILE* file;
5105 int n;
5106 n = (int) strlen(dir);
5107 (IGNORED) sprintf(str,
5108 #if defined(__DJGPP__)
5109 (( dir[n-1] == '/') || ( dir[n-1] == '\\'))
5110 ? "%s%s"
5111 : (is_forward_slash(dir)? "%s/%s" : "%s\\%s" )
5112 #else
5113 (dir[n-1] == '/')? "%s%s" : "%s/%s"
5114 #endif
5115 , dir, name);
5116 if( (file = f_open(str,flags)) != NULL ){
5117 add_to_cache(dir,name,n);
5118 return file;
5119 }
5120 if( (str[n] ==
5121 #line 15562 "./tex4ht-c.tex"
5122
5123 #if defined(__DJGPP__)
5124 '\\'
5125 #else
5126 '/'
5127 #endif
5128
5129 )
5130 #ifdef DOS_WIN32
5131 || (str[n] == '/' )
5132 #endif
5133 ) n++;
5134 str[n-1] = '\0';
5135 #ifndef NOSUBDIR
5136 #ifdef WIN32
5137
5138 #line 537 "./tex4ht-c.tex"
5139
5140 {
5141 WIN32_FIND_DATA find_file_data;
5142 HANDLE hnd;
5143 int proceed;
5144 (IGNORED) strcpy((char *) dirname, (char *) str);
5145 strct(dirname, "/*.*");
5146 hnd = FindFirstFile(dirname, &find_file_data);
5147 if (hnd != INVALID_HANDLE_VALUE) {
5148
5149 #line 551 "./tex4ht-c.tex"
5150
5151 proceed = 1;
5152 while (proceed) {
5153 if( !eq_str(find_file_data.cFileName, ".") &&
5154 !eq_str(find_file_data.cFileName, "..") )
5155 {
5156 (IGNORED) strcpy((char *) str+n, (char *) find_file_data.cFileName );
5157 str[n-1] = dir_path_slash(str);
5158 if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
5159 if( (file = search_file_ext(name, str, flags)) != NULL ){
5160 FindClose(hnd);
5161 return file; }
5162 }
5163 }
5164 proceed = FindNextFile(hnd, &find_file_data);
5165 }
5166 FindClose(hnd);
5167
5168
5169 }
5170 }
5171
5172
5173 #else
5174
5175 #line 15602 "./tex4ht-c.tex"
5176
5177 { DIR *dp;
5178
5179 #line 15731 "./tex4ht-c.tex"
5180
5181
5182 #ifdef STRUCT_DIRECT
5183 struct direct
5184 #else
5185 struct dirent
5186 #endif
5187
5188 *dirp;
5189 struct STSTAT buf;
5190 if( (dp = opendir( str )) != NULL ){
5191 while( (dirp = readdir(dp)) != NULL ){
5192 if( !eq_str(dirp->d_name, ".") &&
5193 !eq_str(dirp->d_name, "..") )
5194 {
5195 #line 15617 "./tex4ht-c.tex"
5196
5197 (IGNORED) strcpy((char *) str+n, (char *) dirp->d_name );
5198 str[n-1] = dir_path_slash(str);
5199 if( LSTAT(str, &buf) >= 0 )
5200 if( S_ISDIR( buf.st_mode ) )
5201 if( (file = search_file_ext(name, str, flags)) != NULL ){
5202 (void) closedir(dp);
5203 return file; }
5204
5205
5206 } }
5207 (void) closedir(dp);
5208 } }
5209
5210
5211 #endif
5212 #endif
5213 return NULL;
5214 }
5215
5216
5217 #line 15588 "./tex4ht-c.tex"
5218
5219 #if defined(__DJGPP__)
5220
5221 static BOOL is_forward_slash
5222 #ifdef ANSI
5223 #define SEP ,
5224 (
5225 const char* str
5226 )
5227 #undef SEP
5228 #else
5229 #define SEP ;
5230 (str)
5231 const char* str
5232 ;
5233 #undef SEP
5234 #endif
5235 {
5236 while( *str ){ if( *(str++) == '/' ) { return TRUE; } }
5237 return FALSE;
5238 }
5239 #endif
5240
5241
5242 #line 15810 "./tex4ht-c.tex"
5243
5244
5245 static FILE* f_open_pathed_filename
5246 #ifdef ANSI
5247 #define SEP ,
5248 (
5249 const char* name SEP
5250 const char* flags
5251 )
5252 #undef SEP
5253 #else
5254 #define SEP ;
5255 ( name, flags )
5256 const char* name SEP
5257 const char* flags
5258 ;
5259 #undef SEP
5260 #endif
5261 { FILE* file;
5262 U_CHAR *str;
5263 file = NULL;
5264 if( *name == '~' ){
5265 if( HOME_DIR ){
5266 str = m_alloc(char, strlen((char *) HOME_DIR)+strlen(name));
5267 (IGNORED) sprintf(str,"%s%s", HOME_DIR, name+1);
5268 file = f_open(str,flags);
5269 free((void *) str);
5270 }
5271 } else { file = f_open( name, flags ); }
5272 return file;
5273 }
5274
5275
5276 #line 15844 "./tex4ht-c.tex"
5277
5278
5279 static INTEGER put_4ht_ch
5280 #ifdef ANSI
5281 #define SEP ,
5282 ( int ch SEP FILE* htFile
5283 )
5284 #undef SEP
5285 #else
5286 #define SEP ;
5287 (ch,htFile) int ch SEP FILE* htFile
5288 ;
5289 #undef SEP
5290 #endif
5291 {
5292 int c;
5293 c = ch;
5294 if( ch=='&' ){
5295
5296 #line 15910 "./tex4ht-c.tex"
5297
5298 flush_uni();
5299
5300
5301 if( put_4ht_off ){
5302 c = putc( ch, htFile );
5303 } else {
5304 uni_code[0] = '&';
5305 uni_code_p = 1;
5306 put_4ht_file = htFile;
5307 }
5308 } else
5309 if( uni_code_p ){
5310 if( ch == ';' ){
5311 #line 16133 "./tex4ht-c.tex"
5312
5313 if( uni_code[1] != '#' ){
5314
5315 #line 15910 "./tex4ht-c.tex"
5316
5317 flush_uni();
5318
5319
5320 (IGNORED) putc( ch, htFile );
5321 }
5322 else{
5323 int i, base, value, digit;
5324 if( (uni_code[2] == 'x') || (uni_code[2] == 'X') ){
5325 base =16; i=3;
5326 } else { base=10; i=2; }
5327 value = 0;
5328 for( ; i<uni_code_p; i++ ){
5329 digit = uni_code[i];
5330 if( (digit>='0') && (digit<='9') ){ digit -= '0'; }
5331 else if( (digit>='A') && (digit<='F') ){ digit -= BASE_A; }
5332 else if( (digit>='a') && (digit<='f') ){ digit -= BASE_a; }
5333 else { value = -1; break; }
5334 if( digit >= base ){ value=-1; break; }
5335 value = value*base + digit;
5336 }
5337 if( value<0 ){
5338 #line 15910 "./tex4ht-c.tex"
5339
5340 flush_uni();
5341
5342
5343 (IGNORED) putc( ch, htFile );
5344 } else {
5345
5346 #line 16160 "./tex4ht-c.tex"
5347
5348 int bottom, mid, top;
5349 BOOL found=FALSE;
5350 bottom = 0; top = charset_n;
5351 while( !found ){
5352 mid = (bottom + top) / 2;
5353 if( value == charset[mid].ch ){
5354
5355 #line 16186 "./tex4ht-c.tex"
5356
5357 { U_CHAR *p;
5358 p = charset[mid].str;
5359 while( *p != '\0' ){
5360 if( *p=='\\' ){
5361 p++;
5362 if( *p=='\\' ){
5363 (IGNORED) putc( '\\', htFile );
5364 } else {
5365 int i;
5366 i = *p - '0';
5367 while( *(++p) != '\\' ){ i = 10*i + *p - '0'; }
5368 (IGNORED) putc( i, htFile );
5369 } }
5370 else {
5371 (IGNORED) putc( *p, htFile );
5372 if ( (*p=='&') && u10 ){
5373 #line 16260 "./tex4ht-c.tex"
5374
5375 if ( *(p+1) == '#' ){
5376 p++;
5377 (IGNORED) putc( '#', htFile );
5378 if ( (*(p+1) == 'x') || (*(p+1) == 'X') ){
5379 int value, digit;
5380 U_CHAR *q;
5381 q = p+2;
5382 value = 0;
5383 digit = *(q++);
5384 while( digit!=0 ){
5385 if( (digit>='0') && (digit<='9') ){
5386 value = value*16 + digit - '0';
5387 }
5388 else if( (digit>='A') && (digit<='F') ){
5389 value = value*16 + digit - 'A'+10;
5390 }
5391 else if( (digit>='a') && (digit<='f') ){
5392 value = value*16 + digit - 'a'+10; }
5393 else {
5394 if( digit == ';' ){
5395
5396 #line 16291 "./tex4ht-c.tex"
5397
5398 char uni_10[MAX_UNI_CODE];
5399 int n;
5400 n = 0;
5401 while( value>0 ){
5402 uni_10[ n++ ] = value % 10 + '0';
5403 value /= 10;
5404 }
5405 while( n>0 ){
5406 (IGNORED) putc( uni_10[--n], htFile );
5407 }
5408
5409
5410 p=q-2;
5411 }
5412 break;
5413 }
5414 digit = *(q++);
5415 }
5416 } }
5417
5418 }
5419 }
5420 p++;
5421 } }
5422
5423
5424 found = TRUE;
5425 } else if( value < charset[mid].ch ){
5426 if( bottom == top ){ break; }
5427 top = mid;
5428 }
5429 else {
5430 if ( bottom < mid ){ bottom = mid; }
5431 else if ( bottom<top ){ bottom++; }
5432 else{ break; }
5433 }
5434 }
5435 if( ! found ){
5436 if( u10 || utf8 ){
5437 #line 16229 "./tex4ht-c.tex"
5438
5439 short n;
5440 long dec;
5441 int ch;
5442 char uni_10[MAX_UNI_CODE];
5443 if( (uni_code[2] == 'x') || (uni_code[2] == 'X') ) {
5444 dec = 0;
5445 for( n=3; n<uni_code_p; n++ ){
5446 ch = uni_code[n];
5447 dec = 16*dec +
5448 ((ch > '9')?
5449 ( 10 + ((ch > 'Z')? (ch-'a') : (ch-'A')) )
5450 : (ch-'0'));
5451 }
5452 if( u10 ){
5453 #line 16249 "./tex4ht-c.tex"
5454
5455 if( dec == 0 ){
5456 uni_code_p = 3; uni_code[2] = '0';
5457 } else {
5458 n = 0;
5459 while( dec > 0 ){ uni_10[ n++ ] = dec % 10 + '0'; dec /= 10; }
5460 uni_code_p = 2;
5461 while( n>0 ){ uni_code[ uni_code_p++ ] = uni_10[ --n ]; }
5462 }
5463
5464 }
5465 else {
5466 #line 16370 "./tex4ht-c.tex"
5467
5468
5469 #line 16320 "./tex4ht-c.tex"
5470
5471 if( dec < 0x80 ){
5472 uni_code_p = 1; uni_code[0] = dec;
5473 }
5474 else if( dec < 0x800 ){
5475 uni_code_p = 2;
5476 uni_code[0] = (dec >> 6) | 0xC0;
5477 uni_code[1] = (dec & 0x3F) | 0x80;
5478 }
5479 else if( dec < 0x10000 ){
5480 uni_code_p = 3;
5481 uni_code[0] = (dec >> 12) | 0xE0;
5482 uni_code[1] = ((dec >> 6) & 0x3F) | 0x80;
5483 uni_code[2] = (dec & 0x3F) | 0x80;
5484 }
5485 else if( dec < 0x200000 ){
5486 uni_code_p = 4;
5487 uni_code[0] = (dec >> 18) | 0xF0;
5488 uni_code[1] = ((dec >> 12) & 0x3F) | 0x80;
5489 uni_code[2] = ((dec >> 6) & 0x3F) | 0x80;
5490 uni_code[3] = (dec & 0x3F) | 0x80;
5491 }
5492 else if( dec < 0x4000000 ){
5493 uni_code_p = 5;
5494 uni_code[0] = (dec >> 24) | 0xF8;
5495 uni_code[1] = ((dec >> 18) & 0x3F) | 0x80;
5496 uni_code[2] = ((dec >> 12) & 0x3F) | 0x80;
5497 uni_code[3] = ((dec >> 6) & 0x3F) | 0x80;
5498 uni_code[4] = (dec & 0x3F) | 0x80;
5499 }
5500 else if( dec <= 0x7FFFFFFF ){
5501 uni_code_p = 6;
5502 uni_code[0] = (dec >> 30) | 0xFC;
5503 uni_code[1] = ((dec >> 24) & 0x3F) | 0x80;
5504 uni_code[2] = ((dec >> 18) & 0x3F) | 0x80;
5505 uni_code[3] = ((dec >> 12) & 0x3F) | 0x80;
5506 uni_code[4] = ((dec >> 6) & 0x3F) | 0x80;
5507 uni_code[5] = (dec & 0x3F) | 0x80;
5508 }
5509
5510
5511 else {
5512 n = 0;
5513 while( dec > 0 ){ uni_10[ n++ ] = dec % 10 + '0'; dec /= 10; }
5514 uni_code_p = 2;
5515 while( n>0 ){ uni_code[ uni_code_p++ ] = uni_10[ --n ]; }
5516 }
5517
5518 }
5519 }
5520
5521 }
5522
5523 #line 15910 "./tex4ht-c.tex"
5524
5525 flush_uni();
5526
5527
5528 if( !utf8 ){ (IGNORED) putc( ch, htFile ); }
5529 }
5530
5531
5532 } }
5533
5534 uni_code_p = 0; }
5535 else if ( ((uni_code_p+1) == MAX_UNI_CODE)
5536 ||
5537 ( ((ch<'0') || (ch>'9'))
5538 && ((ch<'a') || (ch>'f'))
5539 && ((ch<'A') || (ch>'F'))
5540 && (ch!='#')
5541 && (ch!='x')
5542 && (ch!='X')
5543 )
5544 )
5545 {
5546 #line 15910 "./tex4ht-c.tex"
5547
5548 flush_uni();
5549
5550
5551 c = putc( ch, htFile );
5552 } else { uni_code[ uni_code_p++ ] = ch; }
5553 } else { c = putc( ch, htFile ); }
5554 return c;
5555 }
5556
5557
5558 #line 15918 "./tex4ht-c.tex"
5559
5560 static void flush_uni( MYVOID )
5561 {
5562 int i;
5563 for( i=0; i<uni_code_p; i++ ){
5564 (IGNORED) putc( uni_code[i], put_4ht_file );
5565 }
5566 uni_code_p = 0;
5567 put_4ht_file = (FILE *) 0;
5568 }
5569
5570
5571 #line 16586 "./tex4ht-c.tex"
5572
5573
5574 static INTEGER insert_ch
5575 #ifdef ANSI
5576 #define SEP ,
5577 ( int ch
5578 )
5579 #undef SEP
5580 #else
5581 #define SEP ;
5582 (ch) int ch
5583 ;
5584 #undef SEP
5585 #endif
5586 {
5587 if( !ignore_chs ){
5588 BOOL flag;
5589
5590 #line 16608 "./tex4ht-c.tex"
5591
5592 flag = FALSE;
5593 if(
5594 #line 4342 "./tex4ht-c.tex"
5595
5596 next_str
5597
5598 ) {
5599 if( eq_str(next_str, "") ) {
5600 flag = TRUE;
5601 free((void *) next_str);
5602 next_str = (char *) 0;
5603 } }
5604
5605
5606 if( !flag ){
5607 try_new_line();
5608
5609 #line 10653 "./tex4ht-c.tex"
5610
5611
5612 #line 12302 "./tex4ht-c.tex"
5613
5614 if( x_val > needs_end_accent ){
5615
5616 #line 12285 "./tex4ht-c.tex"
5617
5618 if( needs_end_accent && t_accent_template ){
5619
5620 #line 2613 "./tex4ht-c.tex"
5621
5622 if( span_on && in_span_ch ){
5623 if( *end_span[0] ){
5624 in_span_ch = FALSE;
5625
5626 #line 1715 "./tex4ht-c.tex"
5627
5628 if( no_root_file ){ open_o_file(); }
5629
5630
5631 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
5632 } }
5633
5634
5635 (IGNORED) fprintf(cur_o_file, "%s", t_accent_fifth);
5636 needs_end_accent = FALSE;
5637 #line 12428 "./tex4ht-c.tex"
5638
5639 needs_accented_sym--;
5640
5641
5642 }
5643
5644
5645 }
5646
5647
5648
5649 #line 2543 "./tex4ht-c.tex"
5650
5651 if( span_on && (default_font != font_tbl[cur_fnt].num) ){
5652 if( !ch_map_flag && start_span ){
5653 if( span_name_on ){
5654
5655 #line 1715 "./tex4ht-c.tex"
5656
5657 if( no_root_file ){ open_o_file(); }
5658
5659
5660 if( span_open[0] ) if( *span_open[0] )
5661 (IGNORED) fprintf(cur_o_file, "%s", span_open[0]);
5662 if( span_name[0] ) if( *span_name[0] )
5663 (IGNORED) fprintf(cur_o_file,
5664 span_name[0], font_tbl[cur_fnt].family_name);
5665 if( span_size[0] ) if( *span_size[0] )
5666 (IGNORED) fprintf(cur_o_file,
5667 span_size[0], font_tbl[cur_fnt].font_size);
5668 if( span_mag[0] )
5669 if( *span_mag[0] && (font_tbl[cur_fnt].mag != 100))
5670 (IGNORED) fprintf(cur_o_file,
5671 span_mag[0], font_tbl[cur_fnt].mag);
5672 if( span_ch[0] ) if( *span_ch[0] )
5673 (IGNORED) fprintf(cur_o_file, "%s", span_ch[0]);
5674 }
5675 start_span = FALSE;
5676 }
5677 }
5678
5679
5680 #line 2901 "./tex4ht-c.tex"
5681
5682 if( trace_dvi_C ){
5683 if( !ch_map_flag ){
5684
5685 #line 1715 "./tex4ht-c.tex"
5686
5687 if( no_root_file ){ open_o_file(); }
5688
5689
5690 if( *trace_dvi_del_C != '\0' ){
5691 (IGNORED) fprintf(cur_o_file,
5692 block_start? "%s%s %d B" : "%s%s %d",
5693 trace_dvi_del_C, font_tbl[cur_fnt].name, ch);
5694 }
5695 (IGNORED) fprintf(cur_o_file,"%s", end_trace_dvi_del_C);
5696 }
5697 block_start = FALSE;
5698 }
5699
5700
5701
5702 #line 12917 "./tex4ht-c.tex"
5703
5704 if( show_class && !pause_class && !ignore_subclass_del){
5705 if( !stack[stack_n].no_left_del && stack[stack_n+1].active_class_del ){
5706
5707 #line 12992 "./tex4ht-c.tex"
5708
5709 (IGNORED) print_f( (stack[stack_n+1].temp_class_del)?
5710 stack[stack_n+1].temp_class_open
5711 : stack[stack_n+1].class_open);
5712
5713
5714 if( !stack[stack_n+1].ignore_subclass_del ){
5715
5716 #line 12930 "./tex4ht-c.tex"
5717
5718 math_class = math_class_of( ch, cur_fnt );
5719 (IGNORED) print_f( open_class[math_class]);
5720
5721
5722 }
5723 } else {
5724
5725 #line 12930 "./tex4ht-c.tex"
5726
5727 math_class = math_class_of( ch, cur_fnt );
5728 (IGNORED) print_f( open_class[math_class]);
5729
5730
5731 } }
5732
5733
5734 #line 8198 "./tex4ht-c.tex"
5735
5736 if( pos_dvi ){ long int d;
5737 if( *pos_text ){
5738
5739 #line 1715 "./tex4ht-c.tex"
5740
5741 if( no_root_file ){ open_o_file(); }
5742
5743
5744 (IGNORED) fprintf(cur_o_file, pos_text,
5745 pos_x_A * (x_val - base_pos_x) + pos_x_B,
5746 pos_y_C * (y_val - base_pos_y) + pos_y_D);
5747 }
5748 if( x_val < min_pos_x ) min_pos_x = x_val;
5749 if( (d = x_val +
5750 #line 9855 "./tex4ht-c.tex"
5751
5752 (int)(
5753 #line 9841 "./tex4ht-c.tex"
5754
5755 design_size_to_pt( *(font_tbl[cur_fnt].wtbl
5756 + (int) (
5757 #line 9849 "./tex4ht-c.tex"
5758
5759 *(font_tbl[cur_fnt].char_wi + (int)
5760 ( ch - font_tbl[cur_fnt].char_f)% 256)
5761
5762 ) )
5763 )
5764 * (double) font_tbl[cur_fnt].scale
5765
5766 )
5767
5768 ) > max_pos_x ) max_pos_x = d;
5769 if( (d = y_val -
5770 #line 9879 "./tex4ht-c.tex"
5771
5772 (int)(
5773 #line 9864 "./tex4ht-c.tex"
5774
5775 design_size_to_pt( *(font_tbl[cur_fnt].htbl
5776 + (int) (
5777 #line 9871 "./tex4ht-c.tex"
5778
5779 ( *(font_tbl[cur_fnt].char_hidp + (int)
5780 ( ch - font_tbl[cur_fnt].char_f)% 256)
5781 >> 4
5782 ) & 0x0F
5783
5784 )) )
5785 * (double) font_tbl[cur_fnt].scale
5786
5787 )
5788
5789 ) < min_pos_y ) min_pos_y = d;
5790 if( (d = y_val +
5791 #line 9902 "./tex4ht-c.tex"
5792
5793 (int)(
5794 #line 9888 "./tex4ht-c.tex"
5795
5796 design_size_to_pt( *(font_tbl[cur_fnt].dtbl
5797 + (int) (
5798 #line 9895 "./tex4ht-c.tex"
5799
5800 ( *(font_tbl[cur_fnt].char_hidp + (int)
5801 ( ch - font_tbl[cur_fnt].char_f)% 256)
5802 ) & 0x0F
5803
5804 )) )
5805 * (double) font_tbl[cur_fnt].scale
5806
5807 )
5808
5809 ) > max_pos_y ) max_pos_y = d;
5810 }
5811
5812
5813
5814 #line 12396 "./tex4ht-c.tex"
5815
5816 if( a_accent_template && needs_accented_sym ){
5817 (IGNORED) fprintf(cur_o_file, "%s%s%s%d%s%d%s",
5818 a_accent_first, font_tbl[cur_fnt].family_name,
5819 a_accent_second, ch, a_accent_third,
5820 font_tbl[cur_fnt].accented[ch]?
5821 font_tbl[cur_fnt].accented_array[font_tbl[cur_fnt].accented[ch]-1]
5822 : 0,
5823 a_accent_fourth);
5824 }
5825
5826
5827 if(
5828 #line 4336 "./tex4ht-c.tex"
5829
5830 next_char
5831
5832 != -1 ) {
5833
5834 #line 1715 "./tex4ht-c.tex"
5835
5836 if( no_root_file ){ open_o_file(); }
5837
5838
5839 (IGNORED) put_4ht_ch(
5840 #line 4336 "./tex4ht-c.tex"
5841
5842 next_char
5843
5844 , cur_o_file );
5845
5846 #line 4336 "./tex4ht-c.tex"
5847
5848 next_char
5849
5850 = -1;
5851 } else if(
5852 #line 4342 "./tex4ht-c.tex"
5853
5854 next_str
5855
5856 ) {
5857
5858 #line 4351 "./tex4ht-c.tex"
5859
5860 if( keepChar ){
5861 keepChar=FALSE;
5862 {
5863 #line 10682 "./tex4ht-c.tex"
5864
5865 int gif_flag, chr, r_ch;
5866 BOOL ch_str_flag;
5867 r_ch = ch - font_tbl[cur_fnt].char_f;
5868 gif_flag = font_tbl[cur_fnt].gif1[r_ch];
5869 ch_str_flag = get_bit( font_tbl[cur_fnt].ch_str, r_ch);
5870 chr = ((r_ch == 255) && font_tbl[cur_fnt].ch255 )? 256 :
5871 *(font_tbl[cur_fnt].ch + r_ch);
5872 if( (gif_flag % 2) || ch_str_flag ){ design_ch = ch;
5873 {
5874 #line 10705 "./tex4ht-c.tex"
5875
5876 U_CHAR str[256], *p;
5877 BOOL sv;
5878 int mag;
5879 sv = special_on; special_on = TRUE;
5880 if( gif_ch && (gif_flag % 2) ){
5881
5882 #line 1715 "./tex4ht-c.tex"
5883
5884 if( no_root_file ){ open_o_file(); }
5885
5886
5887 if( !gif_open[gif_flag] ){
5888
5889 #line 10782 "./tex4ht-c.tex"
5890
5891 (IGNORED) sprintf(str,
5892 "configuration for htf class %d (char %d of %s.htf)",
5893 gif_flag, ch,font_tbl[cur_fnt].name
5894 );
5895 warn_i_str(50,str);
5896
5897
5898 #line 10790 "./tex4ht-c.tex"
5899
5900 gif_open[gif_flag] = m_alloc(char,
5901
5902 #line 10815 "./tex4ht-c.tex"
5903
5904 29
5905
5906 );
5907 (IGNORED) strcpy((char *) gif_open[gif_flag],
5908
5909 #line 10811 "./tex4ht-c.tex"
5910
5911 "<img src=\"+\" alt=\"+++++\" />+"
5912
5913 );
5914 gif_alt[gif_flag] = gif_open[gif_flag]+11;
5915 *(gif_alt[gif_flag] - 1) = '\0';
5916 gif_class[gif_flag] = gif_open[gif_flag]+19;
5917 *(gif_class[gif_flag] - 1) = '\0';
5918 gif_size[gif_flag] = gif_open[gif_flag]+20;
5919 *(gif_size[gif_flag] - 1) = '\0';
5920 gif_mag[gif_flag] = gif_open[gif_flag]+21;
5921 *(gif_mag[gif_flag] - 1) = '\0';
5922 gif_ord[gif_flag] = gif_open[gif_flag]+22;
5923 *(gif_ord[gif_flag] - 1) = '\0';
5924 gif_end[gif_flag] = gif_open[gif_flag]+23;
5925 *(gif_end[gif_flag] - 1) = '\0';
5926 gif_id[gif_flag] = gif_open[gif_flag]+28;
5927 *(gif_id[gif_flag] - 1) = '\0';
5928
5929
5930 } else if( !get_bit( class_on, gif_flag ) ) {
5931 notify_class_info(gif_flag);
5932 store_bit_I( class_on, gif_flag );
5933 }
5934
5935 #line 11471 "./tex4ht-c.tex"
5936
5937 p= gif_open[gif_flag];
5938 if( p )
5939 if( *p ){
5940 print_f(p); (IGNORED) strcpy((char *) str, (char *) font_tbl[cur_fnt].name);
5941 mag = (int) ((double) font_tbl[cur_fnt].scale /
5942 font_tbl[cur_fnt].design_sz * 10 );
5943
5944 #line 10897 "./tex4ht-c.tex"
5945
5946 if( !dos_file_names ){
5947 print_f(font_tbl[cur_fnt].name);
5948 if( mag == 10 ) (IGNORED) sprintf(str, GIF_I, design_ch, gif);
5949 else (IGNORED) sprintf(str, GIF_II, mag, design_ch, gif);
5950 }
5951
5952
5953 #line 10918 "./tex4ht-c.tex"
5954
5955
5956 if( dos_file_names ){
5957 dos_gif_file(str, mag, design_ch);
5958 print_f(str);
5959 (IGNORED) sprintf(str, GIF_VII, gif);
5960 }
5961
5962
5963
5964 print_f(str);
5965 add_bit( font_tbl[cur_fnt].gif_on, r_ch, 1 );
5966 }
5967
5968
5969
5970 #line 11504 "./tex4ht-c.tex"
5971
5972 p = gif_alt[gif_flag];
5973 if( p )
5974 if( *p ){
5975 print_f(p); put_alt_ch(chr,ch_str_flag);
5976 }
5977
5978
5979
5980 #line 11518 "./tex4ht-c.tex"
5981
5982 p = gif_class[gif_flag];
5983 if( p )
5984 if( *p ){
5985 (IGNORED) fprintf(cur_o_file, p,
5986 font_tbl[cur_fnt].family_name); }
5987
5988
5989
5990 #line 11542 "./tex4ht-c.tex"
5991
5992 p = gif_size[gif_flag];
5993 if( p )
5994 if( *p ){
5995 (IGNORED) fprintf(cur_o_file, p,
5996 font_tbl[cur_fnt].font_size); }
5997
5998
5999
6000 #line 11559 "./tex4ht-c.tex"
6001
6002 p = gif_mag[gif_flag];
6003 if( p )
6004 if( *p && (font_tbl[cur_fnt].mag != 100) ){
6005 (IGNORED) fprintf(cur_o_file, p, font_tbl[cur_fnt].mag);
6006 }
6007
6008
6009
6010 #line 11574 "./tex4ht-c.tex"
6011
6012 p = gif_ord[gif_flag];
6013 if( p )
6014 if( *p ){
6015 (IGNORED) fprintf(cur_o_file, p, ch);
6016 }
6017
6018
6019
6020 #line 11591 "./tex4ht-c.tex"
6021
6022 p = gif_end[gif_flag];
6023 if( p )
6024 if( *p ){ print_f( p ); }
6025
6026
6027 } else {
6028 #line 10834 "./tex4ht-c.tex"
6029
6030 if( !gif_flag || (gif_flag % 2) || ch_map_flag ) {
6031 put_alt_ch(chr,ch_str_flag); }
6032 else{
6033 #line 11727 "./tex4ht-c.tex"
6034
6035
6036 #line 11743 "./tex4ht-c.tex"
6037
6038 if( gif_flag && !get_bit( class_on, gif_flag ) ) {
6039 notify_class_info(gif_flag);
6040 store_bit_I( class_on, gif_flag );
6041 }
6042
6043
6044 if( span_on ){
6045
6046 #line 11753 "./tex4ht-c.tex"
6047
6048 if( span_open[gif_flag] )
6049 if( *span_open[gif_flag] ){
6050 print_f( span_open[gif_flag] );
6051 }
6052
6053
6054
6055 #line 11777 "./tex4ht-c.tex"
6056
6057 if( span_name[gif_flag] )
6058 if( *span_name[gif_flag] ){
6059 (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
6060 font_tbl[cur_fnt].family_name);
6061 }
6062
6063
6064
6065 #line 11787 "./tex4ht-c.tex"
6066
6067 if( span_size[gif_flag] )
6068 if( *span_size[gif_flag] ){
6069 (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
6070 font_tbl[cur_fnt].font_size);
6071 }
6072
6073
6074
6075 #line 11796 "./tex4ht-c.tex"
6076
6077 if( span_mag[gif_flag] )
6078 if( *span_mag[gif_flag] ){
6079 (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
6080 font_tbl[cur_fnt].mag);
6081 }
6082
6083
6084
6085 #line 11805 "./tex4ht-c.tex"
6086
6087 if( span_ord[gif_flag] )
6088 if( *span_ord[gif_flag] ){
6089 (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
6090 }
6091
6092
6093
6094 #line 11769 "./tex4ht-c.tex"
6095
6096 if( span_ch[gif_flag] )
6097 if( *span_ch[gif_flag] ){
6098 print_f( span_ch[gif_flag] );
6099 }
6100
6101
6102 }
6103 put_alt_ch(chr,ch_str_flag);
6104 if( span_on ){
6105
6106 #line 11760 "./tex4ht-c.tex"
6107
6108 if( end_span[gif_flag] )
6109 if( *end_span[gif_flag] ){
6110 print_f( end_span[gif_flag] );
6111 }
6112
6113
6114 }
6115
6116 }
6117
6118 }
6119 special_on = sv;
6120
6121 } design_ch = 0; }
6122 else {
6123 #line 10825 "./tex4ht-c.tex"
6124
6125 if( !gif_flag || (gif_flag % 2) || ch_map_flag ) { put_char(chr);
6126 } else{
6127 #line 11708 "./tex4ht-c.tex"
6128
6129
6130 #line 1715 "./tex4ht-c.tex"
6131
6132 if( no_root_file ){ open_o_file(); }
6133
6134
6135
6136 #line 11743 "./tex4ht-c.tex"
6137
6138 if( gif_flag && !get_bit( class_on, gif_flag ) ) {
6139 notify_class_info(gif_flag);
6140 store_bit_I( class_on, gif_flag );
6141 }
6142
6143
6144 if( span_on ){
6145
6146 #line 11753 "./tex4ht-c.tex"
6147
6148 if( span_open[gif_flag] )
6149 if( *span_open[gif_flag] ){
6150 print_f( span_open[gif_flag] );
6151 }
6152
6153
6154
6155 #line 11777 "./tex4ht-c.tex"
6156
6157 if( span_name[gif_flag] )
6158 if( *span_name[gif_flag] ){
6159 (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
6160 font_tbl[cur_fnt].family_name);
6161 }
6162
6163
6164
6165 #line 11787 "./tex4ht-c.tex"
6166
6167 if( span_size[gif_flag] )
6168 if( *span_size[gif_flag] ){
6169 (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
6170 font_tbl[cur_fnt].font_size);
6171 }
6172
6173
6174
6175 #line 11796 "./tex4ht-c.tex"
6176
6177 if( span_mag[gif_flag] )
6178 if( *span_mag[gif_flag] ){
6179 (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
6180 font_tbl[cur_fnt].mag);
6181 }
6182
6183
6184
6185 #line 11805 "./tex4ht-c.tex"
6186
6187 if( span_ord[gif_flag] )
6188 if( *span_ord[gif_flag] ){
6189 (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
6190 }
6191
6192
6193
6194 #line 11769 "./tex4ht-c.tex"
6195
6196 if( span_ch[gif_flag] )
6197 if( *span_ch[gif_flag] ){
6198 print_f( span_ch[gif_flag] );
6199 }
6200
6201
6202 }
6203 put_char(chr);
6204 if( span_on ){
6205
6206 #line 11760 "./tex4ht-c.tex"
6207
6208 if( end_span[gif_flag] )
6209 if( *end_span[gif_flag] ){
6210 print_f( end_span[gif_flag] );
6211 }
6212
6213
6214 }
6215
6216 }
6217
6218 }
6219
6220 }
6221 }
6222
6223
6224 print_f_4ht(next_str); free((void *) next_str);
6225 next_str = (char *) 0;
6226 } else {
6227 if( verb_ch ){
6228
6229 #line 1715 "./tex4ht-c.tex"
6230
6231 if( no_root_file ){ open_o_file(); }
6232
6233
6234 (IGNORED) put_4ht_ch( ch, cur_o_file );
6235 } else {
6236 #line 10682 "./tex4ht-c.tex"
6237
6238 int gif_flag, chr, r_ch;
6239 BOOL ch_str_flag;
6240 r_ch = ch - font_tbl[cur_fnt].char_f;
6241 gif_flag = font_tbl[cur_fnt].gif1[r_ch];
6242 ch_str_flag = get_bit( font_tbl[cur_fnt].ch_str, r_ch);
6243 chr = ((r_ch == 255) && font_tbl[cur_fnt].ch255 )? 256 :
6244 *(font_tbl[cur_fnt].ch + r_ch);
6245 if( (gif_flag % 2) || ch_str_flag ){ design_ch = ch;
6246 {
6247 #line 10705 "./tex4ht-c.tex"
6248
6249 U_CHAR str[256], *p;
6250 BOOL sv;
6251 int mag;
6252 sv = special_on; special_on = TRUE;
6253 if( gif_ch && (gif_flag % 2) ){
6254
6255 #line 1715 "./tex4ht-c.tex"
6256
6257 if( no_root_file ){ open_o_file(); }
6258
6259
6260 if( !gif_open[gif_flag] ){
6261
6262 #line 10782 "./tex4ht-c.tex"
6263
6264 (IGNORED) sprintf(str,
6265 "configuration for htf class %d (char %d of %s.htf)",
6266 gif_flag, ch,font_tbl[cur_fnt].name
6267 );
6268 warn_i_str(50,str);
6269
6270
6271 #line 10790 "./tex4ht-c.tex"
6272
6273 gif_open[gif_flag] = m_alloc(char,
6274
6275 #line 10815 "./tex4ht-c.tex"
6276
6277 29
6278
6279 );
6280 (IGNORED) strcpy((char *) gif_open[gif_flag],
6281
6282 #line 10811 "./tex4ht-c.tex"
6283
6284 "<img src=\"+\" alt=\"+++++\" />+"
6285
6286 );
6287 gif_alt[gif_flag] = gif_open[gif_flag]+11;
6288 *(gif_alt[gif_flag] - 1) = '\0';
6289 gif_class[gif_flag] = gif_open[gif_flag]+19;
6290 *(gif_class[gif_flag] - 1) = '\0';
6291 gif_size[gif_flag] = gif_open[gif_flag]+20;
6292 *(gif_size[gif_flag] - 1) = '\0';
6293 gif_mag[gif_flag] = gif_open[gif_flag]+21;
6294 *(gif_mag[gif_flag] - 1) = '\0';
6295 gif_ord[gif_flag] = gif_open[gif_flag]+22;
6296 *(gif_ord[gif_flag] - 1) = '\0';
6297 gif_end[gif_flag] = gif_open[gif_flag]+23;
6298 *(gif_end[gif_flag] - 1) = '\0';
6299 gif_id[gif_flag] = gif_open[gif_flag]+28;
6300 *(gif_id[gif_flag] - 1) = '\0';
6301
6302
6303 } else if( !get_bit( class_on, gif_flag ) ) {
6304 notify_class_info(gif_flag);
6305 store_bit_I( class_on, gif_flag );
6306 }
6307
6308 #line 11471 "./tex4ht-c.tex"
6309
6310 p= gif_open[gif_flag];
6311 if( p )
6312 if( *p ){
6313 print_f(p); (IGNORED) strcpy((char *) str, (char *) font_tbl[cur_fnt].name);
6314 mag = (int) ((double) font_tbl[cur_fnt].scale /
6315 font_tbl[cur_fnt].design_sz * 10 );
6316
6317 #line 10897 "./tex4ht-c.tex"
6318
6319 if( !dos_file_names ){
6320 print_f(font_tbl[cur_fnt].name);
6321 if( mag == 10 ) (IGNORED) sprintf(str, GIF_I, design_ch, gif);
6322 else (IGNORED) sprintf(str, GIF_II, mag, design_ch, gif);
6323 }
6324
6325
6326 #line 10918 "./tex4ht-c.tex"
6327
6328
6329 if( dos_file_names ){
6330 dos_gif_file(str, mag, design_ch);
6331 print_f(str);
6332 (IGNORED) sprintf(str, GIF_VII, gif);
6333 }
6334
6335
6336
6337 print_f(str);
6338 add_bit( font_tbl[cur_fnt].gif_on, r_ch, 1 );
6339 }
6340
6341
6342
6343 #line 11504 "./tex4ht-c.tex"
6344
6345 p = gif_alt[gif_flag];
6346 if( p )
6347 if( *p ){
6348 print_f(p); put_alt_ch(chr,ch_str_flag);
6349 }
6350
6351
6352
6353 #line 11518 "./tex4ht-c.tex"
6354
6355 p = gif_class[gif_flag];
6356 if( p )
6357 if( *p ){
6358 (IGNORED) fprintf(cur_o_file, p,
6359 font_tbl[cur_fnt].family_name); }
6360
6361
6362
6363 #line 11542 "./tex4ht-c.tex"
6364
6365 p = gif_size[gif_flag];
6366 if( p )
6367 if( *p ){
6368 (IGNORED) fprintf(cur_o_file, p,
6369 font_tbl[cur_fnt].font_size); }
6370
6371
6372
6373 #line 11559 "./tex4ht-c.tex"
6374
6375 p = gif_mag[gif_flag];
6376 if( p )
6377 if( *p && (font_tbl[cur_fnt].mag != 100) ){
6378 (IGNORED) fprintf(cur_o_file, p, font_tbl[cur_fnt].mag);
6379 }
6380
6381
6382
6383 #line 11574 "./tex4ht-c.tex"
6384
6385 p = gif_ord[gif_flag];
6386 if( p )
6387 if( *p ){
6388 (IGNORED) fprintf(cur_o_file, p, ch);
6389 }
6390
6391
6392
6393 #line 11591 "./tex4ht-c.tex"
6394
6395 p = gif_end[gif_flag];
6396 if( p )
6397 if( *p ){ print_f( p ); }
6398
6399
6400 } else {
6401 #line 10834 "./tex4ht-c.tex"
6402
6403 if( !gif_flag || (gif_flag % 2) || ch_map_flag ) {
6404 put_alt_ch(chr,ch_str_flag); }
6405 else{
6406 #line 11727 "./tex4ht-c.tex"
6407
6408
6409 #line 11743 "./tex4ht-c.tex"
6410
6411 if( gif_flag && !get_bit( class_on, gif_flag ) ) {
6412 notify_class_info(gif_flag);
6413 store_bit_I( class_on, gif_flag );
6414 }
6415
6416
6417 if( span_on ){
6418
6419 #line 11753 "./tex4ht-c.tex"
6420
6421 if( span_open[gif_flag] )
6422 if( *span_open[gif_flag] ){
6423 print_f( span_open[gif_flag] );
6424 }
6425
6426
6427
6428 #line 11777 "./tex4ht-c.tex"
6429
6430 if( span_name[gif_flag] )
6431 if( *span_name[gif_flag] ){
6432 (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
6433 font_tbl[cur_fnt].family_name);
6434 }
6435
6436
6437
6438 #line 11787 "./tex4ht-c.tex"
6439
6440 if( span_size[gif_flag] )
6441 if( *span_size[gif_flag] ){
6442 (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
6443 font_tbl[cur_fnt].font_size);
6444 }
6445
6446
6447
6448 #line 11796 "./tex4ht-c.tex"
6449
6450 if( span_mag[gif_flag] )
6451 if( *span_mag[gif_flag] ){
6452 (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
6453 font_tbl[cur_fnt].mag);
6454 }
6455
6456
6457
6458 #line 11805 "./tex4ht-c.tex"
6459
6460 if( span_ord[gif_flag] )
6461 if( *span_ord[gif_flag] ){
6462 (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
6463 }
6464
6465
6466
6467 #line 11769 "./tex4ht-c.tex"
6468
6469 if( span_ch[gif_flag] )
6470 if( *span_ch[gif_flag] ){
6471 print_f( span_ch[gif_flag] );
6472 }
6473
6474
6475 }
6476 put_alt_ch(chr,ch_str_flag);
6477 if( span_on ){
6478
6479 #line 11760 "./tex4ht-c.tex"
6480
6481 if( end_span[gif_flag] )
6482 if( *end_span[gif_flag] ){
6483 print_f( end_span[gif_flag] );
6484 }
6485
6486
6487 }
6488
6489 }
6490
6491 }
6492 special_on = sv;
6493
6494 } design_ch = 0; }
6495 else {
6496 #line 10825 "./tex4ht-c.tex"
6497
6498 if( !gif_flag || (gif_flag % 2) || ch_map_flag ) { put_char(chr);
6499 } else{
6500 #line 11708 "./tex4ht-c.tex"
6501
6502
6503 #line 1715 "./tex4ht-c.tex"
6504
6505 if( no_root_file ){ open_o_file(); }
6506
6507
6508
6509 #line 11743 "./tex4ht-c.tex"
6510
6511 if( gif_flag && !get_bit( class_on, gif_flag ) ) {
6512 notify_class_info(gif_flag);
6513 store_bit_I( class_on, gif_flag );
6514 }
6515
6516
6517 if( span_on ){
6518
6519 #line 11753 "./tex4ht-c.tex"
6520
6521 if( span_open[gif_flag] )
6522 if( *span_open[gif_flag] ){
6523 print_f( span_open[gif_flag] );
6524 }
6525
6526
6527
6528 #line 11777 "./tex4ht-c.tex"
6529
6530 if( span_name[gif_flag] )
6531 if( *span_name[gif_flag] ){
6532 (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
6533 font_tbl[cur_fnt].family_name);
6534 }
6535
6536
6537
6538 #line 11787 "./tex4ht-c.tex"
6539
6540 if( span_size[gif_flag] )
6541 if( *span_size[gif_flag] ){
6542 (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
6543 font_tbl[cur_fnt].font_size);
6544 }
6545
6546
6547
6548 #line 11796 "./tex4ht-c.tex"
6549
6550 if( span_mag[gif_flag] )
6551 if( *span_mag[gif_flag] ){
6552 (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
6553 font_tbl[cur_fnt].mag);
6554 }
6555
6556
6557
6558 #line 11805 "./tex4ht-c.tex"
6559
6560 if( span_ord[gif_flag] )
6561 if( *span_ord[gif_flag] ){
6562 (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
6563 }
6564
6565
6566
6567 #line 11769 "./tex4ht-c.tex"
6568
6569 if( span_ch[gif_flag] )
6570 if( *span_ch[gif_flag] ){
6571 print_f( span_ch[gif_flag] );
6572 }
6573
6574
6575 }
6576 put_char(chr);
6577 if( span_on ){
6578
6579 #line 11760 "./tex4ht-c.tex"
6580
6581 if( end_span[gif_flag] )
6582 if( *end_span[gif_flag] ){
6583 print_f( end_span[gif_flag] );
6584 }
6585
6586
6587 }
6588
6589 }
6590
6591 }
6592
6593 }
6594 }
6595
6596 #line 12409 "./tex4ht-c.tex"
6597
6598 if( a_accent_template && needs_accented_sym ){
6599 (IGNORED) fprintf(cur_o_file, "%s", a_accent_fifth);
6600 }
6601
6602
6603
6604 #line 8217 "./tex4ht-c.tex"
6605
6606 if( pos_dvi ){
6607 print_f(end_pos_text);
6608 }
6609
6610
6611 #line 12951 "./tex4ht-c.tex"
6612
6613 if( show_class && !pause_class && !ignore_subclass_del ){
6614 if( !stack[stack_n].no_left_del && stack[stack_n+1].active_class_del ){
6615 if( !stack[stack_n+1].ignore_subclass_del ){
6616
6617 #line 12966 "./tex4ht-c.tex"
6618
6619 (IGNORED) print_f( close_class[math_class]);
6620
6621
6622 }
6623
6624 #line 12979 "./tex4ht-c.tex"
6625
6626 (IGNORED) print_f( (stack[stack_n+1].temp_class_del)?
6627 stack[stack_n+1].temp_class_close
6628 : stack[stack_n+1].class_close);
6629
6630
6631 stack[stack_n+1].active_class_del = FALSE;
6632 } else {
6633
6634 #line 12966 "./tex4ht-c.tex"
6635
6636 (IGNORED) print_f( close_class[math_class]);
6637
6638
6639 stack[stack_n+1].active_class_del = FALSE;
6640 }
6641 }
6642
6643
6644
6645 #line 2917 "./tex4ht-c.tex"
6646
6647 if( trace_dvi_C && !ch_map_flag ){
6648
6649 #line 1715 "./tex4ht-c.tex"
6650
6651 if( no_root_file ){ open_o_file(); }
6652
6653
6654 (IGNORED) fprintf(cur_o_file, "%s%s",
6655 trace_dvi_del_c, end_trace_dvi_del_c);
6656 }
6657
6658
6659 #line 2623 "./tex4ht-c.tex"
6660
6661
6662
6663
6664
6665 #line 12311 "./tex4ht-c.tex"
6666
6667
6668 #line 12285 "./tex4ht-c.tex"
6669
6670 if( needs_end_accent && t_accent_template ){
6671
6672 #line 2613 "./tex4ht-c.tex"
6673
6674 if( span_on && in_span_ch ){
6675 if( *end_span[0] ){
6676 in_span_ch = FALSE;
6677
6678 #line 1715 "./tex4ht-c.tex"
6679
6680 if( no_root_file ){ open_o_file(); }
6681
6682
6683 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
6684 } }
6685
6686
6687 (IGNORED) fprintf(cur_o_file, "%s", t_accent_fifth);
6688 needs_end_accent = FALSE;
6689 #line 12428 "./tex4ht-c.tex"
6690
6691 needs_accented_sym--;
6692
6693
6694 }
6695
6696
6697
6698
6699
6700
6701 text_on = TRUE;
6702 } }
6703
6704 #line 9804 "./tex4ht-c.tex"
6705
6706 return (INTEGER)(
6707
6708 #line 9841 "./tex4ht-c.tex"
6709
6710 design_size_to_pt( *(font_tbl[cur_fnt].wtbl
6711 + (int) (
6712 #line 9849 "./tex4ht-c.tex"
6713
6714 *(font_tbl[cur_fnt].char_wi + (int)
6715 ( ch - font_tbl[cur_fnt].char_f)% 256)
6716
6717 ) )
6718 )
6719 * (double) font_tbl[cur_fnt].scale
6720
6721
6722 );
6723
6724
6725 }
6726
6727
6728 #line 16624 "./tex4ht-c.tex"
6729
6730
6731 static void put_char
6732 #ifdef ANSI
6733 #define SEP ,
6734 ( int ch
6735 )
6736 #undef SEP
6737 #else
6738 #define SEP ;
6739 ( ch ) int ch
6740 ;
6741 #undef SEP
6742 #endif
6743 {
6744 if( !ignore_chs
6745 && !( ((ch==' ') || (ch=='\n')) && no_root_file )
6746 ){
6747
6748 #line 1715 "./tex4ht-c.tex"
6749
6750 if( no_root_file ){ open_o_file(); }
6751
6752
6753 if( ch_map_flag ){
6754 if( special_on || ((ch != '\n') && (ch != ' ')) ){
6755
6756 #line 4994 "./tex4ht-c.tex"
6757
6758 insert_ch_map((char) ch, TRUE);
6759
6760 }
6761 }else {
6762 if ( ch == '\n' ){
6763 #line 3413 "./tex4ht-c.tex"
6764
6765 if( eoln_str ){ print_f(eoln_str); }
6766 else { (IGNORED) put_4ht_ch( ch, cur_o_file ); }
6767 recover_spaces = 0;
6768
6769 }
6770 else if ( ch == ' ' ){
6771 #line 3435 "./tex4ht-c.tex"
6772
6773 if( space_str ){ print_f(space_str); }
6774 else { (IGNORED) put_4ht_ch( ch, cur_o_file ); }
6775
6776 }
6777 else { (IGNORED) put_4ht_ch( ch, cur_o_file ); }
6778 } } }
6779
6780
6781 #line 16657 "./tex4ht-c.tex"
6782
6783
6784 static void print_f
6785 #ifdef ANSI
6786 #define SEP ,
6787 ( const char* str
6788 )
6789 #undef SEP
6790 #else
6791 #define SEP ;
6792 (str) const char* str
6793 ;
6794 #undef SEP
6795 #endif
6796 {
6797
6798 #line 1715 "./tex4ht-c.tex"
6799
6800 if( no_root_file ){ open_o_file(); }
6801
6802
6803 if( ch_map_flag ){
6804 while( *str ){ put_char( *str ); str++; }
6805 }else {
6806 (IGNORED) print_f_4ht( str );
6807 } }
6808
6809
6810 #line 16677 "./tex4ht-c.tex"
6811
6812
6813 static void print_f_4ht
6814 #ifdef ANSI
6815 #define SEP ,
6816 ( const char* str
6817 )
6818 #undef SEP
6819 #else
6820 #define SEP ;
6821 (str) const char* str
6822 ;
6823 #undef SEP
6824 #endif
6825 {
6826
6827 #line 1715 "./tex4ht-c.tex"
6828
6829 if( no_root_file ){ open_o_file(); }
6830
6831
6832 if( ch_map_flag ){
6833 while( *str ){ put_char( *str ); str++; }
6834 } else {
6835 while( *str ){
6836 (IGNORED) put_4ht_ch( *str, cur_o_file );
6837 str++;
6838 } } }
6839
6840
6841 #line 16702 "./tex4ht-c.tex"
6842
6843 static int get_char(MYVOID)
6844 {
6845 return (int) getc(dvi_file);
6846 }
6847
6848
6849 #line 16714 "./tex4ht-c.tex"
6850
6851 static int get_noop(MYVOID)
6852 { int ch;
6853 while( (ch = get_char()) ==
6854 #line 17326 "./tex4ht-c.tex"
6855
6856 138
6857 ){;}
6858 return ch;
6859 }
6860
6861
6862 #line 16730 "./tex4ht-c.tex"
6863
6864
6865 static char* get_str
6866 #ifdef ANSI
6867 #define SEP ,
6868 ( int n
6869 )
6870 #undef SEP
6871 #else
6872 #define SEP ;
6873 (n) int n
6874 ;
6875 #undef SEP
6876 #endif
6877 { U_CHAR *q, *p;
6878 p = q = m_alloc(char,n+1);
6879 while( n-- ) *q++ = get_char();
6880 *q = '\0';
6881 return p;
6882 }
6883
6884
6885 #line 16754 "./tex4ht-c.tex"
6886
6887
6888 static long fget_unt
6889 #ifdef ANSI
6890 #define SEP ,
6891 (
6892 FILE* file SEP
6893 register int n
6894
6895 )
6896 #undef SEP
6897 #else
6898 #define SEP ;
6899 ( file, n )
6900 FILE* file SEP
6901 register int n
6902
6903 ;
6904 #undef SEP
6905 #endif
6906 { register long val = 0;
6907 while( n-- ){ val = (val << 8) + (unsigned INTEGER) getc(file) ; }
6908 return val;
6909 }
6910
6911
6912 #line 16778 "./tex4ht-c.tex"
6913
6914
6915 static long fget_int
6916 #ifdef ANSI
6917 #define SEP ,
6918 (
6919 FILE *file SEP
6920 int n
6921
6922 )
6923 #undef SEP
6924 #else
6925 #define SEP ;
6926 ( file, n )
6927 FILE *file SEP
6928 int n
6929
6930 ;
6931 #undef SEP
6932 #endif
6933 { register long val;
6934 val = (unsigned INTEGER) getc(file);
6935 if( val & 0x80 ) val -= 0x100;
6936 while( --n ){ val = (val << 8) + (unsigned INTEGER) getc(file); }
6937 return val;
6938 }
6939
6940
6941 #line 16814 "./tex4ht-c.tex"
6942
6943
6944 static long cond_int
6945 #ifdef ANSI
6946 #define SEP ,
6947 (
6948 register INTEGER n
6949 )
6950 #undef SEP
6951 #else
6952 #define SEP ;
6953 ( n )
6954 register INTEGER n
6955 ;
6956 #undef SEP
6957 #endif
6958 { register long val;
6959 int ch;
6960 val = (unsigned int) (ch = get_char());
6961 cond_idv_char( ch );
6962 if( val & 0x80 ) val -= 0x100;
6963 while( --n ){
6964 val = (val << 8) + (unsigned int) (ch = get_char());
6965 cond_idv_char( ch );
6966 }
6967 return val;
6968 }
6969
6970
6971 #line 16921 "./tex4ht-c.tex"
6972
6973
6974 static void warn_i
6975 #ifdef ANSI
6976 #define SEP ,
6977 ( int n
6978 )
6979 #undef SEP
6980 #else
6981 #define SEP ;
6982 (n) int n
6983 ;
6984 #undef SEP
6985 #endif
6986 { (IGNORED) fprintf(stderr,"--- warning --- ");
6987 (IGNORED) fprintf(stderr, "%s", warn_err_mssg[n]);
6988 show_err_context();
6989 }
6990
6991
6992 #line 16945 "./tex4ht-c.tex"
6993
6994
6995 static void warn_i_int
6996 #ifdef ANSI
6997 #define SEP ,
6998 ( int n SEP int i
6999
7000 )
7001 #undef SEP
7002 #else
7003 #define SEP ;
7004 (n,i) int n SEP int i
7005
7006 ;
7007 #undef SEP
7008 #endif
7009 { (IGNORED) fprintf(stderr,"--- warning --- ");
7010 (IGNORED) fprintf(stderr, warn_err_mssg[n], i);
7011 show_err_context();
7012 }
7013
7014
7015 #line 16961 "./tex4ht-c.tex"
7016
7017
7018 static void warn_i_int_2
7019 #ifdef ANSI
7020 #define SEP ,
7021 ( int n SEP int i SEP int j
7022
7023 )
7024 #undef SEP
7025 #else
7026 #define SEP ;
7027 (n,i,j) int n SEP int i SEP int j
7028
7029 ;
7030 #undef SEP
7031 #endif
7032 { (IGNORED) fprintf(stderr,"--- warning --- ");
7033 (IGNORED) fprintf(stderr, warn_err_mssg[n], i, j);
7034 show_err_context();
7035 }
7036
7037
7038 #line 16977 "./tex4ht-c.tex"
7039
7040
7041 static void warn_i_str
7042 #ifdef ANSI
7043 #define SEP ,
7044 (
7045 int n SEP
7046 const char *str
7047
7048 )
7049 #undef SEP
7050 #else
7051 #define SEP ;
7052 (n,str)
7053 int n SEP
7054 const char *str
7055
7056 ;
7057 #undef SEP
7058 #endif
7059 {
7060 (IGNORED) fprintf(stderr,"--- warning --- ");
7061 (IGNORED) fprintf(stderr,warn_err_mssg[n], str);
7062 show_err_context();
7063 }
7064
7065
7066 #line 16997 "./tex4ht-c.tex"
7067
7068
7069 static void warn_i_str2
7070 #ifdef ANSI
7071 #define SEP ,
7072 (
7073 int n SEP
7074 const char *str1 SEP
7075 const char *str2
7076
7077 )
7078 #undef SEP
7079 #else
7080 #define SEP ;
7081 (n,str1,str2)
7082 int n SEP
7083 const char *str1 SEP
7084 const char *str2
7085
7086 ;
7087 #undef SEP
7088 #endif
7089 { (IGNORED) fprintf(stderr,"--- warning --- ");
7090 (IGNORED) fprintf(stderr,warn_err_mssg[n], str1,str2);
7091 show_err_context();
7092 }
7093
7094
7095 #line 17031 "./tex4ht-c.tex"
7096
7097
7098 static void err_i
7099 #ifdef ANSI
7100 #define SEP ,
7101 ( int n
7102
7103 )
7104 #undef SEP
7105 #else
7106 #define SEP ;
7107 (n) int n
7108
7109 ;
7110 #undef SEP
7111 #endif
7112 { (IGNORED) fprintf(stderr,"--- error --- ");
7113 (IGNORED) fprintf(stderr, "%s", warn_err_mssg[n]);
7114 show_err_context();
7115 exit(EXIT_FAILURE);
7116 }
7117
7118
7119 #line 17048 "./tex4ht-c.tex"
7120
7121
7122 static void err_i_int
7123 #ifdef ANSI
7124 #define SEP ,
7125 ( int n SEP int i
7126
7127 )
7128 #undef SEP
7129 #else
7130 #define SEP ;
7131 (n,i) int n SEP int i
7132
7133 ;
7134 #undef SEP
7135 #endif
7136 { (IGNORED) fprintf(stderr,"--- error --- ");
7137 (IGNORED) fprintf(stderr, warn_err_mssg[n], i);
7138 show_err_context();
7139 exit(EXIT_FAILURE);
7140 }
7141
7142
7143 #line 17064 "./tex4ht-c.tex"
7144
7145
7146 static void err_i_str
7147 #ifdef ANSI
7148 #define SEP ,
7149 (
7150 int n SEP
7151 U_CHAR *str
7152
7153 )
7154 #undef SEP
7155 #else
7156 #define SEP ;
7157 (n,str)
7158 int n SEP
7159 U_CHAR *str
7160
7161 ;
7162 #undef SEP
7163 #endif
7164 { (IGNORED) fprintf(stderr,"--- error --- ");
7165 (IGNORED) fprintf(stderr, warn_err_mssg[n], str);
7166 show_err_context();
7167 exit(EXIT_FAILURE);
7168 }
7169
7170
7171 #line 17111 "./tex4ht-c.tex"
7172
7173 static void show_err_context(MYVOID)
7174 { long curr_pos;
7175 int n, i;
7176 U_CHAR ch;
7177 if( err_context ){
7178 curr_pos = ftell(dvi_file);
7179 for(n=6; n--;){
7180 (IGNORED) putc( '\n', stderr );
7181 for(i=70; i--;){
7182 ch = get_char();
7183 (IGNORED) putc(( (ch>31) && (ch<127))? ch : ' ', stderr);
7184 }
7185 }
7186 (IGNORED) fseek(dvi_file, curr_pos,
7187 #line 2174 "./tex4ht-c.tex"
7188
7189 0
7190 );
7191 (IGNORED) putc( '\n', stderr ); (IGNORED) putc( '\n', stderr );
7192 if( err_mark ){ print_f( err_mark ); }
7193 } }
7194
7195
7196
7197 int
7198 #line 507 "./tex4ht-c.tex"
7199
7200 #ifdef CDECL
7201 CDECL
7202 #endif
7203
7204 main
7205 #ifdef ANSI
7206 #define SEP ,
7207 (
7208 int argc SEP
7209 U_CHAR **argv
7210 )
7211 #undef SEP
7212 #else
7213 #define SEP ;
7214 (argc, argv)
7215 int argc SEP
7216 U_CHAR **argv
7217 ;
7218 #undef SEP
7219 #endif
7220 {
7221 #line 1385 "./tex4ht-c.tex"
7222
7223 register INTEGER i;
7224 int ch;
7225
7226
7227 #line 2208 "./tex4ht-c.tex"
7228
7229 int unread_pages;
7230
7231
7232 #line 5404 "./tex4ht-c.tex"
7233
7234 long int eof_op_n, begin_postamble;
7235 int dis_pages;
7236
7237
7238 #line 6608 "./tex4ht-c.tex"
7239
7240 int stack_id=0;
7241
7242
7243 #line 11862 "./tex4ht-c.tex"
7244
7245 static struct css_ext_rec * css_ext = (struct css_ext_rec *) 0;
7246 static char css_default[] = "4cs";
7247
7248
7249 #line 12263 "./tex4ht-c.tex"
7250
7251 BOOL in_accenting;
7252
7253
7254 #line 13038 "./tex4ht-c.tex"
7255
7256 char* tex4ht_env_file = (char *) 0;
7257 char* dos_env_file =
7258 #if defined(__MSDOS__)
7259
7260 #line 13225 "./tex4ht-c.tex"
7261
7262 get_env_dir(argv[0])
7263
7264 ;
7265 #endif
7266 #if !defined(__MSDOS__)
7267 (char *) 0;
7268 #endif
7269
7270
7271
7272 #line 13863 "./tex4ht-c.tex"
7273
7274 struct htf_com_rec* htf_font_dir = (struct htf_com_rec *) 0;
7275
7276
7277
7278 #line 1064 "./tex4ht-c.tex"
7279
7280 #ifdef WIN32
7281 /* The idea here is to split options apart at spaces: a single argument
7282 "-foo -bar" becomes the two options "-foo" and "-bar". We need to
7283 do this for Windows because mk4ht passes this sort of combined
7284 option in one string to scripts like htlatex.{unix,bat}. In the
7285 Unix case, the shell resplits words when calling t4ht and tex4ht,
7286 so the program see two options. But this does not happen with the
7287 .bat; %4, for instance, remains "-foo -bar". So we fix it here. */
7288 if (argc > 2) {
7289 int i, nargc;
7290 char **nargv, **pnargv, **pargv;
7291
7292 nargv = (char **) xmalloc (2 * argc * sizeof (char *));
7293 pnargv = nargv;
7294 pargv = argv;
7295 *pnargv++ = xstrdup (*pargv++);
7296 *pnargv++ = xstrdup (*pargv++);
7297 nargc = 2;
7298
7299 for (i=2; i < argc; i++) {
7300 char *p, *q, *r;
7301 p = q = *pargv++;
7302 while (*p == ' ' || *p == '\t') {
7303 p++;
7304 q++;
7305 }
7306 while (*p != ' ' && *p != '\t' && *p) {
7307 p++;
7308 if (*p == '\0') {
7309 *pnargv++ = xstrdup(q);
7310 nargc++;
7311 } else if (*p == ' ' || *p == '\t') {
7312 r = p;
7313 while (*p == ' ' || *p == '\t')
7314 p++;
7315 if (*p == '-' || *p == '\0') {
7316 *r = '\0';
7317 *pnargv++ = xstrdup(q);
7318 nargc++;
7319 q = p;
7320 }
7321 }
7322 }
7323 }
7324
7325 nargv[nargc] = NULL;
7326 argv = nargv;
7327 argc = nargc;
7328 }
7329 #endif
7330
7331
7332
7333 #line 1159 "./tex4ht-c.tex"
7334
7335
7336 #ifdef SIGSEGV
7337 (void) signal(SIGSEGV,sig_err);
7338 #endif
7339 (void) signal(SIGFPE,sig_err);
7340 #ifdef WIN32
7341
7342 #line 577 "./tex4ht-c.tex"
7343
7344 SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE);
7345
7346
7347 #else
7348 #ifdef SIGINT
7349 (void) signal(SIGINT,sig_err);
7350 #endif
7351 #endif
7352
7353
7354
7355 #line 1336 "./tex4ht-c.tex"
7356
7357 (IGNORED) printf("----------------------------\n");
7358 #ifndef KPATHSEA
7359 #ifdef PLATFORM
7360 (IGNORED) printf("tex4ht.c (2023-10-13-15:32 %s)\n",PLATFORM);
7361 #else
7362 (IGNORED) printf("tex4ht.c (2023-10-13-15:32)\n");
7363 #endif
7364 #else
7365 #ifdef PLATFORM
7366 (IGNORED) printf("tex4ht.c (2023-10-13-15:32 %s kpathsea)\n",PLATFORM);
7367 #else
7368 (IGNORED) printf("tex4ht.c (2023-10-13-15:32 kpathsea)\n");
7369 #endif
7370 #endif
7371 for(i=0; i<argc; i++){
7372 (IGNORED) printf("%s%s ", (i>1)?"\n " : "", argv[i]); }
7373 (IGNORED) printf("\n");
7374
7375
7376
7377 #line 2785 "./tex4ht-c.tex"
7378
7379 set_del( &trace_dvi_del_P, &end_trace_dvi_del_P);
7380 set_del( &trace_dvi_del_p, &end_trace_dvi_del_p);
7381 set_del( &trace_dvi_del_C, &end_trace_dvi_del_C);
7382 set_del( &trace_dvi_del_c, &end_trace_dvi_del_c);
7383 set_del( &trace_dvi_del_H, &end_trace_dvi_del_H);
7384 set_del( &trace_dvi_del_h, &end_trace_dvi_del_h);
7385 set_del( &trace_dvi_del_R, &end_trace_dvi_del_R);
7386 set_del( &trace_dvi_del_r, &end_trace_dvi_del_r);
7387 set_del( &trace_dvi_del_V, &end_trace_dvi_del_V);
7388 set_del( &trace_dvi_del_v, &end_trace_dvi_del_v);
7389
7390
7391
7392 #line 1576 "./tex4ht-c.tex"
7393
7394 dvi_file = stdin;
7395
7396
7397 #line 4686 "./tex4ht-c.tex"
7398
7399 { U_CHAR *yes = NULL;
7400 system_yes = (system( yes ) != 0);
7401 }
7402
7403
7404 #line 6304 "./tex4ht-c.tex"
7405
7406 { int i;
7407 for( i=8; i--; ){
7408 halign[i] = m_alloc(struct halign_rec, 1);
7409 halign[i]->str = m_alloc(char, 1);
7410 *(halign[i]->str) = '\0';
7411 halign[i]->refs = 1;
7412 }
7413 }
7414
7415
7416 #line 7443 "./tex4ht-c.tex"
7417
7418 del_stack = (struct del_stack_entry *) 0;
7419
7420
7421 #line 7468 "./tex4ht-c.tex"
7422
7423 back_id_off = 1; id_latex = 0;
7424
7425
7426 #line 7547 "./tex4ht-c.tex"
7427
7428 back_token = back_group = m_alloc(struct send_back_entry,1);
7429 back_token->id = -1;
7430
7431
7432 #line 8464 "./tex4ht-c.tex"
7433
7434 pos_text = pos_line = end_pos_body = end_pos_text = pos_body =
7435 m_alloc(char, (int) 1);
7436 (IGNORED) strcpy((char *) pos_text, "" );
7437
7438
7439 #line 9752 "./tex4ht-c.tex"
7440
7441 margin_sp = (double) MARGINSP;
7442
7443
7444 #line 11666 "./tex4ht-c.tex"
7445
7446 { int i; i=256; while( i-- ) {
7447 span_name[i] = span_open[i] = span_size[i] =
7448 span_mag[i] = span_ch[i] = end_span[i] =
7449 span_ord[i] = gif_id[i] = NULL;
7450 if( (i>0) && !(i%2) ) { store_bit_Z( class_on, i ); }
7451 else { store_bit_I( class_on, i ); }
7452 }
7453 }
7454
7455
7456 #line 12267 "./tex4ht-c.tex"
7457
7458 in_accenting = FALSE;
7459
7460
7461 #line 12757 "./tex4ht-c.tex"
7462
7463 for( math_class=0; math_class<
7464 #line 12723 "./tex4ht-c.tex"
7465
7466 79
7467
7468 ; math_class++ ){
7469 open_class[math_class] = m_alloc(char, 1);
7470 close_class[math_class] = m_alloc(char, 1);
7471 *(open_class[math_class]) = *(close_class[math_class]) = '\0';
7472 }
7473
7474
7475 #line 14211 "./tex4ht-c.tex"
7476
7477 HOME_DIR = getenv("HOME");
7478
7479
7480
7481 #line 1360 "./tex4ht-c.tex"
7482
7483 { long file_len;
7484
7485 #line 1443 "./tex4ht-c.tex"
7486
7487 { int i;
7488 U_CHAR *p;
7489 const U_CHAR *in_name = "", *out_name = "";
7490
7491 #line 14882 "./tex4ht-c.tex"
7492
7493
7494 #ifdef KPATHSEA
7495 kpse_set_program_name (argv[0], "tex4ht");
7496 #endif
7497
7498
7499
7500 #line 642 "./tex4ht-c.tex"
7501
7502 #if !defined(DOS_GIF_FILE) && !defined(WIN32) && defined(__DJGPP__)
7503 dos_file_names = !_use_lfn(NULL);
7504 #endif
7505
7506
7507 if( argc == 1 ){ bad_arg; }
7508 for(i=1; i<argc; i++) {
7509 if( *( p=argv[i] ) == '-' ){
7510 #line 1468 "./tex4ht-c.tex"
7511
7512 if( (int) strlen((char *) argv[i] ) == 2 ){
7513 if( ++i == argc ) bad_arg;
7514 }
7515 switch( *(p+1) ){
7516 case 'b':{
7517 #line 11119 "./tex4ht-c.tex"
7518
7519 begin_char_gif = p+2;
7520
7521 break; }
7522 case 'c':{
7523 #line 13431 "./tex4ht-c.tex"
7524
7525 struct env_c_rec *temp = (struct env_c_rec*)
7526 m_alloc(struct env_c_rec, (int) 1);
7527 temp->option = p+2;
7528 temp->next = envChoice;
7529 envChoice = temp;
7530
7531 break;}
7532 case 'e':{
7533 #line 13029 "./tex4ht-c.tex"
7534
7535 tex4ht_env_file = p+2;
7536
7537 break; }
7538 case 'f':{
7539 #line 1503 "./tex4ht-c.tex"
7540
7541 p = p + 2;
7542 in_name = p + (int) strlen((char *) p );
7543 while( *in_name != *p ){ in_name--; }
7544 in_name++;
7545
7546 break; }
7547 case 'F':{
7548 #line 9967 "./tex4ht-c.tex"
7549
7550 char *digit = p+2;
7551 ignore_ch = 0;
7552 while( *digit != '\0' ){
7553 if( (*digit < '0') || (*digit > '9') ){
7554 ignore_ch = 0; break;
7555 }
7556 ignore_ch = 10 * ignore_ch + (*digit - '0');
7557 if( ignore_ch > 255 ){ ignore_ch = 0; break; }
7558 digit++;
7559 }
7560
7561 break; }
7562 case 'g':{
7563 #line 11147 "./tex4ht-c.tex"
7564
7565 gif = p+2;
7566
7567 break; }
7568 case 'h':{
7569 #line 1513 "./tex4ht-c.tex"
7570
7571 {
7572 char trace = *(p+2);
7573 if (trace == 'A' || trace == 'e') {
7574 #line 17145 "./tex4ht-c.tex"
7575
7576 err_context = TRUE;
7577
7578 }
7579 if (trace == 'A' || trace == 'f') {
7580 #line 10495 "./tex4ht-c.tex"
7581
7582 dump_htf_files = 1;
7583
7584 }
7585 if (trace == 'A' || trace == 'F') {
7586 #line 15070 "./tex4ht-c.tex"
7587
7588 dump_htf_search = TRUE;
7589
7590 }
7591 if (trace == 'A' || trace == 's') {
7592 #line 17174 "./tex4ht-c.tex"
7593
7594 trace_special = TRUE;
7595
7596 }
7597 if (trace == 'A' || trace == 'g') {
7598 #line 2757 "./tex4ht-c.tex"
7599
7600 trace_dvi_P++;
7601 if( !( *trace_dvi_del_P || *end_trace_dvi_del_P
7602 || *trace_dvi_del_p || *end_trace_dvi_del_p
7603 )
7604 ){
7605 trace_dvi_del_P =
7606 (char *) r_alloc((void *) trace_dvi_del_P,
7607 (size_t) 4);
7608 (IGNORED) strcpy((char *) trace_dvi_del_P, "[G " );
7609 end_trace_dvi_del_P =
7610 (char *) r_alloc((void *) end_trace_dvi_del_P,
7611 (size_t) 2);
7612 (IGNORED) strcpy((char *) end_trace_dvi_del_P, "]" );
7613 trace_dvi_del_p =
7614 (char *) r_alloc((void *) trace_dvi_del_p,
7615 (size_t) 5);
7616 (IGNORED) strcpy((char *) trace_dvi_del_p, "[/G " );
7617 end_trace_dvi_del_p =
7618 (char *) r_alloc((void *) end_trace_dvi_del_p,
7619 (size_t) 2);
7620 (IGNORED) strcpy((char *) end_trace_dvi_del_p, "]" );
7621 }
7622
7623 }
7624 if (trace == 'A' || trace == 'v') {
7625 #line 10499 "./tex4ht-c.tex"
7626
7627 dump_env_files = TRUE;
7628
7629 }
7630 if (trace == 'A' || trace == 'V') {
7631 #line 13066 "./tex4ht-c.tex"
7632
7633 dump_env_search = TRUE;
7634
7635 }
7636 else { bad_arg; }
7637 }
7638
7639 break; }
7640 case 'i':{
7641 #line 13867 "./tex4ht-c.tex"
7642
7643 com_dir(p);
7644 {
7645 struct htf_com_rec *q, *t;
7646 q = m_alloc( struct htf_com_rec, 1);
7647 q->name = p+2;
7648 q->next = (struct htf_com_rec *) 0;
7649 if( htf_font_dir ){
7650 t = htf_font_dir;
7651 while( t->next ){ t = t->next; }
7652 t->next = q;
7653 } else {
7654 htf_font_dir = q;
7655 }
7656 }
7657
7658 break; }
7659 case 'l':{
7660 #line 14218 "./tex4ht-c.tex"
7661
7662 #ifndef KPATHSEA
7663 tex4ht_fls_name = p+2;
7664 #endif
7665
7666 break; }
7667 case 'P':{
7668 #line 4648 "./tex4ht-c.tex"
7669
7670 { struct sys_call_rec *q;
7671 q = m_alloc(struct sys_call_rec, 1);
7672 q->next = system_calls;
7673 q->filter = p + 2;
7674 system_calls = q;
7675 }
7676
7677 break; }
7678 case 'S':{
7679 #line 11081 "./tex4ht-c.tex"
7680
7681 font_gif = p+2;
7682
7683 break; }
7684 case 's':{
7685 #line 11846 "./tex4ht-c.tex"
7686
7687 struct css_ext_rec * css = m_alloc(struct css_ext_rec, 1);;
7688 css->name = p + 2;
7689 css->next = css_ext;
7690 css_ext = css;
7691
7692 break; }
7693 case 't':{
7694 #line 13485 "./tex4ht-c.tex"
7695
7696 com_dir(p); fontdir[fontdir_count++] = p+2;
7697
7698 break; }
7699 case 'u':{
7700 #line 16223 "./tex4ht-c.tex"
7701
7702 if( eq_str(p+2, "10") ){ u10 = TRUE; }
7703
7704 #line 16366 "./tex4ht-c.tex"
7705
7706 else if( eq_str(p+2, "tf8") ){ utf8 = TRUE; }
7707
7708
7709 else{ bad_arg;}
7710
7711 break; }
7712 case 'v':{
7713 #line 5473 "./tex4ht-c.tex"
7714
7715 { U_CHAR *q;
7716 q = p + 2;
7717 id_version = 0;
7718 while( *q != '\0' ){
7719 if( id_version != -1 ){
7720 if( (*q < '0') || (*q > '9') ){
7721 id_version = -1;
7722 warn_i(53);
7723 }
7724 id_version = id_version * 10 + *q - '0';
7725 }
7726 q++;
7727 } }
7728
7729 break; }
7730 case 'x':{
7731 #line 649 "./tex4ht-c.tex"
7732
7733 switch( *(p+2) ){
7734 case 's':{ dos_file_names = TRUE; break; }
7735 default:{ bad_arg; }
7736 }
7737
7738 break; }
7739 case '.':{
7740 #line 1634 "./tex4ht-c.tex"
7741
7742 ext = p+1;
7743
7744 break; }
7745 default:{ bad_arg; }
7746 }
7747
7748 }
7749 else in_name = argv[i];
7750 }
7751
7752 #line 11853 "./tex4ht-c.tex"
7753
7754 if( css_ext == (struct css_ext_rec *) 0 ){
7755 struct css_ext_rec * css = m_alloc(struct css_ext_rec, 1);;
7756 css->name = css_default;
7757 css->next = css_ext;
7758 css_ext = css;
7759 }
7760
7761
7762
7763 #line 1588 "./tex4ht-c.tex"
7764
7765 if( *in_name != '\0' ){
7766 #line 1596 "./tex4ht-c.tex"
7767
7768 BOOL tag;
7769 job_name_n = (int) strlen( in_name );
7770 job_name = m_alloc(char, job_name_n+6);
7771 (IGNORED) strcpy((char *) job_name, in_name);
7772 tag = job_name_n < 3;
7773 if( !tag ){
7774 tag = !eq_str( job_name+job_name_n-
7775 #line 1614 "./tex4ht-c.tex"
7776
7777 (
7778 (ext==NULL)? 4 : (int) strlen((char *) ext)
7779 )
7780
7781 ,
7782 #line 1620 "./tex4ht-c.tex"
7783
7784 (
7785 (ext==NULL)? ".dvi" : ext
7786 )
7787
7788 );
7789 }
7790 if( tag ){
7791 job_name_n+=
7792 #line 1614 "./tex4ht-c.tex"
7793
7794 (
7795 (ext==NULL)? 4 : (int) strlen((char *) ext)
7796 )
7797
7798 ; (IGNORED) strct(job_name,
7799 #line 1620 "./tex4ht-c.tex"
7800
7801 (
7802 (ext==NULL)? ".dvi" : ext
7803 )
7804
7805 );
7806 }
7807 if( (dvi_file = fopen(job_name, READ_BIN_FLAGS)) == NULL )
7808 {
7809 #line 1655 "./tex4ht-c.tex"
7810
7811 { int i;
7812 for(i=job_name_n-5; i; i--){
7813 if( job_name[i] == '.' ){
7814 job_name[i] = '\0';
7815 job_name_n = i +
7816 #line 1614 "./tex4ht-c.tex"
7817
7818 (
7819 (ext==NULL)? 4 : (int) strlen((char *) ext)
7820 )
7821
7822 ;
7823 (IGNORED) strct(job_name,
7824 #line 1620 "./tex4ht-c.tex"
7825
7826 (
7827 (ext==NULL)? ".dvi" : ext
7828 )
7829
7830 );
7831 break;
7832 } }
7833 if( (dvi_file = fopen(job_name, READ_BIN_FLAGS)) == NULL ){
7834 warn_i_str(1, job_name); bad_in_file(job_name);
7835 } }
7836
7837 }
7838
7839 #line 5394 "./tex4ht-c.tex"
7840
7841 job_name[job_name_n-1] = 'v';
7842 job_name[job_name_n-2] = 'd';
7843 job_name[job_name_n-3] = 'i';
7844 if( (idv_file = fopen(job_name, WRITE_BIN_FLAGS)) == NULL )
7845 bad_in_file(job_name);
7846
7847
7848
7849
7850 }
7851 #ifdef KWIN32
7852 else if (!isatty(fileno(stdin))) SET_BINARY(fileno(stdin));
7853 #endif
7854
7855
7856 {
7857 #line 1700 "./tex4ht-c.tex"
7858
7859 U_CHAR *name=0;
7860 if( *out_name == '\0' )
7861 { if( *in_name == '\0' ){
7862 #line 1785 "./tex4ht-c.tex"
7863
7864 bad_arg;
7865
7866 }
7867 else {
7868 #line 1790 "./tex4ht-c.tex"
7869
7870 int n = (int) strlen((char *) job_name );
7871 name = m_alloc(char, 6 + n);
7872 (IGNORED) strcpy((char *) name, (char *) job_name);
7873 n -= 4; *(name + n) = '\0';
7874 (IGNORED) strct(name,".html");
7875 #ifdef HTM
7876 name[n+4] ='\0';
7877 #endif
7878
7879 }
7880 }
7881 else{
7882 #line 1808 "./tex4ht-c.tex"
7883
7884 int tag = 1;
7885 int n = (int) strlen( out_name );
7886 name = m_alloc(char, 6 + n);
7887 (IGNORED) strcpy((char *) name, out_name);
7888 while( n-- ) tag = tag && (*(name+n) != '.') ;
7889 if( tag ) (IGNORED) strct(name,".html");
7890 #ifdef HTM
7891 name[n+4] = '\0';
7892 #endif
7893
7894 }
7895 no_root_file = name;
7896
7897 }
7898 }
7899
7900
7901
7902 #line 13070 "./tex4ht-c.tex"
7903
7904 { U_CHAR str[PATH_MAX], *TEX4HTENV;
7905
7906 #line 13088 "./tex4ht-c.tex"
7907
7908 if( dump_env_search && tex4ht_env_file ){
7909 (IGNORED) printf("-e: %s?\n", tex4ht_env_file);
7910 }
7911 dot_file = tex4ht_env_file?
7912 f_open_pathed_filename( tex4ht_env_file, READ_TEXT_FLAGS ) : NULL;
7913
7914
7915
7916 #line 13133 "./tex4ht-c.tex"
7917
7918 if( !dot_file ){
7919 if( dump_env_search ){ (IGNORED) printf("%s?\n", "tex4ht.env"); }
7920 dot_file = f_open("tex4ht.env", READ_TEXT_FLAGS);
7921 }
7922 #ifndef DOS_WIN32
7923 if( !dot_file ){
7924 if( dump_env_search ){ (IGNORED) printf("%s?\n", ".tex4ht"); }
7925 dot_file = f_open(".tex4ht", READ_TEXT_FLAGS);
7926 if( dot_file ){
7927 printf("(%s)\n", ".tex4ht");
7928 } }
7929 #endif
7930
7931
7932 if( !dot_file ){
7933
7934 #line 13162 "./tex4ht-c.tex"
7935
7936 TEX4HTENV = getenv("TEX4HTENV");
7937 if( TEX4HTENV ){
7938 if( dump_env_search ){
7939 (IGNORED) printf("TEX4HTENV: %s?\n", TEX4HTENV); }
7940 dot_file = f_open_pathed_filename(TEX4HTENV,READ_TEXT_FLAGS);
7941 } else {
7942 if( dump_env_search ){
7943 (IGNORED) printf("getenv(\"TEX4HTENV\")=\n");
7944 } }
7945
7946
7947 }
7948
7949 #line 13100 "./tex4ht-c.tex"
7950
7951 if( !dot_file ){
7952 if( HOME_DIR ){
7953 (IGNORED) sprintf(str,
7954 #line 13181 "./tex4ht-c.tex"
7955
7956 #if defined(__DJGPP__)
7957 is_forward_slash(HOME_DIR)? "%s/tex4ht.env" : "%s\\tex4ht.env"
7958 #else
7959 "%s/tex4ht.env"
7960 #endif
7961
7962 , HOME_DIR);
7963 if( dump_env_search ){ (IGNORED) printf("%s?\n", str); }
7964 dot_file = f_open(str,READ_TEXT_FLAGS);
7965 } }
7966 #ifndef DOS_WIN32
7967 if( !dot_file ){
7968 if( HOME_DIR ){
7969 (IGNORED) sprintf(str,"%s/.tex4ht", HOME_DIR);
7970 if( dump_env_search ){ (IGNORED) printf("%s?\n", str); }
7971 dot_file = f_open(str,READ_TEXT_FLAGS);
7972 } }
7973 #endif
7974 #if defined(__MSDOS__)
7975 if( !dot_file ){
7976 if( dump_env_search ){ (IGNORED) printf("%s?\n", "C:/tex4ht.env"); }
7977 dot_file = f_open("C:/tex4ht.env",READ_TEXT_FLAGS);
7978 }
7979 #endif
7980
7981
7982
7983 #line 13149 "./tex4ht-c.tex"
7984
7985 #ifdef ENVFILE
7986 if( !dot_file ){
7987 if( dump_env_search ){ (IGNORED) printf("ENVFILE: %s?\n", ENVFILE); }
7988 dot_file = f_open_pathed_filename( ENVFILE,READ_TEXT_FLAGS);
7989 }
7990 #else
7991 if( dump_env_search ){
7992 (IGNORED) printf("tex4ht compiled without ENVFILE\n");
7993 }
7994 #endif
7995
7996
7997
7998 #line 13126 "./tex4ht-c.tex"
7999
8000 if( !dot_file && dos_env_file){
8001 if( dump_env_search ){ (IGNORED) printf("%s?\n", dos_env_file); }
8002 dot_file = f_open( dos_env_file, READ_TEXT_FLAGS );
8003 }
8004
8005
8006
8007 #line 14891 "./tex4ht-c.tex"
8008
8009
8010 #ifdef KPATHSEA
8011 if( !dot_file ) { U_CHAR * envfile;
8012 char *arch, *p, str[256];
8013
8014 #line 14943 "./tex4ht-c.tex"
8015
8016 p = arch = (char *) kpse_var_value( "SELFAUTOLOC" );
8017 while( *p != '\0' ){
8018 if( (*p == '/') || (*p == '\\') ){
8019 arch = p;
8020 }
8021 p++;
8022 }
8023
8024
8025 envfile = (char *) 0;
8026
8027 #line 14954 "./tex4ht-c.tex"
8028
8029 if( arch ){
8030 (IGNORED) sprintf(str,"%s%ctex4ht.env", arch+1, *arch);
8031 if( dump_env_search ){
8032 (IGNORED) printf("kpse_open_file (\"%s\", ...)?\n", str );
8033 }
8034 envfile= kpse_find_file (str, kpse_program_text_format, 0);
8035 }
8036
8037
8038 if ( !envfile ){
8039 #line 14965 "./tex4ht-c.tex"
8040
8041 if( dump_env_search ){
8042 (IGNORED) printf("kpse_open_file (\"tex4ht.env\", ...)?\n");
8043 }
8044 envfile= kpse_find_file ("tex4ht.env", kpse_program_text_format, 0);
8045
8046 }
8047 if ( !envfile ){
8048 #line 15016 "./tex4ht-c.tex"
8049
8050 #define KPSEWHICH_CMD "kpsewhich --progname=tex4ht --format=othertext tex4ht.env"
8051 if( dump_env_search ){
8052 (IGNORED) printf("system(" KPSEWHICH_CMD ")?\n"); /* cpp concatenation */
8053 }
8054 if( system(KPSEWHICH_CMD ">tex4ht.tmp") == 0 ){
8055
8056 #line 15046 "./tex4ht-c.tex"
8057
8058 char fileaddr [256];
8059 int loc = 0;
8060 FILE* file = f_open("tex4ht.tmp", READ_TEXT_FLAGS);
8061 if( file ){
8062 while( (fileaddr[loc] = getc(file)) >=0 ){
8063 if( fileaddr[loc] == '\n' ){ fileaddr[loc] = '\0'; break; }
8064 loc++;
8065 }
8066 (IGNORED) fclose(file);
8067 }
8068
8069
8070 envfile= kpse_find_file (fileaddr, kpse_program_text_format, 0);
8071 if( envfile ){
8072 warn_i_str( 50,
8073 "search support for kpse_find_file--using kpsewhich calls instead");
8074 } }
8075
8076 }
8077 if ( envfile ){
8078 dot_file = kpse_open_file (envfile,
8079 kpse_program_text_format);
8080 (IGNORED) printf("(%s)\n", envfile);
8081 } else if( dump_env_search ){
8082 p = (char *) kpse_var_value( "TEX4HTINPUTS" );
8083 if( p ){
8084 (IGNORED) printf( "TEX4HTINPUTS = %s\n", p );
8085 } else { warn_i_str( 50, "kpathsea variable TEX4HTINPUTS"); }
8086 }
8087 }
8088 #endif
8089
8090
8091 if( !dot_file ) { bad_in_file(
8092 #line 13191 "./tex4ht-c.tex"
8093
8094 #ifdef DOS_WIN32
8095 "tex4ht.env"
8096 #else
8097 "tex4ht.env | .tex4ht"
8098 #endif
8099
8100 ); } /* give up if no tex4ht.env */
8101 }
8102
8103
8104
8105 #line 4630 "./tex4ht-c.tex"
8106
8107 (IGNORED) fseek(dot_file, 0L,
8108 #line 2174 "./tex4ht-c.tex"
8109
8110 0
8111 );
8112 while ( search_dot_file( 'P' ) ){ struct sys_call_rec *q;
8113 U_CHAR *p, str[256];
8114 q = m_alloc(struct sys_call_rec, 1);
8115 q->next = system_calls;
8116 system_calls = q;
8117 p = str;
8118 do
8119 *(p++) = ch = (int) getc(dot_file);
8120 while( (ch !='\n') && (ch != EOF) );
8121 p--;
8122 *p = '\0';
8123 q->filter = m_alloc(char, (int) strlen((char *) str)+1);
8124 (IGNORED) strcpy((char *) q->filter, (char *) str);
8125 }
8126
8127
8128 #line 8861 "./tex4ht-c.tex"
8129
8130 lg_font_fmt = (char *) get_script(lg_font_fmt,LGFNT,'f');
8131
8132
8133 #line 10858 "./tex4ht-c.tex"
8134
8135 class_fmt = (char *) get_script(class_fmt,LGCLS,'c');
8136
8137
8138 #line 11087 "./tex4ht-c.tex"
8139
8140 font_gif = (char *) get_script(font_gif,LGPIC,'s');
8141
8142 #line 11093 "./tex4ht-c.tex"
8143
8144 { int n;
8145 n = (int) strlen((char *) font_gif);
8146 if( font_gif[n-1] != '%' ){ font_gif[n] = '%'; font_gif[n+1] = '\0'; }
8147 }
8148
8149
8150
8151
8152 #line 11125 "./tex4ht-c.tex"
8153
8154 begin_char_gif = (char *) get_script(begin_char_gif,LGSEP,'b');
8155
8156
8157 #line 11153 "./tex4ht-c.tex"
8158
8159 gif = (char *) get_script(gif,LGTYP,'g');
8160 { int n;
8161 n = (int) strlen((char *) gif) - 1;
8162 if( gif[n] == '%' ){ gif[n] = '%'; }
8163 else if( gif[n] == '\n' ) { gif[n] = '\0'; }
8164 }
8165
8166
8167
8168 #line 1880 "./tex4ht-c.tex"
8169
8170 { long curr_pos;
8171 curr_pos = ftell(dvi_file);
8172 (IGNORED) fseek(dvi_file, 0, SEEK_END);
8173 file_len = ftell(dvi_file);
8174 (IGNORED) fseek(dvi_file, curr_pos,
8175 #line 2174 "./tex4ht-c.tex"
8176
8177 0
8178 );
8179 if( (file_len % 4) != 0 ) bad_dvi;
8180 }
8181
8182
8183
8184 #line 5957 "./tex4ht-c.tex"
8185
8186 { U_CHAR str[256];
8187 (IGNORED) strcpy((char *) str, (char *) job_name);
8188 str[job_name_n-1] = '\0';
8189 str[job_name_n-2] = 'g';
8190 str[job_name_n-3] = 'l';
8191 if( (log_file = fopen(str, WRITE_TEXT_FLAGS)) == NULL )
8192 bad_in_file(str);
8193 }
8194
8195
8196
8197 #line 14441 "./tex4ht-c.tex"
8198
8199 #ifdef KPATHSEA
8200 { char str [256], *export_str, *postfix;
8201 export_str = m_alloc(char, 1);
8202 *export_str = '\0';
8203
8204 #line 14529 "./tex4ht-c.tex"
8205
8206 {
8207 struct htf_com_rec *q;
8208 q = htf_font_dir;
8209 while( q != (struct htf_com_rec *) 0 ){
8210 (IGNORED) strcpy((char *) str, (char *) q->name);
8211 export_htf( &export_str, str );
8212 q = q->next;
8213 } }
8214 (IGNORED) fseek(dot_file, 0L,
8215 #line 2174 "./tex4ht-c.tex"
8216
8217 0
8218 );
8219 while ( search_dot_file( 'i' ) ){
8220 int ch;
8221 char* p;
8222 p = str;
8223 do {
8224 ch = (int) getc(dot_file);
8225 if( ch != EOF) { *(p++) = ch;}
8226 } while( (ch !='\n') && (ch != EOF) );
8227 *p = '\0';
8228 export_htf( &export_str, str );
8229 }
8230 #ifdef HTFDIR
8231 (IGNORED) strcpy((char *) str, (char *) HTFDIR);
8232 export_htf( &export_str, str );
8233 #endif
8234
8235 #line 14559 "./tex4ht-c.tex"
8236
8237 { U_CHAR * q;
8238 q = (U_CHAR *) kpse_var_value( "TEX4HTFONTSET" );
8239 if( q ){
8240 if( (int) strlen((char *) q) > 0 ){
8241 export_str = (char *) r_alloc((void *) export_str,
8242 (int) strlen((char *) export_str) + (int) strlen((char *) q) + 2);
8243 if( (int) strlen((char *) export_str) > 0 ){
8244 (IGNORED) strcat((char *) export_str, ",");
8245 }
8246 (IGNORED) strcat((char *) export_str, (char *) q);
8247 } } }
8248
8249
8250
8251
8252 if( (int) strlen((char *) export_str) > 0 ){
8253 (IGNORED) strcpy((char *) str, "%%12");
8254 export_str = (char *) r_alloc((void *) export_str,
8255 (int) strlen((char *) export_str) + (int) strlen((char *) str) + 1 );
8256 postfix = str - 1;
8257 while( *(++postfix) != '\0' ){
8258 if( (*postfix=='%') && (*(postfix+1)=='%') &&
8259 (*(postfix+2)=='1') && (*(postfix+3)=='2') ){
8260 *postfix='\0'; postfix += 4; break;
8261 } }
8262 if( (int) strlen((char *) export_str) != 0 ){
8263
8264 #line 14472 "./tex4ht-c.tex"
8265
8266 { char *from_ch;
8267 int i, n, m;
8268 n = (int) strlen((char *) str);
8269 m = (int) strlen((char *) export_str);
8270 from_ch = export_str + m;
8271 for( i = 0; i<=m; i++){
8272 *(from_ch + n) = *(from_ch);
8273 from_ch--;
8274 }
8275 for( i = 0; i<n; i++){
8276 export_str[i] = str[i];
8277 }
8278 (IGNORED) strcat((char *) export_str, (char *) postfix);
8279 }
8280
8281
8282
8283 #line 14497 "./tex4ht-c.tex"
8284
8285 { U_CHAR * q;
8286 if( dump_htf_search ) { U_CHAR *p, *q;
8287
8288 #line 14846 "./tex4ht-c.tex"
8289
8290 p = (U_CHAR *) kpse_var_value( "TEX4HTFONTSET" );
8291 if( p ){
8292 (IGNORED) printf("given TEX4HTFONTSET = %s\n", p);
8293 }
8294 q = getenv("TEX4HTFONTSET");
8295 if( q ){ (IGNORED) printf(
8296 "Environmet var TEX4HTFONTSET: %s\n", q);
8297 }
8298 if( !p && !q ){
8299 (IGNORED) printf( "Missing TEX4HTFONTSET for kpathsea\n" );
8300 }
8301
8302
8303 }
8304 q = (U_CHAR *) kpse_var_value( "TEX4HTFONTSET" );
8305 if( q ){
8306 xputenv("TEX4HTFONTSET", export_str);
8307 if( dump_htf_search ){
8308 (IGNORED) printf("setting TEX4HTFONTSET={%s}\n", export_str);
8309 }
8310 } else if( dump_htf_search ) {
8311 warn_i_str( 50, "TEX4HTFONTSET for kpathsea" );
8312 }
8313 }
8314
8315
8316 }
8317 }
8318
8319 #line 14677 "./tex4ht-c.tex"
8320
8321 { int n;
8322 n = (int) strlen((char *) export_str);
8323 if( n > 0 ){
8324 export_str_chars = m_alloc(char, n+1);
8325 (IGNORED) strcpy((char *) export_str_chars, (char *) export_str);
8326 } }
8327
8328
8329 free((void *) export_str);
8330
8331 #line 14794 "./tex4ht-c.tex"
8332
8333 if( dump_htf_search || dump_env_search ) {
8334 U_CHAR *p, *q;
8335
8336 #line 14824 "./tex4ht-c.tex"
8337
8338 p = kpse_find_file ( "texmf.cnf", kpse_cnf_format, 0);
8339 if( p ){
8340 (IGNORED) printf( "texmf.cnf = %s\n", p);
8341 } else { warn_i_str(1, "texmf.cnf" ); }
8342 p = (U_CHAR *) kpse_var_value( "TEX4HTINPUTS" );
8343 if( p ){
8344 (IGNORED) printf("TEX4HTINPUTS = %s\n", p);
8345 }
8346 q = getenv("TEX4HTINPUTS");
8347 if( q ){ (IGNORED) printf(
8348 "Environment var TEX4HTINPUTS: %s\n", q);
8349 }
8350 if( !p && !q ){
8351 (IGNORED) printf( "Missing TEX4HTINPUTS for kpathsea\n" );
8352 }
8353
8354
8355 }
8356
8357
8358 }
8359 #endif
8360
8361
8362
8363 #line 2150 "./tex4ht-c.tex"
8364
8365 i=0;
8366 do{
8367 i++; file_len -= 1;
8368 (IGNORED) fseek(dvi_file, file_len,
8369 #line 2174 "./tex4ht-c.tex"
8370
8371 0
8372 );
8373 } while( (ch=get_char()) ==
8374 #line 17429 "./tex4ht-c.tex"
8375
8376 223
8377 );
8378 eof_op_n = file_len;
8379 if( (i<4)
8380 ||
8381 ((ch !=
8382 #line 2283 "./tex4ht-c.tex"
8383
8384 2
8385 ) && (ch >
8386 #line 2292 "./tex4ht-c.tex"
8387
8388 10
8389
8390 ))
8391 ) bad_dvi;
8392 version_id = ch;
8393
8394
8395 #line 2185 "./tex4ht-c.tex"
8396
8397 file_len -= 5;
8398 (IGNORED) fseek(dvi_file, file_len,
8399 #line 2174 "./tex4ht-c.tex"
8400
8401 0
8402 );
8403 if( get_char() !=
8404 #line 17478 "./tex4ht-c.tex"
8405
8406 249
8407 ) bad_dvi;
8408 eof_op_n -= begin_postamble = get_unt(4);
8409 (IGNORED) fseek(dvi_file, begin_postamble,
8410 #line 2174 "./tex4ht-c.tex"
8411
8412 0
8413 );
8414
8415
8416 #line 2197 "./tex4ht-c.tex"
8417
8418 if( get_char() !=
8419 #line 17475 "./tex4ht-c.tex"
8420
8421 248
8422 ) bad_dvi;
8423 (IGNORED) fseek(dvi_file, 16L,
8424 #line 2177 "./tex4ht-c.tex"
8425
8426 1
8427 );
8428
8429 #line 5972 "./tex4ht-c.tex"
8430
8431 mid_page_y = (INTEGER) get_unt(4) / 2;
8432 mid_page_x = (INTEGER) get_unt(4) / 2;
8433
8434
8435 if( (stack_len = (int) get_unt(2)) < 1) bad_dvi;
8436
8437 #line 6683 "./tex4ht-c.tex"
8438
8439 stack = m_alloc(struct stack_entry,
8440 #line 6688 "./tex4ht-c.tex"
8441
8442 ((int) stack_len + 2)
8443
8444 );
8445
8446 #line 6722 "./tex4ht-c.tex"
8447
8448 { int i;
8449 for( i=
8450 #line 6688 "./tex4ht-c.tex"
8451
8452 ((int) stack_len + 2)
8453
8454 -1; i>=0; i--){
8455 stack[i].begin = (struct group_info *) 0;
8456 stack[i].end = (struct stack_end_entry *) 0;
8457 stack[i].stack_id = -1;
8458
8459 #line 6358 "./tex4ht-c.tex"
8460
8461 stack[i].halign_info = FALSE;
8462 stack[i].halign_on = FALSE;
8463
8464
8465 #line 7808 "./tex4ht-c.tex"
8466
8467 stack[i].path_start = (struct group_path *) 0;
8468 stack[i].path_end = (struct group_path *) 0;
8469
8470
8471 #line 12891 "./tex4ht-c.tex"
8472
8473 stack[i].class_open = stack[i].class_close
8474 = (char *) 0;
8475 stack[i].temp_class_open = m_alloc(char, 1 );
8476 stack[i].temp_class_close = m_alloc(char, 1 );
8477 stack[i].ignore_subclass_del = stack[i].temp_class_del
8478 = stack[i].active_class_del
8479 = FALSE;
8480
8481
8482 } }
8483
8484
8485
8486
8487 unread_pages = (int) get_unt(2);
8488
8489
8490 #line 2222 "./tex4ht-c.tex"
8491
8492 {
8493 #line 10260 "./tex4ht-c.tex"
8494
8495 int fonts_n;
8496 struct html_font_rec *html_font=0;
8497
8498
8499 #line 11942 "./tex4ht-c.tex"
8500
8501 struct visited_file_rec * visited_file =
8502 (struct visited_file_rec *) 0;
8503
8504
8505 #line 13652 "./tex4ht-c.tex"
8506
8507 #ifndef KPATHSEA
8508 struct env_var_rec *tfm_dirs;
8509 #endif
8510 struct env_var_rec *htf_dirs;
8511
8512
8513 #line 14667 "./tex4ht-c.tex"
8514
8515
8516 #ifdef KPATHSEA
8517
8518 #line 14687 "./tex4ht-c.tex"
8519
8520 int cardinality=0;
8521 char ** fontset=0;
8522
8523
8524 #endif
8525
8526
8527 BOOL missing_fonts;
8528 #ifndef KPATHSEA
8529
8530 #line 14199 "./tex4ht-c.tex"
8531
8532 U_CHAR files_cache[PATH_MAX];
8533
8534
8535
8536 #line 14159 "./tex4ht-c.tex"
8537
8538 { U_CHAR *p;
8539 if( !tex4ht_fls_name ){
8540 tex4ht_fls_name = p = files_cache;
8541 (IGNORED) fseek(dot_file, 0L,
8542 #line 2174 "./tex4ht-c.tex"
8543
8544 0
8545 );
8546 if ( search_dot_file( 'l' ) ){
8547 do
8548 *(p++) = ch = (int) getc(dot_file);
8549 while( (ch !='\n') && (ch != EOF) );
8550 p--; *p = '\0';
8551 } else { (IGNORED) strcpy((char *) p,
8552 (char *) getenv("TEX4HTWR")? "~~/tex4ht.fls" : "tex4ht.fls");
8553 }
8554 }
8555
8556 #line 14178 "./tex4ht-c.tex"
8557
8558 if( *tex4ht_fls_name == '~' ){
8559 tex4ht_fls_name = abs_addr(tex4ht_fls_name,getenv("TEX4HTWR"));
8560 }
8561
8562
8563 }
8564
8565
8566
8567 #line 14342 "./tex4ht-c.tex"
8568
8569 cache_files = f_open(tex4ht_fls_name, READ_BIN_FLAGS);
8570
8571
8572 #endif
8573
8574 #line 10265 "./tex4ht-c.tex"
8575
8576 fonts_n = 0;
8577
8578
8579 #line 13732 "./tex4ht-c.tex"
8580
8581 cache_font = (struct cache_font_rec *) 0;
8582 cur_cache_font = (struct cache_font_rec *) 0;
8583
8584
8585 missing_fonts = FALSE;
8586
8587 #line 13572 "./tex4ht-c.tex"
8588
8589 #ifndef KPATHSEA
8590 tfm_dirs = get_env_var("TEX4HTTFM");
8591 #endif
8592 htf_dirs = get_env_var("TEX4HTHTF");
8593
8594
8595
8596 #line 14692 "./tex4ht-c.tex"
8597
8598
8599 #ifdef KPATHSEA
8600 if( export_str_chars ){
8601
8602 #line 14713 "./tex4ht-c.tex"
8603
8604 { U_CHAR *p;
8605 int n;
8606 cardinality = 1;
8607 p = (U_CHAR *) export_str_chars;
8608 while( *p != '\0' ){
8609 if( *p == ',' ){ cardinality++; }
8610 p++;
8611 }
8612 fontset = m_alloc(char *, cardinality);
8613 p = (U_CHAR *) export_str_chars;
8614 fontset[0] = p;
8615 n=1;
8616 while( *p != '\0' ){
8617 if( *p == ',' ){ fontset[n++] = p+1; *p = '\0'; }
8618 p++;
8619 } }
8620
8621
8622 }
8623 #endif
8624
8625
8626
8627 #line 15939 "./tex4ht-c.tex"
8628
8629 { U_CHAR name[256];
8630 FILE* file;
8631 (IGNORED) sprintf(name, "%s.4hf", "unicode");
8632
8633 #line 13841 "./tex4ht-c.tex"
8634
8635 file = NULL;
8636
8637 #line 13909 "./tex4ht-c.tex"
8638
8639 {
8640 struct htf_com_rec *p;
8641 p = htf_font_dir;
8642 while( p ){
8643 file = search_file_base(name, p->name, READ_TEXT_FLAGS, htf_dirs);
8644 if( file ){
8645 #ifndef KPATHSEA
8646 tex4ht_fls = TRUE;
8647 #endif
8648 break;
8649 }
8650 p = p->next;
8651 }
8652 }
8653
8654
8655 if( !file ){
8656 if( ((file = f_open(name, READ_TEXT_FLAGS)) == NULL) && dot_file )
8657 file = search_in_dot_file( 'i', name, READ_TEXT_FLAGS, htf_dirs);
8658 #ifdef HTFDIR
8659 if( !file ) file = search_file_base(name, HTFDIR,
8660 READ_TEXT_FLAGS, htf_dirs);
8661 #endif
8662
8663 #line 15077 "./tex4ht-c.tex"
8664
8665
8666 #ifdef KPATHSEA
8667 if( !file ){ U_CHAR * htfname;
8668 htfname= kpse_find_file (name, kpse_program_text_format, 0);
8669 if ( htfname ){
8670
8671 #line 14733 "./tex4ht-c.tex"
8672
8673 { U_CHAR * head, * tail, *p;
8674 int n;
8675
8676 #line 14743 "./tex4ht-c.tex"
8677
8678 n = (int) strlen((char *) htfname);
8679 tail = head = m_alloc(char, n+1);
8680 (IGNORED) strcpy((char *) head, (char *) htfname);
8681 while( n>11 ){
8682 if( (*tail=='\\') || (*tail=='/') ){
8683 if( (*tail == *(tail+9)) && (*(tail+1) == 'h')
8684 && (*(tail+2) == 't') && (*(tail+3) == '-')
8685 && (*(tail+4) == 'f') && (*(tail+5) == 'o')
8686 && (*(tail+6) == 'n') && (*(tail+7) == 't')
8687 && (*(tail+8) == 's') ){
8688 p = tail + 9; *(tail + 10) = '\0'; tail += 11;
8689 while( (*tail != *p) && (*tail != '\0') ){ tail++; }
8690 break;
8691 } }
8692 tail++; n--;
8693 }
8694
8695
8696 htfname = (U_CHAR *) 0;
8697
8698 #line 14765 "./tex4ht-c.tex"
8699
8700 for( n = 0 ; (n < cardinality) && !htfname ; n++){
8701 p = tail;
8702 while( *p != '\0' ){
8703 char * s, *nm;
8704 s = m_alloc(char, (int) strlen((char *) head ) +
8705 (int) strlen((char *) fontset[n] ) +
8706 (int) strlen((char *) p ) + 1);
8707 (IGNORED) strcpy((char *) s, (char *) head);
8708 (IGNORED) strcat((char *) s, (char *) fontset[n]);
8709 (IGNORED) strcat((char *) s, (char *) p);
8710 nm = kpse_find_file (s, kpse_program_text_format, 0);
8711 free((void *) s);
8712 if ( nm ){
8713 htfname = nm; break;
8714 }
8715 p++;
8716 while( (*p != '\\') && (*p != '/') && (*p != '\0') ){ p++; }
8717 } }
8718
8719
8720 }
8721
8722
8723 if ( htfname ){
8724 (IGNORED) printf("(%s)\n", htfname);
8725 file= fopen(htfname,READ_TEXT_FLAGS);
8726 } }
8727 }
8728 #endif
8729
8730
8731 }
8732
8733
8734 if( file ){
8735
8736 #line 15954 "./tex4ht-c.tex"
8737
8738 int chr, delimiter, delimiter_n, line_no, digit, i, j;
8739 U_CHAR in[512], *in_p, * start[4], *p;
8740 BOOL char_on, err;
8741 int value;
8742
8743
8744
8745 #line 16057 "./tex4ht-c.tex"
8746
8747 max_charset_n = 256;
8748 charset = m_alloc(struct charset_rec, 256);
8749
8750
8751 #line 16469 "./tex4ht-c.tex"
8752
8753 max_htf_4hf_n = 256;
8754 htf_4hf = m_alloc(struct htf_4hf_rec, 256);
8755 /* Zero the array, since otherwise some elements of htf_4hf may be used
8756 before it's initialized. See https://puszcza.gnu.org.ua/bugs/?611.
8757 Eitan never wrote a wrapper like malloc_chk for calloc, so
8758 just do it manually. */
8759 memset (htf_4hf, 0, 256 * sizeof (struct htf_4hf_rec));
8760
8761
8762
8763 #line 15962 "./tex4ht-c.tex"
8764
8765 err = FALSE;
8766 line_no = 0;
8767 while( TRUE ){
8768 line_no++;
8769 chr = (int) getc(file);
8770 if( chr == EOF ){ break; }
8771 if( (chr>32) && (chr<127) ){
8772
8773 #line 15998 "./tex4ht-c.tex"
8774
8775 delimiter = chr;
8776 delimiter_n = 1;
8777 char_on = TRUE;
8778 in_p = in;
8779 while( TRUE ) {
8780 chr = (int) getc(file);
8781 if( (chr == EOF) || (chr=='\n') ){ break; }
8782 if( chr == delimiter ){
8783 if( char_on ){ *(in_p++) = '\0'; }
8784 else{ start[ delimiter_n/2 ] = in_p; }
8785 char_on = !char_on;
8786 delimiter_n++;
8787 } else if (char_on ) {
8788 *(in_p++) = chr;
8789 }
8790 if( delimiter_n==8 ){ break; }
8791 }
8792
8793
8794 if( delimiter_n == 8 ){
8795 if( *in != '?' ) {
8796 if(
8797 #line 15991 "./tex4ht-c.tex"
8798
8799 (*in != '&')
8800 || (*(in+1) != '#')
8801 || ( (*(in+2) != 'x') && (*(in+2) != 'X'))
8802 || (*(start[1] - 2) != ';')
8803
8804 ){ err = TRUE; }
8805 else {
8806
8807 #line 16067 "./tex4ht-c.tex"
8808
8809 value = 0;
8810 for( p=in+3; *p!=';'; p++){
8811 digit = (int) *p;
8812 if( (digit>='0') && (digit<='9') ){ digit -= '0'; }
8813 else if( (digit>='A') && (digit<='F') ){ digit -= BASE_A; }
8814 else if( (digit>='a') && (digit<='f') ){ digit -= BASE_a; }
8815 else { digit=0; err = TRUE; }
8816 value = 16*value + digit;
8817 }
8818
8819
8820 if( start[3] == (in_p-1) ){
8821 if( !err ){
8822 #line 16086 "./tex4ht-c.tex"
8823
8824
8825 #line 16116 "./tex4ht-c.tex"
8826
8827 if( (charset_n+1) == max_charset_n){
8828 max_charset_n += 10;
8829 charset = (struct charset_rec *) r_alloc((void *) charset,
8830 (size_t) ((max_charset_n) * sizeof(struct charset_rec) ));
8831 }
8832
8833
8834 p = m_alloc(char, (int) (start[3] - start[2]) );
8835 (IGNORED) strcpy((char *) p, (char *) start[2] );
8836 i = charset_n;
8837 while( i-- > 0 ){
8838 if( charset[i].ch == value ){
8839 free((void *) charset[i].str);
8840 break;
8841 } else {
8842 if( (charset[i].ch < value)
8843 || ((charset[i].ch > value) && (i==0)) ){
8844 if( charset[i].ch < value ){ i++; }
8845 charset_n++;
8846 for( j=charset_n; j>i; j-- ){
8847 charset[j].ch = charset[j-1].ch;
8848 charset[j].str = charset[j-1].str;
8849 }
8850 break;
8851 } }
8852 }
8853 if(i == -1){ i = charset_n; }
8854 if( i==charset_n ){ charset_n++; }
8855 charset[i].str = p;
8856 charset[i].ch = value;
8857
8858 }
8859 } else {
8860 #line 16385 "./tex4ht-c.tex"
8861
8862
8863 #line 16425 "./tex4ht-c.tex"
8864
8865 if( (htf_4hf_n+1) == max_htf_4hf_n){
8866 max_htf_4hf_n += 10;
8867 htf_4hf = (struct htf_4hf_rec *) r_alloc((void *) htf_4hf,
8868 (size_t) ((max_htf_4hf_n) * sizeof(struct htf_4hf_rec) ));
8869 }
8870 p = m_alloc(char, (int) (start[3] - start[2]) );
8871
8872
8873 (IGNORED) strcpy((char *) p, (char *) start[2] );
8874 i = htf_4hf_n;
8875 while( i-- > 0 ){
8876 if( htf_4hf[i].ch == value ){
8877 free((void *) htf_4hf[i].str);
8878 break;
8879 } else {
8880 if( (htf_4hf[i].ch < value)
8881 || ((htf_4hf[i].ch > value) && (i==0)) ){
8882 if( htf_4hf[i].ch < value ){ i++; }
8883 htf_4hf_n++;
8884 for( j=htf_4hf_n; j>i; j-- ){
8885 htf_4hf[j].ch = htf_4hf[j-1].ch;
8886 htf_4hf[j].str = htf_4hf[j-1].str;
8887 htf_4hf[j].type1 = htf_4hf[j-1].type1;
8888 htf_4hf[j].type2 = htf_4hf[j-1].type2;
8889 }
8890 break;
8891 } } }
8892 if(i == -1){ i = htf_4hf_n; }
8893 if(i == htf_4hf_n){ htf_4hf_n++; }
8894 htf_4hf[i].str = p;
8895 htf_4hf[i].ch = value;
8896
8897 #line 16435 "./tex4ht-c.tex"
8898
8899 value = 0;
8900 p = start[1];
8901 while( *p != '\0' ){
8902 if( (*p < '0') || (*p > '9') ) break;
8903 value = value * 10 + *p - '0';
8904 p++;
8905 }
8906 htf_4hf[i].type1 = value;
8907
8908
8909 #line 16446 "./tex4ht-c.tex"
8910
8911 value = 0;
8912 p = start[3];
8913 while( *p != '\0' ){
8914 if( (*p < '0') || (*p > '9') ) break;
8915 value = value * 10 + *p - '0';
8916 p++;
8917 }
8918 htf_4hf[i].type2 = value;
8919
8920
8921
8922
8923 }
8924 } } }
8925 else { err = TRUE; }
8926
8927 #line 16024 "./tex4ht-c.tex"
8928
8929 if( err ){
8930 warn_i_int(48,line_no);
8931 (IGNORED) printf( "%c", delimiter );
8932 for( p=in; p != in_p; p++ ){
8933 if( *p=='\0' ){
8934 (IGNORED) printf("%c", delimiter);
8935 if( p != in_p-1 ){ (IGNORED) printf(" %c", delimiter); }
8936 }
8937 else { (IGNORED) printf( "%c", *p ); }
8938 }
8939 (IGNORED) printf( "\n" );
8940 err = FALSE;
8941 }
8942
8943
8944 }
8945 while( (chr != EOF) && (chr!='\n') ){
8946 chr = (int) getc(file);
8947 }
8948 if( chr == EOF ){ break; }
8949 }
8950
8951
8952 put_4ht_off = 0;
8953 } else{ put_4ht_off = 1;
8954 #line 16062 "./tex4ht-c.tex"
8955
8956 max_charset_n = 0;
8957
8958
8959 #line 16479 "./tex4ht-c.tex"
8960
8961 max_htf_4hf_n = 0;
8962
8963 }
8964 }
8965
8966
8967 while( (ch = get_char()) !=
8968 #line 17478 "./tex4ht-c.tex"
8969
8970 249
8971 ){
8972
8973 #line 8667 "./tex4ht-c.tex"
8974
8975 #ifdef MAXFONTS
8976 if( (font_tbl_size + 1) < MAXFONTS )
8977 #endif
8978 {
8979 INTEGER new_font_checksum;
8980 int font_name_n;
8981 font_tbl = font_tbl_size?
8982 (struct font_entry *) r_alloc((void *) font_tbl,
8983 (size_t) ((font_tbl_size+1)
8984 * sizeof(struct font_entry)))
8985 : m_alloc(struct font_entry, 1);
8986 if( (version_id ==
8987 #line 2292 "./tex4ht-c.tex"
8988
8989 10
8990
8991 )
8992 && (ch ==
8993 #line 17499 "./tex4ht-c.tex"
8994
8995 252
8996
8997 )
8998 ){
8999
9000 #line 8890 "./tex4ht-c.tex"
9001
9002 unsigned short flags;
9003 new_font.num = (INTEGER) get_unt(4);
9004 new_font.scale = (INTEGER) get_unt(4);
9005 new_font.design_sz = new_font.scale;
9006 flags = (INTEGER) get_unt(2);
9007
9008 #line 8917 "./tex4ht-c.tex"
9009
9010 { int n, family_name_n, style_name_n;
9011 U_CHAR *ch;
9012
9013 font_name_n = (INTEGER) get_unt(1);
9014 family_name_n = (INTEGER) get_unt(1);
9015 style_name_n = (INTEGER) get_unt(1);
9016 n = font_name_n + 1;
9017 ch = new_font_name = m_alloc(char, n);
9018 while( --n ){ *ch = (int) get_unt(1); ch++; }
9019 *ch = '\0';
9020 n = family_name_n + 1;
9021
9022 while( --n ){ (void) get_unt(1); ch++; }
9023 *ch = '\0';
9024 n = style_name_n + 1;
9025
9026 while( --n ){ (void) get_unt(1); ch++; }
9027 *ch = '\0';
9028 }
9029
9030
9031 new_font.layout_dir = (flags &
9032 #line 8955 "./tex4ht-c.tex"
9033
9034 0x0100
9035
9036 ) ? 1 : 0;
9037 new_font.rgba_color = (flags &
9038 #line 8959 "./tex4ht-c.tex"
9039
9040 0x0200
9041
9042 )?
9043 (unsigned long) get_unt(4)
9044 :
9045 0xffffffff;
9046 if( flags &
9047 #line 8963 "./tex4ht-c.tex"
9048
9049 0x0800
9050
9051 ){
9052 int n = (INTEGER) get_unt(2);
9053 int i;
9054 for (i = 0; i < n; ++i) {
9055 (void) get_unt(4);
9056 }
9057 for (i = 0; i < n; ++i) {
9058 (void) get_int(4);
9059 } }
9060 (IGNORED) printf("(--- xdv font = %s (not implemented) ---)\n", new_font_name);
9061
9062 #line 9081 "./tex4ht-c.tex"
9063
9064
9065 #line 9302 "./tex4ht-c.tex"
9066
9067 { int i;
9068 for( i=font_tbl_size-1; i>0; i-- )
9069 if( new_font.num == font_tbl[i].num ) warn_i(10); }
9070
9071
9072
9073 #line 9102 "./tex4ht-c.tex"
9074
9075 {
9076
9077 /*
9078 if( font_file == NULL ){
9079 dump_env(); err_i_str(1,file_name);
9080 missing_fonts = TRUE;
9081 new_font.char_f = 2;
9082 new_font.char_l = 1;
9083 } else {
9084 */
9085
9086 #line 9123 "./tex4ht-c.tex"
9087
9088 {
9089
9090 #line 9170 "./tex4ht-c.tex"
9091
9092 new_font.char_f = 0;
9093 new_font.char_l = 255;
9094 new_font.wtbl_n = 0;
9095 new_font.htbl_n = 0;
9096 new_font.dtbl_n = 0;
9097
9098
9099
9100
9101 #line 9195 "./tex4ht-c.tex"
9102
9103 { U_CHAR *ch, *hidp;
9104 int i;
9105 ch = new_font.char_wi = m_alloc(char, new_font.char_l
9106 - new_font.char_f + 1);
9107 hidp = new_font.char_hidp = m_alloc(char, new_font.char_l
9108 - new_font.char_f + 1);
9109 for( i = new_font.char_f; i <= new_font.char_l; i++ ){
9110 *(ch++) = 10;
9111 *(hidp++) = 26;
9112 } }
9113
9114
9115
9116 #line 9209 "./tex4ht-c.tex"
9117
9118 { INTEGER *p;
9119 int i;
9120 p = new_font.wtbl = m_alloc( INTEGER, new_font.wtbl_n);
9121 for( i = 0; i < new_font.wtbl_n; i++ ){
9122 *(p++) = 600000;
9123 } }
9124
9125
9126
9127 #line 9220 "./tex4ht-c.tex"
9128
9129 { INTEGER *p;
9130 int i;
9131 p = new_font.htbl = m_alloc( INTEGER, new_font.htbl_n);
9132 for( i = 0; i < new_font.htbl_n; i++ ){
9133 *(p++) = 600000;
9134 } }
9135
9136
9137
9138
9139
9140
9141
9142
9143 #line 9144 "./tex4ht-c.tex"
9144
9145
9146 #line 9155 "./tex4ht-c.tex"
9147
9148 new_font.it = 0;
9149
9150
9151
9152 #line 9160 "./tex4ht-c.tex"
9153
9154 new_font.word_sp = 350000;
9155
9156 #line 9756 "./tex4ht-c.tex"
9157
9158 if( new_font.word_sp == 0 ) {
9159 int i;
9160 for( i = new_font.char_f; i <= new_font.char_l; i++ ){
9161 new_font.word_sp =
9162 ( new_font.word_sp
9163 +
9164 *(new_font.wtbl + (int)(*(new_font.char_wi + i - new_font.char_f)))
9165 ) / (new_font.char_f<i? 2:1);
9166 } }
9167 if( new_font.word_sp == 0 ) new_font.word_sp = MARGINSP;
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179 }
9180
9181
9182 /*
9183 (IGNORED) fclose(font_file);
9184 }
9185 */
9186 }
9187
9188
9189 new_font_name[font_name_n] = '\0';
9190 new_font.name = m_alloc(char, font_name_n + 1);
9191 (IGNORED) strcpy((char *) new_font.name, (char *) new_font_name );
9192
9193 #line 8785 "./tex4ht-c.tex"
9194
9195 { int n, i;
9196 for( n=0; n<font_name_n; n++ ){
9197 if( ( '0' <= new_font_name[n] ) && ( new_font_name[n] <= '9' )){
9198 break;
9199 }
9200 }
9201
9202 #line 8807 "./tex4ht-c.tex"
9203
9204 { int m;
9205 for( m=n; m<font_name_n; m++ ){
9206 if( ( new_font_name[m] < '0' ) || ( new_font_name[m] > '9' )){
9207 n=font_name_n;
9208 break;
9209 } } }
9210
9211
9212 new_font.family_name = m_alloc(char, n + 2);
9213 new_font.font_size = m_alloc(char, font_name_n - n + 1 );
9214 for( i=0; i<n; i++ ){
9215 new_font.family_name[i] = new_font_name[i];
9216 }
9217 new_font.family_name[i] = '\0'; i = 0;
9218 while( n<font_name_n ){
9219 new_font.font_size[i++] = new_font_name[n++];
9220 }
9221 new_font.font_size[i] = '\0';
9222 }
9223
9224
9225
9226 #line 9092 "./tex4ht-c.tex"
9227
9228 new_font.mag = new_font.scale / (new_font.design_sz / 100);
9229
9230
9231
9232
9233
9234
9235 } else {
9236
9237 #line 8701 "./tex4ht-c.tex"
9238
9239
9240 #line 8727 "./tex4ht-c.tex"
9241
9242 switch( ch ){
9243 case
9244 #line 17460 "./tex4ht-c.tex"
9245
9246 243
9247 :
9248 case
9249 #line 17463 "./tex4ht-c.tex"
9250
9251 244
9252 :
9253 case
9254 #line 17466 "./tex4ht-c.tex"
9255
9256 245
9257 : {
9258 new_font.num = (INTEGER)
9259 get_unt(ch -
9260 #line 17460 "./tex4ht-c.tex"
9261
9262 243
9263 + 1); break; }
9264 case
9265 #line 17469 "./tex4ht-c.tex"
9266
9267 246
9268 : {
9269 new_font.num = (INTEGER) get_int(4); break; }
9270 default: err_i(8);
9271 }
9272
9273
9274 new_font_checksum = (INTEGER) get_int(4);
9275 new_font.scale = (INTEGER) get_unt(4);
9276 new_font.design_sz = (INTEGER) get_unt(4);
9277
9278 #line 8741 "./tex4ht-c.tex"
9279
9280 { int n, area_ln;
9281 U_CHAR *ch;
9282 area_ln = (int) get_unt(1);
9283 font_name_n = (int) get_unt(1);
9284 n = area_ln + font_name_n + 1;
9285 ch = new_font_name = m_alloc(char, n);
9286 while( --n ){ *ch = (int) get_unt(1); ch++; }
9287 *ch = '\0';
9288 }
9289
9290
9291
9292 #line 8757 "./tex4ht-c.tex"
9293
9294
9295 #line 9302 "./tex4ht-c.tex"
9296
9297 { int i;
9298 for( i=font_tbl_size-1; i>0; i-- )
9299 if( new_font.num == font_tbl[i].num ) warn_i(10); }
9300
9301
9302
9303 #line 9348 "./tex4ht-c.tex"
9304
9305 { FILE *font_file;
9306 U_CHAR file_name[256];
9307
9308 #line 13516 "./tex4ht-c.tex"
9309
9310 {
9311 font_file = NULL;
9312 (IGNORED) sprintf(file_name, "%s.tfm", new_font_name);
9313
9314 #line 14975 "./tex4ht-c.tex"
9315
9316 #ifdef KPATHSEA
9317 {
9318 U_CHAR * tfmfile;
9319 tfmfile = kpse_find_file (file_name, kpse_tfm_format, 0);
9320 if( !tfmfile ){
9321 #line 15030 "./tex4ht-c.tex"
9322
9323 char s [256];
9324 (IGNORED) strcpy(s, "kpsewhich ");
9325 (IGNORED) strcat(s, file_name);
9326 (IGNORED) strcat(s, " > tex4ht.tmp ");
9327 if( system(s) == 0 ){
9328
9329 #line 15046 "./tex4ht-c.tex"
9330
9331 char fileaddr [256];
9332 int loc = 0;
9333 FILE* file = f_open("tex4ht.tmp", READ_TEXT_FLAGS);
9334 if( file ){
9335 while( (fileaddr[loc] = getc(file)) >=0 ){
9336 if( fileaddr[loc] == '\n' ){ fileaddr[loc] = '\0'; break; }
9337 loc++;
9338 }
9339 (IGNORED) fclose(file);
9340 }
9341
9342
9343 tfmfile = kpse_find_file (fileaddr, kpse_program_text_format, 0);
9344 }
9345
9346 }
9347 if ( tfmfile ){
9348 (IGNORED) printf("(%s)\n", tfmfile);
9349 font_file = kpse_open_file (tfmfile, kpse_tfm_format);
9350 }
9351 }
9352 #else
9353
9354
9355
9356 #line 13672 "./tex4ht-c.tex"
9357
9358 for( cur_cache_font = cache_font;
9359 cur_cache_font;
9360 cur_cache_font = cur_cache_font->next )
9361 if( (font_file = search_file(file_name,
9362 cur_cache_font->dir,
9363 READ_BIN_FLAGS))
9364 != NULL) break;
9365
9366
9367 if( !font_file ){ int i;
9368 for( i = fontdir_count; i--; ){
9369 if( (font_file = search_file_base(file_name, fontdir[i],
9370 READ_BIN_FLAGS, tfm_dirs))
9371 != NULL ) break; }
9372 }
9373 if( !font_file ) font_file = f_open(file_name, READ_BIN_FLAGS);
9374 if( !font_file && dot_file )
9375 font_file = search_in_dot_file( 't', file_name,
9376 READ_BIN_FLAGS, tfm_dirs);
9377
9378 #line 13548 "./tex4ht-c.tex"
9379
9380 #ifdef TFMDIR
9381 if( !font_file )
9382 font_file = search_file_base(file_name, TFMDIR,
9383 READ_BIN_FLAGS, tfm_dirs);
9384 #endif
9385
9386
9387
9388 #line 14992 "./tex4ht-c.tex"
9389
9390 #endif
9391
9392
9393 }
9394
9395
9396 if( font_file == NULL ){
9397 dump_env(); err_i_str(1,file_name);
9398 missing_fonts = TRUE;
9399 new_font.char_f = 2;
9400 new_font.char_l = 1;
9401 } else {
9402
9403 #line 9389 "./tex4ht-c.tex"
9404
9405 {
9406 #line 9439 "./tex4ht-c.tex"
9407
9408 INTEGER file_length;
9409 int header_length,
9410 it_correction_table_length,
9411 lig_kern_table_length,
9412 kern_table_length,
9413 extensible_char_table_length,
9414 num_font_parameters;
9415
9416
9417
9418 #line 9411 "./tex4ht-c.tex"
9419
9420 file_length = (INTEGER) fget_int(font_file,2);
9421 header_length = (int) fget_int(font_file,2);
9422 new_font.char_f = (int) fget_int(font_file,2);
9423 new_font.char_l = (int) fget_int(font_file,2);
9424 new_font.wtbl_n = (int) fget_int(font_file,2);
9425 new_font.htbl_n = (int) fget_int(font_file,2);
9426 new_font.dtbl_n = (int) fget_int(font_file,2);
9427 it_correction_table_length = (int) fget_int(font_file,2);
9428 lig_kern_table_length = (int) fget_int(font_file,2);
9429 kern_table_length = (int) fget_int(font_file,2);
9430 extensible_char_table_length = (int) fget_int(font_file,2);
9431 num_font_parameters = (int) fget_int(font_file,2);
9432 if( file_length != ( 6 + header_length
9433 - new_font.char_f + new_font.char_l + 1
9434 + new_font.wtbl_n + new_font.htbl_n
9435 + new_font.dtbl_n + it_correction_table_length
9436 + lig_kern_table_length + kern_table_length
9437 + extensible_char_table_length + num_font_parameters )
9438 ){ err_i_str(15,file_name); }
9439
9440
9441
9442 #line 9484 "./tex4ht-c.tex"
9443
9444
9445 #line 9493 "./tex4ht-c.tex"
9446
9447 { INTEGER checksum;
9448 checksum = ( INTEGER) fget_int(font_file,4);
9449 if( checksum && new_font_checksum
9450 && (checksum != new_font_checksum) )
9451 { warn_i(16);
9452 (IGNORED) fprintf(stderr,"%s: %d\ndvi file: %d\n",file_name,
9453 checksum, new_font_checksum);
9454 } }
9455
9456
9457
9458 #line 9513 "./tex4ht-c.tex"
9459
9460 new_font.design_pt = ( INTEGER) fget_int(font_file,4);
9461
9462
9463 (IGNORED) fseek(font_file, (long) ((header_length - 2) * 4),
9464 #line 2177 "./tex4ht-c.tex"
9465
9466 1
9467 );
9468
9469
9470
9471 #line 9525 "./tex4ht-c.tex"
9472
9473 { U_CHAR *ch, *hidp;
9474 int i;
9475 ch = new_font.char_wi = m_alloc(char, new_font.char_l
9476 - new_font.char_f + 1);
9477 hidp = new_font.char_hidp = m_alloc(char, new_font.char_l
9478 - new_font.char_f + 1);
9479 for( i = new_font.char_f; i <= new_font.char_l; i++ ){
9480 *(ch++) = (int) fget_unt(font_file,1);
9481 *(hidp++) = (int) fget_unt(font_file,1);
9482 (IGNORED) fseek(font_file, 2L,
9483 #line 2177 "./tex4ht-c.tex"
9484
9485 1
9486 );
9487 } }
9488
9489
9490
9491 #line 9580 "./tex4ht-c.tex"
9492
9493 { INTEGER *p;
9494 int i;
9495 p = new_font.wtbl = m_alloc( INTEGER, new_font.wtbl_n);
9496 for( i = 0; i < new_font.wtbl_n; i++ ){
9497 *(p++) = ( INTEGER) fget_int(font_file,4);
9498 } }
9499
9500
9501
9502 #line 9616 "./tex4ht-c.tex"
9503
9504 { INTEGER *p;
9505 int i;
9506 p = new_font.htbl = m_alloc( INTEGER, new_font.htbl_n);
9507 for( i = 0; i < new_font.htbl_n; i++ ){
9508 *(p++) = ( INTEGER) fget_int(font_file,4);
9509 } }
9510
9511
9512 #line 9640 "./tex4ht-c.tex"
9513
9514 { INTEGER *p;
9515 int i;
9516 p = new_font.dtbl = m_alloc( INTEGER, new_font.dtbl_n);
9517 for( i = 0; i < new_font.dtbl_n; i++ ){
9518 *(p++) = ( INTEGER) fget_int(font_file,4);
9519 } }
9520
9521
9522
9523
9524 #line 9663 "./tex4ht-c.tex"
9525
9526
9527 (IGNORED) fseek(font_file, (long) (it_correction_table_length * 4),
9528
9529 #line 2177 "./tex4ht-c.tex"
9530
9531 1
9532 );
9533
9534
9535
9536 #line 9673 "./tex4ht-c.tex"
9537
9538 (IGNORED) fseek(font_file, (long) (lig_kern_table_length * 4),
9539
9540 #line 2177 "./tex4ht-c.tex"
9541
9542 1
9543 );
9544
9545
9546
9547 #line 9682 "./tex4ht-c.tex"
9548
9549
9550 (IGNORED) fseek(font_file, (long) (kern_table_length * 4),
9551
9552 #line 2177 "./tex4ht-c.tex"
9553
9554 1
9555 );
9556
9557
9558
9559 #line 9692 "./tex4ht-c.tex"
9560
9561 (IGNORED) fseek(font_file, (long) (extensible_char_table_length * 4),
9562
9563 #line 2177 "./tex4ht-c.tex"
9564
9565 1
9566 );
9567
9568
9569
9570 #line 9707 "./tex4ht-c.tex"
9571
9572
9573 #line 9722 "./tex4ht-c.tex"
9574
9575 new_font.it = ( INTEGER) fget_int(font_file,4);
9576
9577
9578
9579 #line 9728 "./tex4ht-c.tex"
9580
9581 new_font.word_sp = ( INTEGER) fget_int(font_file,4);
9582
9583 #line 9756 "./tex4ht-c.tex"
9584
9585 if( new_font.word_sp == 0 ) {
9586 int i;
9587 for( i = new_font.char_f; i <= new_font.char_l; i++ ){
9588 new_font.word_sp =
9589 ( new_font.word_sp
9590 +
9591 *(new_font.wtbl + (int)(*(new_font.char_wi + i - new_font.char_f)))
9592 ) / (new_font.char_f<i? 2:1);
9593 } }
9594 if( new_font.word_sp == 0 ) new_font.word_sp = MARGINSP;
9595
9596
9597
9598
9599
9600 #line 9772 "./tex4ht-c.tex"
9601
9602 (IGNORED) fseek(font_file, 4L,
9603 #line 2177 "./tex4ht-c.tex"
9604
9605 1
9606 );
9607
9608
9609
9610 #line 9776 "./tex4ht-c.tex"
9611
9612 (IGNORED) fseek(font_file, 4L,
9613 #line 2177 "./tex4ht-c.tex"
9614
9615 1
9616 );
9617
9618
9619
9620 #line 9165 "./tex4ht-c.tex"
9621
9622 new_font.ex = 450000;
9623
9624
9625 #line 9782 "./tex4ht-c.tex"
9626
9627 new_font.ex = (INTEGER) fget_int(font_file,4);
9628
9629
9630
9631 #line 9788 "./tex4ht-c.tex"
9632
9633
9634
9635
9636
9637 #line 9794 "./tex4ht-c.tex"
9638
9639
9640
9641
9642
9643
9644 }
9645
9646
9647 (IGNORED) fclose(font_file);
9648 } }
9649
9650
9651 new_font_name[font_name_n] = '\0';
9652 new_font.name = m_alloc(char, font_name_n + 1);
9653 (IGNORED) strcpy((char *) new_font.name, (char *) new_font_name );
9654
9655 #line 8785 "./tex4ht-c.tex"
9656
9657 { int n, i;
9658 for( n=0; n<font_name_n; n++ ){
9659 if( ( '0' <= new_font_name[n] ) && ( new_font_name[n] <= '9' )){
9660 break;
9661 }
9662 }
9663
9664 #line 8807 "./tex4ht-c.tex"
9665
9666 { int m;
9667 for( m=n; m<font_name_n; m++ ){
9668 if( ( new_font_name[m] < '0' ) || ( new_font_name[m] > '9' )){
9669 n=font_name_n;
9670 break;
9671 } } }
9672
9673
9674 new_font.family_name = m_alloc(char, n + 2);
9675 new_font.font_size = m_alloc(char, font_name_n - n + 1 );
9676 for( i=0; i<n; i++ ){
9677 new_font.family_name[i] = new_font_name[i];
9678 }
9679 new_font.family_name[i] = '\0'; i = 0;
9680 while( n<font_name_n ){
9681 new_font.font_size[i++] = new_font_name[n++];
9682 }
9683 new_font.font_size[i] = '\0';
9684 }
9685
9686
9687
9688 #line 8772 "./tex4ht-c.tex"
9689
9690 new_font.mag = new_font.scale / (new_font.design_sz / 100);
9691
9692
9693
9694
9695
9696
9697 }
9698
9699 #line 9998 "./tex4ht-c.tex"
9700
9701 { U_CHAR str[256];
9702 int i, design_n, n_gif;
9703
9704 #line 10093 "./tex4ht-c.tex"
9705
9706 int loopBound = 0;
9707 U_CHAR loopName[256];
9708 loopName[0] = '\0';
9709
9710
9711 n_gif = new_font.char_l - new_font.char_f + 1;
9712 new_font.ch255 = 0;
9713
9714 #line 10028 "./tex4ht-c.tex"
9715
9716 { int n_gif_bytes;
9717 n_gif_bytes = (n_gif + 7) / 8;
9718 new_font.gif_on = m_alloc(char, n_gif_bytes );
9719 new_font.ch_str = m_alloc(char, n_gif_bytes );
9720
9721 #line 12772 "./tex4ht-c.tex"
9722
9723 new_font.math_closing = m_alloc(char, n_gif_bytes );
9724 new_font.math = m_alloc(char, n_gif );
9725
9726
9727 for( i=n_gif_bytes; i--; ) {
9728
9729 #line 12778 "./tex4ht-c.tex"
9730
9731 new_font.math_closing[i] =
9732
9733 new_font.ch_str[i] = new_font.gif_on[i] = 0;
9734 }
9735 new_font.gif1 = m_alloc(unsigned char, n_gif );
9736 for( i=n_gif; i--; ) {
9737
9738 #line 12782 "./tex4ht-c.tex"
9739
9740 new_font.math[i] =
9741
9742 new_font.gif1[i] = 0;
9743 } }
9744
9745
9746
9747 #line 12082 "./tex4ht-c.tex"
9748
9749 new_font.accent = m_alloc(unsigned char, n_gif );
9750 new_font.accented = m_alloc(unsigned char, n_gif );
9751 new_font.accent_array = (unsigned int *) 0;
9752 new_font.accented_array = (unsigned int *) 0;
9753 new_font.accent_N = new_font.accented_N = 0;
9754 for( i=n_gif; i--; ) {
9755 new_font.accent[i] = new_font.accented[i] = 0;
9756 }
9757
9758
9759 new_font.ch = m_alloc(unsigned char, n_gif );
9760
9761 #line 10043 "./tex4ht-c.tex"
9762
9763 for( i = new_font.char_f; i <= new_font.char_l ; i++ ){
9764 new_font.ch[i - new_font.char_f] =
9765 (char) (((31<i) && (i<128))? i : ignore_ch);
9766 }
9767
9768
9769 new_font.str = m_alloc(unsigned char*, n_gif);
9770 new_font.str[0] = &null_str;
9771 design_n = 0;
9772
9773 #line 10057 "./tex4ht-c.tex"
9774
9775 { char search_font_name [256];
9776 (IGNORED) strcpy((char *) search_font_name, (char *) new_font.name);
9777 while( 1 ){ BOOL flag;
9778
9779 #line 10099 "./tex4ht-c.tex"
9780
9781 if( eq_str( new_font_name, loopName) ){
9782 U_CHAR name[256];
9783 (IGNORED) sprintf(name, "%s.htf", new_font_name);
9784 err_i_str(1, name);
9785 } else {
9786 (IGNORED) strcpy((char *) loopName, (char *) new_font_name);
9787 }
9788 loopBound++;
9789 if( loopBound > 10 ){
9790 U_CHAR name[256];
9791 (IGNORED) sprintf(name, "%s.htf", new_font_name);
9792 err_i_str(1, name);
9793 }
9794
9795
9796 flag = TRUE;
9797 for( ; font_name_n; font_name_n-- ){ FILE* file;
9798 int char_f, char_l;
9799 new_font_name[font_name_n] = '\0';
9800
9801 #line 13832 "./tex4ht-c.tex"
9802
9803 { U_CHAR name[256];
9804 (IGNORED) sprintf(name, "%s.htf", new_font_name);
9805
9806 #line 13841 "./tex4ht-c.tex"
9807
9808 file = NULL;
9809
9810 #line 13909 "./tex4ht-c.tex"
9811
9812 {
9813 struct htf_com_rec *p;
9814 p = htf_font_dir;
9815 while( p ){
9816 file = search_file_base(name, p->name, READ_TEXT_FLAGS, htf_dirs);
9817 if( file ){
9818 #ifndef KPATHSEA
9819 tex4ht_fls = TRUE;
9820 #endif
9821 break;
9822 }
9823 p = p->next;
9824 }
9825 }
9826
9827
9828 if( !file ){
9829 if( ((file = f_open(name, READ_TEXT_FLAGS)) == NULL) && dot_file )
9830 file = search_in_dot_file( 'i', name, READ_TEXT_FLAGS, htf_dirs);
9831 #ifdef HTFDIR
9832 if( !file ) file = search_file_base(name, HTFDIR,
9833 READ_TEXT_FLAGS, htf_dirs);
9834 #endif
9835
9836 #line 15077 "./tex4ht-c.tex"
9837
9838
9839 #ifdef KPATHSEA
9840 if( !file ){ U_CHAR * htfname;
9841 htfname= kpse_find_file (name, kpse_program_text_format, 0);
9842 if ( htfname ){
9843
9844 #line 14733 "./tex4ht-c.tex"
9845
9846 { U_CHAR * head, * tail, *p;
9847 int n;
9848
9849 #line 14743 "./tex4ht-c.tex"
9850
9851 n = (int) strlen((char *) htfname);
9852 tail = head = m_alloc(char, n+1);
9853 (IGNORED) strcpy((char *) head, (char *) htfname);
9854 while( n>11 ){
9855 if( (*tail=='\\') || (*tail=='/') ){
9856 if( (*tail == *(tail+9)) && (*(tail+1) == 'h')
9857 && (*(tail+2) == 't') && (*(tail+3) == '-')
9858 && (*(tail+4) == 'f') && (*(tail+5) == 'o')
9859 && (*(tail+6) == 'n') && (*(tail+7) == 't')
9860 && (*(tail+8) == 's') ){
9861 p = tail + 9; *(tail + 10) = '\0'; tail += 11;
9862 while( (*tail != *p) && (*tail != '\0') ){ tail++; }
9863 break;
9864 } }
9865 tail++; n--;
9866 }
9867
9868
9869 htfname = (U_CHAR *) 0;
9870
9871 #line 14765 "./tex4ht-c.tex"
9872
9873 for( n = 0 ; (n < cardinality) && !htfname ; n++){
9874 p = tail;
9875 while( *p != '\0' ){
9876 char * s, *nm;
9877 s = m_alloc(char, (int) strlen((char *) head ) +
9878 (int) strlen((char *) fontset[n] ) +
9879 (int) strlen((char *) p ) + 1);
9880 (IGNORED) strcpy((char *) s, (char *) head);
9881 (IGNORED) strcat((char *) s, (char *) fontset[n]);
9882 (IGNORED) strcat((char *) s, (char *) p);
9883 nm = kpse_find_file (s, kpse_program_text_format, 0);
9884 free((void *) s);
9885 if ( nm ){
9886 htfname = nm; break;
9887 }
9888 p++;
9889 while( (*p != '\\') && (*p != '/') && (*p != '\0') ){ p++; }
9890 } }
9891
9892
9893 }
9894
9895
9896 if ( htfname ){
9897 (IGNORED) printf("(%s)\n", htfname);
9898 file= fopen(htfname,READ_TEXT_FLAGS);
9899 } }
9900 }
9901 #endif
9902
9903
9904 }
9905
9906
9907 if( file ){
9908 #line 8831 "./tex4ht-c.tex"
9909
9910 if( (strlen((char *) new_font.family_name) +
9911 strlen((char *) new_font.font_size) + 4) == strlen((char *) name) ){
9912 new_font.family_name = (char *) r_alloc((void *) new_font.family_name,
9913 (size_t) (strlen((char *) name)+1));
9914 (IGNORED) strcat((char *) new_font.family_name, (char *) new_font.font_size);
9915 *(new_font.font_size)='\0';
9916 }
9917
9918 }
9919 }
9920
9921
9922 if( file != NULL){
9923 INTEGER x_char_l;
9924
9925 #line 10584 "./tex4ht-c.tex"
9926
9927 x_char_l =
9928 get_html_file_id(file, new_font.char_f, new_font.char_l, 19);
9929 if( x_char_l != HTF_ALIAS) {
9930 char_f = (int) (x_char_l / 1000.0 + 0.5) + new_font.char_f;
9931 x_char_l -= (char_f-new_font.char_f) * 1000 - new_font.char_l;
9932 char_l = (int) x_char_l;
9933 }
9934
9935
9936 if( x_char_l == HTF_ALIAS) {
9937
9938 #line 10170 "./tex4ht-c.tex"
9939
9940 { int chr;
9941 font_name_n=0;
9942 while( (chr = get_html_ch(file)) != '\n' ){
9943 if( chr != ' ' ) search_font_name[font_name_n++] = chr;
9944 }
9945 search_font_name[font_name_n] = '\0';
9946 if( eq_str( search_font_name, new_font_name) ){ err_i_str(20, new_font_name); }
9947 (IGNORED) printf("Searching `%s.htf' for `%s.htf'\n",
9948 search_font_name, new_font.name);
9949 htf_to_lg(html_font, new_font_name, fonts_n, file);
9950 new_font_name = (char *) r_alloc((void *) new_font_name,
9951 (size_t) (font_name_n+1));
9952 (IGNORED) strcpy((char *) new_font_name, (char *) search_font_name);
9953 font_name_n = strlen((char *) new_font_name);
9954 }
9955
9956
9957 (IGNORED) fclose(file); flag = FALSE; break;
9958 }
9959
9960 #line 10287 "./tex4ht-c.tex"
9961
9962 if( char_f <= new_font.char_l ){ U_CHAR del;
9963 int j, n;
9964
9965 #line 10301 "./tex4ht-c.tex"
9966
9967 while( char_f < new_font.char_f ){
9968 while( get_html_ch(file) != '\n' );
9969 char_f++; }
9970
9971
9972 n = ((char_l < new_font.char_l)? char_l : new_font.char_l)
9973 - char_f + 1;
9974 for( i = char_f - new_font.char_f; i < n; i++ ){
9975
9976 #line 10316 "./tex4ht-c.tex"
9977
9978 { int indirect_ch, base=0, value=0, digit, ch1;
9979 indirect_ch = 0;
9980 del = get_html_ch(file); j=0;
9981 while( (str[j++] = get_html_ch(file)) != del )
9982 {
9983 #line 10350 "./tex4ht-c.tex"
9984
9985 if( (digit=str[j-1]) == '\\' )
9986 if( (indirect_ch = !indirect_ch) != 0) {
9987 switch( value=get_html_ch(file) ){
9988 case 'x': { base = 16; value = 0; j--; break; }
9989 case 'o': { base = 8; value = 0; j--; break; }
9990 default: {
9991 if( (value < '0') || (value > '9') ) {
9992 indirect_ch = !indirect_ch; str[j-1] = value;
9993 } else { value -= '0'; base = 10; j--; }
9994 } } }
9995 else{ if( value>255 ){
9996 warn_i_int(28,value);
9997 value = 32; dump_htf( file );
9998 }
9999 str[j-1] = value;
10000 }
10001 else if ( indirect_ch ){
10002 j--; digit -= (digit>'9')? 'A'-10 : '0';
10003 if( (digit<0) || (digit>=base) ){
10004 warn_i_int(29, str[j]);
10005 digit = 0; dump_htf( file );
10006 }
10007 value = value*base + digit;
10008 } else if ( str[j-1]==10 ){
10009 dump_htf( file );
10010 err_i_int(48, i+1);
10011 }
10012
10013 };
10014 str[j-1] = '\0';
10015 while( get_html_ch(file) != del );
10016 ch1 = 0;
10017 while( ((ch = (int) get_html_ch(file)) != del) ){
10018 if( (ch < '0') || (ch > '9') ) break;
10019 ch1 = ch1 * 10 + ch - '0'; }
10020
10021 #line 16489 "./tex4ht-c.tex"
10022
10023 if(
10024 (*str == '&')
10025 && (*(str+1) == '#')
10026 && ( (*(str+2) == 'x') || (*(str+2) == 'X'))
10027 && (*(str + strlen((char *) str) - 1) == ';')
10028 ) {
10029 char* p;
10030 int value = 0;
10031 BOOL err = FALSE;
10032 for( p=str+3; *p!=';'; p++){
10033 int digit = (int) *p;
10034 if( (digit>='0') && (digit<='9') ){ digit -= '0'; }
10035 else if( (digit>='A') && (digit<='F') ){ digit -= BASE_A; }
10036 else if( (digit>='a') && (digit<='f') ){ digit -= BASE_a; }
10037 else { digit=0; err = TRUE; }
10038 value = 16*value + digit;
10039 }
10040 if( !err ){
10041
10042 #line 16527 "./tex4ht-c.tex"
10043
10044 int bottom, mid, top;
10045 BOOL found=FALSE;
10046 bottom = 0; top = htf_4hf_n;
10047 while( !found ){
10048 mid = (bottom + top) / 2;
10049 if( value == htf_4hf[mid].ch ){
10050
10051 #line 16513 "./tex4ht-c.tex"
10052
10053 if( htf_4hf[mid].type1 == ch1 ){
10054 ch1 = htf_4hf[mid].type2;
10055 (IGNORED) strcpy((char *) str, (char *) htf_4hf[mid].str );
10056 }
10057
10058
10059 found = TRUE;
10060 } else if( value < htf_4hf[mid].ch ){
10061 if( bottom == top ){ break; }
10062 top = mid;
10063 }
10064 else {
10065 if ( bottom < mid ){ bottom = mid; }
10066 else if ( bottom<top ){ bottom++; }
10067 else{ break; }
10068 }
10069 }
10070
10071
10072
10073 } }
10074
10075
10076 new_font.gif1[i] = ch1 % 256;
10077 do{
10078 if( (ch = get_html_ch(file)) == del ){
10079
10080 #line 12094 "./tex4ht-c.tex"
10081
10082 ch1 = 0;
10083 while( ((ch = (int) get_html_ch(file)) != del) ){
10084 if( (ch < '0') || (ch > '9') ){ warn_i_int(48,i); break; }
10085 ch1 = ch1 * 10 + ch - '0'; }
10086 new_font.accent_array = new_font.accent_N++?
10087 (unsigned int *) r_alloc((void *) new_font.accent_array,
10088 (size_t) (new_font.accent_N * sizeof(unsigned int)))
10089 : m_alloc(unsigned int, 1);
10090 new_font.accent_array[new_font.accent_N - 1] = ch1;
10091 new_font.accent[i] = new_font.accent_N;
10092
10093 break;
10094 }
10095 } while( ch != '\n' );
10096 if( ch != '\n' ){
10097 do{
10098 if( (ch = get_html_ch(file)) == del ){
10099
10100 #line 12108 "./tex4ht-c.tex"
10101
10102 ch1 = 0;
10103 while( ((ch = (int) get_html_ch(file)) != del) ){
10104 if( (ch < '0') || (ch > '9') ){ warn_i_int(48,i); break; }
10105 ch1 = ch1 * 10 + ch - '0'; }
10106 new_font.accented_array = new_font.accented_N++?
10107 (unsigned int *) r_alloc((void *) new_font.accented_array,
10108 (size_t) (new_font.accented_N * sizeof(unsigned int)))
10109 : m_alloc(unsigned int, 1);
10110 new_font.accented_array[new_font.accented_N - 1] = ch1;
10111 new_font.accented[i] = new_font.accented_N;
10112
10113 break;
10114 }
10115 } while( ch != '\n' );
10116 }
10117 if( ch != '\n' )
10118 { while( get_html_ch(file) != '\n' ); }
10119 }
10120
10121
10122
10123 #line 10393 "./tex4ht-c.tex"
10124
10125 add_bit( new_font.ch_str, i, j!=2 );
10126 switch( j ){
10127 case 1: { new_font.ch[i] = 0; break; }
10128 case 2: { new_font.ch[i] = *str; break; }
10129 default: { unsigned U_CHAR *p;
10130 new_font.str[design_n] = p = m_alloc(unsigned char, j);
10131 if( design_n>255 ){ design_n--; warn_i(35);}
10132 if( i==255 ){
10133 if( design_n == 255 ){
10134 new_font.ch[i] = 0; new_font.ch255 = 1;
10135 } else { new_font.ch[i] = ++design_n; }
10136 } else { new_font.ch[i] = ++design_n; }
10137 while( j-- ) p[j] = str[j];
10138 } }
10139
10140 }
10141
10142 #line 10307 "./tex4ht-c.tex"
10143
10144 while( char_l > new_font.char_l ){
10145 while( get_html_ch(file) != '\n' );
10146 char_l--; }
10147
10148
10149 }
10150
10151
10152
10153 #line 10595 "./tex4ht-c.tex"
10154
10155 (void) get_html_file_id(file, new_font.char_f, new_font.char_l, 18);
10156
10157
10158 htf_to_lg(html_font, new_font_name, fonts_n, file);
10159
10160 #line 10503 "./tex4ht-c.tex"
10161
10162 if( dump_htf_files ){
10163 dump_htf_files++; dump_htf( file ); dump_htf_files--;
10164 }
10165
10166
10167 (IGNORED) fclose(file); break;
10168 } }
10169 if( flag ){ break; }
10170 }
10171 if( font_name_n == 0 ){
10172 if( errCode == 0 ){ errCode= 21; }
10173 warn_i_str(21,search_font_name);
10174 (IGNORED) fprintf(stderr,
10175 "%d--%d)\n", new_font.char_f, new_font.char_l);
10176 dump_env();
10177 } else {
10178 #line 10509 "./tex4ht-c.tex"
10179
10180 if( dump_env_files ){ dump_env(); }
10181
10182 }
10183 }
10184
10185
10186 new_font.str = (unsigned U_CHAR **) r_alloc((void *) new_font.str,
10187 (size_t) ( (design_n?design_n:1) * sizeof(char *)) );
10188
10189 #line 10235 "./tex4ht-c.tex"
10190
10191 for( i = fonts_n; i--; )
10192 if( eq_str(html_font[i].name, new_font_name) ){ int k;
10193 k = html_font[i].i;
10194 free((void *) new_font.gif1 ); new_font.gif1= font_tbl[ k ].gif1;
10195 free((void *) new_font.ch ); new_font.ch = font_tbl[ k ].ch;
10196 free((void *) new_font.str ); new_font.str = font_tbl[ k ].str;
10197 free((void *) new_font.ch_str );
10198 new_font.ch_str = font_tbl[ k ].ch_str;
10199
10200 #line 12786 "./tex4ht-c.tex"
10201
10202 free((void *) new_font.math_closing );
10203 new_font.math_closing = font_tbl[ k ].math_closing;
10204 free((void *) new_font.math );
10205 new_font.math = font_tbl[ k ].math;
10206
10207
10208 break; }
10209 if( i < 0 ){
10210 #line 10250 "./tex4ht-c.tex"
10211
10212 html_font = fonts_n? (struct html_font_rec *) r_alloc((void *) html_font,
10213 (size_t) ((fonts_n+1) * sizeof(struct html_font_rec) ))
10214 : m_alloc(struct html_font_rec, 1);
10215 html_font[fonts_n].name = m_alloc(char, font_name_n + 1);
10216 (IGNORED) strcpy((char *) html_font[fonts_n].name, (char *) new_font_name);
10217 html_font[fonts_n].i = font_tbl_size;
10218 fonts_n++;
10219
10220 }
10221
10222
10223 }
10224
10225
10226
10227 #line 11879 "./tex4ht-c.tex"
10228
10229 { static struct css_ext_rec * search_css_ext;
10230 for( search_css_ext = css_ext;
10231 search_css_ext != (struct css_ext_rec *) 0;
10232 search_css_ext = search_css_ext->next ){
10233 int css_name_n = (int) strlen((char *) new_font.name );
10234 char * css_file_name = m_alloc(char, css_name_n + 1);
10235 (IGNORED) strcpy((char *) css_file_name, (char *) new_font.name);
10236 for( ; css_name_n; css_name_n-- ){
10237 FILE* file;
10238 css_file_name[css_name_n] = '\0';
10239
10240 #line 11896 "./tex4ht-c.tex"
10241
10242 { U_CHAR name[256];
10243 (IGNORED) sprintf(name, "%s.%s", css_file_name,
10244 search_css_ext->name);
10245
10246 #line 13841 "./tex4ht-c.tex"
10247
10248 file = NULL;
10249
10250 #line 13909 "./tex4ht-c.tex"
10251
10252 {
10253 struct htf_com_rec *p;
10254 p = htf_font_dir;
10255 while( p ){
10256 file = search_file_base(name, p->name, READ_TEXT_FLAGS, htf_dirs);
10257 if( file ){
10258 #ifndef KPATHSEA
10259 tex4ht_fls = TRUE;
10260 #endif
10261 break;
10262 }
10263 p = p->next;
10264 }
10265 }
10266
10267
10268 if( !file ){
10269 if( ((file = f_open(name, READ_TEXT_FLAGS)) == NULL) && dot_file )
10270 file = search_in_dot_file( 'i', name, READ_TEXT_FLAGS, htf_dirs);
10271 #ifdef HTFDIR
10272 if( !file ) file = search_file_base(name, HTFDIR,
10273 READ_TEXT_FLAGS, htf_dirs);
10274 #endif
10275
10276 #line 15077 "./tex4ht-c.tex"
10277
10278
10279 #ifdef KPATHSEA
10280 if( !file ){ U_CHAR * htfname;
10281 htfname= kpse_find_file (name, kpse_program_text_format, 0);
10282 if ( htfname ){
10283
10284 #line 14733 "./tex4ht-c.tex"
10285
10286 { U_CHAR * head, * tail, *p;
10287 int n;
10288
10289 #line 14743 "./tex4ht-c.tex"
10290
10291 n = (int) strlen((char *) htfname);
10292 tail = head = m_alloc(char, n+1);
10293 (IGNORED) strcpy((char *) head, (char *) htfname);
10294 while( n>11 ){
10295 if( (*tail=='\\') || (*tail=='/') ){
10296 if( (*tail == *(tail+9)) && (*(tail+1) == 'h')
10297 && (*(tail+2) == 't') && (*(tail+3) == '-')
10298 && (*(tail+4) == 'f') && (*(tail+5) == 'o')
10299 && (*(tail+6) == 'n') && (*(tail+7) == 't')
10300 && (*(tail+8) == 's') ){
10301 p = tail + 9; *(tail + 10) = '\0'; tail += 11;
10302 while( (*tail != *p) && (*tail != '\0') ){ tail++; }
10303 break;
10304 } }
10305 tail++; n--;
10306 }
10307
10308
10309 htfname = (U_CHAR *) 0;
10310
10311 #line 14765 "./tex4ht-c.tex"
10312
10313 for( n = 0 ; (n < cardinality) && !htfname ; n++){
10314 p = tail;
10315 while( *p != '\0' ){
10316 char * s, *nm;
10317 s = m_alloc(char, (int) strlen((char *) head ) +
10318 (int) strlen((char *) fontset[n] ) +
10319 (int) strlen((char *) p ) + 1);
10320 (IGNORED) strcpy((char *) s, (char *) head);
10321 (IGNORED) strcat((char *) s, (char *) fontset[n]);
10322 (IGNORED) strcat((char *) s, (char *) p);
10323 nm = kpse_find_file (s, kpse_program_text_format, 0);
10324 free((void *) s);
10325 if ( nm ){
10326 htfname = nm; break;
10327 }
10328 p++;
10329 while( (*p != '\\') && (*p != '/') && (*p != '\0') ){ p++; }
10330 } }
10331
10332
10333 }
10334
10335
10336 if ( htfname ){
10337 (IGNORED) printf("(%s)\n", htfname);
10338 file= fopen(htfname,READ_TEXT_FLAGS);
10339 } }
10340 }
10341 #endif
10342
10343
10344 }
10345
10346
10347 if( file != NULL ){
10348
10349 #line 11917 "./tex4ht-c.tex"
10350
10351
10352 #line 11965 "./tex4ht-c.tex"
10353
10354 BOOL is_visited = FALSE;
10355 struct visited_file_rec * v = visited_file;
10356 while( v != (struct visited_file_rec *) 0 ){
10357 if( eq_str(v->name, name) ){
10358 is_visited = TRUE; break;
10359 }
10360 v = v->next;
10361 }
10362
10363
10364 if( !is_visited ){
10365
10366 #line 11957 "./tex4ht-c.tex"
10367
10368 struct visited_file_rec * v = m_alloc(struct visited_file_rec, 1);
10369 v->name = m_alloc(char, (int) strlen((char *) name ) + 1 );
10370 (IGNORED) strcpy((char *) v->name, (char *) name);
10371 v->next = visited_file;
10372 visited_file = v;
10373
10374
10375 while( 1 ){
10376 int ch;
10377 do{
10378 ch = (int) getc(file);
10379 } while ( (ch == ' ') || (ch == '\n') || (ch == '\t') );
10380 if( ch == EOF ){ break; }
10381 do{
10382 (void) putc( ch, log_file );
10383 ch = (int) getc(file);
10384 } while ( (ch != '\n') && (ch != EOF) );
10385 (void) putc( '\n', log_file );
10386 if( ch == EOF ){ break; }
10387 } }
10388
10389
10390 (IGNORED) fclose(file); break;
10391 }
10392 }
10393
10394
10395 }
10396 free((void *) css_file_name);
10397 } }
10398
10399
10400 free((void *) new_font_name); font_tbl_size++;
10401 }
10402 #ifdef MAXFONTS
10403 else err_i_int(17, MAXFONTS);
10404 #endif
10405
10406
10407 }
10408
10409 #line 11947 "./tex4ht-c.tex"
10410
10411 while( visited_file != (struct visited_file_rec *) 0 ){
10412 struct visited_file_rec * v = visited_file;
10413 visited_file = visited_file->next;
10414 free((void *) v->name);
10415 free((void *) v);
10416 }
10417
10418
10419 #line 14702 "./tex4ht-c.tex"
10420
10421
10422 #ifdef KPATHSEA
10423 if( export_str_chars ){
10424 free((void *) export_str_chars);
10425 free((void *) fontset);
10426 }
10427 #endif
10428
10429
10430 #line 16415 "./tex4ht-c.tex"
10431
10432 for( i = 0; i<htf_4hf_n; i++){
10433 free((void *) htf_4hf[i].str);
10434 }
10435 free((void *) htf_4hf);
10436
10437
10438 if( missing_fonts ) err_i(14);
10439 #ifndef KPATHSEA
10440
10441 #line 14346 "./tex4ht-c.tex"
10442
10443 if( cache_files != (FILE *) 0 ){ (IGNORED) fclose(cache_files); }
10444
10445
10446
10447 #line 14109 "./tex4ht-c.tex"
10448
10449 if( tex4ht_fls ){
10450 FILE *in_file, *out_file;
10451 U_CHAR temp_file[256];
10452
10453 #line 14130 "./tex4ht-c.tex"
10454
10455 (IGNORED) strcpy((char *) temp_file, (char *) job_name);
10456 temp_file[job_name_n] = '\0';
10457 temp_file[job_name_n-1] = 'p';
10458 temp_file[job_name_n-2] = 'm';
10459 temp_file[job_name_n-3] = 't';
10460
10461
10462
10463 #line 14226 "./tex4ht-c.tex"
10464
10465 if( (out_file = fopen(temp_file, WRITE_TEXT_FLAGS)) == NULL )
10466 { bad_in_file(temp_file);
10467 } else {
10468 if( (in_file = fopen(tex4ht_fls_name, READ_TEXT_FLAGS)) != NULL ){
10469 int ch;
10470 while( (ch = getc(in_file)) != EOF ) {
10471 (IGNORED) putc( ch, out_file );
10472 }
10473 (IGNORED) fclose(in_file);
10474 }
10475 (IGNORED) fclose(out_file);
10476 }
10477
10478
10479 if( (out_file = fopen(tex4ht_fls_name, WRITE_TEXT_FLAGS)) == NULL )
10480 { bad_in_file(tex4ht_fls_name);
10481 } else {
10482 if( (in_file = fopen(temp_file, READ_TEXT_FLAGS)) != NULL ){
10483
10484 #line 14242 "./tex4ht-c.tex"
10485
10486 U_CHAR dir[255], prev_dir[255], file[255], *p;
10487 int ch;
10488 BOOL is_dir;
10489 struct cache_file_rec *file_rec, *prev_file_rec;
10490 cur_cache_font = cache_font;
10491 ch = 'n'; prev_dir[0] = '\0';
10492 while( ch != EOF ){
10493 ch = getc(in_file);
10494 is_dir = (ch == ' ');
10495 p = is_dir? dir : file;
10496 while( ch != '\n' ) {
10497 if( ch == EOF ) break;
10498 if( ch != ' ' ) { *p++ = ch; }
10499 ch = getc(in_file);
10500 }
10501 *p = '\0';
10502 if( is_dir && (dir[0] != '\0') ){
10503
10504 #line 14272 "./tex4ht-c.tex"
10505
10506 while( cur_cache_font != (struct cache_font_rec *)0 ){
10507 if( gt_str(dir,cur_cache_font->dir) ){
10508
10509 #line 14282 "./tex4ht-c.tex"
10510
10511 file_rec = cur_cache_font->cache_file;
10512 if( file_rec ){
10513 if( !eq_str( prev_dir, cur_cache_font->dir) ){
10514 (IGNORED) fprintf(out_file, " %s\n", cur_cache_font->dir);
10515 (IGNORED) strcpy((char *) prev_dir, (char *) dir);
10516 }
10517 cur_cache_font->cache_file = (struct cache_file_rec *) 0;
10518 while( file_rec ) {
10519 prev_file_rec = file_rec;
10520 file_rec = file_rec->next;
10521 (IGNORED) fprintf(out_file, "%s\n", prev_file_rec->file);
10522 free((void *) prev_file_rec );
10523 }
10524 }
10525
10526
10527 } else break;
10528 cur_cache_font = cur_cache_font->next;
10529 }
10530
10531
10532 (IGNORED) fprintf(out_file," %s\n", dir);
10533 (IGNORED) strcpy((char *) prev_dir, (char *) dir);
10534 } else if( !is_dir && (file[0] != '\0') ){
10535
10536 #line 14302 "./tex4ht-c.tex"
10537
10538 if( cur_cache_font != (struct cache_font_rec *)0 ){
10539 if( eq_str(dir,cur_cache_font->dir) ){
10540 file_rec = cur_cache_font->cache_file;
10541 while( file_rec ) {
10542 if( gt_str(file_rec->file,file) ){ break; }
10543 else if( gt_str(file,file_rec->file) ){
10544 (IGNORED) fprintf(out_file, "%s\n", file_rec->file);
10545 }
10546 prev_file_rec = file_rec;
10547 file_rec = file_rec->next;
10548 free((void *) prev_file_rec );
10549 }
10550 cur_cache_font->cache_file = file_rec;
10551 }
10552 }
10553
10554
10555 (IGNORED) fprintf(out_file,"%s\n", file);
10556 }
10557 }
10558
10559 #line 14322 "./tex4ht-c.tex"
10560
10561 while( cur_cache_font != (struct cache_font_rec *)0 ){
10562
10563 #line 14282 "./tex4ht-c.tex"
10564
10565 file_rec = cur_cache_font->cache_file;
10566 if( file_rec ){
10567 if( !eq_str( prev_dir, cur_cache_font->dir) ){
10568 (IGNORED) fprintf(out_file, " %s\n", cur_cache_font->dir);
10569 (IGNORED) strcpy((char *) prev_dir, (char *) dir);
10570 }
10571 cur_cache_font->cache_file = (struct cache_file_rec *) 0;
10572 while( file_rec ) {
10573 prev_file_rec = file_rec;
10574 file_rec = file_rec->next;
10575 (IGNORED) fprintf(out_file, "%s\n", prev_file_rec->file);
10576 free((void *) prev_file_rec );
10577 }
10578 }
10579
10580
10581 cur_cache_font = cur_cache_font->next;
10582 }
10583
10584
10585
10586
10587 (IGNORED) fclose(in_file);
10588 }
10589 (IGNORED) fclose(out_file);
10590 } }
10591
10592
10593 #endif
10594
10595 #line 10269 "./tex4ht-c.tex"
10596
10597 if( html_font ){
10598 while( fonts_n-- ) free((void *) html_font[fonts_n].name);
10599 free((void *) html_font );
10600 }
10601
10602
10603 #line 13720 "./tex4ht-c.tex"
10604
10605 while( (cur_cache_font = cache_font) != (struct cache_font_rec *)0 ){
10606 cache_font = cache_font->next;
10607 free((void *) cur_cache_font->dir );
10608 free((void *) cur_cache_font ); }
10609
10610
10611 }
10612
10613
10614 (IGNORED) fclose(dot_file);
10615 }
10616
10617 #line 2268 "./tex4ht-c.tex"
10618
10619 (IGNORED) fseek(dvi_file, 0L,
10620 #line 2174 "./tex4ht-c.tex"
10621
10622 0
10623 );
10624 ch = get_noop();
10625 if( ch !=
10626 #line 17484 "./tex4ht-c.tex"
10627
10628 247
10629 ) bad_dvi;
10630 if( ((int) get_char()) != version_id ) bad_dvi;
10631 (void) get_unt(4);
10632 (void) get_unt(4);
10633 (void) get_unt(4);
10634 for( i= get_char(); i>0; i-- ) ch = get_char();
10635
10636
10637
10638 #line 2318 "./tex4ht-c.tex"
10639
10640 {
10641 dis_pages = unread_pages;
10642 while( unread_pages-- ){
10643 (IGNORED) printf("[%d", dis_pages - unread_pages);
10644
10645 #line 2343 "./tex4ht-c.tex"
10646
10647 x_val = dx_1 = dx_2 = 0; max_x_val = -10000;
10648 y_val = max_y_val = prev_y_val = dy_1 = dy_2 = 0;
10649
10650
10651 if( get_noop() !=
10652 #line 17329 "./tex4ht-c.tex"
10653
10654 139
10655 ) bad_dvi;
10656 for( i = 1; i<45; i++ )
10657 if( get_char() == EOF ) bad_dvi;
10658 while( (ch = get_char()) !=
10659 #line 17332 "./tex4ht-c.tex"
10660
10661 140
10662 ){
10663
10664 #line 2934 "./tex4ht-c.tex"
10665
10666 { register int ch_1;
10667 ch_1 = ch;
10668
10669 #line 6466 "./tex4ht-c.tex"
10670
10671 if( stack[stack_n].halign_on )
10672 {
10673 switch( ch ){
10674 case
10675 #line 17383 "./tex4ht-c.tex"
10676
10677 157
10678 : { ; }
10679 case
10680 #line 17386 "./tex4ht-c.tex"
10681
10682 158
10683 : { ; }
10684 case
10685 #line 17389 "./tex4ht-c.tex"
10686
10687 159
10688 : { ; }
10689 case
10690 #line 17392 "./tex4ht-c.tex"
10691
10692 160
10693 : { ; }
10694 case
10695 #line 17395 "./tex4ht-c.tex"
10696
10697 161
10698 : { ; }
10699 case
10700 #line 17398 "./tex4ht-c.tex"
10701
10702 162
10703 : { ; }
10704 case
10705 #line 17401 "./tex4ht-c.tex"
10706
10707 163
10708 : { ; }
10709 case
10710 #line 17404 "./tex4ht-c.tex"
10711
10712 164
10713 : { ; }
10714 case
10715 #line 17407 "./tex4ht-c.tex"
10716
10717 165
10718 : { ; }
10719 case
10720 #line 17410 "./tex4ht-c.tex"
10721
10722 166
10723 : { ; }
10724 case
10725 #line 17413 "./tex4ht-c.tex"
10726
10727 167
10728 : { ; }
10729 case
10730 #line 17416 "./tex4ht-c.tex"
10731
10732 168
10733 : { ; }
10734 case
10735 #line 17419 "./tex4ht-c.tex"
10736
10737 169
10738 : { ; }
10739 case
10740 #line 17422 "./tex4ht-c.tex"
10741
10742 170
10743 : { ; }
10744 case
10745 #line 17318 "./tex4ht-c.tex"
10746
10747 132
10748 : { ; }
10749 case
10750 #line 17323 "./tex4ht-c.tex"
10751
10752 137
10753 : { ; }
10754 case
10755 #line 17438 "./tex4ht-c.tex"
10756
10757 235
10758 : { ; }
10759 case
10760 #line 17441 "./tex4ht-c.tex"
10761
10762 236
10763 : { ; }
10764 case
10765 #line 17444 "./tex4ht-c.tex"
10766
10767 237
10768 : { ; }
10769 case
10770 #line 17447 "./tex4ht-c.tex"
10771
10772 238
10773 : { ; }
10774 case
10775 #line 17335 "./tex4ht-c.tex"
10776
10777 141
10778 :
10779 { break; }
10780 default: {
10781 #line 6502 "./tex4ht-c.tex"
10782
10783 print_f( stack[stack_n].halign[1]->str );
10784 stack[stack_n].halign_on = FALSE;
10785
10786 }
10787 } }
10788
10789
10790
10791 #line 3201 "./tex4ht-c.tex"
10792
10793 if( (ch > 127) && (ch < 137) && (ch !=
10794 #line 17318 "./tex4ht-c.tex"
10795
10796 132
10797 ) ){
10798 ch_1 = (int) get_unt( (ch - (ch>132)) % 4 +1);
10799 }
10800
10801
10802
10803 #line 7659 "./tex4ht-c.tex"
10804
10805 if( group_dvi ){
10806 if( ( ch < 132 ) ||
10807 ( (ch > 127) && (ch < 137) && (ch !=
10808 #line 17318 "./tex4ht-c.tex"
10809
10810 132
10811 ) )
10812 ){
10813 ch_id++;
10814 back_token = back_insert ( back_token, ch_id);
10815 } }
10816
10817
10818
10819 #line 2630 "./tex4ht-c.tex"
10820
10821 if( trace_dvi_C && !in_trace_char ){
10822 if( (ch < 137) && (ch !=
10823 #line 17318 "./tex4ht-c.tex"
10824
10825 132
10826 ) ){
10827 in_trace_char = TRUE; block_start = TRUE;
10828 } }
10829 else if ( in_trace_char ){
10830 if( !trace_dvi_C || (ch > 136) || (ch ==
10831 #line 17318 "./tex4ht-c.tex"
10832
10833 132
10834 ) ){
10835 in_trace_char = FALSE;
10836 } }
10837
10838
10839
10840 #line 2591 "./tex4ht-c.tex"
10841
10842 if( span_on && !in_span_ch && !ignore_chs && !in_accenting
10843 && cur_fnt >= 0 && (default_font != font_tbl[cur_fnt].num) ){
10844 if( (ch < 137) && (ch !=
10845 #line 17318 "./tex4ht-c.tex"
10846
10847 132
10848 ) ){
10849 in_span_ch = TRUE; start_span = TRUE;
10850 } }
10851 else if ( in_span_ch ){
10852 if( !span_on ||
10853 (ch ==
10854 #line 17318 "./tex4ht-c.tex"
10855
10856 132
10857 ) ||
10858 ((136 < ch) && (ch <
10859 #line 17341 "./tex4ht-c.tex"
10860
10861 143
10862 )) ||
10863 (ch >
10864 #line 17380 "./tex4ht-c.tex"
10865
10866 156
10867 )
10868 ){
10869 in_span_ch = FALSE;
10870 if( *end_span[0] ){
10871
10872 #line 1715 "./tex4ht-c.tex"
10873
10874 if( no_root_file ){ open_o_file(); }
10875
10876
10877 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
10878 }
10879 } }
10880
10881
10882
10883 #line 12216 "./tex4ht-c.tex"
10884
10885 if( in_accenting ){
10886
10887 #line 12248 "./tex4ht-c.tex"
10888
10889 long int width;
10890 if( i_accent_template ){
10891 (IGNORED) fprintf(cur_o_file, "%s", i_accent_second); }
10892 needs_end_accent = (needs_accent_sym == 2 * TRUE);
10893 if( needs_end_accent && t_accent_template )
10894 {
10895 #line 12205 "./tex4ht-c.tex"
10896
10897 needs_accented_sym++;
10898
10899 }
10900 else if( m_accent_template )
10901 {
10902 #line 12205 "./tex4ht-c.tex"
10903
10904 needs_accented_sym++;
10905
10906 stack[stack_n-1].accented = TRUE; }
10907 needs_accent_sym = FALSE;
10908 width = (INTEGER)(
10909 #line 9841 "./tex4ht-c.tex"
10910
10911 design_size_to_pt( *(font_tbl[cur_fnt].wtbl
10912 + (int) (
10913 #line 9849 "./tex4ht-c.tex"
10914
10915 *(font_tbl[cur_fnt].char_wi + (int)
10916 ( ch - font_tbl[cur_fnt].char_f)% 256)
10917
10918 ) )
10919 )
10920 * (double) font_tbl[cur_fnt].scale
10921
10922 );
10923 if( needs_end_accent ){ needs_end_accent = x_val + 9 * width / 10; }
10924 in_accenting = FALSE;
10925
10926
10927 } else if(
10928 #line 12273 "./tex4ht-c.tex"
10929
10930 needs_accent_sym && (ch < 128)
10931
10932 ){
10933 if( needs_accent_sym ){
10934 BOOL needs_end_accent;
10935 needs_end_accent = (needs_accent_sym == 2 * TRUE);
10936 if( needs_end_accent && t_accent_template ){
10937 (IGNORED) fprintf(cur_o_file, "%s%s%s%d%s%d%s",
10938 t_accent_first, font_tbl[cur_fnt].family_name,
10939 t_accent_second, ch, t_accent_third,
10940 font_tbl[cur_fnt].accent[ch]?
10941 font_tbl[cur_fnt].accent_array[font_tbl[cur_fnt].accent[ch]-1]
10942 : 0,
10943 t_accent_fourth);
10944 } else if( m_accent_template ){
10945 (IGNORED) fprintf(cur_o_file, "%s%s%s%d%s%d%s",
10946 m_accent_first, font_tbl[cur_fnt].family_name,
10947 m_accent_second, ch, m_accent_third,
10948 font_tbl[cur_fnt].accent[ch]?
10949 font_tbl[cur_fnt].accent_array[font_tbl[cur_fnt].accent[ch]-1]
10950 : 0,
10951 m_accent_fourth);
10952 }
10953 if( i_accent_template ){
10954 (IGNORED) fprintf(cur_o_file, "%s", i_accent_first); }
10955 in_accenting = TRUE;
10956 }
10957 }
10958
10959
10960 if( ch < 132 ) {
10961 x_val += math_class_on?
10962 #line 12655 "./tex4ht-c.tex"
10963
10964 set_ch_class(ch_1)
10965
10966
10967 : insert_ch(ch_1);
10968 if( max_x_val < x_val ) max_x_val = x_val;
10969 } else switch( ch ) {
10970 case 133: case 134: case 135: case 136: {
10971 INTEGER w;
10972 w = math_class_on?
10973 #line 12655 "./tex4ht-c.tex"
10974
10975 set_ch_class(ch_1)
10976
10977 : insert_ch(ch_1);
10978 max_x_val = ( x_val + w > max_x_val )? x_val + w : max_x_val;
10979 break;
10980 }
10981
10982 #line 3040 "./tex4ht-c.tex"
10983
10984 case
10985 #line 17341 "./tex4ht-c.tex"
10986
10987 143
10988 : {;}
10989 case
10990 #line 17344 "./tex4ht-c.tex"
10991
10992 144
10993 : {;}
10994 case
10995 #line 17347 "./tex4ht-c.tex"
10996
10997 145
10998 : {;}
10999 case
11000 #line 17350 "./tex4ht-c.tex"
11001
11002 146
11003 : {
11004 try_new_line();
11005 (void) move_x((INTEGER) get_int(ch -
11006 #line 17341 "./tex4ht-c.tex"
11007
11008 143
11009 + 1 ));
11010 break; }
11011
11012
11013 #line 3050 "./tex4ht-c.tex"
11014
11015 case
11016 #line 17353 "./tex4ht-c.tex"
11017
11018 147
11019 : {
11020 (void) move_x( dx_1 ); break; }
11021 case
11022 #line 17356 "./tex4ht-c.tex"
11023
11024 148
11025 : {;}
11026 case
11027 #line 17359 "./tex4ht-c.tex"
11028
11029 149
11030 : {;}
11031 case
11032 #line 17362 "./tex4ht-c.tex"
11033
11034 150
11035 : {;}
11036 case
11037 #line 17365 "./tex4ht-c.tex"
11038
11039 151
11040 : {
11041 try_new_line();
11042 dx_1 = move_x((INTEGER) get_int(ch -
11043 #line 17353 "./tex4ht-c.tex"
11044
11045 147
11046 ));
11047 break; }
11048
11049
11050 #line 3062 "./tex4ht-c.tex"
11051
11052 case
11053 #line 17368 "./tex4ht-c.tex"
11054
11055 152
11056 : {
11057 (void) move_x( dx_2 ); break; }
11058 case
11059 #line 17371 "./tex4ht-c.tex"
11060
11061 153
11062 : {;}
11063 case
11064 #line 17374 "./tex4ht-c.tex"
11065
11066 154
11067 : {;}
11068 case
11069 #line 17377 "./tex4ht-c.tex"
11070
11071 155
11072 : {;}
11073 case
11074 #line 17380 "./tex4ht-c.tex"
11075
11076 156
11077 : {
11078 try_new_line();
11079 dx_2 = move_x((INTEGER) get_int(ch -
11080 #line 17368 "./tex4ht-c.tex"
11081
11082 152
11083 ));
11084 break; }
11085
11086
11087 #line 3147 "./tex4ht-c.tex"
11088
11089 case
11090 #line 17383 "./tex4ht-c.tex"
11091
11092 157
11093 : {;}
11094 case
11095 #line 17386 "./tex4ht-c.tex"
11096
11097 158
11098 : {;}
11099 case
11100 #line 17389 "./tex4ht-c.tex"
11101
11102 159
11103 : {;}
11104 case
11105 #line 17392 "./tex4ht-c.tex"
11106
11107 160
11108 : {
11109 (void) move_y( (INTEGER) get_int(ch -
11110 #line 17383 "./tex4ht-c.tex"
11111
11112 157
11113 + 1 ));
11114 break; }
11115
11116
11117 #line 3156 "./tex4ht-c.tex"
11118
11119 case
11120 #line 17395 "./tex4ht-c.tex"
11121
11122 161
11123 : { (void) move_y( dy_1 ); break; }
11124 case
11125 #line 17398 "./tex4ht-c.tex"
11126
11127 162
11128 : {;}
11129 case
11130 #line 17401 "./tex4ht-c.tex"
11131
11132 163
11133 : {;}
11134 case
11135 #line 17404 "./tex4ht-c.tex"
11136
11137 164
11138 : {;}
11139 case
11140 #line 17407 "./tex4ht-c.tex"
11141
11142 165
11143 : {
11144 dy_1 = move_y( (INTEGER) get_int(ch -
11145 #line 17395 "./tex4ht-c.tex"
11146
11147 161
11148 ));
11149 break; }
11150
11151
11152 #line 3166 "./tex4ht-c.tex"
11153
11154 case
11155 #line 17410 "./tex4ht-c.tex"
11156
11157 166
11158 : { (void) move_y( dy_2 ); break; }
11159 case
11160 #line 17413 "./tex4ht-c.tex"
11161
11162 167
11163 : {;}
11164 case
11165 #line 17416 "./tex4ht-c.tex"
11166
11167 168
11168 : {;}
11169 case
11170 #line 17419 "./tex4ht-c.tex"
11171
11172 169
11173 : {;}
11174 case
11175 #line 17422 "./tex4ht-c.tex"
11176
11177 170
11178 : {
11179 dy_2 = move_y( (INTEGER) get_int(ch -
11180 #line 17410 "./tex4ht-c.tex"
11181
11182 166
11183 ));
11184 break; }
11185
11186
11187 #line 3590 "./tex4ht-c.tex"
11188
11189 case
11190 #line 17318 "./tex4ht-c.tex"
11191
11192 132
11193 : {
11194 (void) rule_x( TRUE ); break;
11195 }
11196 case
11197 #line 17323 "./tex4ht-c.tex"
11198
11199 137
11200 : {
11201 (void) rule_x( FALSE ); break;
11202 }
11203
11204
11205 #line 3763 "./tex4ht-c.tex"
11206
11207
11208 #line 3768 "./tex4ht-c.tex"
11209
11210 case
11211 #line 17469 "./tex4ht-c.tex"
11212
11213 246
11214 : (void) get_char();
11215 case
11216 #line 17466 "./tex4ht-c.tex"
11217
11218 245
11219 : (void) get_char();
11220 case
11221 #line 17463 "./tex4ht-c.tex"
11222
11223 244
11224 : (void) get_char();
11225 case
11226 #line 17460 "./tex4ht-c.tex"
11227
11228 243
11229 : {
11230 for( i=0; i<14; i++ ){ ch = get_char(); }
11231 for( i=ch + get_char(); i>0; i--) (void) get_char();
11232 break;
11233 }
11234
11235
11236
11237
11238 #line 3780 "./tex4ht-c.tex"
11239
11240 case
11241 #line 17499 "./tex4ht-c.tex"
11242
11243 252
11244
11245 :
11246 if( version_id ==
11247 #line 2292 "./tex4ht-c.tex"
11248
11249 10
11250
11251 ){
11252
11253 #line 9234 "./tex4ht-c.tex"
11254
11255 unsigned short flags;
11256 for( i=0; i<8; i++ ){ ch = get_char(); }
11257 flags = (INTEGER) get_unt(2);
11258 for( i = (INTEGER) get_unt(1)
11259 + (INTEGER) get_unt(1)
11260 + (INTEGER) get_unt(1)
11261 ; i>0
11262 ; i-- ){ ch = get_char(); }
11263 if( flags &
11264 #line 8959 "./tex4ht-c.tex"
11265
11266 0x0200
11267
11268 ){ (void) get_unt(4); }
11269 if( flags &
11270 #line 8963 "./tex4ht-c.tex"
11271
11272 0x0800
11273
11274 ){
11275 int n = (INTEGER) get_unt(2);
11276 int i;
11277 for (i = 0; i < n; ++i) {
11278 (void) get_unt(4);
11279 }
11280 for (i = 0; i < n; ++i) {
11281 (void) get_int(4);
11282 } }
11283
11284
11285 break;
11286 }
11287 case
11288 #line 17505 "./tex4ht-c.tex"
11289
11290 253
11291
11292 :
11293 if( version_id ==
11294 #line 2292 "./tex4ht-c.tex"
11295
11296 10
11297
11298 ){
11299
11300 #line 9257 "./tex4ht-c.tex"
11301
11302 doGlyphArray(TRUE);
11303
11304
11305 break;
11306 }
11307 case
11308 #line 17510 "./tex4ht-c.tex"
11309
11310 254
11311
11312 :
11313 if( version_id ==
11314 #line 2292 "./tex4ht-c.tex"
11315
11316 10
11317
11318 ){
11319
11320 #line 9262 "./tex4ht-c.tex"
11321
11322 doGlyphArray(FALSE);
11323
11324
11325 break;
11326 }
11327
11328
11329 #line 3799 "./tex4ht-c.tex"
11330
11331 default: {
11332 if( (ch <
11333 #line 17426 "./tex4ht-c.tex"
11334
11335 171
11336 ) || (ch >
11337 #line 17432 "./tex4ht-c.tex"
11338
11339 234
11340 ) ) {
11341 bad_char(ch);
11342 } else { cur_fnt = ch -
11343 #line 17426 "./tex4ht-c.tex"
11344
11345 171
11346 ;
11347
11348 #line 9313 "./tex4ht-c.tex"
11349
11350 cur_fnt = search_font_tbl( cur_fnt );
11351 word_sp =
11352 #line 9915 "./tex4ht-c.tex"
11353
11354 design_size_to_pt( font_tbl[cur_fnt].word_sp )
11355 * (double) font_tbl[cur_fnt].scale
11356
11357 ;
11358
11359 }
11360 break;
11361 }
11362
11363
11364 #line 3809 "./tex4ht-c.tex"
11365
11366 case
11367 #line 17438 "./tex4ht-c.tex"
11368
11369 235
11370 :
11371 case
11372 #line 17441 "./tex4ht-c.tex"
11373
11374 236
11375 :
11376 case
11377 #line 17444 "./tex4ht-c.tex"
11378
11379 237
11380 :
11381 case
11382 #line 17447 "./tex4ht-c.tex"
11383
11384 238
11385 : {
11386 INTEGER n;
11387 n = ch -
11388 #line 17438 "./tex4ht-c.tex"
11389
11390 235
11391 + 1;
11392 cur_fnt = (int) ((n==4)? get_int(4) : get_unt((int) n));
11393
11394 #line 9313 "./tex4ht-c.tex"
11395
11396 cur_fnt = search_font_tbl( cur_fnt );
11397 word_sp =
11398 #line 9915 "./tex4ht-c.tex"
11399
11400 design_size_to_pt( font_tbl[cur_fnt].word_sp )
11401 * (double) font_tbl[cur_fnt].scale
11402
11403 ;
11404
11405
11406 break; }
11407
11408
11409 #line 3845 "./tex4ht-c.tex"
11410
11411 case
11412 #line 17450 "./tex4ht-c.tex"
11413
11414 239
11415 : {;}
11416 case
11417 #line 17452 "./tex4ht-c.tex"
11418
11419 240
11420 : {;}
11421 case
11422 #line 17454 "./tex4ht-c.tex"
11423
11424 241
11425 : {;}
11426 case
11427 #line 17456 "./tex4ht-c.tex"
11428
11429 242
11430 : {
11431 #line 3861 "./tex4ht-c.tex"
11432
11433 long int special_n;
11434
11435 #line 12285 "./tex4ht-c.tex"
11436
11437 if( needs_end_accent && t_accent_template ){
11438
11439 #line 2613 "./tex4ht-c.tex"
11440
11441 if( span_on && in_span_ch ){
11442 if( *end_span[0] ){
11443 in_span_ch = FALSE;
11444
11445 #line 1715 "./tex4ht-c.tex"
11446
11447 if( no_root_file ){ open_o_file(); }
11448
11449
11450 (IGNORED) fprintf(cur_o_file, "%s", end_span[0]);
11451 } }
11452
11453
11454 (IGNORED) fprintf(cur_o_file, "%s", t_accent_fifth);
11455 needs_end_accent = FALSE;
11456 #line 12428 "./tex4ht-c.tex"
11457
11458 needs_accented_sym--;
11459
11460
11461 }
11462
11463
11464 if( tex4ht_special( &ch, &special_n) ) { int sv; sv = ch;
11465 special_on = TRUE;
11466 #line 3948 "./tex4ht-c.tex"
11467
11468 try_new_line();
11469 switch( ch ){
11470 case '*': {
11471 #line 4589 "./tex4ht-c.tex"
11472
11473 if( special_n ){
11474 special_n--;
11475 switch ( get_char() ){
11476 case '<': {
11477 #line 4693 "./tex4ht-c.tex"
11478
11479 U_CHAR name[256];
11480 int i=0;
11481 FILE* file;
11482 name[(int) special_n] = '\0';
11483 while( special_n-- > 0 ){ name[i++] = get_char(); }
11484 file = f_open(name, READ_TEXT_FLAGS);
11485 if( file ) {
11486
11487 #line 1715 "./tex4ht-c.tex"
11488
11489 if( no_root_file ){ open_o_file(); }
11490
11491
11492 while( (ch = getc(file)) >=0 ){
11493 (IGNORED) put_4ht_ch(ch,cur_o_file);
11494 }
11495 (IGNORED) fclose(file);
11496 } else { warn_i_str( 1, name ); }
11497
11498 break; }
11499 case '>': {
11500 #line 4398 "./tex4ht-c.tex"
11501
11502 if( special_n > 0 ){
11503
11504 #line 4508 "./tex4ht-c.tex"
11505
11506 static struct files_rec *p, *q;
11507 U_CHAR name[256];
11508 int i;
11509
11510 #line 4518 "./tex4ht-c.tex"
11511
11512 i = 0;
11513 name[(int) special_n] = '\0';
11514 while( special_n-- > 0 ){ name[i++] = get_char(); }
11515 for( p = opened_files; p != (struct files_rec*) 0; p = p->next ){
11516 if( eq_str(p->name, name) ){ break; }
11517 }
11518
11519
11520 if( p != (struct files_rec*) 0 ){
11521
11522 #line 4529 "./tex4ht-c.tex"
11523
11524 for( q = p; q->next != (struct files_rec*) 0; q = q->next ){ }
11525 if( q != p ){
11526 q->next = p;
11527 (p->next)->prev = p->prev;
11528 if( opened_files == p ){ opened_files = p->next; }
11529 else { (p->prev)->next = p->next; }
11530 p->prev = q;
11531 p->next = (struct files_rec*) 0;
11532 }
11533
11534
11535 }
11536
11537
11538 } else {
11539
11540 #line 4474 "./tex4ht-c.tex"
11541
11542
11543 #line 4478 "./tex4ht-c.tex"
11544
11545 static struct files_rec *p, *q;
11546 for( p = opened_files; p != (struct files_rec*) 0; p = p->next ){
11547 if( (p->file == cur_o_file) && p->prev_file ){
11548
11549 #line 4490 "./tex4ht-c.tex"
11550
11551 for( q = opened_files; q != (struct files_rec*) 0; q = q->next ){
11552 if( q->file == p->prev_file ){
11553 break;
11554 }
11555 }
11556 if( q == (struct files_rec*) 0 ){
11557 warn_i_str(51,q->name);
11558 break;
11559 }
11560
11561
11562 cur_o_file = p->prev_file;
11563 p->prev_file = (FILE *) 0;
11564 break;
11565 }
11566 }
11567
11568
11569
11570
11571 }
11572
11573 break; }
11574 case '!': {
11575 #line 4612 "./tex4ht-c.tex"
11576
11577 U_CHAR name[256], ch;
11578 int i=0, n;
11579 struct sys_call_rec *p;
11580 BOOL flag;
11581 name[(int) special_n] = '\0';
11582 while( special_n-- > 0 ){ name[i++] = get_char(); }
11583 (IGNORED) printf("System call: %s\n", name);
11584
11585 #line 4658 "./tex4ht-c.tex"
11586
11587 flag = FALSE;
11588 p = system_calls;
11589 while( p ){
11590 if( (n = (int) strlen((char *) p->filter)) == 1 ) {
11591 flag = flag || (*(p->filter) == '*');
11592 } if( strlen((char *) name) >= (unsigned int) n ) {
11593 ch = name[n]; name[n] = '\0';
11594 flag = flag || eq_str(p->filter,name);
11595 name[n] = ch;
11596 }
11597 p = p->next;
11598 }
11599
11600
11601 if( flag ){
11602 (IGNORED) printf("System return: %d\n",
11603 system_yes? (int) system(name) : -1 );
11604 } else { (IGNORED) printf("No permission for system call\n"); }
11605
11606 break; }
11607 case '^': {
11608 #line 12159 "./tex4ht-c.tex"
11609
11610 special_n--;
11611 switch ( get_char() ){
11612 case 't': { if( special_n ){
11613
11614 #line 12321 "./tex4ht-c.tex"
11615
11616 (IGNORED) get_open_accent(&t_accent_template,
11617 &t_accent_first, &t_accent_second,
11618 &t_accent_third, &t_accent_fourth,
11619 &t_accent_fifth, &special_n);
11620
11621
11622 } else {
11623 #line 12197 "./tex4ht-c.tex"
11624
11625 needs_accent_sym = TRUE * 2;
11626
11627 }
11628 break;
11629 }
11630 case 'm': { if( special_n ){
11631
11632 #line 12328 "./tex4ht-c.tex"
11633
11634 (IGNORED) get_open_accent(&m_accent_template,
11635 &m_accent_first, &m_accent_second,
11636 &m_accent_third, &m_accent_fourth,
11637 &m_accent_fifth, &special_n);
11638
11639
11640 } else {
11641 #line 12201 "./tex4ht-c.tex"
11642
11643 needs_accent_sym = TRUE;
11644
11645 }
11646 break;
11647 }
11648 case 'a': {
11649 #line 12432 "./tex4ht-c.tex"
11650
11651 (IGNORED) get_open_accent(&a_accent_template,
11652 &a_accent_first, &a_accent_second,
11653 &a_accent_third, &a_accent_fourth,
11654 &a_accent_fifth, &special_n);
11655
11656
11657 break;
11658 }
11659 case 'i': {
11660 #line 12448 "./tex4ht-c.tex"
11661
11662 (IGNORED) get_open_accent(&i_accent_template,
11663 &i_accent_first, &i_accent_second,
11664 &i_accent_third, &i_accent_fourth,
11665 &i_accent_fifth, &special_n);
11666
11667
11668 break;
11669 }
11670 default: {
11671 #line 17097 "./tex4ht-c.tex"
11672
11673 while( special_n-- ) (void) get_char();
11674
11675 }
11676 }
11677
11678 break; }
11679 case '@': {
11680 #line 6243 "./tex4ht-c.tex"
11681
11682 int i;
11683 i = 0;
11684 special_n--;
11685 switch ( get_char() ){
11686 case '8': { i++; }
11687 case '7': { i++; }
11688 case '6': { i++; }
11689 case '5': { i++; }
11690 case '4': { i++; }
11691 case '3': { i++; }
11692 case '2': { i++; }
11693 case '1': {
11694 #line 6317 "./tex4ht-c.tex"
11695
11696 if( halign[i]->refs == 1 ){
11697 free((void *) halign[i]->str );
11698 } else {
11699 (halign[i]->refs)--;
11700 halign[i] = m_alloc(struct halign_rec, 1);
11701 halign[i]->refs = 1;
11702 }
11703 halign[i]->str = get_str( (int) special_n );
11704 special_n=0;
11705
11706 break; }
11707 case '/': { if( special_n ){
11708
11709 #line 17097 "./tex4ht-c.tex"
11710
11711 while( special_n-- ) (void) get_char();
11712
11713
11714 } else {
11715 #line 6496 "./tex4ht-c.tex"
11716
11717 if( stack[stack_n].halign_on )
11718 {
11719 #line 6502 "./tex4ht-c.tex"
11720
11721 print_f( stack[stack_n].halign[1]->str );
11722 stack[stack_n].halign_on = FALSE;
11723
11724 }
11725
11726 }
11727 break;
11728 }
11729 case '&': { i++; }
11730 case '@': { i++;
11731 if( special_n ){
11732
11733 #line 17097 "./tex4ht-c.tex"
11734
11735 while( special_n-- ) (void) get_char();
11736
11737
11738 } else {
11739
11740 #line 6374 "./tex4ht-c.tex"
11741
11742 new_halign = i * TRUE;
11743
11744
11745 }
11746 break;
11747 }
11748 default: {
11749 #line 17097 "./tex4ht-c.tex"
11750
11751 while( special_n-- ) (void) get_char();
11752
11753 }
11754 }
11755
11756 break; }
11757 case '=': {
11758 #line 4153 "./tex4ht-c.tex"
11759
11760 char *str, *repl;
11761 struct hcode_repl_typ *p, *q;
11762 BOOL flag;
11763 if( special_n ){
11764 repl = str = m_alloc(char, (int) special_n + 1);
11765 while( special_n-- > 0 ){
11766 *str = get_char(); str++;
11767 }
11768 *str = 0;
11769
11770 #line 4180 "./tex4ht-c.tex"
11771
11772 if( hcode_repl != (struct hcode_repl_typ*) 0 ){
11773 if( *(hcode_repl->str) == *repl ){
11774 p = hcode_repl;
11775 hcode_repl = hcode_repl->next;
11776 free((void *) p->str);
11777 free((void *) p);
11778 } else {
11779 p = hcode_repl;
11780 while( TRUE ){
11781 q = p->next;
11782 if( q == (struct hcode_repl_typ*) 0 ){ break; }
11783 if( *(q->str) == *repl ){
11784 p->next = q->next;
11785 free((void *) q->str);
11786 free((void *) q);
11787 break;
11788 }
11789 p = q;
11790 } } }
11791
11792
11793
11794 #line 4203 "./tex4ht-c.tex"
11795
11796 flag = *repl != *(repl+1);
11797 if( !flag ){ flag = *(repl+2) != 0; }
11798 if( flag ){
11799 p = (struct hcode_repl_typ *) m_alloc(struct hcode_repl_typ, 1);
11800 p->str = repl;
11801 p->next = hcode_repl;
11802 hcode_repl = p;
11803 }
11804
11805
11806 } else {
11807
11808 #line 4170 "./tex4ht-c.tex"
11809
11810 while( hcode_repl != (struct hcode_repl_typ*) 0 ){
11811 p = hcode_repl;
11812 hcode_repl = hcode_repl->next;
11813 free((void *) p->str);
11814 free((void *) p);
11815 }
11816
11817
11818 }
11819
11820 break; }
11821 default: {
11822 #line 17097 "./tex4ht-c.tex"
11823
11824 while( special_n-- ) (void) get_char();
11825
11826 }
11827 }
11828 } else {
11829 #line 17102 "./tex4ht-c.tex"
11830
11831 ;
11832
11833 }
11834
11835 break; }
11836 case '@': {
11837 #line 4244 "./tex4ht-c.tex"
11838
11839 int code, digit;
11840 special_n--;
11841 switch ( code = get_char() ){
11842 case '%': {
11843 #line 2511 "./tex4ht-c.tex"
11844
11845 if( special_n>1 ) {
11846 special_n--;
11847 if ( get_char() == '%' ) {
11848 if( special_n>2 ) {
11849 #line 2652 "./tex4ht-c.tex"
11850
11851 U_CHAR type, ch, *p, *q, *pp=0, *qq=0, pre[256], post[256];
11852 special_n -= 2; type = get_char(); ch = get_char();
11853 p = pre;
11854 while( special_n-- > 0 ) {
11855 if ( (*(p++)=get_char() ) == ch ) { p--; break; }
11856 }
11857 *p = '\0';
11858 p = post;
11859 while( special_n-- > 0 ) { *(p++)=get_char(); } *p='\0';
11860
11861
11862 #line 2665 "./tex4ht-c.tex"
11863
11864 p = m_alloc(char, 1 + (int) strlen((char *) pre));
11865 (IGNORED) strcpy((char *) p, (char *) pre );
11866 q = m_alloc(char, 1 + (int) strlen((char *) post));
11867 (IGNORED) strcpy((char *) q, (char *) post );
11868
11869
11870 #line 2674 "./tex4ht-c.tex"
11871
11872 switch ( type ){
11873 case 'P': {
11874 pp = trace_dvi_del_P; trace_dvi_del_P = p;
11875 qq = end_trace_dvi_del_P; end_trace_dvi_del_P = q;
11876 break; }
11877 case 'C': {
11878 pp = trace_dvi_del_C; trace_dvi_del_C = p;
11879 qq = end_trace_dvi_del_C; end_trace_dvi_del_C = q;
11880 break; }
11881 case 'V': {
11882 pp = trace_dvi_del_V; trace_dvi_del_V = p;
11883 qq = end_trace_dvi_del_V; end_trace_dvi_del_V = q;
11884 break; }
11885 case 'H': {
11886 pp = trace_dvi_del_H; trace_dvi_del_H = p;
11887 qq = end_trace_dvi_del_H; end_trace_dvi_del_H = q;
11888 break; }
11889 case 'R': {
11890 pp = trace_dvi_del_R; trace_dvi_del_R = p;
11891 qq = end_trace_dvi_del_R; end_trace_dvi_del_R = q;
11892 break; }
11893 case 'p': {
11894 pp = trace_dvi_del_p; trace_dvi_del_p = p;
11895 qq = end_trace_dvi_del_p; end_trace_dvi_del_p = q;
11896 break; }
11897 case 'c': {
11898 pp = trace_dvi_del_c; trace_dvi_del_c = p;
11899 qq = end_trace_dvi_del_c; end_trace_dvi_del_c = q;
11900 break; }
11901 case 'v': {
11902 pp = trace_dvi_del_v; trace_dvi_del_v = p;
11903 qq = end_trace_dvi_del_v; end_trace_dvi_del_v = q;
11904 break; }
11905 case 'h': {
11906 pp = trace_dvi_del_h; trace_dvi_del_h = p;
11907 qq = end_trace_dvi_del_h; end_trace_dvi_del_h = q;
11908 break; }
11909 case 'r': {
11910 pp = trace_dvi_del_r; trace_dvi_del_r = p;
11911 qq = end_trace_dvi_del_r; end_trace_dvi_del_r = q;
11912 break; }
11913 default: { ; }
11914 }
11915 free((void *) pp);
11916 free((void *) qq);
11917
11918 }
11919 else {
11920 #line 17097 "./tex4ht-c.tex"
11921
11922 while( special_n-- ) (void) get_char();
11923
11924 }
11925 } else {
11926 #line 17097 "./tex4ht-c.tex"
11927
11928 while( special_n-- ) (void) get_char();
11929
11930 }
11931 } else if( special_n ) {
11932 special_n--;
11933 switch ( get_char() ){
11934 case 'P': { trace_dvi_P++; break; }
11935 case 'C': { trace_dvi_C++; break; }
11936 case 'V': { trace_dvi_V++; break; }
11937 case 'H': { trace_dvi_H++; break; }
11938 case 'R': { trace_dvi_R++; break; }
11939 case 'p': { trace_dvi_P--; break; }
11940 case 'c': { trace_dvi_C--; break; }
11941 case 'v': { trace_dvi_V--; break; }
11942 case 'h': { trace_dvi_H--; break; }
11943 case 'r': { trace_dvi_R--; break; }
11944 default: { ; }
11945 } }
11946
11947 break; }
11948 case '@': { verb_ch = !verb_ch; break; }
11949 case '/': {
11950 #line 17185 "./tex4ht-c.tex"
11951
11952 trace_special = !trace_special;
11953
11954 break; }
11955 case 'e': {
11956 #line 17162 "./tex4ht-c.tex"
11957
11958 if( err_mark ){ free((void *) err_mark); }
11959 if( special_n ){
11960 err_mark = get_str( (int) special_n ); special_n=0;
11961 } else { err_mark = (char *) 0; }
11962
11963 break; }
11964 case '!': {
11965 #line 3266 "./tex4ht-c.tex"
11966
11967 while( recover_spaces-- ){ text_on=TRUE; put_char(' '); }
11968 recover_spaces = 0;
11969
11970 break; }
11971 case '(': {
11972 #line 3272 "./tex4ht-c.tex"
11973
11974 ignore_spaces++;
11975
11976 break; }
11977 case ')': {
11978 #line 3276 "./tex4ht-c.tex"
11979
11980 ignore_spaces--;
11981
11982 break; }
11983 case '[': {
11984 #line 3294 "./tex4ht-c.tex"
11985
11986 if( special_n ){
11987
11988 #line 3282 "./tex4ht-c.tex"
11989
11990 U_CHAR *unhskip_mark;
11991 long retract_addr;
11992 BOOL unhskip;
11993 int cr_fnt, ch, unskip_depth;
11994
11995
11996 cr_fnt = cur_fnt;
11997 unskip_depth = 0;
11998 unhskip_mark = get_str( (int) special_n ); special_n=0;
11999 retract_addr = ftell(dvi_file);
12000
12001 #line 3308 "./tex4ht-c.tex"
12002
12003 unhskip = TRUE;
12004 while( unhskip ){
12005 if( (ch = get_char()) >= 128 ) {
12006 switch( ch ){
12007
12008 #line 7084 "./tex4ht-c.tex"
12009
12010 case
12011 #line 17469 "./tex4ht-c.tex"
12012
12013 246
12014 : (void) get_char();
12015 case
12016 #line 17466 "./tex4ht-c.tex"
12017
12018 245
12019 : (void) get_char();
12020 case
12021 #line 17463 "./tex4ht-c.tex"
12022
12023 244
12024 : (void) get_char();
12025 case
12026 #line 17460 "./tex4ht-c.tex"
12027
12028 243
12029 : { int i;
12030 for( i=14; i; i-- ){ ch = get_char(); }
12031 i = ch + get_char();
12032 (IGNORED) fseek(dvi_file, (long) i,
12033 #line 2177 "./tex4ht-c.tex"
12034
12035 1
12036 );
12037 break; }
12038
12039
12040
12041 #line 7155 "./tex4ht-c.tex"
12042
12043 case
12044 #line 17318 "./tex4ht-c.tex"
12045
12046 132
12047 :
12048 case
12049 #line 17323 "./tex4ht-c.tex"
12050
12051 137
12052 :{
12053 (IGNORED) fseek(dvi_file, 8L,
12054 #line 2177 "./tex4ht-c.tex"
12055
12056 1
12057 );
12058 break;
12059 }
12060
12061
12062 #line 7163 "./tex4ht-c.tex"
12063
12064 case
12065 #line 17329 "./tex4ht-c.tex"
12066
12067 139
12068 : {
12069 (IGNORED) fseek(dvi_file, 44L,
12070 #line 2177 "./tex4ht-c.tex"
12071
12072 1
12073 ); break; }
12074
12075
12076 #line 7168 "./tex4ht-c.tex"
12077
12078 case
12079 #line 17341 "./tex4ht-c.tex"
12080
12081 143
12082 : case
12083 #line 17344 "./tex4ht-c.tex"
12084
12085 144
12086 :
12087 case
12088 #line 17347 "./tex4ht-c.tex"
12089
12090 145
12091 : case
12092 #line 17350 "./tex4ht-c.tex"
12093
12094 146
12095 : {
12096 (IGNORED) (get_int( ch -
12097 #line 17341 "./tex4ht-c.tex"
12098
12099 143
12100 + 1 )); break; }
12101 case
12102 #line 17356 "./tex4ht-c.tex"
12103
12104 148
12105 :
12106 case
12107 #line 17359 "./tex4ht-c.tex"
12108
12109 149
12110 :
12111 case
12112 #line 17362 "./tex4ht-c.tex"
12113
12114 150
12115 :
12116 case
12117 #line 17365 "./tex4ht-c.tex"
12118
12119 151
12120 : {
12121 (IGNORED) (get_int( ch -
12122 #line 17356 "./tex4ht-c.tex"
12123
12124 148
12125 + 1));
12126 break; }
12127 case
12128 #line 17371 "./tex4ht-c.tex"
12129
12130 153
12131 :
12132 case
12133 #line 17374 "./tex4ht-c.tex"
12134
12135 154
12136 :
12137 case
12138 #line 17377 "./tex4ht-c.tex"
12139
12140 155
12141 :
12142 case
12143 #line 17380 "./tex4ht-c.tex"
12144
12145 156
12146 : {
12147 (IGNORED) (get_int( ch -
12148 #line 17371 "./tex4ht-c.tex"
12149
12150 153
12151 + 1));
12152 break; }
12153 case
12154 #line 17383 "./tex4ht-c.tex"
12155
12156 157
12157 : case
12158 #line 17386 "./tex4ht-c.tex"
12159
12160 158
12161 :
12162 case
12163 #line 17389 "./tex4ht-c.tex"
12164
12165 159
12166 : case
12167 #line 17392 "./tex4ht-c.tex"
12168
12169 160
12170 : {
12171 (IGNORED) (get_int( ch -
12172 #line 17383 "./tex4ht-c.tex"
12173
12174 157
12175 + 1));
12176 break; }
12177 case
12178 #line 17398 "./tex4ht-c.tex"
12179
12180 162
12181 :
12182 case
12183 #line 17401 "./tex4ht-c.tex"
12184
12185 163
12186 :
12187 case
12188 #line 17404 "./tex4ht-c.tex"
12189
12190 164
12191 :
12192 case
12193 #line 17407 "./tex4ht-c.tex"
12194
12195 165
12196 : {
12197 (IGNORED) (get_int( ch -
12198 #line 17398 "./tex4ht-c.tex"
12199
12200 162
12201 + 1));
12202 break; }
12203 case
12204 #line 17413 "./tex4ht-c.tex"
12205
12206 167
12207 :
12208 case
12209 #line 17416 "./tex4ht-c.tex"
12210
12211 168
12212 :
12213 case
12214 #line 17419 "./tex4ht-c.tex"
12215
12216 169
12217 :
12218 case
12219 #line 17422 "./tex4ht-c.tex"
12220
12221 170
12222 : {
12223 (IGNORED) (get_int( ch -
12224 #line 17413 "./tex4ht-c.tex"
12225
12226 167
12227 + 1));
12228 break; }
12229
12230
12231 #line 7204 "./tex4ht-c.tex"
12232
12233 case
12234 #line 17353 "./tex4ht-c.tex"
12235
12236 147
12237 :
12238 case
12239 #line 17368 "./tex4ht-c.tex"
12240
12241 152
12242 :
12243 case
12244 #line 17395 "./tex4ht-c.tex"
12245
12246 161
12247 :
12248 case
12249 #line 17410 "./tex4ht-c.tex"
12250
12251 166
12252 :
12253 { break; }
12254
12255
12256
12257 #line 3346 "./tex4ht-c.tex"
12258
12259 case 128: case 129: case 130: case 131: case 133:
12260 case 134: case 135: case 136: {
12261 (void) get_unt( (ch-(ch>132)) % 4 +1);
12262 break;
12263 }
12264
12265
12266
12267 #line 3359 "./tex4ht-c.tex"
12268
12269 case
12270 #line 17335 "./tex4ht-c.tex"
12271
12272 141
12273 :
12274 case
12275 #line 17338 "./tex4ht-c.tex"
12276
12277 142
12278 : { break; }
12279
12280
12281
12282 #line 3368 "./tex4ht-c.tex"
12283
12284 case
12285 #line 17450 "./tex4ht-c.tex"
12286
12287 239
12288 : case
12289 #line 17452 "./tex4ht-c.tex"
12290
12291 240
12292 :
12293 case
12294 #line 17454 "./tex4ht-c.tex"
12295
12296 241
12297 : case
12298 #line 17456 "./tex4ht-c.tex"
12299
12300 242
12301 : { long int i;
12302 if( tex4ht_special( &ch, &i ) ){ char *mark;
12303 mark = get_str( (int) i );
12304 if( i ){
12305 if( (ch=='@') && eq_str(mark+1,unhskip_mark) ){
12306 switch( *mark ){
12307 case '[': { unskip_depth++; break; }
12308 case ']': {
12309 unhskip = !(--unskip_depth);
12310 break;
12311 }
12312 default: { ; }
12313 } } }
12314 }else{
12315 #line 7020 "./tex4ht-c.tex"
12316
12317 U_CHAR *ch;
12318 ch = special_hd + 4;
12319 while( *ch ){ ch++; }
12320 (IGNORED) fseek(dvi_file, (long) i,
12321 #line 2177 "./tex4ht-c.tex"
12322
12323 1
12324 );
12325
12326 }
12327 break;
12328 }
12329
12330
12331
12332 #line 7097 "./tex4ht-c.tex"
12333
12334 case
12335 #line 17438 "./tex4ht-c.tex"
12336
12337 235
12338 :
12339 case
12340 #line 17441 "./tex4ht-c.tex"
12341
12342 236
12343 :
12344 case
12345 #line 17444 "./tex4ht-c.tex"
12346
12347 237
12348 :
12349 case
12350 #line 17447 "./tex4ht-c.tex"
12351
12352 238
12353 : {
12354 INTEGER n;
12355 n = ch -
12356 #line 17438 "./tex4ht-c.tex"
12357
12358 235
12359 + 1;
12360 cr_fnt = (int) ((n==4)? get_int(4) : get_unt((int) n));
12361 cr_fnt = search_font_tbl( cr_fnt );
12362 break; }
12363 default: {
12364 if( (ch <
12365 #line 17426 "./tex4ht-c.tex"
12366
12367 171
12368 ) || (ch >
12369 #line 17432 "./tex4ht-c.tex"
12370
12371 234
12372 ) ) {
12373 if( ch ==
12374 #line 17332 "./tex4ht-c.tex"
12375
12376 140
12377 ) { warn_i(46); }
12378 else { warn_i_int(45,ch); }
12379 } else { cr_fnt = ch -
12380 #line 17426 "./tex4ht-c.tex"
12381
12382 171
12383 ;
12384 cr_fnt = search_font_tbl( cr_fnt );
12385 }
12386 break;
12387 }
12388
12389
12390 }
12391 } }
12392
12393 #line 3324 "./tex4ht-c.tex"
12394
12395 do{
12396 long int i;
12397 char *mark;
12398 ch = get_char();
12399 if(
12400 ( ch==
12401 #line 17450 "./tex4ht-c.tex"
12402
12403 239
12404 ) || ( ch==
12405 #line 17452 "./tex4ht-c.tex"
12406
12407 240
12408 ) ||
12409 ( ch==
12410 #line 17454 "./tex4ht-c.tex"
12411
12412 241
12413 ) || ( ch==
12414 #line 17456 "./tex4ht-c.tex"
12415
12416 242
12417 )
12418 )
12419 {
12420 if( tex4ht_special( &ch, &i ) ){
12421 mark = get_str( (int) i );
12422 if( (ch=='@') && ( *mark=='?') && eq_str(mark+1,unhskip_mark)){
12423 break;
12424 } }
12425 }
12426 (IGNORED) fseek(dvi_file, (long) retract_addr,
12427 #line 2174 "./tex4ht-c.tex"
12428
12429 0
12430 );
12431 } while(FALSE);
12432
12433
12434
12435
12436 cur_fnt = cr_fnt;
12437 free((void *) unhskip_mark);
12438 } else { ignore_chs++;; }
12439
12440 break; }
12441 case ']': {
12442 #line 3394 "./tex4ht-c.tex"
12443
12444 if( special_n ){
12445 while( special_n-- > 0 ){ (void) get_char(); }
12446 } else { ignore_chs--; }
12447
12448 break; }
12449 case '?': {
12450 #line 3401 "./tex4ht-c.tex"
12451
12452 while( special_n-- > 0 ){ (void) get_char(); }
12453
12454 break; }
12455 case '-': {
12456 if( special_n ) { code = 0;
12457 #line 4284 "./tex4ht-c.tex"
12458
12459 while( special_n-- > 0 ){
12460 digit = get_char() - '0';
12461 if ( (digit < 0) || (digit > 9) ) { warn_i_int(41,digit+'0') ; }
12462 else { code = code * 10 + digit; }
12463 }
12464 if ( (code < 0) || (code > 255) ) { code = '?'; warn_i_int(41,'?') ; }
12465
12466
12467 put_char( code );
12468 } else { nomargin = TRUE; }
12469 break; }
12470 case '*': {
12471 #line 4346 "./tex4ht-c.tex"
12472
12473 keepChar=1;
12474
12475 }
12476 case '+': {
12477 #line 4303 "./tex4ht-c.tex"
12478
12479 if(
12480 #line 4336 "./tex4ht-c.tex"
12481
12482 next_char
12483
12484 != -1 ) {
12485
12486 #line 1715 "./tex4ht-c.tex"
12487
12488 if( no_root_file ){ open_o_file(); }
12489
12490
12491 (IGNORED) put_4ht_ch(
12492 #line 4336 "./tex4ht-c.tex"
12493
12494 next_char
12495
12496 , cur_o_file );
12497
12498 #line 4336 "./tex4ht-c.tex"
12499
12500 next_char
12501
12502 = -1;
12503 }
12504 if(
12505 #line 4342 "./tex4ht-c.tex"
12506
12507 next_str
12508
12509 ){ print_f(next_str);
12510 free((void *) next_str); next_str = (char *) 0; }
12511 next_str = get_str( (int) special_n ); special_n = 0;
12512
12513 #line 4318 "./tex4ht-c.tex"
12514
12515 { char *front, *back;
12516 int i;
12517 back = front = next_str;
12518 while( *front != '\0' ){
12519 if( *front == '{' ){
12520 i = *(++front) - '0';
12521 while( *(++front) != '}' ){ i = i*10 + (*front - '0'); }
12522 *front = (char) i;
12523 }
12524 *(back++) = *(front++);
12525 }
12526 *back = '\0';
12527 }
12528
12529
12530
12531 break; }
12532 case '.': {
12533 #line 3406 "./tex4ht-c.tex"
12534
12535 if( eoln_str ){ free((void *) eoln_str); }
12536 if( special_n ){
12537 eoln_str = get_str( (int) special_n ); special_n=0;
12538 } else { eoln_str = (char *) 0; }
12539
12540 break; }
12541 case ',': {
12542 #line 3428 "./tex4ht-c.tex"
12543
12544 if( space_str ){ free((void *) space_str); }
12545 if( special_n ){
12546 space_str = get_str( (int) special_n ); special_n=0;
12547 } else { space_str = (char *) 0; }
12548
12549 break; }
12550 case '_': {
12551 #line 3682 "./tex4ht-c.tex"
12552
12553 if( !special_n ){ rule_ch = '\0'; }
12554 else { while( special_n-- > 0 ){ rule_ch = get_char(); }
12555 }
12556
12557 break; }
12558 case 'D': {
12559 #line 3690 "./tex4ht-c.tex"
12560
12561 struct files_rec *p;
12562 while( special_n-- > 0 ) (void) putc( get_char(), log_file );
12563 for( p = opened_files; p != (struct files_rec*) 0; p = p->next ){
12564 if( p->file == cur_o_file) {
12565 (IGNORED) fprintf(log_file, "%d %s\n",
12566 (int) ftell(cur_o_file), p->name);
12567 break;
12568 } }
12569
12570 break; }
12571 case 'u': {
12572 #line 15892 "./tex4ht-c.tex"
12573
12574 special_n--;
12575 switch ( code = get_char() ){
12576 case '+': { put_4ht_off++;
12577 #line 15910 "./tex4ht-c.tex"
12578
12579 flush_uni();
12580
12581 break; }
12582 case '-': { if( put_4ht_off>0 ){ put_4ht_off--; }
12583 else { warn_i_str(52, "@u-"); }
12584 break; }
12585 }
12586
12587 break; }
12588 default: {
12589 #line 4293 "./tex4ht-c.tex"
12590
12591 code -= '0';
12592 #line 4284 "./tex4ht-c.tex"
12593
12594 while( special_n-- > 0 ){
12595 digit = get_char() - '0';
12596 if ( (digit < 0) || (digit > 9) ) { warn_i_int(41,digit+'0') ; }
12597 else { code = code * 10 + digit; }
12598 }
12599 if ( (code < 0) || (code > 255) ) { code = '?'; warn_i_int(41,'?') ; }
12600
12601 next_char = code;
12602 if(
12603 #line 4342 "./tex4ht-c.tex"
12604
12605 next_str
12606
12607 ){ print_f(next_str);
12608 free((void *) next_str); next_str = (char *) 0; }
12609
12610 }
12611 }
12612
12613 break; }
12614 case '+': {
12615 #line 5444 "./tex4ht-c.tex"
12616
12617 while( special_n-- > 0 ) (void) get_char();
12618
12619 break; }
12620 case '=': {
12621 #line 4123 "./tex4ht-c.tex"
12622
12623 while( special_n-- > 0 ){
12624 int ch;
12625 BOOL flag;
12626 struct hcode_repl_typ *q;
12627 ch = get_char();
12628 q = hcode_repl;
12629 flag = FALSE;
12630 while( q != (struct hcode_repl_typ*) 0 ){
12631 if( ch == *(q->str) ){ flag = TRUE; break; }
12632 q = q->next;
12633 }
12634 if( flag ){
12635 char *chr;
12636 chr = (q->str) + 1;
12637 while( *chr != 0 ){ put_char( *chr ); chr++; }
12638 } else { put_char( ch ); }
12639 }
12640
12641 break; }
12642 case '<':
12643 case '>': {
12644 #line 4387 "./tex4ht-c.tex"
12645
12646
12647 #line 4545 "./tex4ht-c.tex"
12648
12649 int i=0;
12650 U_CHAR *name;
12651 name = m_alloc(char, (int) special_n+1);
12652 *(name + (int) special_n) = '\0';
12653 while( special_n-- > 0 ) *(name + i++) = get_char();
12654
12655
12656
12657 #line 1715 "./tex4ht-c.tex"
12658
12659 if( no_root_file ){ open_o_file(); }
12660
12661
12662
12663 #line 4559 "./tex4ht-c.tex"
12664
12665 for( p = opened_files; p != (struct files_rec*) 0; p = p->next )
12666 { if( eq_str(p->name, name) ) break; }
12667
12668
12669 if( ch == '>' ){
12670 #line 4411 "./tex4ht-c.tex"
12671
12672 if( p != (struct files_rec*) 0 ){
12673 out_file = p->file;
12674 p->prev_file = cur_o_file;
12675 free((void *) name );
12676 } else {
12677 if( !(*name) ) out_file = (FILE *) 0;
12678 else {
12679 #line 4423 "./tex4ht-c.tex"
12680
12681 p = m_alloc(struct files_rec, 1);
12682 if( opened_files != (struct files_rec*) 0 ) opened_files->prev = p;
12683 p->prev = (struct files_rec *) 0;
12684 p->next = opened_files; opened_files = p;
12685 p->name = name;
12686 p->file = out_file = open_html_file(name);
12687 p->prev_file = cur_o_file;
12688
12689 }
12690 }
12691
12692 }
12693 else {
12694 #line 4435 "./tex4ht-c.tex"
12695
12696 if( p == (struct files_rec *) 0 ) bad_special( name );
12697 else { /* if p is null, do nothing more */
12698
12699 #line 4448 "./tex4ht-c.tex"
12700
12701 if( p->prev != (struct files_rec*) 0 ) (p->prev)->next = p->next;
12702 else opened_files = p->next;
12703 if( p->next != (struct files_rec*) 0 ) (p->next)->prev = p->prev;
12704
12705
12706 if( opened_files != (struct files_rec*) 0 )
12707 { if( out_file == p->file ) out_file = opened_files->file; }
12708 else out_file = (FILE *) 0;
12709 (IGNORED) fclose( p->file ); free((void *) p->name );
12710 free((void *) p );
12711 }
12712
12713 }
12714 cur_o_file = ( out_file == (FILE *) 0 )? root_file
12715 : out_file;
12716
12717 break; }
12718 case '!': {
12719 #line 4820 "./tex4ht-c.tex"
12720
12721 ch_map_flag = !ch_map_flag;
12722 if( ch_map_flag ){
12723 #line 4910 "./tex4ht-c.tex"
12724
12725 init_ch_map();
12726 xresolution = yresolution = 0;
12727 while( special_n-- > 0 ){
12728 ch = get_char();
12729 if( (ch >= '0') && (ch <= '9') )
12730 { yresolution = yresolution * 10 + ch - '0'; }
12731 else if( (ch == ',') && !xresolution && yresolution )
12732 { xresolution = yresolution; yresolution = 0; }
12733 else {
12734 #line 4934 "./tex4ht-c.tex"
12735
12736 xresolution = yresolution = 0;
12737
12738 #line 17089 "./tex4ht-c.tex"
12739
12740 warn_i_int( 26, '!');
12741 (IGNORED) putc( ch, stderr);
12742 while( special_n-- ) (IGNORED) putc( get_char(), stderr);
12743
12744
12745
12746 }
12747 }
12748 if( !xresolution ) xresolution = yresolution;
12749 if( !xresolution ){ xresolution = XRESOLUTION;
12750 yresolution = YRESOLUTION; }
12751 else { xresolution = xresolution * (INTEGER) (XRESOLUTION / 100);
12752 yresolution = yresolution * (INTEGER) (YRESOLUTION / 100); }
12753
12754 }
12755 else {
12756 #line 5279 "./tex4ht-c.tex"
12757
12758 dump_ch_map();
12759
12760 }
12761
12762 break; }
12763 case '|': { gif_ch = !gif_ch; break; }
12764 case ':': {
12765 #line 4726 "./tex4ht-c.tex"
12766
12767 if( special_n-- ){
12768 int code, n;
12769 U_CHAR str [255], *p;
12770 struct count_rec *q;
12771 code = get_char();
12772 while( special_n > 254 ){ (void) get_char(); special_n--; }
12773 p = str; n = special_n;
12774 while( special_n-- ) { *(p++) = get_char(); }
12775 *p = '\0';
12776
12777 #line 4755 "./tex4ht-c.tex"
12778
12779 q = counter;
12780 while( q ){
12781 if( eq_str(str,q->str) ) break; q = q->next;
12782 }
12783 if( !q ){
12784 q = m_alloc(struct count_rec, 1);
12785 q->i = q->depth = 0; q->max = 10;
12786 q->next = counter; counter = q;
12787 q->str = m_alloc(char, (int) n+1);
12788 (IGNORED) strcpy((char *) q->str, (char *) str );
12789 q->stack = m_alloc(int, q->max);
12790 }
12791
12792
12793
12794 #line 4787 "./tex4ht-c.tex"
12795
12796 switch ( code ){
12797 case '+': { (q->i)++; break; }
12798 case '-': { (q->i)--; break; }
12799 case '>': {
12800 #line 4770 "./tex4ht-c.tex"
12801
12802 if( q->depth == q->max ){
12803 q->max += 10;
12804 if( (q->stack = (int *) r_alloc( (void *) q->stack,
12805 (size_t) (q->max * sizeof(int)))) == NULL) bad_mem;
12806 }
12807 q->stack[q->depth++] = q->i;
12808
12809 break; }
12810 case '<': { if( q->depth ){
12811 #line 4779 "./tex4ht-c.tex"
12812
12813 q->depth--;
12814 if( q->max > q->depth + 20 ){ q->max -= 15;
12815 if( (q->stack = (int *) r_alloc( (void *) q->stack,
12816 (size_t) (q->max * sizeof(int)))) == NULL) bad_mem;
12817 }
12818
12819 }
12820 break; }
12821 case '!': {
12822 #line 1715 "./tex4ht-c.tex"
12823
12824 if( no_root_file ){ open_o_file(); }
12825
12826
12827 (IGNORED) fprintf(cur_o_file, "%d", q->i); break; }
12828 case '|': { if( q->depth ){
12829
12830 #line 1715 "./tex4ht-c.tex"
12831
12832 if( no_root_file ){ open_o_file(); }
12833
12834
12835 (IGNORED) fprintf(cur_o_file, "%d", q->stack[q->depth - 1] );
12836 }
12837 break; }
12838 default: { ; }
12839 }
12840
12841
12842 }
12843
12844 break; }
12845 case ';': {
12846 #line 11404 "./tex4ht-c.tex"
12847
12848 int n, code;
12849 U_CHAR *p, *q;
12850 code = get_char();
12851 n = 1 + ((--special_n>254)? 254 : special_n);
12852 q = p = m_alloc(char, (int) n);
12853 while( special_n > 254 ){ (void) get_char(); special_n--; }
12854 while( special_n-- ) { *(q++) = get_char(); }
12855 *q = '\0'; q = p;
12856 switch ( code ){
12857 case '8': { pause_style--; break; }
12858 case '9': { pause_style++; break; }
12859 case '-': { default_font = font_tbl[cur_fnt].num;
12860 base_font_size = font_tbl[cur_fnt].scale / 100;
12861 break; }
12862 case '+': { default_font = -1; break; }
12863 case '%': {
12864 #line 11818 "./tex4ht-c.tex"
12865
12866 int f;
12867 f = 0; while( *p ){ f = 10*f + *(p++) - '0'; }
12868
12869 #line 1715 "./tex4ht-c.tex"
12870
12871 if( no_root_file ){ open_o_file(); }
12872
12873
12874 (IGNORED) fprintf(cur_o_file, "%d",
12875 (font_tbl[cur_fnt].scale / base_font_size - 100) * f / 100 +100
12876 );
12877
12878 break; }
12879 case '=': {
12880 #line 11827 "./tex4ht-c.tex"
12881
12882
12883 #line 1715 "./tex4ht-c.tex"
12884
12885 if( no_root_file ){ open_o_file(); }
12886
12887
12888 (IGNORED) fprintf(cur_o_file, "%s", font_tbl[cur_fnt].name);
12889 if( font_tbl[cur_fnt].mag != 100 ){
12890 (IGNORED) fprintf(cur_o_file,"_%d", font_tbl[cur_fnt].mag);
12891 }
12892
12893 break; }
12894 case '|': {
12895 #line 11603 "./tex4ht-c.tex"
12896
12897 { int bad_str, m;
12898 U_CHAR ch, *t[
12899 #line 11647 "./tex4ht-c.tex"
12900
12901 8
12902 ], err_str[256];
12903 bad_str=
12904 #line 11649 "./tex4ht-c.tex"
12905
12906 7
12907 ; (IGNORED) strcpy((char *) err_str, (char *) p);
12908 if( n>
12909 #line 11651 "./tex4ht-c.tex"
12910
12911 10
12912 ){
12913 m = 100*( *p-'0' ) + 10*( *(p+1)-'0' )+ *(p+2)-'0';
12914 if( (m>-1) && (m<256) ){
12915 ch = *(p + 3); t[0]=p;
12916 while( (*p = *(p+4)) != '\0' ){
12917 if( ch == *p ){ *p = '\0';
12918 if( bad_str-- > 0 ) t[
12919 #line 11649 "./tex4ht-c.tex"
12920
12921 7
12922 - bad_str] = p+1;
12923 }
12924 p++;
12925 } }
12926 if( !bad_str ){
12927 if( m==0 ){ span_name_on = n>
12928 #line 11653 "./tex4ht-c.tex"
12929
12930 11
12931 ; }
12932 q = span_open[m]; span_open[m] = t[0];
12933 span_name[m] = t[1]; span_size[m] = t[2];
12934 span_mag[m] = t[3]; span_ord[m] = t[4];
12935 span_ch[m] = t[5]; end_span[m] = t[6];
12936 gif_id[m] = t[7];
12937 if( not_notify ) {
12938 store_bit_I( class_on, m );
12939 not_notify = FALSE;
12940 } else store_bit_Z( class_on, m );
12941 }
12942 }
12943 if( bad_str ){ warn_i_str(37,err_str); }
12944 }
12945
12946 break; }
12947 case ',': {
12948 #line 11638 "./tex4ht-c.tex"
12949
12950 not_notify = TRUE;
12951
12952 break; }
12953 default: { warn_i_int( 36, code); }
12954 }
12955 span_on = span_name_on && !pause_style;
12956 if( q ) free((void *) q);
12957
12958 break; }
12959 case '"': {
12960 #line 8400 "./tex4ht-c.tex"
12961
12962 if( special_n ){
12963
12964 #line 8471 "./tex4ht-c.tex"
12965
12966 { U_CHAR * p, ch, i;
12967 ch = get_char();
12968 p = pos_text = pos_line = end_pos_text
12969 = end_pos_body = pos_body
12970 = (char *) r_alloc((void *) pos_body,(size_t) special_n + 1);
12971 i = 0;
12972 #line 8490 "./tex4ht-c.tex"
12973
12974 { BOOL after_star=0;
12975 while( special_n-- > 0 ){
12976 if( (*p = get_char()) == ch ){
12977 *p = '\0'; i++;
12978 if( i==1 ){ end_pos_body = p + 1; after_star = FALSE; }
12979 else if( i==2 ){ pos_text = p + 1;
12980 if( !after_star ){ i--; after_star = TRUE; }
12981 }
12982 else if( i==3 ){ end_pos_text = p + 1; }
12983 else if( i==4 ){ pos_line = p + 1; }
12984 else { p++; break; }
12985 } else { after_star = FALSE; }
12986 p++;
12987 }
12988 }
12989
12990
12991
12992 #line 8510 "./tex4ht-c.tex"
12993
12994 { long int v=0;
12995 double w[5];
12996 int j;
12997 U_CHAR ch, sign;
12998 BOOL done;
12999 for(j=0;j<5;j++){
13000
13001 #line 8532 "./tex4ht-c.tex"
13002
13003 done = FALSE; sign = 1;
13004 if( --special_n > 0 ){
13005 if( (ch = get_char()) == '-' ){ sign = -1; v=0; }
13006 else v = ch - '0';
13007 if( (v<0) || (v>9) ) done = TRUE;
13008 }
13009 if( !done )
13010 while( --special_n > 0 ){
13011 ch = get_char();
13012 if( ('0' <= ch ) && (ch <= '9' ) ){
13013 v = v * 10 + ch - '0'; }
13014 else{ done = TRUE; break; }
13015 }
13016
13017
13018 if( done ){
13019 i++;
13020 w[j] = sign * ((double) v + pos_dbl( &special_n ));
13021 }
13022 }
13023 pos_x_A = w[0]; pos_x_B = w[1];
13024 pos_y_C = w[2]; pos_y_D = w[3]; pos_y_E = w[4];
13025 }
13026 rect_pos = (special_n == 2);
13027 if( rect_pos ){ special_n -= 2; rect_pos = get_char() - '0';}
13028
13029
13030 if( (i != 10) || special_n ){
13031 warn_i_str(39,pos_text);
13032 *(pos_text = end_pos_body = pos_line =
13033 end_pos_text = pos_body) = '\0';
13034 }
13035 }
13036
13037
13038 } else if( (pos_dvi = !pos_dvi) == TRUE ){
13039 print_f(pos_body);
13040 min_pos_x = max_pos_x = base_pos_x = x_val;
13041 min_pos_y = max_pos_y = base_pos_y = y_val ;
13042 } else { U_CHAR *p;
13043 double dim=0.0;
13044 BOOL dim_on;
13045
13046 #line 1715 "./tex4ht-c.tex"
13047
13048 if( no_root_file ){ open_o_file(); }
13049
13050
13051 p = end_pos_body;
13052 while( *p ){
13053 dim_on = TRUE;
13054 switch( *p ){
13055
13056 #line 8430 "./tex4ht-c.tex"
13057
13058 case 'X': { dim = pos_x_A * (max_pos_x - base_pos_x) + pos_x_B;
13059 break; }
13060 case 'x': { dim = pos_x_A * (base_pos_x - min_pos_x) + pos_x_B;
13061 break; }
13062 case 'd': { dim = pos_x_A * (max_pos_x - min_pos_x) + pos_x_B;
13063 break; }
13064 case 'y': { dim = pos_y_C * (base_pos_y - min_pos_y - 1) + pos_y_D;
13065 break; }
13066 case 'Y': { dim = pos_y_C * (max_pos_y - base_pos_y) + pos_y_D;
13067 break; }
13068 case 'D': { dim = pos_y_C * (max_pos_y - min_pos_y) + pos_y_D;
13069 break; }
13070
13071
13072 default: { dim_on = FALSE; }
13073 }
13074 p++;
13075 if( dim_on ){ (IGNORED) fprintf(cur_o_file, p, dim); }
13076 else { (IGNORED) fprintf(cur_o_file, "%s", p); }
13077 while( * (p++) );
13078 }
13079 }
13080
13081 break; }
13082 case '~': {
13083 #line 6585 "./tex4ht-c.tex"
13084
13085 if( special_n ){
13086
13087 #line 6616 "./tex4ht-c.tex"
13088
13089 U_CHAR in_ch;
13090 if( (in_ch = get_char()) == '>' ) {
13091
13092 #line 6738 "./tex4ht-c.tex"
13093
13094 if( special_n == 1 ){
13095 special_n--;
13096 switch( get_char() ){
13097 case '[': { ignore_end_group++; break; }
13098 case ']': { ignore_end_group--; break; }
13099 default: {
13100 #line 17102 "./tex4ht-c.tex"
13101
13102 ;
13103
13104 }
13105 }
13106 } else {
13107 struct stack_end_entry *p;
13108 U_CHAR *q;
13109 int j;
13110 j = get_char() - '0' + stack_n - 1;
13111 if( --special_n ){
13112 if (j >= stack_len ) { j = stack_len - 1; }
13113 p = m_alloc(struct stack_end_entry,1);
13114 p->next = stack[ j ].end;
13115 stack[ j ].end = p;
13116 q = p->send = m_alloc(char,special_n+1);
13117 while( --special_n ) *q++ = get_char();
13118 *q = '\0';
13119 } }
13120
13121
13122 } else if( in_ch == '!' ) {
13123
13124 #line 7813 "./tex4ht-c.tex"
13125
13126 struct group_path *p, *t;
13127 U_CHAR *q, str[256];
13128 int n;
13129 p = m_alloc(struct group_path,1);
13130
13131 #line 7836 "./tex4ht-c.tex"
13132
13133 n = 0;
13134 while( --special_n ) {
13135 str[n] = get_char();
13136 if( ( str[n] != 'e') && (str[n] != 's') ){ break; }
13137 n++;
13138 }
13139 if((
13140 ( str[n] != '<') && (str[n] != '>') &&
13141 ( str[n] != '/') && (str[n] != '-')
13142 ) || (n==0) ){
13143 str[n+1] = '\0';
13144 err_i_str(38,str);
13145 }
13146 p->action = str[n]; str[n] = '\0';
13147 p->path = m_alloc(char,n+1);
13148 (IGNORED) strcpy((char *) p->path, (char *) str);
13149
13150
13151
13152 #line 7855 "./tex4ht-c.tex"
13153
13154 q = p->info = m_alloc(char,special_n+1);
13155 while( --special_n ) *q++ = get_char();
13156 *q = '\0';
13157
13158
13159 n = stack_n - 1;
13160 if( p->action == '>' ){
13161 p->next = stack[ n ].path_end;
13162 stack[ n ].path_end = p;
13163 } else {
13164 p->next = (struct group_path *) 0;
13165 if( stack[n].path_start == (struct group_path *) 0 ) {
13166 stack[n].path_start = p;
13167 } else {
13168 t = stack[n].path_start;
13169 while( t->next != (struct group_path *) 0 ) { t = t->next; }
13170 t->next = p;
13171 } }
13172
13173
13174 } else {
13175 if( !group_dvi ){ warn_i(42); }
13176 (IGNORED) fseek(dvi_file, (long) --special_n,
13177
13178 #line 2177 "./tex4ht-c.tex"
13179
13180 1
13181 );
13182 special_n = 0;
13183 }
13184
13185
13186 } else if( (group_dvi = !group_dvi) == TRUE ){
13187 long curr_pos;
13188 int ch, sv_stack_n;
13189
13190 #line 7118 "./tex4ht-c.tex"
13191
13192 int cr_fnt;
13193
13194
13195 #line 7478 "./tex4ht-c.tex"
13196
13197 BOOL ch_token;
13198 int id_hide;
13199
13200
13201
13202 #line 7122 "./tex4ht-c.tex"
13203
13204 cr_fnt = cur_fnt;
13205
13206
13207 #line 7483 "./tex4ht-c.tex"
13208
13209 sv_id = 0;
13210 #line 7474 "./tex4ht-c.tex"
13211
13212 ch_id = 0;
13213
13214
13215 id_hide = 0; ch_token = TRUE;
13216 while( del_stack != (struct del_stack_entry*) 0 ){
13217 struct del_stack_entry* p;
13218 del_stack = (p = del_stack)->next;
13219 free((void *) p );
13220 }
13221
13222 stack_id = 0;
13223 curr_pos = ftell(dvi_file); sv_stack_n = stack_n;
13224
13225 #line 6993 "./tex4ht-c.tex"
13226
13227 while( group_dvi ){
13228
13229 #line 7130 "./tex4ht-c.tex"
13230
13231 if( (ch = get_char()) >= 128 ) {
13232 switch( ch ){
13233
13234 #line 7146 "./tex4ht-c.tex"
13235
13236 case 128: case 129: case 130: case 131: case 133:
13237 case 134: case 135: case 136: {
13238 ch = (int) get_unt( (ch-(ch>132)) % 4 +1);
13239
13240 #line 7358 "./tex4ht-c.tex"
13241
13242 ch_id++;
13243 if(!back_id_off ){
13244 if( !id_hide ){ ch_token = TRUE; sv_id = ch_id; }
13245 switch( math_class_of( ch, cr_fnt ) ){
13246 case
13247 #line 7377 "./tex4ht-c.tex"
13248
13249 4
13250
13251 : { del_stack = push_del( (char) ch, cr_fnt);
13252 break; }
13253 case
13254 #line 7373 "./tex4ht-c.tex"
13255
13256 5
13257
13258 : {
13259 del_stack = pop_del( (char) ch, id_hide, cr_fnt); break; }
13260 default:{ ; }
13261 } }
13262
13263
13264 break;
13265 }
13266
13267
13268
13269 #line 7084 "./tex4ht-c.tex"
13270
13271 case
13272 #line 17469 "./tex4ht-c.tex"
13273
13274 246
13275 : (void) get_char();
13276 case
13277 #line 17466 "./tex4ht-c.tex"
13278
13279 245
13280 : (void) get_char();
13281 case
13282 #line 17463 "./tex4ht-c.tex"
13283
13284 244
13285 : (void) get_char();
13286 case
13287 #line 17460 "./tex4ht-c.tex"
13288
13289 243
13290 : { int i;
13291 for( i=14; i; i-- ){ ch = get_char(); }
13292 i = ch + get_char();
13293 (IGNORED) fseek(dvi_file, (long) i,
13294 #line 2177 "./tex4ht-c.tex"
13295
13296 1
13297 );
13298 break; }
13299
13300
13301
13302 #line 7155 "./tex4ht-c.tex"
13303
13304 case
13305 #line 17318 "./tex4ht-c.tex"
13306
13307 132
13308 :
13309 case
13310 #line 17323 "./tex4ht-c.tex"
13311
13312 137
13313 :{
13314 (IGNORED) fseek(dvi_file, 8L,
13315 #line 2177 "./tex4ht-c.tex"
13316
13317 1
13318 );
13319 break;
13320 }
13321
13322
13323 #line 7163 "./tex4ht-c.tex"
13324
13325 case
13326 #line 17329 "./tex4ht-c.tex"
13327
13328 139
13329 : {
13330 (IGNORED) fseek(dvi_file, 44L,
13331 #line 2177 "./tex4ht-c.tex"
13332
13333 1
13334 ); break; }
13335
13336
13337 #line 7168 "./tex4ht-c.tex"
13338
13339 case
13340 #line 17341 "./tex4ht-c.tex"
13341
13342 143
13343 : case
13344 #line 17344 "./tex4ht-c.tex"
13345
13346 144
13347 :
13348 case
13349 #line 17347 "./tex4ht-c.tex"
13350
13351 145
13352 : case
13353 #line 17350 "./tex4ht-c.tex"
13354
13355 146
13356 : {
13357 (IGNORED) (get_int( ch -
13358 #line 17341 "./tex4ht-c.tex"
13359
13360 143
13361 + 1 )); break; }
13362 case
13363 #line 17356 "./tex4ht-c.tex"
13364
13365 148
13366 :
13367 case
13368 #line 17359 "./tex4ht-c.tex"
13369
13370 149
13371 :
13372 case
13373 #line 17362 "./tex4ht-c.tex"
13374
13375 150
13376 :
13377 case
13378 #line 17365 "./tex4ht-c.tex"
13379
13380 151
13381 : {
13382 (IGNORED) (get_int( ch -
13383 #line 17356 "./tex4ht-c.tex"
13384
13385 148
13386 + 1));
13387 break; }
13388 case
13389 #line 17371 "./tex4ht-c.tex"
13390
13391 153
13392 :
13393 case
13394 #line 17374 "./tex4ht-c.tex"
13395
13396 154
13397 :
13398 case
13399 #line 17377 "./tex4ht-c.tex"
13400
13401 155
13402 :
13403 case
13404 #line 17380 "./tex4ht-c.tex"
13405
13406 156
13407 : {
13408 (IGNORED) (get_int( ch -
13409 #line 17371 "./tex4ht-c.tex"
13410
13411 153
13412 + 1));
13413 break; }
13414 case
13415 #line 17383 "./tex4ht-c.tex"
13416
13417 157
13418 : case
13419 #line 17386 "./tex4ht-c.tex"
13420
13421 158
13422 :
13423 case
13424 #line 17389 "./tex4ht-c.tex"
13425
13426 159
13427 : case
13428 #line 17392 "./tex4ht-c.tex"
13429
13430 160
13431 : {
13432 (IGNORED) (get_int( ch -
13433 #line 17383 "./tex4ht-c.tex"
13434
13435 157
13436 + 1));
13437 break; }
13438 case
13439 #line 17398 "./tex4ht-c.tex"
13440
13441 162
13442 :
13443 case
13444 #line 17401 "./tex4ht-c.tex"
13445
13446 163
13447 :
13448 case
13449 #line 17404 "./tex4ht-c.tex"
13450
13451 164
13452 :
13453 case
13454 #line 17407 "./tex4ht-c.tex"
13455
13456 165
13457 : {
13458 (IGNORED) (get_int( ch -
13459 #line 17398 "./tex4ht-c.tex"
13460
13461 162
13462 + 1));
13463 break; }
13464 case
13465 #line 17413 "./tex4ht-c.tex"
13466
13467 167
13468 :
13469 case
13470 #line 17416 "./tex4ht-c.tex"
13471
13472 168
13473 :
13474 case
13475 #line 17419 "./tex4ht-c.tex"
13476
13477 169
13478 :
13479 case
13480 #line 17422 "./tex4ht-c.tex"
13481
13482 170
13483 : {
13484 (IGNORED) (get_int( ch -
13485 #line 17413 "./tex4ht-c.tex"
13486
13487 167
13488 + 1));
13489 break; }
13490
13491
13492 #line 7204 "./tex4ht-c.tex"
13493
13494 case
13495 #line 17353 "./tex4ht-c.tex"
13496
13497 147
13498 :
13499 case
13500 #line 17368 "./tex4ht-c.tex"
13501
13502 152
13503 :
13504 case
13505 #line 17395 "./tex4ht-c.tex"
13506
13507 161
13508 :
13509 case
13510 #line 17410 "./tex4ht-c.tex"
13511
13512 166
13513 :
13514 { break; }
13515
13516
13517
13518 #line 6875 "./tex4ht-c.tex"
13519
13520 case
13521 #line 17335 "./tex4ht-c.tex"
13522
13523 141
13524 : {
13525
13526 #line 6895 "./tex4ht-c.tex"
13527
13528 { struct group_info *p, *last;
13529 if( (last = p = stack[ stack_n ].begin) != (struct group_info *)0 )
13530 if( p->stack_id == -1 ){
13531
13532 #line 6905 "./tex4ht-c.tex"
13533
13534 while( p ){
13535 if( p->stack_id != -1 ){ break; }
13536 p->stack_id = stack_id;
13537 last = p;
13538 p = p->next;
13539 }
13540
13541
13542
13543 #line 6915 "./tex4ht-c.tex"
13544
13545 while ( stack[ stack_n ].begin != last ){
13546 p = (stack[ stack_n ].begin) -> next;
13547 (stack[ stack_n ].begin) -> next = last->next;
13548 last->next = stack[ stack_n ].begin;
13549 stack[ stack_n ].begin = p;
13550 }
13551
13552
13553 }
13554 }
13555
13556
13557 stack[stack_n].stack_id = stack_id++;
13558
13559 #line 7343 "./tex4ht-c.tex"
13560
13561 if( !back_id_off )
13562 { struct del_stack_entry *p;
13563 p = m_alloc(struct del_stack_entry,1);
13564 p->next = del_stack;
13565 p->id = p->fnt = -1;
13566 del_stack = p;
13567 }
13568
13569 stack_n++;
13570 if( stack_n >
13571 #line 6688 "./tex4ht-c.tex"
13572
13573 ((int) stack_len + 2)
13574
13575 ){ warn_i(40); }
13576 break;
13577 }
13578 case
13579 #line 17338 "./tex4ht-c.tex"
13580
13581 142
13582 : {
13583 stack_n--;
13584 #line 7329 "./tex4ht-c.tex"
13585
13586 if( !back_id_off ){
13587 if( !id_hide ){ ch_token = FALSE;
13588 sv_id = stack[stack_n].stack_id; }
13589 while( del_stack != (struct del_stack_entry*) 0 ){
13590 struct del_stack_entry* p;
13591 int id;
13592 del_stack = (p = del_stack)->next;
13593 id = p->id;
13594 free((void *) p );
13595 if( id == -1 ) break;
13596 } }
13597
13598
13599 stack[stack_n].stack_id = -1;
13600 break;
13601 }
13602
13603
13604
13605 #line 7006 "./tex4ht-c.tex"
13606
13607 case
13608 #line 17450 "./tex4ht-c.tex"
13609
13610 239
13611 : case
13612 #line 17452 "./tex4ht-c.tex"
13613
13614 240
13615 :
13616 case
13617 #line 17454 "./tex4ht-c.tex"
13618
13619 241
13620 : case
13621 #line 17456 "./tex4ht-c.tex"
13622
13623 242
13624 : { long int i;
13625 if( tex4ht_special( &ch, &i ) ){
13626 if( ch == '~' ){
13627
13628 #line 7033 "./tex4ht-c.tex"
13629
13630 if( i==0 ){
13631 group_dvi = FALSE ;
13632 }else{
13633 switch( get_char() ){
13634 case '<': {
13635 if( i-- ){ U_CHAR ch;
13636 if( (ch = get_char()) == '*' )
13637 {
13638 #line 7558 "./tex4ht-c.tex"
13639
13640 struct send_back_entry *p, *q, *t=0;
13641 if( back_id_off ){
13642 while( i-- ){ (IGNORED) get_char(); }
13643 } else {
13644 p = m_alloc(struct send_back_entry,1);
13645 p->send = get_str( (int)( i - 1 ));
13646 if( ch_token ){
13647
13648 #line 7599 "./tex4ht-c.tex"
13649
13650 p->id = sv_id;
13651 if( sv_id > back_token->id ){
13652 p->next = back_token; back_token = p;
13653 } else {
13654 q = back_token;
13655 while( sv_id <= q->id ){ t = q; q = q->next; }
13656 p->next = t->next; t->next = p;
13657 }
13658
13659
13660 } else {
13661 p->id = (sv_id<0? 0 : sv_id) + push_id;
13662 if( back_group->id < p->id )
13663 { p->next = back_group; back_group = p; }
13664 else
13665 { q = back_group;
13666 while( q->id >= p->id ) { t = q; q = q->next; }
13667 p->next = t->next; t->next = p;
13668 }
13669 }
13670 }
13671
13672 }
13673 else if( (ch == '[') && (i==1) ){
13674 i--;
13675 #line 7497 "./tex4ht-c.tex"
13676
13677 id_hide++;
13678
13679
13680 }
13681 else if( (ch == ']') && (i==1) ){
13682 i--;
13683 #line 7502 "./tex4ht-c.tex"
13684
13685 id_hide--;
13686
13687
13688 }
13689 else if( (ch == '-') && (i==1) ){
13690 i--;
13691 #line 7506 "./tex4ht-c.tex"
13692
13693 id_latex++;
13694
13695
13696 }
13697 else if( (ch == '+') && (i==1) ){
13698 i--;
13699 #line 7511 "./tex4ht-c.tex"
13700
13701 id_latex--;
13702
13703
13704 }
13705 else if( (ch == '(') && (i==1) ){
13706 i--;
13707 #line 7517 "./tex4ht-c.tex"
13708
13709 back_id_off++;
13710
13711
13712 }
13713 else if( (ch == ')') && (i==1) ){
13714 i--;
13715 #line 7522 "./tex4ht-c.tex"
13716
13717 back_id_off--;
13718
13719
13720 }
13721 else {
13722 #line 6850 "./tex4ht-c.tex"
13723
13724 struct group_info *p;
13725 U_CHAR *q;
13726 int j;
13727 j = ch - '0' + stack_n - 1;
13728 if (j >= stack_len ) { j = stack_len - 1; }
13729 p = m_alloc(struct group_info,1);
13730 p->next = stack[ j ].begin; stack[ j ].begin = p;
13731 p->stack_id = stack[ j ].stack_id;
13732 q = p->info = m_alloc(char,i+1);
13733 while( --i ) *q++ = get_char();
13734 *q = '\0';
13735
13736 }
13737 }
13738 break; }
13739 default: { (IGNORED) fseek(dvi_file, (long) --i,
13740
13741 #line 2177 "./tex4ht-c.tex"
13742
13743 1
13744 ); break; }
13745 } }
13746
13747
13748 } else {
13749 (IGNORED) fseek(dvi_file, (long) i,
13750 #line 2177 "./tex4ht-c.tex"
13751
13752 1
13753 );
13754 }
13755 }else{
13756 #line 7020 "./tex4ht-c.tex"
13757
13758 U_CHAR *ch;
13759 ch = special_hd + 4;
13760 while( *ch ){ ch++; }
13761 (IGNORED) fseek(dvi_file, (long) i,
13762 #line 2177 "./tex4ht-c.tex"
13763
13764 1
13765 );
13766
13767 }
13768 break;
13769 }
13770
13771
13772
13773 #line 7097 "./tex4ht-c.tex"
13774
13775 case
13776 #line 17438 "./tex4ht-c.tex"
13777
13778 235
13779 :
13780 case
13781 #line 17441 "./tex4ht-c.tex"
13782
13783 236
13784 :
13785 case
13786 #line 17444 "./tex4ht-c.tex"
13787
13788 237
13789 :
13790 case
13791 #line 17447 "./tex4ht-c.tex"
13792
13793 238
13794 : {
13795 INTEGER n;
13796 n = ch -
13797 #line 17438 "./tex4ht-c.tex"
13798
13799 235
13800 + 1;
13801 cr_fnt = (int) ((n==4)? get_int(4) : get_unt((int) n));
13802 cr_fnt = search_font_tbl( cr_fnt );
13803 break; }
13804 default: {
13805 if( (ch <
13806 #line 17426 "./tex4ht-c.tex"
13807
13808 171
13809 ) || (ch >
13810 #line 17432 "./tex4ht-c.tex"
13811
13812 234
13813 ) ) {
13814 if( ch ==
13815 #line 17332 "./tex4ht-c.tex"
13816
13817 140
13818 ) { warn_i(46); }
13819 else { warn_i_int(45,ch); }
13820 } else { cr_fnt = ch -
13821 #line 17426 "./tex4ht-c.tex"
13822
13823 171
13824 ;
13825 cr_fnt = search_font_tbl( cr_fnt );
13826 }
13827 break;
13828 }
13829
13830
13831 }
13832 } else {
13833 #line 7358 "./tex4ht-c.tex"
13834
13835 ch_id++;
13836 if(!back_id_off ){
13837 if( !id_hide ){ ch_token = TRUE; sv_id = ch_id; }
13838 switch( math_class_of( ch, cr_fnt ) ){
13839 case
13840 #line 7377 "./tex4ht-c.tex"
13841
13842 4
13843
13844 : { del_stack = push_del( (char) ch, cr_fnt);
13845 break; }
13846 case
13847 #line 7373 "./tex4ht-c.tex"
13848
13849 5
13850
13851 : {
13852 del_stack = pop_del( (char) ch, id_hide, cr_fnt); break; }
13853 default:{ ; }
13854 } }
13855
13856 }
13857
13858
13859 }
13860
13861
13862
13863 #line 6958 "./tex4ht-c.tex"
13864
13865 { struct group_info *first, *second, *temp;
13866 int i;
13867 for(i = stack_len; i >= 0; i--){
13868 first = stack[i].begin;
13869 if( first ) {
13870 second = first->next;
13871 while( second ){
13872 temp = second->next;
13873 second->next = first;
13874 first = second;
13875 second = temp;
13876 }
13877 (stack[i].begin)->next = (struct group_info *) 0;
13878 stack[i].begin = first;
13879 } } }
13880
13881
13882 #line 7614 "./tex4ht-c.tex"
13883
13884 back_group = rev_list( back_group );
13885 back_token = rev_list( back_token );
13886 back_token = back_insert ( back_token, 0);
13887
13888 #line 7474 "./tex4ht-c.tex"
13889
13890 ch_id = 0;
13891
13892
13893
13894
13895 (IGNORED) fseek(dvi_file, curr_pos,
13896 #line 2174 "./tex4ht-c.tex"
13897
13898 0
13899 );
13900 group_dvi = TRUE; stack_n = sv_stack_n; stack_id = 0;
13901 } else {
13902 #line 6817 "./tex4ht-c.tex"
13903
13904 { int stack_n;
13905 for( stack_n=
13906 #line 6688 "./tex4ht-c.tex"
13907
13908 ((int) stack_len + 2)
13909
13910 ;
13911 stack_n>0; stack_n--){
13912 group_dvi = TRUE;
13913 #line 6796 "./tex4ht-c.tex"
13914
13915 while( stack[stack_n-1].end ){
13916
13917 #line 6774 "./tex4ht-c.tex"
13918
13919 struct stack_end_entry *q, *p, *t;
13920 q = stack[ stack_n-1 ].end;
13921 p = stack[ stack_n-1 ].end = (struct stack_end_entry *) 0;
13922 while( q ){
13923 t = q->next; q->next = p; p = q; q = t;
13924 }
13925 while( p ){
13926 if( ! ignore_end_group ){ print_f( p->send ); }
13927 free((void *) p->send );
13928 q = p; p = p->next; free((void *) q );
13929 }
13930
13931
13932 }
13933
13934
13935 group_dvi =FALSE;
13936
13937 #line 6828 "./tex4ht-c.tex"
13938
13939 while( stack[stack_n-1].begin ){
13940 struct group_info *p;
13941 warn_i_str(44, stack[stack_n-1].begin->info);
13942 p = stack[stack_n-1].begin;
13943 stack[stack_n-1].begin = p->next;
13944 free((void *) p );
13945 }
13946 stack[stack_n-1].stack_id = -1;
13947
13948
13949 } }
13950
13951 }
13952
13953 break; }
13954 case '.': {
13955 #line 1759 "./tex4ht-c.tex"
13956
13957 if( no_root_file ){
13958 U_CHAR *name;
13959 name = m_alloc(char, 256);
13960 (IGNORED) strcpy((char *) name, (char *) no_root_file );
13961 free((void *) no_root_file);
13962 no_root_file = name;
13963 name += (size_t) strlen((char *) name); while( *(--name) != '.' ); name++;
13964 while( special_n-- ){
13965 if( (no_root_file+253) == name ) name--;
13966 *name++ = get_char();
13967 }
13968 *name = '\0';
13969 } else {
13970 U_CHAR str[256], *p;
13971 p = str; while( special_n-- ){ *p++ = get_char(); } *p = '\0';
13972 warn_i_str(43,str);
13973 }
13974
13975 break; }
13976 case '^': {
13977 #line 12532 "./tex4ht-c.tex"
13978
13979 switch( special_n ){
13980 case 0:{ if( math_class_on ){
13981 open_del = 256; pause_class = ignore_subclass_del = 0;
13982 math_class_on = FALSE;
13983 #line 12579 "./tex4ht-c.tex"
13984
13985 group_dvi = sv_group_dvi;
13986 trace_dvi_C = sv_trace_dvi_C;
13987 in_trace_char = sv_in_trace_char;
13988 span_on = sv_span_on;
13989 in_span_ch = sv_in_span_ch;
13990
13991
13992 } else { show_class = !show_class; }
13993 break;
13994 }
13995 case 1:{
13996 #line 12570 "./tex4ht-c.tex"
13997
13998 sv_group_dvi = group_dvi;
13999 sv_trace_dvi_C = trace_dvi_C;
14000 sv_in_trace_char = in_trace_char;
14001 sv_span_on = span_on;
14002 sv_in_span_ch = in_span_ch;
14003
14004
14005 special_n--;
14006 if( (math_class = scan_class(1)) ==
14007 #line 12723 "./tex4ht-c.tex"
14008
14009 79
14010
14011 )
14012 { math_class = 0; }
14013 else math_class_on = TRUE;
14014 break;
14015 }
14016 case 2:{
14017 #line 12805 "./tex4ht-c.tex"
14018
14019 special_n -= 2; math_class = scan_class(0);
14020 stack[stack_n+1].ignore_subclass_del =
14021 (
14022 #line 12730 "./tex4ht-c.tex"
14023
14024 ')'
14025
14026 == get_char());
14027 stack[stack_n+1].active_class_del = TRUE;
14028 stack[stack_n+1].temp_class_del = FALSE;
14029 stack[stack_n+1].no_left_del = TRUE;
14030 stack[stack_n+1].class_open = open_class[math_class];
14031 stack[stack_n+1].class_close = close_class[math_class];
14032
14033
14034 break; }
14035 default:{
14036 #line 12661 "./tex4ht-c.tex"
14037
14038 { U_CHAR str[256], *p, ch, **q;
14039 math_class = scan_class(2); ch = get_char();
14040 special_n -= 2; p = str;
14041 while( special_n-- > 0 ){
14042 if( (*(p++) = get_char()) == ch ){ p--; break; }
14043 }
14044 *p = '\0';
14045 q = (math_class >
14046 #line 12719 "./tex4ht-c.tex"
14047
14048 78
14049
14050 )? &(
14051 #line 12837 "./tex4ht-c.tex"
14052
14053 stack[stack_n+1].temp_class_open
14054
14055 )
14056 : &(open_class[math_class]);
14057 *q = (char *) r_alloc((void *) open_class[math_class],
14058 1 + (size_t) strlen((char *) str));
14059 (IGNORED) strcpy((char *) *q, (char *) str);
14060 q = (math_class >
14061 #line 12719 "./tex4ht-c.tex"
14062
14063 78
14064
14065 ) ? &(
14066 #line 12833 "./tex4ht-c.tex"
14067
14068 stack[stack_n+1].temp_class_close
14069
14070 )
14071 : &(close_class[math_class]);
14072 p = *q = (char *) r_alloc((void *) *q, 1 + (size_t) special_n);
14073 while( special_n-- > 0 ){ *(p++) = get_char(); }
14074 *p = '\0';
14075 if( math_class >
14076 #line 12719 "./tex4ht-c.tex"
14077
14078 78
14079
14080 ){
14081 #line 12824 "./tex4ht-c.tex"
14082
14083 stack[stack_n+1].ignore_subclass_del =
14084 (math_class ==
14085 #line 12738 "./tex4ht-c.tex"
14086
14087 (
14088 #line 12723 "./tex4ht-c.tex"
14089
14090 79
14091
14092 + 1)
14093
14094 );
14095 stack[stack_n+1].temp_class_del = TRUE;
14096 stack[stack_n+1].active_class_del = TRUE;
14097
14098 }
14099 }
14100
14101 }
14102 }
14103
14104 break; }
14105 }
14106
14107 special_on = FALSE;
14108
14109 #line 17082 "./tex4ht-c.tex"
14110
14111 if( special_n > 0 ){
14112 warn_i_int( 26, sv);
14113 while( special_n-- ) (IGNORED) putc( get_char(), stderr);
14114 }
14115
14116
14117 } else {
14118 #line 3875 "./tex4ht-c.tex"
14119
14120 while( special_n-- ) (void) get_char();
14121
14122 }
14123
14124 break; }
14125
14126
14127 #line 7223 "./tex4ht-c.tex"
14128
14129 case
14130 #line 17335 "./tex4ht-c.tex"
14131
14132 141
14133 : {
14134 #line 7231 "./tex4ht-c.tex"
14135
14136
14137 #line 6418 "./tex4ht-c.tex"
14138
14139 if( new_halign ){
14140
14141 #line 6385 "./tex4ht-c.tex"
14142
14143 stack[stack_n].halign_on = new_halign;
14144 if( stack[stack_n].halign_info )
14145 { int j;
14146 for( j=8; j--; ){
14147 if( stack[stack_n].halign[j] != halign[j] ){
14148 if( ! (--(stack[stack_n].halign[j]->refs) ) ){
14149 free((void *) stack[stack_n].halign[j]->str );
14150 free((void *) stack[stack_n].halign[j] );
14151 }
14152 stack[stack_n].halign[j] = halign[j];
14153 (halign[j]->refs)++;
14154 }
14155 }
14156 } else { int j;
14157 stack[stack_n].halign_info = TRUE;
14158 for( j=8; j--; ){
14159 stack[stack_n].halign[j] = halign[j];
14160 (halign[j]->refs)++;
14161 } }
14162 print_f( stack[stack_n].halign[0]->str );
14163 stack[stack_n].row_no = 0;
14164 new_halign = FALSE;
14165
14166
14167 }
14168 if( stack[stack_n].halign_on )
14169 {
14170 print_f( stack[stack_n].halign[2]->str );
14171 if( stack[stack_n].halign_on > TRUE ){
14172 stack[stack_n].row_no++;
14173 stack[stack_n].col_no = 0;
14174 (IGNORED) fprintf(cur_o_file, "%d%s",
14175 stack[stack_n].row_no, stack[stack_n].halign[6]->str );
14176 } }
14177 if( stack_n ){
14178 if( stack[stack_n-1].halign_on )
14179 {
14180 print_f( stack[stack_n-1].halign[4]->str );
14181 if( stack[stack_n-1].halign_on > TRUE ){
14182 stack[stack_n-1].col_no ++;
14183 (IGNORED) fprintf(cur_o_file, "%d%s",
14184 stack[stack_n-1].col_no, stack[stack_n-1].halign[7]->str );
14185 }
14186 } }
14187
14188
14189
14190 #line 6926 "./tex4ht-c.tex"
14191
14192 { struct group_info *p;
14193 if( group_dvi &&
14194 ( (p = stack[stack_n].begin ) != (struct group_info *)0)
14195 ){
14196 while( p ){
14197 if( p->stack_id != stack_id ) break;
14198 print_f(p->info);
14199 stack[stack_n].begin = p->next;
14200 free((void *) p );
14201 p = stack[stack_n].begin;
14202 }
14203 }
14204 stack_id++;
14205 }
14206
14207
14208 stack[stack_n].text_on = text_on;
14209 push_stack();
14210 #line 7651 "./tex4ht-c.tex"
14211
14212 if( group_dvi ) {
14213 back_group = back_insert ( back_group, push_id);
14214 }
14215
14216
14217
14218 #line 7865 "./tex4ht-c.tex"
14219
14220 {
14221
14222 #line 7885 "./tex4ht-c.tex"
14223
14224 struct group_path *start_head, *start_tail,
14225 *parent_start_head, *parent_start_tail,
14226 *end_head, *end_tail,
14227 *parent_end_head, *parent_end_tail,
14228 *p, *q;
14229 int place=0;
14230 start_head = start_tail = parent_start_head = parent_start_tail
14231 = end_head = end_tail = parent_end_head
14232 = parent_end_tail = (struct group_path *) 0;
14233
14234
14235 if(
14236 #line 3743 "./tex4ht-c.tex"
14237
14238 rule_ch_off
14239
14240 ){
14241
14242 #line 3276 "./tex4ht-c.tex"
14243
14244 ignore_spaces--;
14245
14246
14247
14248 #line 3743 "./tex4ht-c.tex"
14249
14250 rule_ch_off
14251
14252 = FALSE;
14253 }
14254 if( stack_n > 1 ){
14255 p = stack[stack_n - 2].path_start;
14256 if( p != (struct group_path *) 0 ){
14257
14258 #line 7906 "./tex4ht-c.tex"
14259
14260 while( p != (struct group_path *) 0 ){
14261
14262 #line 8011 "./tex4ht-c.tex"
14263
14264 if( *(p->path ) == 'e' ) {
14265 (IGNORED) strcpy((char *) p->path, (char *) p->path+1);
14266 if( *(p->path) == '\0' ) {
14267 switch( p->action ){
14268 case '<': print_f( p->info );
14269 place =
14270 #line 7982 "./tex4ht-c.tex"
14271
14272 4
14273 ;
14274 break;
14275 case '/': ignore_chs++;
14276 place =
14277 #line 7976 "./tex4ht-c.tex"
14278
14279 2
14280 ; break;
14281 case '-':
14282 #line 3743 "./tex4ht-c.tex"
14283
14284 rule_ch_off
14285
14286 = TRUE;
14287
14288 #line 3272 "./tex4ht-c.tex"
14289
14290 ignore_spaces++;
14291
14292
14293 place =
14294 #line 7982 "./tex4ht-c.tex"
14295
14296 4
14297 ; break;
14298 }
14299 } else {
14300 place =
14301 #line 7976 "./tex4ht-c.tex"
14302
14303 2
14304 ;
14305 }
14306 } else {
14307 if( *(p->path ) == 's' ) {
14308 (IGNORED) strcpy((char *) p->path, (char *) p->path+1);
14309 }
14310 place =
14311 #line 7970 "./tex4ht-c.tex"
14312
14313 0
14314 ;
14315 }
14316
14317
14318 q = p;
14319 p = p->next;
14320 q->next = (struct group_path *) 0;
14321
14322 #line 7926 "./tex4ht-c.tex"
14323
14324 switch( place ){
14325 case
14326 #line 7970 "./tex4ht-c.tex"
14327
14328 0
14329 :
14330 if( parent_start_head == (struct group_path *) 0 ){
14331 parent_start_head = parent_start_tail = q;
14332 } else {
14333 parent_start_tail = parent_start_tail->next = q;
14334 }
14335 break;
14336 case
14337 #line 7976 "./tex4ht-c.tex"
14338
14339 2
14340 :
14341 if( start_head == (struct group_path *) 0 ){
14342 start_head = start_tail = q;
14343 } else {
14344 start_tail = start_tail->next = q;
14345 }
14346 break;
14347 case
14348 #line 7982 "./tex4ht-c.tex"
14349
14350 4
14351 :
14352
14353 #line 7985 "./tex4ht-c.tex"
14354
14355 free((void *) q->path );
14356 free((void *) q->info );
14357 free((void *) q );
14358
14359
14360 break;
14361 }
14362
14363
14364 }
14365
14366
14367 }
14368 p = stack[stack_n - 2].path_end;
14369 if( p != (struct group_path *) 0 ){
14370
14371 #line 7916 "./tex4ht-c.tex"
14372
14373 while( p != (struct group_path *) 0 ){
14374
14375 #line 8047 "./tex4ht-c.tex"
14376
14377 if( *(p->path ) == 'e' ) {
14378 (IGNORED) strcpy((char *) p->path, (char *) p->path+1);
14379 place =
14380 #line 7979 "./tex4ht-c.tex"
14381
14382 3
14383 ;
14384 } else {
14385 if( *(p->path ) == 's' ) {
14386 (IGNORED) strcpy((char *) p->path, (char *) p->path+1);
14387 }
14388 place =
14389 #line 7973 "./tex4ht-c.tex"
14390
14391 1
14392 ;
14393 }
14394
14395
14396 q = p;
14397 p = p->next;
14398 q->next = (struct group_path *) 0;
14399
14400 #line 7948 "./tex4ht-c.tex"
14401
14402 switch( place ){
14403 case
14404 #line 7973 "./tex4ht-c.tex"
14405
14406 1
14407 :
14408 if( parent_end_head == (struct group_path *) 0 ){
14409 parent_end_head = parent_end_tail = q;
14410 } else {
14411 parent_end_tail = parent_end_tail->next = q;
14412 }
14413 break;
14414 case
14415 #line 7979 "./tex4ht-c.tex"
14416
14417 3
14418 :
14419 if( end_head == (struct group_path *) 0 ){
14420 end_head = end_tail = q;
14421 } else {
14422 end_tail = end_tail->next = q;
14423 }
14424 break;
14425 case
14426 #line 7982 "./tex4ht-c.tex"
14427
14428 4
14429 :
14430
14431 #line 7985 "./tex4ht-c.tex"
14432
14433 free((void *) q->path );
14434 free((void *) q->info );
14435 free((void *) q );
14436
14437
14438 break;
14439 }
14440
14441
14442 }
14443
14444
14445 }
14446
14447 #line 7897 "./tex4ht-c.tex"
14448
14449 stack[stack_n - 1].path_start = start_head;
14450 stack[stack_n - 1].path_end = end_head;
14451 stack[stack_n - 2].path_start = parent_start_head;
14452 stack[stack_n - 2].path_end = parent_end_head;
14453
14454
14455 } }
14456
14457
14458
14459 #line 2871 "./tex4ht-c.tex"
14460
14461 if( push_depth<256 ) { push_st[push_depth] = push_id++; }
14462 if( trace_dvi_P && !ch_map_flag ){
14463
14464 #line 1715 "./tex4ht-c.tex"
14465
14466 if( no_root_file ){ open_o_file(); }
14467
14468
14469 if( *trace_dvi_del_P != '\0' ){
14470 (IGNORED) fprintf(cur_o_file, "%s%d %d",
14471 trace_dvi_del_P, push_depth,
14472 push_st[(push_depth<256)? push_depth:256]);
14473 }
14474 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_P);
14475 }
14476 push_depth++;
14477
14478
14479
14480 #line 12846 "./tex4ht-c.tex"
14481
14482 if( stack[stack_n].active_class_del ){
14483 if( show_class && !pause_class && !ignore_subclass_del ){
14484
14485 #line 12986 "./tex4ht-c.tex"
14486
14487 (IGNORED) print_f( (stack[stack_n].temp_class_del)?
14488 stack[stack_n].temp_class_open
14489 : stack[stack_n].class_open);
14490
14491
14492 }
14493 ignore_subclass_del = ignore_subclass_del
14494 + stack[stack_n].ignore_subclass_del;
14495 stack[stack_n+1].no_left_del= FALSE;
14496 }
14497
14498
14499
14500 break; }
14501 case
14502 #line 17338 "./tex4ht-c.tex"
14503
14504 142
14505 : {
14506 #line 7276 "./tex4ht-c.tex"
14507
14508
14509 #line 12858 "./tex4ht-c.tex"
14510
14511 if( stack[stack_n].active_class_del ){
14512 ignore_subclass_del = ignore_subclass_del
14513 - stack[stack_n].ignore_subclass_del;
14514 if( show_class && !pause_class && !ignore_subclass_del ){
14515
14516 #line 12973 "./tex4ht-c.tex"
14517
14518 (IGNORED) print_f( (stack[stack_n].temp_class_del)?
14519 stack[stack_n].temp_class_close
14520 : stack[stack_n].class_close);
14521
14522
14523 }
14524 stack[stack_n].active_class_del = FALSE;
14525 }
14526
14527
14528
14529 #line 8067 "./tex4ht-c.tex"
14530
14531 {
14532 struct group_path *p, *q;
14533 if( stack_n > 1 ){
14534 p = stack[stack_n - 1].path_start;
14535 if( p != (struct group_path *) 0 ){
14536
14537 #line 8082 "./tex4ht-c.tex"
14538
14539 while( p != (struct group_path *) 0 ){
14540
14541 #line 8108 "./tex4ht-c.tex"
14542
14543 if( *(p->path) != '\0' ) {
14544
14545 #line 8138 "./tex4ht-c.tex"
14546
14547 char str[256];
14548 (IGNORED) strcpy(str, "...."); *(str+3) = p->action;
14549 (IGNORED) strct(str,p->info); warn_i_str(38,str);
14550
14551
14552 } else {
14553 switch( p->action ){
14554 case '/': ignore_chs--; break;
14555 default: {
14556
14557 #line 8138 "./tex4ht-c.tex"
14558
14559 char str[256];
14560 (IGNORED) strcpy(str, "...."); *(str+3) = p->action;
14561 (IGNORED) strct(str,p->info); warn_i_str(38,str);
14562
14563
14564 break;
14565 } } }
14566
14567
14568 q = p;
14569 p = p->next;
14570
14571 #line 7985 "./tex4ht-c.tex"
14572
14573 free((void *) q->path );
14574 free((void *) q->info );
14575 free((void *) q );
14576
14577
14578 }
14579
14580
14581 }
14582 p = stack[stack_n - 1].path_end;
14583 if( p != (struct group_path *) 0 ){
14584
14585 #line 8091 "./tex4ht-c.tex"
14586
14587 while( p != (struct group_path *) 0 ){
14588
14589 #line 8124 "./tex4ht-c.tex"
14590
14591 if( *(p->path) != '\0' ) {
14592
14593 #line 8138 "./tex4ht-c.tex"
14594
14595 char str[256];
14596 (IGNORED) strcpy(str, "...."); *(str+3) = p->action;
14597 (IGNORED) strct(str,p->info); warn_i_str(38,str);
14598
14599
14600 } else {
14601 switch( p->action ){
14602 case '>': print_f( p->info ); break;
14603 default: {
14604
14605 #line 8138 "./tex4ht-c.tex"
14606
14607 char str[256];
14608 (IGNORED) strcpy(str, "...."); *(str+3) = p->action;
14609 (IGNORED) strct(str,p->info); warn_i_str(38,str);
14610
14611
14612 break;
14613 } } }
14614
14615
14616 q = p;
14617 p = p->next;
14618
14619 #line 7985 "./tex4ht-c.tex"
14620
14621 free((void *) q->path );
14622 free((void *) q->info );
14623 free((void *) q );
14624
14625
14626 }
14627
14628
14629 } } }
14630
14631
14632
14633 #line 6796 "./tex4ht-c.tex"
14634
14635 while( stack[stack_n-1].end ){
14636
14637 #line 6774 "./tex4ht-c.tex"
14638
14639 struct stack_end_entry *q, *p, *t;
14640 q = stack[ stack_n-1 ].end;
14641 p = stack[ stack_n-1 ].end = (struct stack_end_entry *) 0;
14642 while( q ){
14643 t = q->next; q->next = p; p = q; q = t;
14644 }
14645 while( p ){
14646 if( ! ignore_end_group ){ print_f( p->send ); }
14647 free((void *) p->send );
14648 q = p; p = p->next; free((void *) q );
14649 }
14650
14651
14652 }
14653
14654
14655
14656 #line 2887 "./tex4ht-c.tex"
14657
14658 push_depth--;
14659 if( trace_dvi_P && !ch_map_flag ){
14660
14661 #line 1715 "./tex4ht-c.tex"
14662
14663 if( no_root_file ){ open_o_file(); }
14664
14665
14666 if( *trace_dvi_del_p != '\0' ){
14667 (IGNORED) fprintf(cur_o_file, "%s%d %d",
14668 trace_dvi_del_p, push_depth,
14669 push_st[(push_depth<256)? push_depth:256]);
14670 }
14671 (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_p);
14672 }
14673
14674
14675
14676 #line 6447 "./tex4ht-c.tex"
14677
14678
14679 #line 6496 "./tex4ht-c.tex"
14680
14681 if( stack[stack_n].halign_on )
14682 {
14683 #line 6502 "./tex4ht-c.tex"
14684
14685 print_f( stack[stack_n].halign[1]->str );
14686 stack[stack_n].halign_on = FALSE;
14687
14688 }
14689
14690
14691
14692 #line 6509 "./tex4ht-c.tex"
14693
14694 if( stack_n ){
14695 if( stack[stack_n-1].halign_on )
14696 {
14697 print_f( stack[stack_n-1].halign[3]->str );
14698 } }
14699
14700
14701
14702 #line 6518 "./tex4ht-c.tex"
14703
14704 if( stack_n-1 ){
14705 if( stack[stack_n-2].halign_on )
14706 {
14707 print_f( stack[stack_n-2].halign[5]->str );
14708 } }
14709
14710
14711 if( stack[stack_n].halign_info )
14712 { int j;
14713 for( j=8; j--; ){
14714 if( ! (--(stack[stack_n].halign[j]->refs) ) ){
14715 free((void *) stack[stack_n].halign[j]->str );
14716 free((void *) stack[stack_n].halign[j] );
14717 } }
14718 stack[stack_n].halign_info = FALSE;
14719 }
14720
14721
14722 pop_stack();
14723 if( ((x_val+0.6*word_sp) < stack[stack_n].x_val) ) put_char(' ');
14724 text_on = stack[stack_n].text_on;
14725
14726 break; }
14727
14728
14729 }
14730 }
14731
14732
14733 }
14734
14735 #line 5286 "./tex4ht-c.tex"
14736
14737 if( ch_map_flag ){
14738 warn_i(27); init_ch_map(); }
14739
14740
14741 (IGNORED) printf("]%c",unread_pages % 10 == 0? '\n' : ' ');
14742 put_char('\n');
14743 } }
14744
14745
14746 put_char('\n');put_char('\n');
14747
14748 #line 4460 "./tex4ht-c.tex"
14749
14750 while( opened_files != (struct files_rec*) 0 )
14751 {
14752 (IGNORED) fclose( opened_files->file );
14753 opened_files = opened_files->next;
14754 }
14755
14756
14757 {
14758 #line 5782 "./tex4ht-c.tex"
14759
14760 INTEGER bop_addr;
14761
14762
14763 #line 5847 "./tex4ht-c.tex"
14764
14765 int stack_depth=0;
14766
14767
14768 #line 5904 "./tex4ht-c.tex"
14769
14770 char cur_font[6];
14771 BOOL visible_cnt=FALSE;
14772
14773
14774
14775 #line 5410 "./tex4ht-c.tex"
14776
14777 job_name[job_name_n-3] = '\0';
14778
14779 #line 5452 "./tex4ht-c.tex"
14780
14781 file_n = 14;
14782 (IGNORED) fseek(dvi_file, 0L,
14783 #line 2174 "./tex4ht-c.tex"
14784
14785 0
14786 );
14787 do{ ch = get_char();
14788 idv_char( ch );
14789 file_n++;
14790 }while( ch ==
14791 #line 17326 "./tex4ht-c.tex"
14792
14793 138
14794 );
14795
14796 #line 5466 "./tex4ht-c.tex"
14797
14798 ch = get_char();
14799 if( id_version != -1 ){ ch = id_version; }
14800 idv_char( ch );
14801
14802
14803 for( i=12; i ; i-- ){ idv_char( get_char() ); }
14804 i = get_char();
14805 idv_char( (int) i ); while( i-- ) idv_copy();
14806
14807
14808 page_n = 0;
14809
14810 #line 6102 "./tex4ht-c.tex"
14811
14812 x_val = 0; y_val = 0; stack_n = 0;
14813 idv_char(
14814 #line 17329 "./tex4ht-c.tex"
14815
14816 139
14817 );
14818 idv_int( page_n + 1 ); for( i=36; i--; ) idv_char( 0);
14819 idv_int( -1 ); bop_addr = file_n; file_n += 45;
14820 idv_char(
14821 #line 17335 "./tex4ht-c.tex"
14822
14823 141
14824 ); file_n++;
14825
14826
14827 while( dis_pages ){
14828 #line 5530 "./tex4ht-c.tex"
14829
14830 if( (ch = get_char()) < 128 ) { visible_cnt = TRUE; cond_idv_char( ch );}
14831 else switch( ch ){
14832 #line 5537 "./tex4ht-c.tex"
14833
14834 case 128: case 129: case 130: case 131: case 133:
14835 case 134: case 135: case 136: {
14836 visible_cnt = TRUE; cond_string( ch, (ch - (ch>132)) % 4 +1 );
14837 break;
14838 }
14839
14840
14841 #line 5548 "./tex4ht-c.tex"
14842
14843 case
14844 #line 17329 "./tex4ht-c.tex"
14845
14846 139
14847 : {
14848 x_val = 0; y_val = 0; stack_n = 0;
14849 (IGNORED) fseek(dvi_file, 44L,
14850 #line 2177 "./tex4ht-c.tex"
14851
14852 1
14853 ); break; }
14854 case
14855 #line 17332 "./tex4ht-c.tex"
14856
14857 140
14858 : { dis_pages--; }
14859 case
14860 #line 17326 "./tex4ht-c.tex"
14861
14862 138
14863 : { break; }
14864
14865
14866 #line 5557 "./tex4ht-c.tex"
14867
14868 case
14869 #line 17353 "./tex4ht-c.tex"
14870
14871 147
14872 : {
14873 cond_idv_char( ch ); x_val += dx_1; break; }
14874 case
14875 #line 17368 "./tex4ht-c.tex"
14876
14877 152
14878 : {
14879 cond_idv_char( ch ); x_val += dx_2; break; }
14880 case
14881 #line 17395 "./tex4ht-c.tex"
14882
14883 161
14884 : {
14885 cond_idv_char( ch ); y_val += dy_1; break; }
14886 case
14887 #line 17410 "./tex4ht-c.tex"
14888
14889 166
14890 : {
14891 cond_idv_char( ch ); y_val += dy_2; break; }
14892
14893
14894 #line 5569 "./tex4ht-c.tex"
14895
14896 case
14897 #line 17341 "./tex4ht-c.tex"
14898
14899 143
14900 : case
14901 #line 17344 "./tex4ht-c.tex"
14902
14903 144
14904 :
14905 case
14906 #line 17347 "./tex4ht-c.tex"
14907
14908 145
14909 : case
14910 #line 17350 "./tex4ht-c.tex"
14911
14912 146
14913 : {
14914 cond_idv_char( ch );
14915 x_val += cond_int( ch -
14916 #line 17341 "./tex4ht-c.tex"
14917
14918 143
14919 + 1 ); break; }
14920 case
14921 #line 17356 "./tex4ht-c.tex"
14922
14923 148
14924 :
14925 case
14926 #line 17359 "./tex4ht-c.tex"
14927
14928 149
14929 :
14930 case
14931 #line 17362 "./tex4ht-c.tex"
14932
14933 150
14934 :
14935 case
14936 #line 17365 "./tex4ht-c.tex"
14937
14938 151
14939 : {
14940 cond_idv_char( ch );
14941 dx_1 = (INTEGER) cond_int( ch -
14942 #line 17356 "./tex4ht-c.tex"
14943
14944 148
14945 + 1);
14946 x_val += dx_1; break; }
14947 case
14948 #line 17371 "./tex4ht-c.tex"
14949
14950 153
14951 :
14952 case
14953 #line 17374 "./tex4ht-c.tex"
14954
14955 154
14956 :
14957 case
14958 #line 17377 "./tex4ht-c.tex"
14959
14960 155
14961 :
14962 case
14963 #line 17380 "./tex4ht-c.tex"
14964
14965 156
14966 : {
14967 cond_idv_char( ch );
14968 dx_2 = (INTEGER) cond_int( ch -
14969 #line 17371 "./tex4ht-c.tex"
14970
14971 153
14972 + 1);
14973 x_val += dx_2; break; }
14974
14975
14976 #line 5590 "./tex4ht-c.tex"
14977
14978 case
14979 #line 17383 "./tex4ht-c.tex"
14980
14981 157
14982 : case
14983 #line 17386 "./tex4ht-c.tex"
14984
14985 158
14986 :
14987 case
14988 #line 17389 "./tex4ht-c.tex"
14989
14990 159
14991 : case
14992 #line 17392 "./tex4ht-c.tex"
14993
14994 160
14995 : {
14996 cond_idv_char( ch );
14997 y_val += cond_int( ch -
14998 #line 17383 "./tex4ht-c.tex"
14999
15000 157
15001 + 1);
15002 break; }
15003 case
15004 #line 17398 "./tex4ht-c.tex"
15005
15006 162
15007 :
15008 case
15009 #line 17401 "./tex4ht-c.tex"
15010
15011 163
15012 :
15013 case
15014 #line 17404 "./tex4ht-c.tex"
15015
15016 164
15017 :
15018 case
15019 #line 17407 "./tex4ht-c.tex"
15020
15021 165
15022 : {
15023 cond_idv_char( ch );
15024 dy_1 = (INTEGER) cond_int( ch -
15025 #line 17398 "./tex4ht-c.tex"
15026
15027 162
15028 + 1);
15029 y_val += dy_1; break; }
15030 case
15031 #line 17413 "./tex4ht-c.tex"
15032
15033 167
15034 :
15035 case
15036 #line 17416 "./tex4ht-c.tex"
15037
15038 168
15039 :
15040 case
15041 #line 17419 "./tex4ht-c.tex"
15042
15043 169
15044 :
15045 case
15046 #line 17422 "./tex4ht-c.tex"
15047
15048 170
15049 : {
15050 cond_idv_char( ch );
15051 dy_2 = (INTEGER) cond_int( ch -
15052 #line 17413 "./tex4ht-c.tex"
15053
15054 167
15055 + 1);
15056 y_val += dy_2; break; }
15057
15058
15059 #line 5617 "./tex4ht-c.tex"
15060
15061 case
15062 #line 17318 "./tex4ht-c.tex"
15063
15064 132
15065 :{
15066 visible_cnt = TRUE; cond_string( ch,4 ); x_val += cond_int(4);
15067 break;
15068 }
15069 case
15070 #line 17323 "./tex4ht-c.tex"
15071
15072 137
15073 :{
15074 visible_cnt = TRUE; cond_string( ch, 8 );
15075 break;
15076 }
15077
15078
15079 #line 5650 "./tex4ht-c.tex"
15080
15081 case
15082 #line 17450 "./tex4ht-c.tex"
15083
15084 239
15085 : case
15086 #line 17452 "./tex4ht-c.tex"
15087
15088 240
15089 :
15090 case
15091 #line 17454 "./tex4ht-c.tex"
15092
15093 241
15094 : case
15095 #line 17456 "./tex4ht-c.tex"
15096
15097 242
15098 : { long int i;
15099 int special_nr;
15100 special_nr = ch;
15101 if( tex4ht_special( &ch, &i ) ){
15102 if( ch == '+' ){
15103
15104 #line 5705 "./tex4ht-c.tex"
15105
15106 if( i==0 ){ if( dvi_flag ){ dvi_flag = 0;
15107 #line 5837 "./tex4ht-c.tex"
15108
15109 if( !visible_cnt ) { U_CHAR str[256];
15110 (IGNORED) sprintf(str, "--- empty picture --- %sidv[%d] ---\n",
15111 job_name,page_n);
15112 (IGNORED) printf("%s", str); (IGNORED) fprintf(log_file, "%s",str); }
15113 while( stack_depth-- > 0 ){
15114 idv_char(
15115 #line 17338 "./tex4ht-c.tex"
15116
15117 142
15118 ); file_n++; }
15119
15120 } }
15121 else{
15122 if( dvi_flag ){
15123 #line 5764 "./tex4ht-c.tex"
15124
15125 cond_idv_char( special_nr );
15126 cond_idv_int( i, special_nr -
15127 #line 17450 "./tex4ht-c.tex"
15128
15129 239
15130 + 1 );
15131 while( i-- ) cond_idv_char( get_char() );
15132 visible_cnt = TRUE;
15133
15134 }
15135 else switch( get_char() ){
15136 case '+': {
15137 #line 5744 "./tex4ht-c.tex"
15138
15139 { U_CHAR str[256], *ch;
15140 ch = str; while( --i ) *(ch++) = get_char(); *ch = '\0';
15141 script(font_gif, job_name ,page_n+1, str);
15142 }
15143
15144
15145 dvi_flag = TRUE; dvi_page = TRUE;
15146
15147 #line 5772 "./tex4ht-c.tex"
15148
15149 visible_cnt = FALSE;
15150 bop_addr = advance_idv_page( bop_addr, cur_font );
15151 stack_depth = 0;
15152 set_loc(
15153 #line 17341 "./tex4ht-c.tex"
15154
15155 143
15156 , x_val );
15157 set_loc(
15158 #line 17383 "./tex4ht-c.tex"
15159
15160 157
15161 , y_val );
15162
15163 break; }
15164 case '@': {
15165 #line 5720 "./tex4ht-c.tex"
15166
15167 while( --i ) (void) putc( get_char(), log_file );
15168 (IGNORED) putc( '\n', log_file );
15169
15170 break; }
15171 default: { while( --i ) (void) get_char(); break; }
15172 } }
15173
15174 }
15175 else while( i-- ) (void) get_char();
15176 }else if( dvi_flag ){
15177 #line 5683 "./tex4ht-c.tex"
15178
15179 visible_cnt = TRUE;
15180 #line 5688 "./tex4ht-c.tex"
15181
15182 {
15183 U_CHAR *ch;
15184 int j;
15185 ch = special_hd;
15186 (IGNORED) putc( (unsigned)
15187 #line 17456 "./tex4ht-c.tex"
15188
15189 242
15190 , idv_file ); file_n++;
15191 for(j=4; j--; ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
15192 while( *ch ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
15193 file_n += (int) i;
15194 while( i-- ) (IGNORED) putc( get_char(), idv_file );
15195 }
15196
15197
15198
15199
15200 }else {
15201 #line 5668 "./tex4ht-c.tex"
15202
15203 if( dvi_page || !page_n ){ dvi_page = FALSE;
15204 #line 5772 "./tex4ht-c.tex"
15205
15206 visible_cnt = FALSE;
15207 bop_addr = advance_idv_page( bop_addr, cur_font );
15208 stack_depth = 0;
15209 set_loc(
15210 #line 17341 "./tex4ht-c.tex"
15211
15212 143
15213 , x_val );
15214 set_loc(
15215 #line 17383 "./tex4ht-c.tex"
15216
15217 157
15218 , y_val );
15219
15220 }
15221 dvi_flag = TRUE;
15222
15223 #line 5688 "./tex4ht-c.tex"
15224
15225 {
15226 U_CHAR *ch;
15227 int j;
15228 ch = special_hd;
15229 (IGNORED) putc( (unsigned)
15230 #line 17456 "./tex4ht-c.tex"
15231
15232 242
15233 , idv_file ); file_n++;
15234 for(j=4; j--; ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
15235 while( *ch ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
15236 file_n += (int) i;
15237 while( i-- ) (IGNORED) putc( get_char(), idv_file );
15238 }
15239
15240
15241 dvi_flag = FALSE;
15242
15243 }
15244 break;
15245 }
15246
15247
15248 #line 5804 "./tex4ht-c.tex"
15249
15250 case
15251 #line 17335 "./tex4ht-c.tex"
15252
15253 141
15254 : {
15255 push_stack();
15256 stack_depth++;
15257 cond_idv_char( ch );
15258 break; }
15259 case
15260 #line 17338 "./tex4ht-c.tex"
15261
15262 142
15263 : { INTEGER cur_x, cur_y;
15264 stack_depth--;
15265 cur_x = (INTEGER) x_val; cur_y = (INTEGER) y_val; pop_stack();
15266 if( dvi_flag ){
15267 if( stack_depth<0 ){ warn_i_int( 24, page_n );
15268
15269 #line 5821 "./tex4ht-c.tex"
15270
15271 cond_idv_char(
15272 #line 17350 "./tex4ht-c.tex"
15273
15274 146
15275 );
15276 idv_int( x_val - cur_x - dx_1 - dx_2 );
15277 cond_idv_char(
15278 #line 17365 "./tex4ht-c.tex"
15279
15280 151
15281 );
15282 idv_int( dx_1 );
15283 cond_idv_char(
15284 #line 17380 "./tex4ht-c.tex"
15285
15286 156
15287 );
15288 idv_int( dx_2 );
15289 cond_idv_char(
15290 #line 17392 "./tex4ht-c.tex"
15291
15292 160
15293 );
15294 idv_int( y_val - cur_y - dy_1 - dy_2 );
15295 cond_idv_char(
15296 #line 17407 "./tex4ht-c.tex"
15297
15298 165
15299 );
15300 idv_int( dy_1 );
15301 cond_idv_char(
15302 #line 17422 "./tex4ht-c.tex"
15303
15304 170
15305 );
15306 idv_int( dy_2 );
15307 cond_idv_char(
15308 #line 17335 "./tex4ht-c.tex"
15309
15310 141
15311 ); file_n += 24;
15312
15313 }
15314 cond_idv_char( ch );
15315 }
15316 break; }
15317
15318
15319 #line 5858 "./tex4ht-c.tex"
15320
15321 case
15322 #line 17469 "./tex4ht-c.tex"
15323
15324 246
15325 :
15326 case
15327 #line 17466 "./tex4ht-c.tex"
15328
15329 245
15330 :
15331 case
15332 #line 17463 "./tex4ht-c.tex"
15333
15334 244
15335 :
15336 case
15337 #line 17460 "./tex4ht-c.tex"
15338
15339 243
15340 : { idv_char( ch ); file_n++;
15341 for( i=14; i; i-- ){ ch = get_char(); idv_char( ch ); file_n++; }
15342 i = ch; i += ch = get_char(); idv_char( ch ); file_n++;
15343 while( i-- ){ idv_copy(); }
15344 break; }
15345
15346
15347 #line 5877 "./tex4ht-c.tex"
15348
15349 case
15350 #line 17438 "./tex4ht-c.tex"
15351
15352 235
15353 :
15354 case
15355 #line 17441 "./tex4ht-c.tex"
15356
15357 236
15358 :
15359 case
15360 #line 17444 "./tex4ht-c.tex"
15361
15362 237
15363 :
15364 case
15365 #line 17447 "./tex4ht-c.tex"
15366
15367 238
15368 : { int i;
15369 idv_char( ch ); file_n++;
15370 cur_font[0] = ch -
15371 #line 17438 "./tex4ht-c.tex"
15372
15373 235
15374 + 2;
15375 cur_font[1] = ch;
15376 for( i=2; i <= cur_font[0]; i++ ){
15377 ch = get_char(); idv_char( ch );
15378 cur_font[i] = ch; file_n++; }
15379 break; }
15380
15381
15382 #line 5891 "./tex4ht-c.tex"
15383
15384 default: {
15385 if( (ch <
15386 #line 17426 "./tex4ht-c.tex"
15387
15388 171
15389 ) || (ch >
15390 #line 17432 "./tex4ht-c.tex"
15391
15392 234
15393 ) ){
15394 if(
15395 #line 8975 "./tex4ht-c.tex"
15396
15397 (version_id ==
15398 #line 2292 "./tex4ht-c.tex"
15399
15400 10
15401
15402 )
15403 &&
15404 (
15405 (ch ==
15406 #line 17493 "./tex4ht-c.tex"
15407
15408 251
15409
15410 )
15411 ||
15412 (ch ==
15413 #line 17499 "./tex4ht-c.tex"
15414
15415 252
15416
15417 )
15418 ||
15419 (ch ==
15420 #line 17505 "./tex4ht-c.tex"
15421
15422 253
15423
15424 )
15425 ||
15426 (ch ==
15427 #line 17510 "./tex4ht-c.tex"
15428
15429 254
15430
15431 )
15432 )
15433
15434 ){
15435
15436 #line 8997 "./tex4ht-c.tex"
15437
15438 switch( ch ){
15439 case
15440 #line 17499 "./tex4ht-c.tex"
15441
15442 252
15443
15444 :
15445
15446 #line 9025 "./tex4ht-c.tex"
15447
15448 { int i, flags;
15449
15450 (void) get_unt(4);
15451 (void) get_unt(4);
15452
15453 flags = (INTEGER) get_unt(2);
15454
15455
15456
15457 if ((flags &
15458 #line 8989 "./tex4ht-c.tex"
15459
15460 0x0002
15461
15462 ) || (flags &
15463 #line 8993 "./tex4ht-c.tex"
15464
15465 0x0001
15466
15467 )) {
15468
15469 for (
15470 i =
15471 (INTEGER) get_unt(1)
15472 + (INTEGER) get_unt(1)
15473 + (INTEGER) get_unt(1)
15474 ;
15475 i>0;
15476 i--
15477 ){ (void) get_unt(1); }
15478
15479
15480
15481
15482
15483 if( flags &
15484 #line 8959 "./tex4ht-c.tex"
15485
15486 0x0200
15487
15488 ){
15489 (void) get_unt(4);
15490 }
15491
15492 if( flags &
15493 #line 8963 "./tex4ht-c.tex"
15494
15495 0x0800
15496
15497 ){
15498 int n = (INTEGER) get_unt(2);
15499 for (i = 0; i < n; ++i) {
15500 (void) get_unt(4);
15501 }
15502 for (i = 0; i < n; ++i) {
15503 (void) get_int(4);
15504 } }
15505
15506 }
15507
15508 }
15509
15510
15511 break;
15512 case
15513 #line 17510 "./tex4ht-c.tex"
15514
15515 254
15516
15517 :
15518
15519 #line 9010 "./tex4ht-c.tex"
15520
15521 {
15522 int i, glyphCount;
15523 (void) get_unt(4);
15524 glyphCount = (INTEGER) get_unt(2);
15525 for( i = 0; i < glyphCount; ++i ){
15526 (void) get_int(4);
15527 }
15528 for (i = 0; i < glyphCount; ++i){
15529 (void) get_unt(2);
15530 }
15531 }
15532
15533
15534 break;
15535 default:
15536 printf(" ===> ---------- xdv's idv ------------ <==== %d\n" , ch);
15537 }
15538
15539
15540 } else { err_i(23); }
15541 }
15542 else { idv_char( ch ); file_n++;
15543 cur_font[0] = 1; cur_font[1] = ch; }
15544 break;
15545 }
15546
15547 }
15548
15549 }
15550
15551 #line 5424 "./tex4ht-c.tex"
15552
15553 if( errCode > 0 ){
15554 (IGNORED) fprintf(log_file, "tex4ht.c error: %d\n", errCode);
15555 }
15556
15557
15558
15559 #line 5917 "./tex4ht-c.tex"
15560
15561 { int ch, i, mag;
15562 U_CHAR str[256];
15563 (IGNORED) fprintf(log_file, "%s", begin_char_gif);
15564 dvi_flag = TRUE;
15565 for( cur_fnt = font_tbl_size; cur_fnt--; ){
15566
15567 #line 8819 "./tex4ht-c.tex"
15568
15569 (IGNORED) fprintf(log_file, lg_font_fmt,
15570 font_tbl[cur_fnt].family_name,
15571 font_tbl[cur_fnt].font_size,
15572 (int)( font_tbl[cur_fnt].design_sz * 100 / 655360 / 10),
15573 font_tbl[cur_fnt].mag);
15574
15575
15576 for( i = font_tbl[cur_fnt].char_l - font_tbl[cur_fnt].char_f + 1;
15577 i--; )
15578 if( get_bit( font_tbl[cur_fnt].gif_on, i) ){
15579 bop_addr = advance_idv_page( bop_addr, cur_font );
15580 set_loc(
15581 #line 17341 "./tex4ht-c.tex"
15582
15583 143
15584 , (long int) mid_page_x );
15585 set_loc(
15586 #line 17383 "./tex4ht-c.tex"
15587
15588 157
15589 , (long int) mid_page_y );
15590
15591 #line 5987 "./tex4ht-c.tex"
15592
15593 { INTEGER num;
15594 num = font_tbl[cur_fnt].num;
15595 if( num <=
15596 #line 17435 "./tex4ht-c.tex"
15597
15598 63
15599 )
15600 cond_idv_char( (int) (num +
15601 #line 17426 "./tex4ht-c.tex"
15602
15603 171
15604 ) );
15605 else if( dvi_flag ){
15606 if( (num < 0) || (num > 16777215L) ) idv_int(
15607 #line 17447 "./tex4ht-c.tex"
15608
15609 238
15610 );
15611 else if( num < 256 ) { idv_char(
15612 #line 17438 "./tex4ht-c.tex"
15613
15614 235
15615 ); file_n++; }
15616 else if( num < 65536L ) int_to_dvi((long int)
15617 #line 17441 "./tex4ht-c.tex"
15618
15619 236
15620 ,2);
15621 else int_to_dvi((long int)
15622 #line 17444 "./tex4ht-c.tex"
15623
15624 237
15625 ,3);
15626 cond_idv_char( (int) num );
15627 } }
15628
15629
15630
15631 #line 5945 "./tex4ht-c.tex"
15632
15633 if( (ch = i + font_tbl[cur_fnt].char_f) > 127 ) {
15634 if( ch < 256 ) cond_idv_char(133); else warn_i(23); }
15635 cond_idv_char( ch );
15636 mag = (int) ((double) font_tbl[cur_fnt].scale /
15637 font_tbl[cur_fnt].design_sz * 10 );
15638
15639 #line 10905 "./tex4ht-c.tex"
15640
15641 if( !dos_file_names ){
15642 if( mag == 10 ) (IGNORED) sprintf(str, "%s-%x%s",
15643 font_tbl[cur_fnt].name, ch, gif);
15644 else (IGNORED) sprintf(str, "%s-%x-%x%s",
15645 font_tbl[cur_fnt].name, mag, ch, gif);
15646 }
15647
15648
15649 #line 10933 "./tex4ht-c.tex"
15650
15651
15652 if( dos_file_names ){
15653 (IGNORED) strcpy((char *) str, (char *) font_tbl[cur_fnt].name);
15654 dos_gif_file(str, mag, ch);
15655 strct(str,gif);
15656 }
15657
15658
15659
15660 script(font_gif, job_name ,page_n, str);
15661
15662 }
15663 }
15664 (IGNORED) printf("Execute script `%slg'\n",
15665 job_name);
15666 (IGNORED) fclose( log_file );
15667 }
15668
15669
15670
15671 #line 5498 "./tex4ht-c.tex"
15672
15673 idv_char(
15674 #line 17338 "./tex4ht-c.tex"
15675
15676 142
15677 ); file_n += 2;
15678 idv_char(
15679 #line 17332 "./tex4ht-c.tex"
15680
15681 140
15682 );
15683 (IGNORED) fseek(dvi_file, begin_postamble,
15684 #line 2174 "./tex4ht-c.tex"
15685
15686 0
15687 );
15688 begin_postamble = file_n;
15689 idv_char(
15690 #line 17475 "./tex4ht-c.tex"
15691
15692 248
15693 ); file_n += 5;
15694 idv_int( bop_addr ); (IGNORED) fseek(dvi_file, 5L,
15695 #line 2177 "./tex4ht-c.tex"
15696
15697 1
15698 );
15699 for( i = 20; i; i-- ) idv_copy();
15700
15701
15702 #line 5508 "./tex4ht-c.tex"
15703
15704 i = (INTEGER) get_int(2) + 1; idv_char( (int) i >> 8 );
15705 idv_char( (int) i & 0xFF ); file_n += 2;
15706 if( !page_n ) page_n++; idv_char( page_n >> 8 );
15707 idv_char( (int) page_n & 0xFF ); file_n += 2;
15708 (IGNORED) fseek(dvi_file, 2L,
15709 #line 2177 "./tex4ht-c.tex"
15710
15711 1
15712 );
15713
15714
15715 #line 5516 "./tex4ht-c.tex"
15716
15717 eof_op_n -= 32;
15718 while( --eof_op_n ) idv_copy();
15719 idv_int(begin_postamble);
15720 (IGNORED) fseek(dvi_file, 4L,
15721 #line 2177 "./tex4ht-c.tex"
15722
15723 1
15724 ); file_n += 4;
15725
15726 #line 5466 "./tex4ht-c.tex"
15727
15728 ch = get_char();
15729 if( id_version != -1 ){ ch = id_version; }
15730 idv_char( ch );
15731
15732
15733 for( i = 8 - file_n % 4; i; i-- ) idv_char(
15734 #line 17429 "./tex4ht-c.tex"
15735
15736 223
15737 );
15738
15739
15740
15741 }
15742
15743
15744 return 0;
15745 }
15746
15747