1 #ifndef UNDO_HISTORY_H_
2 #define UNDO_HISTORY_H_
4 #include "ring_buffer.h"
6 typedef void (*RevertAction)(void *context, size_t context_size);
12 UndoHistory create_undo_history(void);
15 void destroy_undo_history(UndoHistory undo_history)
17 destroy_ring_buffer(undo_history.actions);
20 void undo_history_push(UndoHistory *undo_history,
23 size_t context_data_size);
24 void undo_history_pop(UndoHistory *undo_history);
26 void undo_history_clean(UndoHistory *undo_history);
29 int undo_history_empty(UndoHistory *undo_history)
31 return undo_history->actions.count == 0;
34 #endif // UNDO_HISTORY_H_