1 #ifndef UNDO_HISTORY_H_
2 #define UNDO_HISTORY_H_
6 #define CONTEXT_SIZE 256
8 #define ASSERT_CONTEXT_SIZE(context) \
9 trace_assert(sizeof(context) <= CONTEXT_SIZE)
12 char data[CONTEXT_SIZE];
15 typedef void (*RevertAction)(void *layer, Context context);
23 typedef struct UndoHistory UndoHistory;
25 UndoHistory *create_undo_history(void);
26 void destroy_undo_history(UndoHistory *undo_history);
28 void undo_history_push(UndoHistory *undo_history, Action action);
29 void undo_history_pop(UndoHistory *undo_history);
31 #endif // UNDO_HISTORY_H_