4coder/4ed_history.h

65 lines
1011 B
C
Raw Normal View History

2019-02-08 10:03:48 +00:00
/*
* Mr. 4th Dimention - Allen Webster
*
* 24.03.2018
*
* History
*
*/
// TOP
#if !defined(FRED_HISTORY_H)
#define FRED_HISTORY_H
struct Record_Batch_Slot{
i64 length_forward;
i64 length_backward;
2019-02-08 10:03:48 +00:00
i32 first;
};
struct Record{
Node node;
2019-06-01 23:58:28 +00:00
Temp_Memory restore_point;
2020-05-03 15:00:28 +00:00
i64 pos_before_edit;
2019-02-08 10:03:48 +00:00
i32 edit_number;
Record_Kind kind;
union{
struct{
String_Const_u8 forward_text;
String_Const_u8 backward_text;
i64 first;
2019-02-08 10:03:48 +00:00
} single;
struct{
Node children;
i32 count;
} group;
};
};
2019-02-09 07:52:15 +00:00
struct Record_Ptr_Lookup_Table{
Record **records;
i32 count;
i32 max;
};
2019-02-08 10:03:48 +00:00
struct History{
b32 activated;
2020-03-11 23:22:37 +00:00
Arena arena;
2019-09-04 05:31:35 +00:00
Heap heap;
Base_Allocator heap_wrapper;
2019-02-08 10:03:48 +00:00
Node free_records;
Node records;
i32 record_count;
2019-02-09 07:52:15 +00:00
Record_Ptr_Lookup_Table record_lookup;
2019-02-08 10:03:48 +00:00
};
struct Global_History{
i32 edit_number_counter;
i32 edit_grouping_counter;
};
#endif
// BOTTOM