2020-03-18 03:45:36 +03:00
|
|
|
|
|
|
|
struct _anchors {
|
2020-03-27 13:38:54 +03:00
|
|
|
char current[256];
|
2020-03-18 03:45:36 +03:00
|
|
|
collection anchor_name;
|
|
|
|
collection anchor_position;
|
|
|
|
void add();
|
2020-03-26 03:12:32 +03:00
|
|
|
int get_pos_by_name();
|
|
|
|
void clear();
|
2020-03-27 13:38:54 +03:00
|
|
|
void take_anchor_from();
|
2020-03-18 03:45:36 +03:00
|
|
|
} anchors;
|
|
|
|
|
|
|
|
void _anchors::add(dword _name, _pos)
|
|
|
|
{
|
|
|
|
anchor_name.add(_name);
|
|
|
|
anchor_position.add(itoa(_pos));
|
|
|
|
}
|
|
|
|
|
2020-03-26 03:12:32 +03:00
|
|
|
int _anchors::get_pos_by_name(dword _get_name)
|
2020-03-18 03:45:36 +03:00
|
|
|
{
|
|
|
|
dword pos_name = anchor_name.get_pos_by_name(_get_name);
|
2020-03-26 03:12:32 +03:00
|
|
|
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();
|
2020-03-18 03:45:36 +03:00
|
|
|
}
|
|
|
|
|
2020-03-27 13:38:54 +03:00
|
|
|
void _anchors::take_anchor_from(dword _URL)
|
|
|
|
{
|
|
|
|
int anchor_pos;
|
|
|
|
if (!current) && (_URL) && (anchor_pos = strrchr(_URL, '#')) {
|
|
|
|
strncpy(#current, _URL+anchor_pos-1, sizeof(_anchors.current)-1);
|
2020-05-23 00:39:04 +03:00
|
|
|
ESBYTE[_URL+anchor_pos-1] = '\0';
|
2020-03-27 13:38:54 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|