1 | enum g_b_undo_entry_type { |
---|
2 | GB_UNDO_ENTRY_TYPE_DELETED, |
---|
3 | GB_UNDO_ENTRY_TYPE_CREATED, |
---|
4 | GB_UNDO_ENTRY_TYPE_MODIFY, |
---|
5 | GB_UNDO_ENTRY_TYPE_MODIFY_ARRAY |
---|
6 | }; |
---|
7 | |
---|
8 | struct g_b_undo_gbd_struct { |
---|
9 | GBQUARK key; |
---|
10 | struct gb_data_base_type *gbd; |
---|
11 | }; |
---|
12 | |
---|
13 | struct g_b_undo_struct; |
---|
14 | struct g_b_undo_entry_struct { |
---|
15 | struct g_b_undo_struct *father; |
---|
16 | struct g_b_undo_entry_struct *next; |
---|
17 | short type; |
---|
18 | short flag; |
---|
19 | |
---|
20 | struct gb_data_base_type *source; |
---|
21 | int gbm_index; |
---|
22 | /* The original(changed element) or father */ |
---|
23 | long sizeof_this; |
---|
24 | union { |
---|
25 | struct gb_transaction_save *ts; |
---|
26 | struct g_b_undo_gbd_struct gs; |
---|
27 | } d; |
---|
28 | }; |
---|
29 | |
---|
30 | struct g_b_undo_header_struct; |
---|
31 | struct g_b_undo_struct { |
---|
32 | struct g_b_undo_header_struct *father; |
---|
33 | struct g_b_undo_entry_struct *entries; |
---|
34 | struct g_b_undo_struct *next; |
---|
35 | long time_of_day; /* the begin of the transaction */ |
---|
36 | long sizeof_this; /* the size of one undo */ |
---|
37 | }; |
---|
38 | |
---|
39 | struct g_b_undo_header_struct { |
---|
40 | struct g_b_undo_struct *stack; |
---|
41 | long sizeof_this; /* the size of all existing undos */ |
---|
42 | long nstack; /* number of available undos */ |
---|
43 | }; |
---|
44 | |
---|
45 | struct g_b_undo_mgr_struct { |
---|
46 | long max_size_of_all_undos; |
---|
47 | struct g_b_undo_struct *valid_u; |
---|
48 | struct g_b_undo_header_struct *u; /* undo */ |
---|
49 | struct g_b_undo_header_struct *r; /* redo */ |
---|
50 | }; |
---|
51 | |
---|
52 | |
---|