diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index e58bf8222e..869d88bc62 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -9,13 +9,11 @@ //libraries #define MEMSIZE 0x100000 -#include "..\lib\kolibri.h" #include "..\lib\strings.h" #include "..\lib\gui.h" #include "..\lib\encoding.h" #include "..\lib\file_system.h" #include "..\lib\mem.h" -#include "..\lib\dll.h" #include "..\lib\draw_buf.h" #include "..\lib\list_box.h" #include "..\lib\cursor.h" @@ -47,6 +45,8 @@ char homepage[] = FROM "html\\homepage.htm"; char accept_language[]= "Accept-Language: en\n"; #endif + + proc_info Form; #define WIN_W 799 #define WIN_H 559 @@ -141,8 +141,7 @@ void main() CreateDir("/tmp0/1/downloads"); SetEventMask(0xa7); - loop() - { + BEGIN_LOOP_APPLICATION: WaitEventTimeout(2); switch(EAX & 0xFF) { @@ -156,13 +155,8 @@ void main() //Menu if (m.y>WB1.list.y) && (m.y
"); - new_buf += strlen(new_buf); + new_buf += sprintf(new_buf,"%s ",#header); for (i=bufpointer; i17) && (strlen(extension)<9) WriteText(-strlen(extension)*font_half_width+Form.cwidth-120,yy+4,font_type,0,extension); + if (icon_n!=17) && (strlen(extension)<9) WriteText(-strlen(extension)*font_half_width+Form.cwidth-120,yy+4,font_type,0,extension); } diff --git a/programs/cmm/eolite/include/left_panel.h b/programs/cmm/eolite/include/left_panel.h index a5d1d51896..90821d1123 100644 --- a/programs/cmm/eolite/include/left_panel.h +++ b/programs/cmm/eolite/include/left_panel.h @@ -63,7 +63,7 @@ void Tip(int y, dword caption, id, arrow) DrawBar(17,y,160,1,0xEFEDEE); DrawFilledBar(17, y+1, 160, 16); WriteText(25,y+5,0x80,sc.work_text,caption); - IF (id<>0) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button + if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button WriteText(165,y+5,0x80,sc.work_text,arrow); //arrow DrawBar(17,y+17,160,1,sc.work_graph); } diff --git a/programs/cmm/eolite/include/sorting.h b/programs/cmm/eolite/include/sorting.h index e5b5bb3b2c..ce6964b2e9 100644 --- a/programs/cmm/eolite/include/sorting.h +++ b/programs/cmm/eolite/include/sorting.h @@ -33,15 +33,16 @@ void Sort_by_Type(int a, b) // filename2 = file_mas[b]*304 + buf+72; n=strlen(filename1)-1; - WHILE (n>0) && (ESBYTE[filename1+n]<>'.') n--; + WHILE (n>0) && (ESBYTE[filename1+n]!='.') n--; if (n) ext1 = filename1+n+1; else ext1=0; - n=strlen(filename2)-1; - WHILE (n>0) && (ESBYTE[filename2+n]<>'.') n--; + n=strlen(filename2); + n--; + WHILE (n>0) && (ESBYTE[filename2+n]!='.') n--; if (n) ext2 = filename2+n+1; else ext2=0; n=strcmp(ext1, ext2); if (n<0) { file_mas[isn] >< file_mas[j]; isn++;} - if (n==0) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;} + if (!n) && (strcmp(filename1, filename2)<=0) { file_mas[isn] >< file_mas[j]; isn++;} } Sort_by_Type(a, isn-2); Sort_by_Type(isn, b); diff --git a/programs/cmm/lib/dll.h b/programs/cmm/lib/dll.h index f84c399d2c..d95fc294d0 100644 --- a/programs/cmm/lib/dll.h +++ b/programs/cmm/lib/dll.h @@ -1,25 +1,24 @@ #ifndef INCLUDE_DLL_H #define INCLUDE_DLL_H -#ifndef INCLUDE_KOLIBRI_H +#ifndef INCLUDE_FILESYSTEM_H #include "../lib/file_system.h" #endif +#ifdef LANG_RUS + #define _TEXT_ERROR_ADD "'Žè¨¡ª ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨" +#elif LANG_EST + #define _TEXT_ERROR_ADD "'Viga teegi laadimisel" +#else + #define _TEXT_ERROR_ADD "'Error while loading library" +#endif char a_libdir[43] = "/sys/lib/\0"; :inline void error_init(dword text) { dword TEXT_ERROR = malloc(1024); - #ifdef LANG_RUS - strcpy(TEXT_ERROR,"'Žè¨¡ª ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ `"); - #elif LANG_EST - strcpy(TEXT_ERROR,"'Viga teegi laadimisel `"); - #else - strcpy(TEXT_ERROR,"'Error while loading library `"); - #endif - strcat(TEXT_ERROR,text); - strcat(TEXT_ERROR,"`' -E"); + sprintf("%s `%s`' -E",_TEXT_ERROR_ADD,text); notify(TEXT_ERROR); free(TEXT_ERROR); } @@ -118,9 +117,9 @@ asm { push ebp mov ebp, esp pushad - mov eax, #mem_Alloc - mov ebx, #mem_Free; - mov ecx, #mem_ReAlloc; + mov eax, #malloc + mov ebx, #free; + mov ecx, #realloc; mov edx, #dll_Load; call SSDWORD[EBP+8] popad @@ -239,9 +238,14 @@ int load_dll2(dword dllname, import_table, byte need_init) return -1; } -void load_dll(dword dllname, import_table, byte need_init) +byte load_dll(dword dllname, import_table, byte need_init) { - if (load_dll2(dllname, import_table, need_init)!=0) error_init(dllname); + if (load_dll2(dllname, import_table, need_init)) + { + error_init(dllname); + return false; + } + return true; } diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index 1267fabc91..9c984c4ee8 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -291,11 +291,6 @@ enum return error; } -:dword notify(dword notify_param) -{ - return RunProgram("@notify", notify_param); -} - :dword abspath(dword relative_path) //GetAbsolutePathFromRelative() { char absolute_path[4096]; @@ -324,7 +319,10 @@ enum sprintf(#ConvertSize_size_prefix,"%d %s",bytes,#size_nm); return #ConvertSize_size_prefix; } - +:dword notify(dword notify_param) +{ + return RunProgram("@notify", notify_param); +} :dword ConvertSizeToKb(unsigned int bytes) { unsigned char size[25]=0; diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index adea342ded..e09ae5894e 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -826,7 +826,6 @@ inline fastcall dword GetStartTime() $int 0x40 } - :dword X_EventRedrawWindow,Y_EventRedrawWindow; :void _EventRedrawWindow() { diff --git a/programs/cmm/lib/lexer.h b/programs/cmm/lib/lexer.h index a41c356d51..6edc224225 100644 --- a/programs/cmm/lib/lexer.h +++ b/programs/cmm/lib/lexer.h @@ -4,9 +4,14 @@ #ifndef INCLUDE_STRING_H #include "../lib/strings.h" #endif + +#ifndef INCLUDE_MEM_H +#include "../lib/mem.h" +#endif /** Splits text into tokens * Author :Pavel Yakovlev * Homepage:https://vk.com/pavelyakov39 + * Ver. : 1.51 */ /** Example: @@ -49,18 +54,75 @@ :struct lexer { byte cmd; - dword token,text; + dword token,text,mem_list,count,buffer_loading; + dword str_buffer; byte type; char quote; - signed count,length; + signed length; dword next(void); dword back(void); + dword list(void); + void free(void); + dword position(dword __); void load(dword _text); void expected(dword _text); }; - - -:void expected(dword _text) +:dword back(void) +{ + +} +:dword lexer::list(void) +{ + dword count_mem,buf_loop,pos; + count_mem = 0; + buf_loop = 5000; // на Ñ‚Ñ‹Ñ Ñлементов. + count = 0; + buffer_loading = malloc(buf_loop); + pos = buffer_loading; + while(type!=LEX_END) + { + pos+=count_mem; + next(); + DSDWORD[pos] = strndup(token,length); + pos+=4; + DSBYTE [pos] = type; + pos++; + count++; + if(pos-buffer_loading>buf_loop) + { + buf_loop*=2; + buffer_loading = realloc(buffer_loading,buf_loop); + } + } + return buffer_loading; +} +:void lexer::free(void) +{ + dword z; + z = count; + while(z) + { + z--; + position(z); + ::free(token); + } + count = 0; + ::free(buffer_loading); +} +:dword lexer::position(dword __) +{ + dword pos1; + if(!count)list(); + if(__>=count)__=count-1; + else if(__<0)__=0; + pos1 = __*5; + pos1 += buffer_loading; + token = DSDWORD[pos1]; + pos1++; + type = DSBYTE[pos1]; + return token; +} +:void lexer::expected(dword _text) { notify(_text); ExitProcess(); @@ -69,15 +131,19 @@ :void lexer::load(dword _text) { text = _text; + count = 0; + str_buffer = 0; } :dword lexer::next(void) { char s; + dword len_str_buf,tmp; dword pos,in; pos = #const_token_lexer; in = text; - + //len_str_buf = 1024; + if(str_buffer)::free(str_buffer); NEXT_TOKEN: length = 0; loop() @@ -184,6 +250,7 @@ { quote = s; in++; + tmp = in; s = DSBYTE[in]; loop() { @@ -210,9 +277,42 @@ DSBYTE[pos] = s; pos++; in++; + /*if(in-tmp>len_str_buf) + { + if(str_buffer) + { + tmp = len_str_buf; + len_str_buf+=1024; + str_buffer = realloc(str_buffer,len_str_buf+1); + strlcpy(str_buffer+tmp,#const_token_lexer,1024); + pos = #const_token_lexer; + } + else { + len_str_buf+=1024; + str_buffer = malloc(len_str_buf+1); + strlcpy(str_buffer,#const_token_lexer,1024); + pos = #const_token_lexer; + } + }*/ s = DSBYTE[in]; } in++; + /*tmp = pos-in; + if(str_buffer) + { + if(tmp) + { + str_buffer = realloc(str_buffer,tmp+1); + strlcpy(str_buffer+len_str_buf,#const_token_lexer,tmp); + } + type = LEX_STR; + length = len_str_buf+tmp; + text = in; + tmp = str_buffer+length; + DSBYTE[tmp] = 0; + token = str_buffer; + return token; + }*/ type = LEX_STR; } else { diff --git a/programs/cmm/lib/obj/http.h b/programs/cmm/lib/obj/http.h index 40e6df259c..6ae57eaea6 100644 --- a/programs/cmm/lib/obj/http.h +++ b/programs/cmm/lib/obj/http.h @@ -10,6 +10,7 @@ #include "../lib/dll.h" #endif +dword NOT_INIT_LIBHTTP = true; dword libHTTP = #alibHTTP; char alibHTTP[23] = "/sys/lib/http.obj\0"; diff --git a/programs/cmm/mouse_cfg/mouse_cfg.c b/programs/cmm/mouse_cfg/mouse_cfg.c index 0efd373138..2ce65356e8 100644 --- a/programs/cmm/mouse_cfg/mouse_cfg.c +++ b/programs/cmm/mouse_cfg/mouse_cfg.c @@ -107,7 +107,7 @@ void main() { mouse_cfg.pointer_speed++; SetMouseSpeed(mouse_cfg.pointer_speed); } - if (id==121) && (mouse_cfg.pointer_speed>0) + if (id==121) && (mouse_cfg.pointer_speed>1) { mouse_cfg.pointer_speed--; SetMouseSpeed(mouse_cfg.pointer_speed);