kolibrios/programs/cmm/TWB/anchors.h
Kirill Lipatov (Leency) d05eee0368 WebView 2.0 beta 1:
- rewrite tag parsing procedure to use collections
- completely refactor TWB component
- fix a couple of issues: broken tabs in <pre>, mishandle of local page not found, anchors memory leak
- so finally all id's and names are included as anchors*
(*some anchors in web still don't work)

git-svn-id: svn://kolibrios.org@7752 a494cfbc-eb01-0410-851d-a64ba20cac60
2020-03-26 00:12:32 +00:00

34 lines
622 B
C

struct _anchors {
char current_anchor_name[100];
collection anchor_name;
collection anchor_position;
void add();
int get_pos_by_name();
void clear();
} anchors;
void _anchors::add(dword _name, _pos)
{
anchor_name.add(_name);
anchor_position.add(itoa(_pos));
}
int _anchors::get_pos_by_name(dword _get_name)
{
dword pos_name = anchor_name.get_pos_by_name(_get_name);
if (ESBYTE[_get_name]==NULL) return 0;
if (pos_name==-1) {
return -1;
} else {
return atoi(anchor_position.get(pos_name));
}
}
void _anchors::clear()
{
anchor_name.drop();
anchor_position.drop();
}