Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2874 → Rev 2873

/programs/network/htmlv/lib/encoding.h
172,7 → 172,14
AL=symbol;
}
 
/*
/*int hex2char(char c)
{
if (c <=9)
return (c+48);
 
return (c - 10 + 'a');
}
 
int hex2char(dword c)
{
if (c <=9)
/programs/network/htmlv/lib/strings.h
13,72 → 13,7
// strtok( ESI)
//------------------------------------------------------------------------------
 
inline fastcall signed int strcmp( ESI, EDI)
{
loop()
{
IF (DSBYTE[ESI]<DSBYTE[EDI]) RETURN -1;
IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1;
IF (DSBYTE[ESI]=='\0') RETURN 0;
ESI++;
EDI++;
}
}
 
 
inline fastcall signed int strncmp( ESI, EDI, ECX)
{
asm {
MOV EBX, EDI
XOR EAX, EAX
MOV EDX, ECX
OR ECX, ECX
JE L1
REPNE SCASB
SUB EDX, ECX
MOV ECX, EDX
MOV EDI, EBX
XOR EBX, EBX
REPE CMPSB
MOV AL, DSBYTE[ ESI-1]
MOV BL, DSBYTE[ EDI-1]
SUB EAX, EBX
L1:
}
}
 
/*
 
inline fastcall signed int strcmpi( ESI,EDI)
uses EBX
{
do{
$lodsb
IF(AL>='a')&&(AL<='z')AL-=0x20;
BL=DSBYTE[(E)DI];
IF(BL>='a')&&(BL<='z')BL-=0x20;
AL-=BL;
IF(!ZEROFLAG)BREAK;
(E)DI++;
}while(BL!=0);
}
 
inline char STRNCMPI((E)SI,(E)DI,(E)CX)
{
(E)AX=0;
LOOPNZ((E)CX){
$lodsb
IF(AL>='a')&&(AL<='z')AL-=0x20;
AH=DSBYTE[EDI];
IF(AH>='a')&&(AH<='z')AH-=0x20;
EDI++;
IF(AL==0)||(AH==0)||(AL!=AH)BREAK;
}
AL=AL-AH;
}*/
 
 
 
inline fastcall unsigned int strlen( EDI)
{
$xor eax, eax
172,6 → 107,18
}
 
 
inline fastcall signed int strcmp( ESI, EDI)
{
loop()
{
IF (DSBYTE[ESI]<DSBYTE[EDI]) RETURN -1;
IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1;
IF (DSBYTE[ESI]=='\0') RETURN 0;
ESI++;
EDI++;
}
}
 
inline fastcall unsigned int strchr( ESI,BL)
{
int jj=0;
256,21 → 203,6
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* strtok( LPSTR dest, src, divs);
src - óêàçàòåëü íà èñõîäíóþ ñòðîêó èëè ðåçóëüòàò ïðåäûäóùåãî âûçîâà
dest - óêàçàòåëü íà áóôåð, êóäà áóäåò ñêîïèðîâàíî ñëîâî
310,13 → 242,3
L4: POP ECX
} DSBYTE[ EDX] = 0;
}
 
#define strncpy strcpyn
#define strnmov strmovn
#define stricmp strcmpi
#define strcmpn strncmp
#define strncmpi strcmpni
#define stricmpn strcmpni
#define strnicmp strcmpni
#define strincmp strcmpni
#define strcmpin strcmpni
/programs/network/htmlv/lib/kolibri.h
33,7 → 33,7
 
struct mouse
{
int x,y,lkm,pkm,hor,vert;
dword x,y,lkm,pkm,hor,vert;
void get();
};
 
165,7 → 165,7
byte reserved[1024-71];
};
 
inline fastcall void GetProcessInfo( EBX, ECX)
void GetProcessInfo( EBX, ECX)
{
$mov eax,9;
$int 0x40
205,30 → 205,19
$int 0x40
}
 
inline fastcall int KillProcess( ECX)
inline fastcall ExitProcess()
{
$mov eax,18;
$mov ebx,18;
$mov eax,-1;
$int 0x40
}
 
inline fastcall int ExitSystem( ECX)
inline fastcall int KillProcess( ECX)
{
#define TURN_OFF 2
#define REBOOT 3
#define KERNEL 4
$mov eax, 18
$mov ebx, 9
$mov eax,18;
$mov ebx,18;
$int 0x40
}
 
inline fastcall ExitProcess()
{
$mov eax,-1;
$int 0x40
}
 
//------------------------------------------------------------------------------
 
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
239,7 → 228,7
$int 0x40
}
 
inline fastcall dword GetSkinHeight()
inline fastcall dword GetSkinWidth()
{
$push ebx
$mov eax,48
255,17 → 244,12
$int 0x40
}
 
inline fastcall int GetScreenWidth()
inline fastcall dword GetScreenWidth()
{
$mov eax, 14
EAX = 14;
EBX = 4;
$int 0x40
$shr eax, 16
}
 
inline fastcall int GetScreenHeight()
{
$mov eax, 14
$int 0x40
$and eax,0x0000FFFF
}
 
276,7 → 260,7
$int 0x40
}
 
inline fastcall int TestBit( EAX, CL)
byte fastcall TestBit( EAX, CL)
{
$shr eax,cl
$and eax,1
285,16 → 269,17
 
//------------------------------------------------------------------------------
 
void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI)
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
{
EAX = 12; // function 12:tell os about windowdraw
EBX = 1;
$int 0x40
EAX = 0;
EBX = x << 16 + sizeX;
ECX = y << 16 + sizeY;
EDX = WindowType << 24 | WindowAreaColor;
EDX = mainAreaType << 24 | mainAreaColour;
ESI = headerType << 24 | headerColour;
$xor eax,eax
$int 0x40
 
EAX = 12; // function 12:tell os about windowdraw
304,7 → 289,7
 
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
{
$mov eax, 67
EAX = 67;
$int 0x40
}
 
331,13 → 316,6
$int 0x40;
}
 
dword GetPixelColor(dword x, x_size, y)
{
$mov eax, 35
EBX= y*x_size+x;
$int 0x40
}
 
void PutImage(dword EBX,w,h,x,y)
{
EAX = 7;
387,7 → 365,7
 
//------------------------------------------------------------------------------
 
:void DrawRegion(dword x,y,width,height,color1)
void DrawRegion(dword x,y,width,height,color1)
{
DrawBar(x,y,width,1,color1); //¯®«®á  £®à ᢥàåã
DrawBar(x,y+height,width,1,color1); //¯®«®á  £®à á­¨§ã
395,7 → 373,7
DrawBar(x+width,y,1,height+1,color1); //¯®«®á  ¢¥àåã á¯à ¢ 
}
 
:void DrawRegion_3D(dword x,y,width,height,color1,color2)
void DrawRegion_3D(dword x,y,width,height,color1,color2)
{
DrawBar(x,y,width+1,1,color1); //¯®«®á  £®à ᢥàåã
DrawBar(x,y+1,1,height-1,color1); //¯®«®á  á«¥¢ 
403,7 → 381,7
DrawBar(x,y+height,width,1,color2); //¯®«®á  £®à á­¨§ã
}
 
:void DrawFlatButton(dword x,y,width,height,id,color,text)
void DrawFlatButton(dword x,y,width,height,id,color,text)
{
DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
413,7 → 391,7
WriteText(width/2+x+1,height/2-3+y,0x80,0,text,0);
}
 
:void DrawCircle(int x, y, r)
void DrawCircle(int x, y, r)
{
int i;
float px=0, py=r, ii = r * 3.1415926 * 2;
/programs/network/htmlv/lib/mem.h
98,113 → 98,3
l2:
}
}
 
 
/*:void fastcall memsetz( EDI, ECX)
{
asm {
XOR EAX, EAX
MOV EDX, ECX
SHR ECX, 2
REP STOSD
MOV ECX, EDX
AND ECX, 3
REP STOSB
}
}
 
:void fastcall memset( EDI, ECX, AL)
{
asm {
MOV AH, AL
MOVZX EDX, AX
SHL EAX, 16
OR EAX, EDX
MOV EDX, ECX
SHR ECX, 2
REP STOSD
MOV ECX, EDX
AND ECX, 3
REP STOSB
}
}
 
:void fastcall memcpy( EDI, ESI, ECX)
{
asm {
MOV EDX, ECX
SHR ECX, 2
REP MOVSD
MOV ECX, EDX
AND ECX, 3
REP MOVSB
}
}
 
:void fastcall memsetd( EDI, ECX, EAX)
{
asm {
REP STOSD
}
}
 
:void fastcall memcpyd( EDI, ESI, ECX)
{
asm {
REP MOVSD
}
}
 
:void fastcall memmov( EDI, ESI, ECX)
{
asm {
MOV EAX, ECX
CMP EDI, ESI
JG L1
JE L2
SAR ECX, 2
JS L2
REP MOVSD
MOV ECX, EAX
AND ECX, 3
REP MOVSB
JMP SHORT L2
L1: LEA ESI, DSDWORD[ ESI+ECX-4]
LEA EDI, DSDWORD[ EDI+ECX-4]
SAR ECX, 2
JS L2
STD
REP MOVSD
MOV ECX, EAX
AND ECX, 3
ADD ESI, 3
ADD EDI, 3
REP MOVSB
CLD
L2:
}
}
 
:long fastcall memcmp( ESI, EDI, ECX)
{
asm {
MOV EAX, ECX
SHR ECX, 2
REPE CMPSD
MOV ECX, EAX
AND ECX, 3
REPE CMPSB
XOR EAX, EAX
XOR ECX, ECX
MOV AL, DSBYTE[ ESI-1]
MOV CL, DSBYTE[ EDI-1]
SUB EAX, ECX
}
}*/
 
 
/*#define memzset memsetz
#define memset0 memsetz
#define mem0set memsetz
#define memset32 memsetd
#define memcpy32 memcpyd*/
/programs/network/htmlv/lib/file_system.h
25,10 → 25,33
 
 
///////////////////////////
// Ïàðàìåòðû ôàéëà //
///////////////////////////
f70 getinfo_file_70;
BDVK getinfo_file_info;
dword GetFileInfo(dword file_name)
{
getinfo_file_70.func = 5;
getinfo_file_70.param1 =
getinfo_file_70.param2 =
getinfo_file_70.param3 =
getinfo_file_70.param4 = #getinfo_file_info;
getinfo_file_70.rezerv = 0;
getinfo_file_70.name = file_name;
$mov eax,70
$mov ebx,#getinfo_file_70.func
$int 0x40
IF (EAX == 0) {
EAX = #getinfo_file_info;
}
}
 
 
///////////////////////////
// Çàïóñê ïðîãðàììû //
///////////////////////////
f70 run_file_70;
:int RunProgram(dword run_path, run_param)
int RunProgram(dword run_path, run_param)
{
run_file_70.func = 7;
run_file_70.param1 =
40,6 → 63,7
$mov eax,70
$mov ebx,#run_file_70.func
$int 0x40
RETURN EAX;
}
 
///////////////////////////
46,7 → 70,7
// Ñîçäàíèå ïàïêè //
///////////////////////////
f70 create_dir_70;
:int CreateFolder(dword new_folder_path)
void CreateFolder(dword new_folder_path)
{
create_dir_70.func = 9;
create_dir_70.param1 =
64,7 → 88,7
// Óäàëåíèå ôàéëà/ïàïêè //
////////////////////////////
f70 del_file_70;
:int DeleteFile(dword del_file_path)
void DeleteFile(dword del_file_path)
{
del_file_70.func = 8;
del_file_70.param1 =
82,43 → 106,25
// Ïðî÷èòàòü ôàéë //
////////////////////////////
f70 read_file_70;
:int ReadFile(dword read_pos, read_file_size, read_buffer, read_file_path)
int ReadFile(dword pos, file_size, read_buffer, file_path)
{
read_file_70.func = 0;
read_file_70.param1 = read_pos;
read_file_70.param1 = pos;
read_file_70.param2 = 0;
read_file_70.param3 = read_file_size;
read_file_70.param3 = file_size;
read_file_70.param4 = read_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)
{
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.rezerv = 0;
write_file_70.name = write_file_path;
$mov eax,70
$mov ebx,#write_file_70.func
$int 0x40
}
 
///////////////////////////
// Ïðî÷èòàòü ïàïêó //
///////////////////////////
f70 read_dir_70;
:int ReadDir(dword file_count, read_buffer, dir_path)
int ReadDir(dword file_count, read_buffer, dir_path)
{
read_dir_70.func = 1;
read_dir_70.param1 =
132,45 → 138,45
$int 0x40
}
 
 
///////////////////////////
// Ïàðàìåòðû ôàéëà //
// Ñêîïèðîâàòü ôàéë //
///////////////////////////
f70 getinfo_file_70;
BDVK getinfo_file_info;
:dword GetFileInfo(dword file_path)
f70 CopyFile_f;
inline fastcall dword CopyFile(dword EBX,ECX)
{
getinfo_file_70.func = 5;
getinfo_file_70.param1 =
getinfo_file_70.param2 =
getinfo_file_70.param3 = 0;
getinfo_file_70.param4 = #getinfo_file_info;
getinfo_file_70.rezerv = 0;
getinfo_file_70.name = file_path;
BDVK CopyFile_atr;
dword s=EBX, d=ECX, cBufer=0;
CopyFile_f.func = 5;
CopyFile_f.param1 = 0;
CopyFile_f.param2 = 0;
CopyFile_f.param3 = 0;
CopyFile_f.param4 = #CopyFile_atr;
CopyFile_f.rezerv = 0;
CopyFile_f.name = s;
$mov eax,70
$mov ebx,#getinfo_file_70.func
$mov ebx, #CopyFile_f
$int 0x40
}
 
 
///////////////////////////
// Ñêîïèðîâàòü ôàéë //
///////////////////////////
:int CopyFile(dword copy_from, copy_in)
if (!EAX)
{
BDVK CopyFile_atr;
dword cBufer=0;
cBufer = malloc(CopyFile_atr.sizelo);
ReadFile(dword 0, CopyFile_atr.sizelo, cBufer, s);
if (! GetFileInfo(copy_from))
IF (!EAX)
{
mem_Init();
cBufer = mem_Alloc(CopyFile_atr.sizelo);
if (! ReadFile(dword 0, CopyFile_atr.sizelo, cBufer, copy_from))
if (! WriteFile(CopyFile_atr.sizelo, cBufer, copy_in)) return 1;
CopyFile_f.func = 2;
CopyFile_f.param1 = 0;
CopyFile_f.param2 = 0;
CopyFile_f.param3 = CopyFile_atr.sizelo;
CopyFile_f.param4 = cBufer;
CopyFile_f.rezerv = 0;
CopyFile_f.name = d;
$mov eax, 70
$mov ebx, #CopyFile_f
$int 0x40
}
return 0;
}
}
 
 
//Asper
186,4 → 192,4
$mov eax,70
$mov ebx,#read_file_70.func
$int 0x40
}
}