texmarks.h /size: 2325 b    last modification: 2024-01-16 10:22
1/*
2    See license.txt in the root of this project.
3*/
4
5# ifndef LMT_MARKS_H
6# define LMT_MARKS_H
7
8typedef enum get_mark_codes {
9    current_marks_code,
10    top_marks_code,
11    first_marks_code,
12    bot_marks_code,
13    split_first_marks_code,
14    split_bot_marks_code,
15    /* these map to zero */
16    top_mark_code,         /*tex the mark in effect at the previous page break */
17    first_mark_code,       /*tex the first mark between |top_mark| and |bot_mark| */
18    bot_mark_code,         /*tex the mark in effect at the current page break */
19    split_first_mark_code, /*tex the first mark found by |\vsplit| */
20    split_bot_mark_code,   /*tex the last mark found by |\vsplit| */
21} get_mark_codes;
22
23# define first_valid_mark_code top_marks_code
24# define last_unique_mark_code split_bot_marks_code
25# define last_get_mark_code    split_bot_mark_code
26
27typedef enum set_mark_codes {
28    set_mark_code,
29    set_marks_code,
30    clear_marks_code,
31    flush_marks_code,
32} set_mark_codes;
33
34# define last_set_mark_code flush_marks_code
35
36typedef halfword mark_record[split_bot_marks_code+1];
37
38typedef struct mark_state_info {
39    mark_record *data;
40    int          min_used;
41    int          max_used;
42    memory_data  mark_data;
43} mark_state_info;
44
45extern mark_state_info lmt_mark_state;
46
47extern void     tex_initialize_marks          (void);
48extern int      tex_valid_mark                (halfword m);
49extern void     tex_reset_mark                (halfword m);
50extern void     tex_wipe_mark                 (halfword m);
51extern void     tex_delete_mark               (halfword m, int what);
52extern halfword tex_get_some_mark             (halfword chr, halfword val);
53extern halfword tex_new_mark                  (quarterword subtype, halfword index, halfword ptr);
54extern void     tex_update_top_marks          (void);
55extern void     tex_update_first_and_bot_mark (halfword m);
56extern void     tex_update_first_marks        (void);
57extern void     tex_update_split_mark         (halfword m);
58extern void     tex_show_marks                (void);
59extern int      tex_has_mark                  (halfword m);
60extern halfword tex_get_mark                  (halfword m, halfword s);
61extern void     tex_set_mark                  (halfword m, halfword s, halfword v);
62
63extern void     tex_run_mark                  (void);
64
65# endif
66