4coder/4ed_history.h

67 lines
1.1 KiB
C

/*
* Mr. 4th Dimention - Allen Webster
*
* 24.03.2018
*
* History
*
*/
// TOP
#if !defined(FRED_HISTORY_H)
#define FRED_HISTORY_H
struct Record_Batch_Slot{
i32 length_forward;
i32 length_backward;
i32 first;
};
struct Record{
Node node;
Temp_Memory_Arena_Light restore_point;
i32 edit_number;
Record_Kind kind;
union{
struct{
char *str_forward;
char *str_backward;
i32 length_forward;
i32 length_backward;
i32 first;
} single;
struct{
Buffer_Batch_Edit_Type type;
i32 count;
char *str_base_forward;
char *str_base_backward;
Record_Batch_Slot *batch_records;
} batch;
struct{
Node children;
i32 count;
} group;
};
};
struct History{
b32 activated;
Arena arena;
Memory_Bank bank;
Node free_records;
Node records;
i32 record_count;
};
struct Global_History{
i32 edit_number_counter;
i32 edit_grouping_counter;
};
#endif
// BOTTOM