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