Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 24414) +++ trunk/src/undo.c (revision 24415) @@ -124,6 +124,11 @@ return res; } +int pcb_undo_above(uundo_serial_t s_min) +{ + return uundo_undo_above(&pcb_uundo, s_min); +} + int pcb_redo(pcb_bool draw) { int res; @@ -277,6 +282,11 @@ } #endif +size_t pcb_num_undo(void) +{ + return pcb_uundo.num_undo; +} + void pcb_undo_freeze_serial(void) { uundo_freeze_serial(&pcb_uundo); Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 24414) +++ trunk/src/undo.h (revision 24415) @@ -45,6 +45,8 @@ void *pcb_undo_alloc(pcb_board_t *pcb, const uundo_oper_t *oper, size_t data_len); int pcb_undo(pcb_bool); int pcb_redo(pcb_bool); +int pcb_undo_above(uundo_serial_t s_min); + void pcb_undo_inc_serial(void); void pcb_undo_save_serial(void); void pcb_undo_restore_serial(void); @@ -62,6 +64,9 @@ void pcb_undo_freeze_add(void); void pcb_undo_unfreeze_add(void); +/* Return the number of undo slots in use */ +size_t pcb_num_undo(void); + /* Returns 0 if undo integrity is not broken */ int undo_check(void);