make history.h global

git-svn-id: svn://kolibrios.org@5977 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
2015-12-16 22:08:01 +00:00
parent 0be26c4c22
commit 35b817fff3
4 changed files with 50 additions and 42 deletions
+38
View File
@@ -0,0 +1,38 @@
#include "..\lib\collection.h"
struct _History {
collection items;
int active;
dword add();
dword back();
dword forward();
dword current();
} History;
dword _History::add(dword in)
{
if (!strcmp(in, items.get(active-1))) return 0;
items.count = active;
items.add(in);
active++;
return 1;
}
dword _History::back()
{
if (active==1) return 0;
active--;
return items.get(active-1);
}
dword _History::forward()
{
if (active==items.count) return 0;
active++;
return items.get(active-1);
}
dword _History::current()
{
return items.get(active-1);
}