Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7209 → Rev 7210

/programs/cmm/TWB/TWB.c
296,7 → 296,6
}
if (opened) {
if (strcmp(#header, #version) != 0) {
debugln("!!!!!!!!!!!!!!!!!!!!!!");
ChangeCharset(charsets[cur_encoding], "CP866", #header);
sprintf(#header, "%s - %s", #header, #version);
}
/programs/cmm/eolite/include/copy.h
57,6 → 57,7
}
 
void Paste() {
copy_stak = free(copy_stak);
copy_stak = malloc(64000);
CreateThread(#PasteThread,copy_stak+64000-4);
}
/programs/cmm/eolite/include/translations.h
1,5 → 1,5
#define TITLE "Eolite File Manager v3.83"
#define ABOUT_TITLE "EOLITE 3.83"
#define TITLE "Eolite File Manager v3.85"
#define ABOUT_TITLE "EOLITE 3.85"
 
#ifdef LANG_RUS
?define T_FILE "” ©«"
/programs/cmm/lib/copyf.h
14,9 → 14,7
 
if (!from1) || (!in1)
{
notify("Error: too less copyf params!");
notify(from1);
notify(in1);
notify("Error: too few copyf() params!");
return;
}
if (error = GetFileInfo(from1, #CopyFile_atr1))
28,7 → 26,7
return CopyFolder(from1, in1);
else
{
Operation_Draw_Progress(from1+strchr(from1, '/'));
Operation_Draw_Progress(from1+strrchr(from1, '/'));
return CopyFile(from1, in1);
}
}
37,27 → 35,24
{
BDVK CopyFile_atr;
dword error, cbuf;
dword block;
 
if (error = GetFileInfo(copy_from3, #CopyFile_atr))
{
debugln("Error: CopyFile->GetFileInfo");
}
else if (GetFreeRAM()-1024*1024 < CopyFile_atr.sizelo) //GetFreeRam-1Mb and convert to bytes
else
{
debugln("Error: CopyFile->File size is bigger than RAM avilable");
error = 30;
if (GetFreeRAM()-1024*1024 < CopyFile_atr.sizelo) //GetFreeRam-1Mb and convert to bytes
{
if (error = CopyFileByBlocks(CopyFile_atr.sizelo, copy_from3, copy_in3))
debugln("Error: CopyFile->CopyFileByBlocks");
}
else {
cbuf = malloc(CopyFile_atr.sizelo);
if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3))
{
debugln("Error: CopyFile->ReadFile");
if (error = CopyFileAtOnce(CopyFile_atr.sizelo, copy_from3, copy_in3))
debugln("Error: CopyFile->CopyFileAtOnce");
}
else
{
if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debugln("Error: CopyFile->WriteFile");
}
}
free(cbuf);
if (error) debug_error(copy_from3, error);
return error;
}
96,7 → 91,7
}
else
{
Operation_Draw_Progress(filename+strchr(filename, '/'));
Operation_Draw_Progress(filename+strrchr(filename, '/'));
if (error=CopyFile(#copy_from2, #copy_in2))
{
if (fabs(error)==8) { debugln("Stop copying."); break;} //TODO: may be need grobal var like stop_all
/programs/cmm/lib/file_system.h
129,33 → 129,30
// Ïðî÷èòàòü ôàéë //
////////////////////////////
:f70 read_file_70;
:int ReadFile(dword read_pos, read_file_size, read_buffer, read_file_path)
:int ReadFile(dword offset, data_size, buffer, file_path)
{
read_file_70.func = 0;
read_file_70.param1 = read_pos;
read_file_70.param1 = offset;
read_file_70.param2 = 0;
read_file_70.param3 = read_file_size;
read_file_70.param4 = read_buffer;
read_file_70.param3 = data_size;
read_file_70.param4 = buffer;
read_file_70.rezerv = 0;
read_file_70.name = read_file_path;
read_file_70.name = file_path;
$mov eax,70
$mov ebx,#read_file_70.func
$int 0x40
}
 
///////////////////////////
// Çàïèñàòü ôàéë //
///////////////////////////
:f70 write_file_70;
:int WriteFile(dword write_file_size, write_buffer, write_file_path)
:int WriteFile(dword data_size, buffer, file_path)
{
write_file_70.func = 2;
write_file_70.param1 = 0;
write_file_70.param2 = 0;
write_file_70.param3 = write_file_size;
write_file_70.param4 = write_buffer;
write_file_70.param3 = data_size;
write_file_70.param4 = buffer;
write_file_70.rezerv = 0;
write_file_70.name = write_file_path;
write_file_70.name = file_path;
$mov eax,70
$mov ebx,#write_file_70.func
$int 0x40
165,20 → 162,21
// WriteInFileThatAlredyExists //
////////////////////////////////////////
:f70 write_file_offset_70;
:int WriteFileWithOffset(dword write_data_size, write_buffer, write_file_path, offset)
:int WriteFileWithOffset(dword offset, data_size, buffer, file_path)
{
write_file_offset_70.func = 3;
write_file_offset_70.param1 = offset;
write_file_offset_70.param2 = 0;
write_file_offset_70.param3 = write_data_size;
write_file_offset_70.param4 = write_buffer;
write_file_offset_70.param3 = data_size;
write_file_offset_70.param4 = buffer;
write_file_offset_70.rezerv = 0;
write_file_offset_70.name = write_file_path;
write_file_offset_70.name = file_path;
$mov eax,70
$mov ebx,#write_file_offset_70.func
$int 0x40
}
 
 
///////////////////////////
// Ïðî÷èòàòü ïàïêó //
///////////////////////////
346,4 → 344,47
 
return #size;
}
 
:int CopyFileAtOnce(dword size, copyFrom, copyTo)
dword cbuf;
int error;
{
cbuf = malloc(size);
if (error = ReadFile(0, size, cbuf, copyFrom))
{
debugln("Error: CopyFileAtOnce->ReadFile");
}
else
{
if (error = WriteFile(size, cbuf, copyTo)) debugln("Error: CopyFileAtOnce->WriteFile");
}
free(cbuf);
return error;
}
 
:int CopyFileByBlocks(dword size, copyFrom, copyTo)
dword cbuf;
int error=-1;
dword offpos=0;
int block_size=1024*4024; //copy by 4 MiBs
{
cbuf = malloc(block_size);
WriteFile(0, 0, copyTo); //create file
while(offpos < size)
{
error = ReadFile(offpos, block_size, cbuf, copyFrom);
if (error = 6) { //File ended before last byte was readed
block_size = EBX;
error=0;
}
else
if (error!=0) break;
if (error = WriteFileWithOffset(offpos, block_size, cbuf, copyTo)) break;
offpos += block_size;
}
free(cbuf);
return error;
}
 
 
#endif