1
4
5# ifndef LMT_COMMANDS_H
6# define LMT_COMMANDS_H
7
8
56
57
96
97
98
103
104typedef enum code_classifications {
105 classification_no_arguments = 0,
106 classification_unknown = 1,
107 classification_integer = 2,
108} code_classifications;
109
110typedef enum tex_command_code {
111
116 escape_cmd,
117 left_brace_cmd,
118 right_brace_cmd,
119 math_shift_cmd,
120 alignment_tab_cmd,
121 end_line_cmd,
122 parameter_cmd,
123 superscript_cmd,
124 subscript_cmd,
125 ignore_cmd,
126 spacer_cmd,
127 letter_cmd,
128 other_char_cmd,
129 active_char_cmd,
130 comment_cmd,
131 invalid_char_cmd,
132
138 relax_cmd,
139 end_template_cmd,
140 alignment_cmd,
141 match_cmd,
142 end_match_cmd,
143 parameter_reference_cmd,
144
145 end_paragraph_cmd,
146 end_job_cmd,
147 delimiter_number_cmd,
148 char_number_cmd,
149 math_char_number_cmd,
150 mark_cmd,
151 node_cmd,
152 xray_cmd,
153 make_box_cmd,
154 hmove_cmd,
155 vmove_cmd,
156 un_hbox_cmd,
157 un_vbox_cmd,
158 remove_item_cmd,
159 hskip_cmd,
160 vskip_cmd,
161 mskip_cmd,
162 kern_cmd,
163 mkern_cmd,
164 leader_cmd,
165 legacy_cmd,
166 local_box_cmd,
167 halign_cmd,
168 valign_cmd,
169 vrule_cmd,
170 hrule_cmd,
171 insert_cmd,
172 vadjust_cmd,
173 ignore_something_cmd,
174 after_something_cmd,
175 penalty_cmd,
176 begin_paragraph_cmd,
177 italic_correction_cmd,
178 accent_cmd,
179 math_accent_cmd,
180 discretionary_cmd,
181 equation_number_cmd,
182 math_fence_cmd,
183 math_component_cmd,
184 math_modifier_cmd,
185 math_fraction_cmd,
186 math_choice_cmd,
187 vcenter_cmd,
188 case_shift_cmd,
189 message_cmd,
190 catcode_table_cmd,
191 end_local_cmd,
192 lua_function_call_cmd,
193 lua_protected_call_cmd,
194 lua_semi_protected_call_cmd,
195 begin_group_cmd,
196 end_group_cmd,
197 explicit_space_cmd,
198 boundary_cmd,
199 math_radical_cmd,
200 math_script_cmd,
201 math_shift_cs_cmd,
202 end_cs_name_cmd,
203
207 char_given_cmd,
208 some_item_cmd,
209
215 internal_toks_cmd,
216 register_toks_cmd,
217 internal_integer_cmd,
218 register_integer_cmd,
219 internal_attribute_cmd,
220 register_attribute_cmd,
221 internal_posit_cmd,
222 register_posit_cmd,
223 internal_dimension_cmd,
224 register_dimension_cmd,
225 internal_glue_cmd,
226 register_glue_cmd,
227 internal_muglue_cmd,
228 register_muglue_cmd,
229 lua_value_cmd,
230 iterator_value_cmd,
231 font_property_cmd,
232 auxiliary_cmd,
233 hyphenation_cmd,
234 page_property_cmd,
235 box_property_cmd,
236 specification_cmd,
237 define_char_code_cmd,
238 define_family_cmd,
239 math_parameter_cmd,
240 math_style_cmd,
241 set_font_cmd,
242 define_font_cmd,
243 integer_cmd,
244 index_cmd,
245 posit_cmd,
246 dimension_cmd,
247 gluespec_cmd,
248 mugluespec_cmd,
249 mathspec_cmd,
250 fontspec_cmd,
251 association_cmd,
252 interaction_cmd,
253 register_cmd,
254
257 combine_toks_cmd,
258 arithmic_cmd,
259 prefix_cmd,
260 let_cmd,
261 shorthand_def_cmd,
262 def_cmd,
263
264 set_box_cmd,
265
270 undefined_cs_cmd,
271 expand_after_cmd,
272 no_expand_cmd,
273 input_cmd,
274 lua_call_cmd,
275 lua_local_call_cmd,
276 begin_local_cmd,
277 if_test_cmd,
278 cs_name_cmd,
279 convert_cmd,
280 the_cmd,
281 get_mark_cmd,
282
296 call_cmd,
297 protected_call_cmd,
298 semi_protected_call_cmd,
299 constant_call_cmd,
300 tolerant_call_cmd,
301 tolerant_protected_call_cmd,
302 tolerant_semi_protected_call_cmd,
303
306 deep_frozen_end_template_cmd,
307 deep_frozen_dont_expand_cmd,
308 deep_frozen_keep_constant_cmd,
309
314 internal_glue_reference_cmd,
315 register_glue_reference_cmd,
316 internal_muglue_reference_cmd,
317 register_muglue_reference_cmd,
318 internal_box_reference_cmd,
319 register_box_reference_cmd,
320 internal_toks_reference_cmd,
321 register_toks_reference_cmd,
322 specification_reference_cmd,
323 unit_reference_cmd,
324
328 internal_integer_reference_cmd,
329 register_integer_reference_cmd,
330 internal_attribute_reference_cmd,
331 register_attribute_reference_cmd,
332 internal_posit_reference_cmd,
333 register_posit_reference_cmd,
334 internal_dimension_reference_cmd,
335 register_dimension_reference_cmd,
336
339 number_tex_commands,
340} tex_command_code;
341
342# define max_char_code_cmd invalid_char_cmd
343# define min_internal_cmd char_given_cmd
344# define max_non_prefixed_cmd some_item_cmd
345# define max_internal_cmd register_cmd
346# define max_command_cmd (undefined_cs_cmd - 1)
347
348# define first_cmd escape_cmd
349# define last_cmd register_dimension_reference_cmd
350
351# define first_call_cmd call_cmd
352# define last_call_cmd tolerant_semi_protected_call_cmd
353
354# define last_visible_cmd tolerant_semi_protected_call_cmd
355
356# define is_call_cmd(cmd) (cmd >= first_call_cmd && cmd <= last_call_cmd)
357# define is_protected_cmd(cmd) (cmd == protected_call_cmd || cmd == tolerant_protected_call_cmd)
358# define is_semi_protected_cmd(cmd) (cmd == semi_protected_call_cmd || cmd == tolerant_semi_protected_call_cmd)
359# define is_tolerant_cmd(cmd) (cmd == tolerant_call_cmd || cmd == tolerant_protected_call_cmd || cmd == tolerant_semi_protected_call_cmd)
360
361# define is_referenced_cmd(cmd) (cmd >= call_cmd)
362# define is_nodebased_cmd(cmd) (cmd >= gluespec_cmd && cmd <= fontspec_cmd)
363# define is_constant_cmd(cmd) ((cmd >= integer_cmd && cmd <= gluespec_cmd) || cmd == constant_call_cmd)
364
365
366
367typedef enum tex_modes {
368 nomode = 0,
369 vmode = 1,
370 hmode = 2,
371 mmode = 3,
372 internal_vmode = -1,
373 restricted_hmode = -2,
374 inline_mmode = -3,
375} tex_modes;
376
377static inline int is_v_mode(halfword mode) { return mode == vmode || mode == internal_vmode; }
378static inline int is_h_mode(halfword mode) { return mode == hmode || mode == restricted_hmode; }
379static inline int is_m_mode(halfword mode) { return mode == mmode || mode == inline_mmode; }
380
381static inline int tex_normalized_mode(halfword mode)
382{
383 switch (mode) {
384 case internal_vmode : return vmode;
385 case restricted_hmode: return hmode;
386 case inline_mmode : return mmode;
387 default : return mode;
388 }
389}
390
391typedef enum arithmic_codes {
392 advance_code,
393 multiply_code,
394 divide_code,
395 e_divide_code,
396 r_divide_code,
397 advance_by_code,
398 multiply_by_code,
399 divide_by_code,
400 e_divide_by_code,
401 r_divide_by_code,
402
403
404
405
406
407
408} arithmic_codes;
409
410# define last_arithmic_code r_divide_code
411
412typedef enum math_script_codes {
413 math_no_script_code,
414 math_no_ruling_code,
415 math_sub_script_code,
416 math_super_script_code,
417 math_super_pre_script_code,
418 math_sub_pre_script_code,
419 math_no_sub_script_code,
420 math_no_super_script_code,
421 math_no_sub_pre_script_code,
422 math_no_super_pre_script_code,
423 math_shifted_sub_script_code,
424 math_shifted_super_script_code,
425 math_shifted_sub_pre_script_code,
426 math_shifted_super_pre_script_code,
427 math_prime_script_code,
428} math_script_codes;
429
430# define last_math_script_code math_prime_script_code
431
432typedef enum math_fraction_codes {
433 math_above_code,
434 math_above_delimited_code,
435 math_over_code,
436 math_over_delimited_code,
437 math_atop_code,
438 math_atop_delimited_code,
439 math_u_above_code,
440 math_u_above_delimited_code,
441 math_u_over_code,
442 math_u_over_delimited_code,
443 math_u_atop_code,
444 math_u_atop_delimited_code,
445 math_u_skewed_code,
446 math_u_skewed_delimited_code,
447 math_u_stretched_code,
448 math_u_stretched_delimited_code,
449} math_fraction_codes;
450
451# define last_math_fraction_code math_u_skewed_code
452
453
457
458typedef enum auxiliary_codes {
459 space_factor_code,
460 prev_depth_code,
461 prev_graf_code,
462 interaction_mode_code,
463 insert_mode_code,
464} auxiliary_codes;
465
466# define last_auxiliary_code insert_mode_code
467
468typedef enum convert_codes {
469 number_code,
470 to_integer_code,
471 to_hexadecimal_code,
472 to_scaled_code,
473 to_sparse_scaled_code,
474 to_dimension_code,
475 to_sparse_dimension_code,
476 to_mathstyle_code,
477 lua_code,
478 lua_function_code,
479 lua_bytecode_code,
480 expanded_code,
481 semi_expanded_code,
482
483 string_code,
484 cs_string_code,
485 cs_active_code,
486
487 detokenized_code,
488 detokened_code,
489 roman_numeral_code,
490 meaning_code,
491 meaning_full_code,
492 meaning_less_code,
493 meaning_asis_code,
494 meaning_ful_code,
495 meaning_les_code,
496 to_character_code,
497 lua_escape_string_code,
498
499 font_name_code,
500 font_specification_code,
501 job_name_code,
502 format_name_code,
503 luatex_banner_code,
504 font_identifier_code,
505} convert_codes;
506
507extern const unsigned char some_convert_classification[font_identifier_code+1];
508
509# define first_convert_code number_code
510# define last_convert_code luatex_banner_code
511
512
516
517typedef enum input_codes {
518 normal_input_code,
519 eof_input_code,
520 end_of_input_code,
521 token_input_code,
522 tex_token_input_code,
523 tokenized_code,
524 retokenized_code,
525
526 quit_loop_code,
527 quit_loop_now_code,
528} input_codes;
529
530# define last_input_code quit_loop_now_code
531
532typedef enum some_item_codes {
533 lastpenalty_code,
534 lastkern_code,
535 lastskip_code,
536 lastboundary_code,
537 last_node_type_code,
538 last_node_subtype_code,
539 input_line_no_code,
540 badness_code,
541 overshoot_code,
542 luatex_version_code,
543 luatex_revision_code,
544 current_group_level_code,
545 current_group_type_code,
546 current_stack_size_code,
547 current_if_level_code,
548 current_if_type_code,
549 current_if_branch_code,
550 glue_stretch_order_code,
551 glue_shrink_order_code,
552 font_id_code,
553 glyph_x_scaled_code,
554 glyph_y_scaled_code,
555 font_char_wd_code,
556 font_char_ht_code,
557 font_char_dp_code,
558 font_char_ic_code,
559 font_char_ta_code,
560 font_char_ba_code,
561 scaled_font_char_wd_code,
562 scaled_font_char_ht_code,
563 scaled_font_char_dp_code,
564 scaled_font_char_ic_code,
565 scaled_font_char_ta_code,
566 scaled_font_char_ba_code,
567 font_spec_id_code,
568 font_spec_scale_code,
569 font_spec_xscale_code,
570 font_spec_yscale_code,
571 font_spec_slant_code,
572 font_spec_weight_code,
573 font_size_code,
574 font_math_control_code,
575 font_text_control_code,
576 math_scale_code,
577 math_style_code,
578 math_main_style_code,
579 math_style_font_id_code,
580 math_stack_style_code,
581 math_char_class_code,
582 math_char_fam_code,
583 math_char_slot_code,
584 scaled_slant_per_point_code,
585 scaled_interword_space_code,
586 scaled_interword_stretch_code,
587 scaled_interword_shrink_code,
588 scaled_ex_height_code,
589 scaled_em_width_code,
590 scaled_extra_space_code,
591 scaled_math_axis_code,
592 scaled_math_ex_height_code,
593 scaled_math_em_width_code,
594 last_arguments_code,
595 parameter_count_code,
596 parameter_index_code,
597
598 insert_progress_code,
599 left_margin_kern_code,
600 right_margin_kern_code,
601 par_shape_length_code,
602 par_shape_indent_code,
603 par_shape_dimension_code,
604 glue_stretch_code,
605 glue_shrink_code,
606 mu_to_glue_code,
607 glue_to_mu_code,
608 numexpr_code,
609 posexpr_code,
610
611 dimexpr_code,
612 glueexpr_code,
613 muexpr_code,
614 numexpression_code,
615 dimexpression_code,
616 last_chk_integer_code,
617 last_chk_dimension_code,
618
619 numeric_scale_code,
620 numeric_scaled_code,
621 index_of_register_code,
622 index_of_character_code,
623 math_atom_glue_code,
624 last_left_class_code,
625 last_right_class_code,
626 last_atom_class_code,
627 nested_loop_iterator_code,
628 previous_loop_iterator_code,
629 current_loop_iterator_code,
630 current_loop_nesting_code,
631 last_loop_iterator_code,
632 last_par_trigger_code,
633 last_par_context_code,
634 last_page_extra_code,
635} some_item_codes;
636
637extern const unsigned char some_item_classification[last_page_extra_code+1];
638
639# define last_some_item_code last_page_extra_code
640
641typedef enum catcode_table_codes {
642 save_cat_code_table_code,
643 init_cat_code_table_code,
644
645} catcode_table_codes;
646
647# define last_catcode_table_code init_cat_code_table_code
648
649typedef enum font_property_codes {
650 font_hyphen_code,
651 font_skew_code,
652 font_lp_code,
653 font_rp_code,
654 font_ef_code,
655 font_cf_code,
656 font_dimension_code,
657 scaled_font_dimension_code,
658} font_property_codes;
659
660# define last_font_property_code scaled_font_dimension_code
661
662typedef enum box_property_codes {
663 box_width_code,
664 box_height_code,
665 box_depth_code,
666 box_direction_code,
667 box_geometry_code,
668 box_orientation_code,
669 box_anchor_code,
670 box_anchors_code,
671 box_source_code,
672 box_target_code,
673 box_xoffset_code,
674 box_yoffset_code,
675 box_xmove_code,
676 box_ymove_code,
677 box_total_code,
678 box_shift_code,
679 box_adapt_code,
680 box_repack_code,
681 box_freeze_code,
682 box_limitate_code,
683 box_finalize_code,
684 box_limit_code,
685 box_stretch_code,
686 box_shrink_code,
687
688 box_attribute_code,
689 box_vadjust_code,
690} box_property_codes;
691
692# define last_box_property_code box_vadjust_code
693
694typedef enum hyphenation_codes {
695 hyphenation_code,
696 patterns_code,
697 prehyphenchar_code,
698 posthyphenchar_code,
699 preexhyphenchar_code,
700 postexhyphenchar_code,
701 hyphenationmin_code,
702 hjcode_code,
703} hyphenation_codes;
704
705# define last_hyphenation_code hjcode_code
706
707typedef enum begin_paragraph_codes {
708 noindent_par_code,
709 indent_par_code,
710 quitvmode_par_code,
711 undent_par_code,
712 snapshot_par_code,
713 attribute_par_code,
714 wrapup_par_code,
715} begin_paragraph_codes;
716
717# define last_begin_paragraph_code wrapup_par_code
718
719extern void tex_initialize_commands (void);
720
721
732
733typedef enum relax_codes {
734 relax_code,
735 no_relax_code,
736 no_expand_relax_code,
737} relax_codes;
738
739# define last_relax_code no_relax_code
740
741typedef enum end_paragraph_codes {
742 normal_end_paragraph_code,
743 inserted_end_paragraph_code,
744 new_line_end_paragraph_code,
745} end_paragraph_codes;
746
747# define last_end_paragraph_code new_line_end_paragraph_code
748
749typedef enum shorthand_def_codes {
750 char_def_code,
751 math_char_def_code,
752 math_uchar_def_code,
753 math_dchar_def_code,
754 float_def_code,
755 count_def_code,
756 attribute_def_code,
757 dimen_def_code,
758 skip_def_code,
759 muskip_def_code,
760 toks_def_code,
761 lua_def_code,
762 integer_def_code,
763 parameter_def_code,
764 posit_def_code,
765 dimension_def_code,
766 gluespec_def_code,
767 mugluespec_def_code,
768
769 fontspec_def_code,
770
771
772} shorthand_def_codes;
773
774# define last_shorthand_def_code fontspec_def_code
775
776typedef enum association_codes {
777 unit_association_code,
778} association_codes;
779
780# define last_association_code unit_association_code
781
782typedef enum char_number_codes {
783 char_number_code,
784 glyph_number_code,
785} char_number_codes;
786
787# define last_char_number_code glyph_number_code
788
789typedef enum math_char_number_codes {
790 math_char_number_code,
791 math_xchar_number_code,
792 math_dictionary_number_code,
793 math_class_number_code,
794} math_char_number_codes;
795
796# define last_math_char_number_code math_class_number_code
797
798typedef enum xray_codes {
799 show_code,
800 show_box_code,
801 show_the_code,
802 show_lists_code,
803 show_groups_code,
804 show_stack_code,
805 show_tokens_code,
806 show_ifs_code,
807} xray_codes;
808
809# define last_xray_code show_ifs_code
810
811typedef enum the_codes {
812 the_code,
813 the_without_unit_code,
814
815 detokenize_code,
816 expanded_detokenize_code,
817 protected_detokenize_code,
818 protected_expanded_detokenize_code,
819 unexpanded_code,
820} the_codes;
821
822# define last_the_code unexpanded_code
823
824typedef enum expand_after_codes {
825 expand_after_code,
826 expand_unless_code,
827 future_expand_code,
828 future_expand_is_code,
829 future_expand_is_ap_code,
830
831
832 expand_after_spaces_code,
833 expand_after_pars_code,
834 expand_token_code,
835 expand_cs_token_code,
836 expand_code,
837 expand_toks_code,
838 expand_active_code,
839 expand_semi_code,
840 expand_after_toks_code,
841 expand_parameter_code,
842
843} expand_after_codes;
844
845# define last_expand_after_code expand_parameter_code
846
847typedef enum after_something_codes {
848 after_group_code,
849 after_grouped_code,
850 after_assignment_code,
851 after_assigned_code,
852 at_end_of_group_code,
853 at_end_of_grouped_code,
854 at_end_of_file_code,
855 at_end_of_filed_code,
856} after_something_codes;
857
858# define last_after_something_code at_end_of_filed_code
859
860typedef enum begin_group_codes {
861 semi_simple_group_code,
862 also_simple_group_code,
863 math_simple_group_code,
864} begin_group_codes;
865
866# define last_begin_group_code also_simple_group_code
867
868typedef enum end_job_codes {
869 end_code,
870 dump_code,
871} end_job_codes;
872
873# define last_end_job_code dump_code
874
875typedef enum local_control_codes {
876 local_control_begin_code,
877 local_control_token_code,
878 local_control_list_code,
879 local_control_loop_code,
880 expanded_loop_code,
881 unexpanded_loop_code,
882 local_control_repeat_code,
883 expanded_repeat_code,
884 unexpanded_repeat_code,
885 local_control_endless_code,
886 expanded_endless_code,
887 unexpanded_endless_code,
888} local_control_codes;
889
890# define last_local_control_code unexpanded_endless_code
891
892
905
906typedef enum prefix_codes {
907 frozen_code,
908 permanent_code,
909 immutable_code,
910
911 mutable_code,
912 noaligned_code,
913 instance_code,
914 untraced_code,
915 global_code,
916 tolerant_code,
917 protected_code,
918 overloaded_code,
919 aliased_code,
920 immediate_code,
921 deferred_code,
922
923
924 semiprotected_code,
925 enforced_code,
926 always_code,
927 inherited_code,
928 constant_code,
929 retained_code,
930 constrained_code,
931 long_code,
932 outer_code,
933} prefix_codes;
934
935# define last_prefix_code enforced_code
936
937typedef enum combine_toks_codes {
938 expanded_toks_code,
939 append_toks_code,
940 append_expanded_toks_code,
941 prepend_toks_code,
942 prepend_expanded_toks_code,
943 global_expanded_toks_code,
944 global_append_toks_code,
945 global_append_expanded_toks_code,
946 global_prepend_toks_code,
947 global_prepend_expanded_toks_code,
948} combine_toks_codes;
949
950# define last_combine_toks_code global_prepend_expanded_toks_code
951
952typedef enum cs_name_codes {
953 cs_name_code,
954 last_named_cs_code,
955 begin_cs_name_code,
956 future_cs_name_code,
957} cs_name_codes;
958
959# define last_cs_name_code begin_cs_name_code
960
961typedef enum def_codes {
962 expanded_def_code,
963 def_code,
964 global_expanded_def_code,
965 global_def_code,
966 expanded_def_csname_code,
967 def_csname_code,
968 global_expanded_def_csname_code,
969 global_def_csname_code,
970 constant_def_code,
971 constant_def_csname_code,
972} def_codes;
973
974# define last_def_code constant_def_csname_code
975
976typedef enum let_codes {
977 global_let_code,
978 let_code,
979 future_let_code,
980 future_def_code,
981 let_charcode_code,
982 swap_cs_values_code,
983 let_protected_code,
984 unlet_protected_code,
985 let_frozen_code,
986 unlet_frozen_code,
987 let_csname_code,
988 global_let_csname_code,
989 let_to_nothing_code,
990 global_let_to_nothing_code,
991 let_to_last_named_cs_code,
992} let_codes;
993
994# define last_let_code global_let_csname_code
995
996typedef enum message_codes {
997 message_code,
998 error_message_code,
999} message_codes;
1000
1001# define last_message_code error_message_code
1002
1003
1024
1025typedef enum lua_call_codes {
1026 lua_function_call_code,
1027 lua_bytecode_call_code,
1028} lua_codes;
1029
1030typedef enum math_delimiter_codes {
1031 math_delimiter_code,
1032 math_udelimiter_code,
1033} math_delimiter_codes;
1034
1035# define last_math_delimiter_code math_udelimiter_code
1036
1037typedef enum math_choice_codes {
1038 math_choice_code,
1039 math_discretionary_code,
1040 math_stack_code,
1041} math_choice_codes;
1042
1043# define last_math_choice_code math_stack_code
1044
1045typedef enum math_accent_codes {
1046 math_accent_code,
1047 math_uaccent_code,
1048} math_accent_codes;
1049
1050# define last_math_accent_code math_uaccent_code
1051
1052typedef enum lua_value_codes {
1053 lua_value_none_code,
1054 lua_value_integer_code,
1055 lua_value_cardinal_code,
1056 lua_value_dimension_code,
1057 lua_value_skip_code,
1058 lua_value_boolean_code,
1059 lua_value_float_code,
1060 lua_value_string_code,
1061 lua_value_node_code,
1062 lua_value_direct_code,
1063 lua_value_conditional_code,
1064
1065 number_lua_values,
1066} lua_value_codes;
1067
1068typedef enum math_shift_cs_codes {
1069 begin_inline_math_code,
1070 end_inline_math_code,
1071 begin_display_math_code,
1072 end_display_math_code,
1073 begin_math_mode_code,
1074 end_math_mode_code,
1075} math_shift_cs_codes;
1076
1077# define first_math_shift_cs_code begin_inline_math_code
1078# define last_math_shift_cs_code end_math_mode_code
1079
1080
1095
1096typedef enum legacy_codes {
1097 shipout_code,
1098} legacy_codes;
1099
1100# define first_legacy_code shipout_code
1101# define last_legacy_code shipout_code
1102
1103typedef enum leader_codes {
1104 a_leaders_code,
1105 c_leaders_code,
1106 x_leaders_code,
1107 g_leaders_code,
1108 u_leaders_code,
1109} leader_codes;
1110
1111# define first_leader_code a_leaders_code
1112# define last_leader_code u_leaders_code
1113
1114typedef enum local_box_codes {
1115 local_left_box_code,
1116 local_right_box_code,
1117 local_middle_box_code,
1118
1119 number_box_pars,
1120} local_box_codes;
1121
1122# define first_local_box_code local_left_box_code
1123# define last_local_box_code local_middle_box_code
1124
1125typedef enum local_box_options {
1126 local_box_par_option = 0x1,
1127 local_box_local_option = 0x2,
1128 local_box_keep_option = 0x4,
1129} local_box_options;
1130
1131typedef enum skip_codes {
1132 fi_l_code,
1133 fi_ll_code,
1134 fi_ss_code,
1135 fi_l_neg_code,
1136 skip_code,
1137 mskip_code,
1138} skip_codes;
1139
1140# define first_skip_code fi_l_code
1141# define last_skip_code skip_code
1142
1143
1144
1145typedef enum charcode_codes {
1146 catcode_charcode,
1147 lccode_charcode,
1148 uccode_charcode,
1149 sfcode_charcode,
1150 hccode_charcode,
1151 hmcode_charcode,
1152 amcode_charcode,
1153 mathcode_charcode,
1154 extmathcode_charcode,
1155 delcode_charcode,
1156 extdelcode_charcode,
1157} charcode_codes;
1158
1159# define first_charcode_code catcode_charcode
1160# define last_charcode_code extdelcode_charcode
1161
1162typedef enum math_styles {
1163 display_style,
1164 cramped_display_style,
1165 text_style,
1166 cramped_text_style,
1167 script_style,
1168 cramped_script_style,
1169 script_script_style,
1170 cramped_script_script_style,
1171
1172 all_display_styles,
1173 all_text_styles,
1174 all_script_styles,
1175 all_script_script_styles,
1176 all_math_styles,
1177 all_main_styles,
1178 all_split_styles,
1179 all_unsplit_styles,
1180 all_uncramped_styles,
1181 all_cramped_styles,
1182
1183 yet_unset_math_style,
1184 scaled_math_style,
1185 former_choice_math_style,
1186} math_styles;
1187
1188# define first_math_style display_style
1189# define last_math_style former_choice_math_style
1190
1191# define is_valid_math_style(n) (n >= display_style && n <= cramped_script_script_style)
1192# define are_valid_math_styles(n) (n >= all_display_styles && n <= all_cramped_styles)
1193# define visible_math_styles(n) (n >= display_style && n <= all_cramped_styles)
1194
1195static inline halfword tex_math_style_to_size(halfword s)
1196{
1197 if (s == script_style || s == cramped_script_style) {
1198 return script_size;
1199 } else if (s == script_script_style || s == cramped_script_script_style) {
1200 return script_script_size;
1201 } else {
1202 return text_size;
1203 }
1204}
1205
1206typedef enum math_choices {
1207 math_display_choice,
1208 math_text_choice,
1209 math_script_choice,
1210 math_script_script_choice,
1211} math_choices;
1212
1213typedef enum math_discretionary_choices {
1214 math_pre_break_choice,
1215 math_post_break_choice,
1216 math_no_break_choice,
1217} math_discretionary_choices;
1218
1219typedef enum math_aboves {
1220 math_numerator_above,
1221 math_denominator_above,
1222} math_aboves;
1223
1224typedef enum math_limits {
1225 math_limits_top,
1226 math_limits_bottom,
1227} math_limits;
1228
1229typedef enum dir_codes {
1230 dir_lefttoright,
1231 dir_righttoleft
1232} dir_codes;
1233
1234typedef enum quantitity_levels {
1235 level_zero,
1236 level_one,
1237} quantitity_levels;
1238
1239typedef enum move_codes {
1240 move_forward_code,
1241 move_backward_code,
1242} move_codes;
1243
1244# define last_move_code move_backward_code
1245
1246typedef enum ignore_something_codes {
1247 ignore_space_code,
1248 ignore_par_code,
1249 ignore_argument_code,
1250 ignore_upto_code,
1251 ignore_nested_upto_code,
1252 ignore_rest_code,
1253} ignore_something_codes;
1254
1255# define last_ignore_something_code ignore_rest_code
1256
1257typedef enum case_shift_codes {
1258 lower_case_code,
1259 upper_case_code,
1260} case_shift_codes;
1261
1262# define last_case_shift_code upper_case_code
1263
1264typedef enum location_codes {
1265 left_location_code,
1266 right_location_code,
1267 top_location_code,
1268 bottom_location_code,
1269} location_codes;
1270
1271# define first_location_code left_location_code
1272# define last_location_code right_location_code
1273
1274typedef enum remove_item_codes {
1275 kern_item_code,
1276 penalty_item_code,
1277 skip_item_code,
1278 boundary_item_code,
1279} remove_item_codes;
1280
1281# define last_remove_item_code boundary_item_code
1282
1283typedef enum kern_codes {
1284 normal_kern_code,
1285 h_kern_code,
1286 v_kern_code,
1287 non_zero_width_kern_code,
1288} kern_codes;
1289
1290# define last_kern_code normal_kern_code
1291
1292typedef enum penalty_codes {
1293 normal_penalty_code,
1294 h_penalty_code,
1295 v_penalty_code,
1296} penalty_codes;
1297
1298# define last_penalty_code normal_penalty_code
1299
1300typedef enum tex_mskip_codes {
1301 normal_mskip_code,
1302 atom_mskip_code,
1303} tex_mskip_codes;
1304
1305# define last_mskip_code atom_mskip_code
1306
1307typedef enum tex_correction_codes {
1308 italic_correction_code,
1309 left_correction_code,
1310 right_correction_code,
1311} tex_correction_codes;
1312
1313# define last_mskip_code atom_mskip_code
1314
1315
1318
1319# define normal_code 0
1320
1321# endif
1322 |