decrease c-- app size

git-svn-id: svn://kolibrios.org@8383 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-12-13 01:21:31 +00:00
parent afa42a24be
commit 9d28bd0e9d
6 changed files with 19 additions and 17 deletions

View File

@ -2,10 +2,9 @@
//by den po - jdp@bk.ru //by den po - jdp@bk.ru
#define MEMSIZE 4096 * 60 #define MEMSIZE 4096 * 60
#include "../lib/io.h" #include "../lib/fs.h"
#include "../lib/strings.h" #include "../lib/strings.h"
#include "../lib/obj/console.h" #include "../lib/obj/console.h"
IO io1, io2;
#define MAX_PATH 260 #define MAX_PATH 260
@ -92,11 +91,8 @@ console() {
char s1; char s1;
int s2; int s2;
srcfile = io1.read(srcfilename); read_file(srcfilename, #srcfile, #srcfilesize);
dstfile = io2.read(dstfilename); read_file(dstfilename, #dstfile, #dstfilesize);
srcfilesize = io1.FILES_SIZE;
dstfilesize = io2.FILES_SIZE;
if (!srcfile) die("'First file not found' -E"); if (!srcfile) die("'First file not found' -E");
if (!dstfile) die("'Second file not found' -E"); if (!dstfile) die("'Second file not found' -E");

View File

@ -198,6 +198,16 @@ inline fastcall void GetCurDir( ECX, EDX)
$int 0x40 $int 0x40
} }
void read_file(dword path1, buf, size)
{
EAX = 68;
EBX = 27;
ECX = path1;
$int 0x40;
ESDWORD[size] = EDX;
ESDWORD[buf] = EAX;
}
//===================================================// //===================================================//
// // // //
// Misc // // Misc //

View File

@ -21,7 +21,7 @@
#endif #endif
#ifndef INCLUDE_IO_H #ifndef INCLUDE_IO_H
#include "../lib/io.h" #include "../lib/fs.h"
#endif #endif
#include "../lib/patterns/rgb.h" #include "../lib/patterns/rgb.h"
@ -69,14 +69,13 @@ int kfont_char_width[255];
:bool KFONT::init(dword font_path) :bool KFONT::init(dword font_path)
{ {
IO label_io; dword fsize_notused;
if(font)free(font); if(font)free(font);
label_io.read(font_path); read_file(font_path, #font_begin, #fsize_notused);
if(!EAX) { if(!EAX) {
label_io.run("/sys/@notify", "'Error: KFONT is not loaded.' -E"); RunProgram("/sys/@notify", "'Error: KFONT is not loaded.' -E");
return false; return false;
} }
font_begin = label_io.buffer_data;
changeSIZE(); changeSIZE();
smooth = true; smooth = true;
return true; return true;

View File

@ -1,7 +1,6 @@
#define MEMSIZE 4096*40 #define MEMSIZE 4096*40
#include "../lib/gui.h" #include "../lib/gui.h"
#include "../lib/io.h"
#include "../lib/collection.h" #include "../lib/collection.h"
#include "../lib/list_box.h" #include "../lib/list_box.h"
#include "../lib/fs.h" #include "../lib/fs.h"

View File

@ -5,7 +5,6 @@ SOFTWARE CENTER v2.86
#define MEMSIZE 4096 * 15 #define MEMSIZE 4096 * 15
#include "..\lib\strings.h" #include "..\lib\strings.h"
#include "..\lib\mem.h" #include "..\lib\mem.h"
#include "..\lib\io.h"
#include "..\lib\gui.h" #include "..\lib\gui.h"
#include "..\lib\obj\libio.h" #include "..\lib\obj\libio.h"
@ -266,7 +265,7 @@ void EventIconClick(dword appid)
// }end // }end
if (file_exists(#run_app_path)) { if (file_exists(#run_app_path)) {
io.run(#run_app_path, param_pos); //0 or offset RunProgram(#run_app_path, param_pos); //0 or offset
if (param_pos) ESBYTE[param_pos - 1] = '|'; if (param_pos) ESBYTE[param_pos - 1] = '|';
} else { } else {
notify("'Application not found' -E"); notify("'Application not found' -E");

View File

@ -16,7 +16,6 @@
// // // //
//===================================================// //===================================================//
#include "../lib/io.h"
#include "../lib/gui.h" #include "../lib/gui.h"
#include "../lib/fs.h" #include "../lib/fs.h"
#include "../lib/list_box.h" #include "../lib/list_box.h"
@ -134,7 +133,7 @@ void main()
EventKillCurrentProcess(); EventKillCurrentProcess();
} }
if (BTN_ID_PROC_INFO == btn) { if (BTN_ID_PROC_INFO == btn) {
io.run("/sys/tinfo", itoa(GetProcessSlot(current_process_id))); RunProgram("/sys/tinfo", itoa(GetProcessSlot(current_process_id)));
} }
break; break;
case evReDraw: case evReDraw: