forked from KolibriOS/kolibrios
Apps/webview: Version 3.8. Fixed <p>, new h3 style
- `cmm/lib/collection.h`: fixed memory leak, more safe, optimizations; - webview: mostly fix <p>, new h3 style, some other updates. Reviewed-on: KolibriOS/kolibrios#115
This commit is contained in:
@@ -101,9 +101,12 @@ void TWebBrowser::SetPageDefaults()
|
||||
img_url.drop();
|
||||
text_colors.drop();
|
||||
text_colors.add(0);
|
||||
if (!secondrun) {
|
||||
bg_colors.drop();
|
||||
bg_colors.add(DEFAULT_BG_COL);
|
||||
canvas.Fill(0, DEFAULT_BG_COL);
|
||||
} else {
|
||||
canvas.Fill(0, bg_colors.get(0));
|
||||
}
|
||||
header = NULL;
|
||||
draw_y = BODY_MARGIN;
|
||||
draw_x = left_gap = BODY_MARGIN;
|
||||
|
@@ -45,9 +45,10 @@ void PAGE_LINKS::clear()
|
||||
w.drop();
|
||||
h.drop();
|
||||
underline_h.drop();
|
||||
id.drop();
|
||||
|
||||
element_links.drop();
|
||||
unic_links.drop();
|
||||
id.drop();
|
||||
|
||||
active = -1;
|
||||
active_url = 0;
|
||||
|
@@ -60,7 +60,8 @@ void TWebBrowser::SetStyle()
|
||||
|
||||
void TWebBrowser::tag_p()
|
||||
{
|
||||
IF (tag.prior[0] == 'h') || (streq(#tag.prior,"td")) || (streq(#tag.prior,"p")) return;
|
||||
IF (tag.prior[0] == 'h') || (streq(#tag.prior,"td")) return;
|
||||
if (!tag.opened) && (streq(#tag.prior,"p")) return;
|
||||
NewLine();
|
||||
}
|
||||
|
||||
@@ -244,11 +245,19 @@ void TWebBrowser::tag_h1234_caption()
|
||||
} else {
|
||||
style.h = tag.opened;
|
||||
if (tag.opened) {
|
||||
if (!style.pre) NewLine();
|
||||
draw_y += 10;
|
||||
list.SetFont(BASIC_CHAR_W*2, 14*2, 10011001b);
|
||||
list.item_h = BASIC_LINE_H * 2 - 2;
|
||||
if (tag.is("h1")) style.b = true;
|
||||
if (!style.pre) {
|
||||
NewLine();
|
||||
NewLine();
|
||||
}
|
||||
if (tag.is("h1")) {
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+12, 10011001b);
|
||||
style.b = true;
|
||||
} else if (tag.is("h2")) {
|
||||
list.SetFont(BASIC_CHAR_W*2, 14+12, 10011001b);
|
||||
} else {
|
||||
list.SetFont(6*2, 9+7, 10001001b);
|
||||
}
|
||||
style.cur_line_h = list.item_h = list.font_h + 2;
|
||||
} else {
|
||||
if (tag.is("h1")) style.b = false;
|
||||
NewLine();
|
||||
|
@@ -337,6 +337,7 @@ void ProcessKeyEvent()
|
||||
{
|
||||
case SCAN_CODE_UP: EventScrollUpAndDown(SCAN_CODE_UP); return;
|
||||
case SCAN_CODE_DOWN: EventScrollUpAndDown(SCAN_CODE_DOWN); return;
|
||||
case SCAN_CODE_F2: EventEditSource(); return;
|
||||
case SCAN_CODE_F6: {omnibox_edit.flags=ed_focus; DrawOmnibox();} return;
|
||||
case SCAN_CODE_F5: EventRefreshPage(); return;
|
||||
case SCAN_CODE_ENTER: if (omnibox_edit.flags & ed_focus) EventSubmitOmnibox(); return;
|
||||
@@ -571,7 +572,6 @@ void OpenPage(dword _open_URL)
|
||||
history.add(#new_url);
|
||||
WB1.custom_encoding = -1;
|
||||
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home));
|
||||
else if (streq(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#buildin_page_help, sizeof(buildin_page_help));
|
||||
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test));
|
||||
else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
|
||||
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||
@@ -740,7 +740,12 @@ void LoadInternalPage(dword _bufdata, _in_bufsize){
|
||||
WB1.DrawPage();
|
||||
}
|
||||
http.hfree();
|
||||
if (WB1.img_url.count) { GetImg(true); DrawOmnibox(); }
|
||||
if (WB1.img_url.count) {
|
||||
GetImg(true);
|
||||
DrawOmnibox();
|
||||
} else {
|
||||
PageLoaded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,7 +767,7 @@ void DrawProgress()
|
||||
void EventShowPageMenu()
|
||||
{
|
||||
open_lmenu(mouse.x, mouse.y, MENU_TOP_LEFT, NULL, #rmb_menu);
|
||||
menu_id = VIEW_SOURCE;
|
||||
menu_id = BACK_BUTTON;
|
||||
}
|
||||
|
||||
void EventShowLinkMenu()
|
||||
@@ -976,8 +981,13 @@ dword GetImg(bool _new)
|
||||
DrawStatusBar(T_RENDERING);
|
||||
WB1.Reparse();
|
||||
WB1.DrawPage();
|
||||
debugln(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100));
|
||||
DrawStatusBar(NULL);
|
||||
PageLoaded();
|
||||
}
|
||||
|
||||
void PageLoaded()
|
||||
{
|
||||
DrawStatusBar(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100,
|
||||
GetStartTime()-render_start_time*10));
|
||||
}
|
||||
|
||||
stop:
|
||||
|
@@ -16,7 +16,7 @@ struct _cache
|
||||
void add();
|
||||
bool has();
|
||||
void clear();
|
||||
} cache=0;
|
||||
} cache;
|
||||
|
||||
void _cache::add(dword _url, _data, _size, _type, _charset)
|
||||
{
|
||||
@@ -37,6 +37,7 @@ void _cache::add(dword _url, _data, _size, _type, _charset)
|
||||
bool _cache::has(dword _link)
|
||||
{
|
||||
int pos;
|
||||
if (!url.count) return false;
|
||||
pos = url.get_pos_by_name(_link);
|
||||
if (pos != -1) {
|
||||
current_buf = data.get(pos);
|
||||
|
@@ -9,8 +9,11 @@ char buildin_page_home[] = FROM "res/homepage_ru.htm";
|
||||
char buildin_page_help[] = FROM "res/help_ru.htm";
|
||||
char accept_language[]= "Accept-Language: ru\n";
|
||||
char rmb_menu[] =
|
||||
"<EFBFBD><EFBFBD>ᬮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD>|Ctrl+U
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD>";
|
||||
"Back|Ctrl+<
|
||||
Forward|Ctrl+>
|
||||
-
|
||||
<EFBFBD><EFBFBD>ᬮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD>|Ctrl+U
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD>|F2";
|
||||
char main_menu[] =
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>...|Ctrl+O
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+N
|
||||
@@ -34,7 +37,7 @@ char update_is_current[] = "'WebView\n
|
||||
char update_can_not_copy[] = "'WebView\n<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> Downloads <20><> Ramdisk. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮 <20><><EFBFBD><EFBFBD><EFBFBD>.' -tE";
|
||||
char clear_cache_ok[] = "'WebView\n<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>饭.' -tI";
|
||||
#define T_RENDERING "<22><><EFBFBD><EFBFBD><EFBFBD>ਭ<EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>..."
|
||||
#define T_DONE_IN_SEC "<22><>⮢<EFBFBD>: %i ᥪ"
|
||||
#define T_DONE_IN_SEC "<22><>⮢<EFBFBD>: %i ᥪ (%i <20><><EFBFBD><EFBFBD>ᥪ)"
|
||||
#else
|
||||
//===================================================//
|
||||
// //
|
||||
@@ -46,8 +49,11 @@ char buildin_page_home[] = FROM "res/homepage_en.htm";
|
||||
char buildin_page_help[] = FROM "res/help_en.htm";
|
||||
char accept_language[]= "Accept-Language: en\n";
|
||||
char rmb_menu[] =
|
||||
"View source|Ctrl+U
|
||||
Edit source";
|
||||
"Back|Ctrl+<
|
||||
Forward|Ctrl+>
|
||||
-
|
||||
View source|Ctrl+U
|
||||
Edit source|F2";
|
||||
char main_menu[] =
|
||||
"Open local file...|Ctrl+O
|
||||
New window|Ctrl+N
|
||||
@@ -70,7 +76,7 @@ char update_is_current[] = "'WebView\nThe browser is up to date.' -tI";
|
||||
char update_can_not_copy[] = "'WebView\nError copying a new version from Downloads folder!\nProbably too litle space on Ramdisk.' -tE";
|
||||
char clear_cache_ok[] = "'WebView\nThe cache has been cleared.' -tI";
|
||||
#define T_RENDERING "Rendering..."
|
||||
#define T_DONE_IN_SEC "Done in %i sec"
|
||||
#define T_DONE_IN_SEC "Done in %i sec (%i milisec)"
|
||||
#endif
|
||||
|
||||
//===================================================//
|
||||
@@ -83,7 +89,6 @@ char buildin_page_test[] = FROM "res/test.htm";
|
||||
|
||||
#define URL_SERVICE_HISTORY "WebView:history"
|
||||
#define URL_SERVICE_HOMEPAGE "WebView:home"
|
||||
#define URL_SERVICE_HELP "WebView:help"
|
||||
#define URL_SERVICE_TEST "WebView:test"
|
||||
|
||||
char webview_shared[] = "WEBVIEW";
|
||||
@@ -91,12 +96,12 @@ char webview_shared[] = "WEBVIEW";
|
||||
enum {
|
||||
NEW_TAB=600,
|
||||
ENCODINGS=700,
|
||||
BACK_BUTTON=800,
|
||||
FORWARD_BUTTON, REFRESH_BUTTON, GOTOURL_BUTTON, CHANGE_ENCODING,
|
||||
SANDWICH_BUTTON, VIEW_SOURCE, EDIT_SOURCE, OPEN_FILE,
|
||||
NEW_WINDOW, VIEW_HISTORY, DOWNLOAD_MANAGER, CLEAR_CACHE,
|
||||
UPDATE_BROWSER, IN_NEW_TAB, IN_NEW_WINDOW, COPY_LINK_URL,
|
||||
DOWNLOAD_LINK_CT, TAB_ID,
|
||||
BACK_BUTTON=800, FORWARD_BUTTON, VIEW_SOURCE, EDIT_SOURCE,
|
||||
REFRESH_BUTTON, GOTOURL_BUTTON, CHANGE_ENCODING,
|
||||
SANDWICH_BUTTON,
|
||||
OPEN_FILE, NEW_WINDOW, VIEW_HISTORY, DOWNLOAD_MANAGER,
|
||||
CLEAR_CACHE, UPDATE_BROWSER, IN_NEW_TAB, IN_NEW_WINDOW,
|
||||
COPY_LINK_URL, DOWNLOAD_LINK_CT, TAB_ID,
|
||||
TAB_CLOSE_ID = 900
|
||||
};
|
||||
|
||||
@@ -107,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
||||
|
||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||
|
||||
char version[]="WebView 3.7";
|
||||
char version[]="WebView 3.8";
|
@@ -2,15 +2,16 @@
|
||||
<head>
|
||||
<title>Homepage</title>
|
||||
</head>
|
||||
<body><pre>Bookmarks:
|
||||
<body><pre>Welcome to WebView a Text-Based Browser.
|
||||
|
||||
Bookmarks:
|
||||
1. <a href=//kolibrios.org>KolibriOS homepage</a>
|
||||
2. <a href=//kolibri-n.org>KolibriN homepage</a>
|
||||
3. <a href="//builds.kolibrios.org">Night-builds</a>
|
||||
4. <a href="//store.kolibri-n.org">Kolibri Stuff</a>
|
||||
2. <a href="//builds.kolibrios.org">Night-builds</a>
|
||||
3. <a href="//ftp.kolibrios.org">KolibriOS FTP</a>
|
||||
|
||||
<font bg=#F8F15B>By the way,</font>
|
||||
<font color="#555555">• You can check for browser updates from the main menu.
|
||||
• To run a web search, type a text in the adress box and press Ctrl+Enter.
|
||||
• You can also use other <a href=WebView:help><font color=555555>Hotkeys</font></a>.
|
||||
• Pressing F6 moves a text cursor to the omnibox.
|
||||
• Click on a label in the bottom right corner to change the encoding of a page.
|
||||
</font>
|
||||
|
@@ -4,14 +4,13 @@
|
||||
<title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></title>
|
||||
</head>
|
||||
<body><pre><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
1. <a href=//kolibrios.org><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> KolibriOS</a>
|
||||
2. <a href=//kolibri-n.org>KolibriN10</a>
|
||||
3. <a href="//builds.kolibrios.org"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮન</a>
|
||||
4. <a href="//store.kolibri-n.org">Kolibri Store</a>
|
||||
1. <a href=//kolibrios.org><EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᠩ<EFBFBD> KolibriOS</a>
|
||||
2. <a href="//builds.kolibrios.org"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮન</a>
|
||||
3. <a href="//ftp.kolibrios.org">KolibriOS FTP</a>
|
||||
|
||||
<font bg=#F8F15B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,</font>
|
||||
<font color="#555555">• <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
• <20><><EFBFBD> <20><><EFBFBD>᪠ <20> Google <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>᭮<EFBFBD> <20><>ப<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+Enter
|
||||
• <20><><EFBFBD><EFBFBD> ⠪<><E2A0AA> <20><>㣨<EFBFBD> <a href=WebView:help><font color=555555><EFBFBD><EFBFBD><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></font></a>.
|
||||
• <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> F6 <20><>६<EFBFBD>頥<EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
• <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>, <20><><EFBFBD> <20>⮣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ࠢ<EFBFBD><E0A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㣫<> <20><><EFBFBD><EFBFBD>.
|
||||
</font>
|
||||
|
@@ -7,8 +7,8 @@
|
||||
|
||||
#define TABS_MAX 5
|
||||
|
||||
TWebBrowser tabdata[TABS_MAX+1]=0;
|
||||
_history tabstory[TABS_MAX+1]=0;
|
||||
TWebBrowser tabdata[TABS_MAX+1];
|
||||
_history tabstory[TABS_MAX+1];
|
||||
|
||||
struct TAB
|
||||
{
|
||||
|
@@ -13,7 +13,6 @@ struct collection_int
|
||||
dword buf;
|
||||
dword buf_size;
|
||||
unsigned count;
|
||||
void alloc();
|
||||
void add();
|
||||
dword get();
|
||||
dword set();
|
||||
@@ -22,34 +21,35 @@ struct collection_int
|
||||
dword get_last();
|
||||
void pop();
|
||||
void drop();
|
||||
#define DWSIZE4 4
|
||||
};
|
||||
|
||||
:void collection_int::alloc() {
|
||||
if (!buf) {
|
||||
buf_size = 4096;
|
||||
buf = malloc(4096);
|
||||
} else {
|
||||
buf_size += 4096;
|
||||
buf = realloc(buf, buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
:void collection_int::add(dword _in) {
|
||||
if (!buf) || (count * sizeof(dword) >= buf_size) alloc();
|
||||
EAX = count * sizeof(dword) + buf;
|
||||
ESDWORD[EAX] = _in;
|
||||
unsigned i;
|
||||
if (!buf) {
|
||||
//if (buf_size) notify("'buf_size on empty buf' -A");
|
||||
buf_size = 4096 * 5;
|
||||
buf = malloc(4096 * 5);
|
||||
//if (!buf) notify("'malloc error' -E");
|
||||
} else if (count + 1 * DWSIZE4 >= buf_size) {
|
||||
buf_size += 4096 * 5;
|
||||
buf = realloc(buf, buf_size);
|
||||
//if (!buf) notify("'realloc error' -E");
|
||||
}
|
||||
i = count * DWSIZE4 + buf;
|
||||
ESDWORD[i] = _in;
|
||||
count++;
|
||||
}
|
||||
|
||||
:dword collection_int::get(dword pos) {
|
||||
if (pos<0) || (pos>=count) return 0;
|
||||
return ESDWORD[pos * sizeof(dword) + buf];
|
||||
if (!buf) || (pos<0) || (pos>=count) return 0;
|
||||
return ESDWORD[pos * DWSIZE4 + buf];
|
||||
}
|
||||
|
||||
|
||||
:dword collection_int::set(dword pos, _in) {
|
||||
while (pos >= count) add(0);
|
||||
EAX = pos * sizeof(dword) + buf;
|
||||
EAX = pos * DWSIZE4 + buf;
|
||||
ESDWORD[EAX] = _in;
|
||||
return ESDWORD[EAX];
|
||||
}
|
||||
@@ -57,8 +57,8 @@ struct collection_int
|
||||
:void collection_int::swap(dword pos1, pos2) {
|
||||
while (pos1 >= count) add(0);
|
||||
while (pos2 >= count) add(0);
|
||||
EAX = pos1 * sizeof(dword) + buf;
|
||||
EBX = pos2 * sizeof(dword) + buf;
|
||||
EAX = pos1 * DWSIZE4 + buf;
|
||||
EBX = pos2 * DWSIZE4 + buf;
|
||||
ESDWORD[EAX] >< ESDWORD[EBX];
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ struct collection_int
|
||||
|
||||
:void collection_int::drop() {
|
||||
count = 0;
|
||||
if (buf) buf = free(buf);
|
||||
buf_size = 0;
|
||||
}
|
||||
|
||||
/*========================================================
|
||||
@@ -87,12 +89,11 @@ struct collection_int
|
||||
|
||||
struct collection
|
||||
{
|
||||
int realloc_size, count;
|
||||
unsigned int realloc_size, count;
|
||||
dword data_start;
|
||||
dword data_size;
|
||||
collection_int offset;
|
||||
int add();
|
||||
int addn();
|
||||
dword add();
|
||||
dword get(); //get_name_by_pos
|
||||
dword get_pos_by_name();
|
||||
void drop();
|
||||
@@ -105,28 +106,22 @@ struct collection
|
||||
if (realloc_size<4096) realloc_size = 4096;
|
||||
if (!data_size) {
|
||||
data_size = realloc_size;
|
||||
data_start = malloc(realloc_size);
|
||||
}
|
||||
else {
|
||||
data_start = malloc(data_size);
|
||||
} else {
|
||||
data_size = data_size + realloc_size;
|
||||
data_start = realloc(data_start, data_size);
|
||||
}
|
||||
}
|
||||
|
||||
:int collection::add(dword in) {
|
||||
return addn(in, strlen(in));
|
||||
}
|
||||
|
||||
:int collection::addn(dword in, len) {
|
||||
if (offset.get(count)+len+2 > data_size) {
|
||||
:dword collection::add(dword in) {
|
||||
dword len = strlen(in);
|
||||
while (offset.get(count) + len + 4 > data_size) {
|
||||
increase_data_size();
|
||||
addn(in, len);
|
||||
return 1;
|
||||
}
|
||||
strncpy(data_start+offset.get(count), in, len);
|
||||
count++;
|
||||
offset.set(count, offset.get(count-1) + len + 1);
|
||||
return 1;
|
||||
return data_start+offset.get(count-1);
|
||||
}
|
||||
|
||||
:dword collection::get(dword pos) {
|
||||
@@ -141,7 +136,9 @@ struct collection
|
||||
:dword collection::get_pos_by_name(dword name) {
|
||||
dword i;
|
||||
for (i=0; i<count; i++) {
|
||||
if (strcmp(data_start + offset.get(i), name)==0) return i;
|
||||
if (streq(data_start + offset.get(i), name)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@@ -57,8 +57,8 @@ inline fastcall void utf8rutodos( ESI)
|
||||
while (BL=ESBYTE[ESI])
|
||||
{
|
||||
if (BL == 0xD0) || (BL == 0xD1) EDI--;
|
||||
else if (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //<EFBFBD>
|
||||
else if (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //<EFBFBD>
|
||||
else if (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //I urk
|
||||
else if (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //i urk
|
||||
//0xE2 0x80 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
else if (BL == 0xE2) && (ESBYTE[ESI+1]==0x80)
|
||||
switch (ESBYTE[ESI+2])
|
||||
|
Reference in New Issue
Block a user