Subversion Repositories Kolibri OS

Rev

Rev 7972 | Rev 8336 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7972 Rev 8016
Line -... Line 1...
-
 
1
enum {
-
 
2
	PAGE=1, IMG
-
 
3
};
Line 1... Line 4...
1
struct PAGES_CACHE
4
 
2
{
5
struct _cache
3
	dword current_page_buf;
6
{
4
	dword current_page_size;
7
	dword current_buf;
5
	collection url;
8
	dword current_size;
6
	collection_int data;
9
	collection url;
7
	collection_int size;
10
	collection_int data;
-
 
11
	collection_int size;
8
	void add();
12
	collection_int type;
9
	bool has();
13
	void add();
10
	void clear();
14
	bool has();
11
} pages_cache=0;
15
	void clear();
Line 12... Line 16...
12
 
16
} cache=0;
13
void PAGES_CACHE::add(dword _url, _data, _size)
17
 
14
{
18
void _cache::add(dword _url, _data, _size, _type)
15
	dword data_pointer;
19
{
16
	data_pointer = malloc(_size);
20
	dword data_pointer;
17
	memmov(data_pointer, _data, _size);
21
	data_pointer = malloc(_size);
Line 18... Line 22...
18
	data.add(data_pointer);
22
	memmov(data_pointer, _data, _size);
19
 
23
	data.add(data_pointer);
-
 
24
 
20
	url.add(_url);
25
	url.add(_url);
Line 21... Line 26...
21
	size.add(_size);
26
	size.add(_size);
22
}
27
	type.add(_type);
23
 
28
}
24
bool PAGES_CACHE::has(dword _link)
29
 
25
{
30
bool _cache::has(dword _link)
26
	int pos;
31
{
27
	pos = url.get_pos_by_name(_link);
32
	int pos;
28
	if (pos != -1) {
33
	pos = url.get_pos_by_name(_link);
29
		current_page_buf = data.get(pos);
34
	if (pos != -1) {
30
		current_page_size = size.get(pos);
35
		current_buf = data.get(pos);
31
		return true;
36
		current_size = size.get(pos);
Line 32... Line 37...
32
	}
37
		return true;
33
	return false;
38
	}
34
}
39
	return false;
35
 
40
}
36
void PAGES_CACHE::clear()
41
 
37
{
42
void _cache::clear()
38
	url.drop();
43
{
39
	data.drop();
44
	url.drop();
40
	size.drop();
45
	data.drop();