2020-04-05 09:33:55 +02:00
|
|
|
|
|
|
|
struct PAGES_CACHE
|
|
|
|
{
|
|
|
|
dword current_page_buf;
|
|
|
|
dword current_page_size;
|
|
|
|
collection url;
|
2020-05-23 13:26:58 +02:00
|
|
|
collection_int data;
|
|
|
|
collection_int size;
|
2020-04-05 09:33:55 +02:00
|
|
|
void add();
|
|
|
|
bool has();
|
2020-04-06 21:54:05 +02:00
|
|
|
void clear();
|
2020-05-23 13:26:58 +02:00
|
|
|
} pages_cache=0;
|
2020-04-05 09:33:55 +02:00
|
|
|
|
|
|
|
void PAGES_CACHE::add(dword _url, _data, _size)
|
|
|
|
{
|
|
|
|
dword data_pointer;
|
|
|
|
data_pointer = malloc(_size);
|
|
|
|
memmov(data_pointer, _data, _size);
|
2020-05-23 13:26:58 +02:00
|
|
|
data.add(data_pointer);
|
2020-04-05 09:33:55 +02:00
|
|
|
|
|
|
|
url.add(_url);
|
2020-05-23 13:26:58 +02:00
|
|
|
size.add(_size);
|
2020-04-05 09:33:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool PAGES_CACHE::has(dword _link)
|
|
|
|
{
|
|
|
|
int pos;
|
|
|
|
pos = url.get_pos_by_name(_link);
|
|
|
|
if (pos != -1) {
|
2020-05-23 13:26:58 +02:00
|
|
|
current_page_buf = data.get(pos);
|
|
|
|
current_page_size = size.get(pos);
|
2020-04-05 09:33:55 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2020-04-06 21:54:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void PAGES_CACHE::clear()
|
|
|
|
{
|
|
|
|
url.drop();
|
|
|
|
data.drop();
|
|
|
|
size.drop();
|
|
|
|
current_page_buf = NULL;
|
|
|
|
current_page_size = NULL;
|
2020-04-05 09:33:55 +02:00
|
|
|
}
|