Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5591 → Rev 5598

/programs/cmm/lib/clipboard.h
1,3 → 1,10
#ifndef INCLUDE_CLIPBOARD_H
#define INCLUDE_CLIPBOARD_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
struct buffer_data
{
dword size;
49,4 → 56,6
$mov eax, 54
$mov ebx, 3
$int 0x40
}
}
 
#endif
/programs/cmm/lib/copyf.h
1,5 → 1,11
//copyf - copy file or folder with content
#ifndef INCLUDE_COPYF_H
#define INCLUDE_COPYF_H
 
#ifndef INCLUDE_FILESYSTEM_H
#include "../lib/file_system.h"
#endif
 
:int copyf(dword from1, in1)
{
dword error;
75,16 → 81,12
for (i=0; i<fcount; i++)
{
filename = i*304+dirbuf+72;
strcpy(#copy_from2, from2);
chrcat(#copy_from2, '/');
strcat(#copy_from2, filename);
strcpy(#copy_in2, in2);
chrcat(#copy_in2, '/');
strcat(#copy_in2, filename);
sprintf(#copy_from2,"%s/%s",from2,filename);
sprintf(#copy_in2,"%s/%s",in2,filename);
 
if ( TestBit(ESDWORD[filename-40], 4) ) //isdir?
{
if ( (!strcmp(filename, ".")) || (!strcmp(filename, "..")) ) continue;
if ( (!strncmp(filename, ".",1)) || (!strncmp(filename, "..",2)) ) continue;
CopyFolder(#copy_from2, #copy_in2);
}
else
145,15 → 147,8
{
char error[256];
N = fabs(N);
if (N<=33)
{
strcpy(#error, ERROR_TEXT[N]);
}
else
{
strcpy(#error, itoa(N));
strcat(#error, " - Unknown error number O_o");
}
if (N<=33) strcpy(#error, ERROR_TEXT[N]);
else sprintf(#error,"%d%s",N," - Unknown error number O_o");
return #error;
}
 
161,4 → 156,6
{
if (path) debugln(path);
debugln(get_error(error_number));
}
}
 
#endif
/programs/cmm/lib/cursor.h
1,5 → 1,11
// cursor file should be 32x32 in default MS Windows .cur format
#ifndef INCLUDE_CURSOR_H
#define INCLUDE_CURSOR_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
struct CustomCursor
{
dword CursorPointer;
43,3 → 49,5
ECX = CursorPointer;
$int 0x40
}
 
#endif
/programs/cmm/lib/dll.h
1,3 → 1,6
#ifndef INCLUDE_DLL_H
#define INCLUDE_DLL_H
 
char a_libdir[43] = "/sys/lib/\0";
 
:inline void error_init(dword text)
234,4 → 237,7
@exit01:
return -1;
//error_init(dllname);
}
}
 
 
#endif
/programs/cmm/lib/draw_buf.h
1,4 → 1,10
#ifndef INCLUDE_DRAW_BUF_H
#define INCLUDE_DRAW_BUF_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
dword buf_data;
dword zbuf_data;
 
149,3 → 155,5
PutPaletteImage(zbuf_data+8, zbufw, zbufh, zbufx, zbufy, 32, 0);
}
}
 
#endif
/programs/cmm/lib/encoding.h
1,26 → 1,32
#ifndef INCLUDE_ENCODING_H
#define INCLUDE_ENCODING_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
inline fastcall void wintodos( ESI)
{
while (BL=ESBYTE[ESI])
{
IF (BL>=192)
if (BL>=192)
{
IF (BL>=240) ESBYTE[ESI] = BL - 16;
ELSE ESBYTE[ESI] = BL - 64;
if (BL>=240) ESBYTE[ESI] = BL - 16;
else ESBYTE[ESI] = BL - 64;
}
ELSE
else
{
IF (BL==178) ESBYTE[ESI] = 73; //I
IF (BL==179) ESBYTE[ESI] = 105; //i
IF (BL==175) ESBYTE[ESI] = 244; //J
IF (BL==191) ESBYTE[ESI] = 245; //j
IF (BL==170) ESBYTE[ESI] = 242; //E
IF (BL==186) ESBYTE[ESI] = 243; //e
IF (BL==168) ESBYTE[ESI] = 240; //ð
IF (BL==184) ESBYTE[ESI] = 'e'; //e
IF (BL==180) ESBYTE[ESI] = 254; //ã
IF ((BL==147) || (BL==148) || (BL==171) || (BL==187)) ESBYTE[ESI] = 34;
IF ((BL==150) || (BL==151)) ESBYTE[ESI] = 45;
if (BL==178) ESBYTE[ESI] = 73; //I
if (BL==179) ESBYTE[ESI] = 105; //i
if (BL==175) ESBYTE[ESI] = 244; //J
if (BL==191) ESBYTE[ESI] = 245; //j
if (BL==170) ESBYTE[ESI] = 242; //E
if (BL==186) ESBYTE[ESI] = 243; //e
if (BL==168) ESBYTE[ESI] = 240; //ð
if (BL==184) ESBYTE[ESI] = 'e'; //e
if (BL==180) ESBYTE[ESI] = 254; //ã
if ((BL==147) || (BL==148) || (BL==171) || (BL==187)) ESBYTE[ESI] = 34;
if ((BL==150) || (BL==151)) ESBYTE[ESI] = 45;
}
ESI++;
}
30,14 → 36,14
byte mas[66] = "椥ä£å¨©ª«¬­®¯ïàáâ㦢ìë§èíéçꞀ–„…”ƒ•ˆ‰Š‹ŒŽŸ‘’“†‚œ›‡˜™—š";
inline fastcall void koitodos( EDI)
{
WHILE (BL=ESBYTE[EDI])
while (BL=ESBYTE[EDI])
{
IF (BL >= 0xC0)
if (BL >= 0xC0)
{
BL -= 0xC0;
ESBYTE[EDI] = mas[BL];
}
//IF (ESBYTE[EDI]=='\244') ESBYTE[EDI]='i';
//if (ESBYTE[EDI]=='\244') ESBYTE[EDI]='i';
EDI++;
}
}
49,27 → 55,27
EDI=ESI;
while (BL=ESBYTE[ESI])
{
IF (BL == 0xD0) || (BL == 0xD1) EDI--;
else IF (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //ø
else IF (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //ì
if (BL == 0xD0) || (BL == 0xD1) EDI--;
else if (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //ø
else if (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //ì
//0xE2 0x80 - ñãðóïïèðîâàòü
else IF (BL == 0xE2) && (ESBYTE[ESI+1]==0x80)
SWITCH (ESBYTE[ESI+2])
else if (BL == 0xE2) && (ESBYTE[ESI+1]==0x80)
switch (ESBYTE[ESI+2])
{
case 0x93: //long defis
CASE 0x94:
case 0x94:
{
ESBYTE[EDI] = '-';
ESI+=2;
BREAK;
break;
}
CASE 0xA2: //central point
case 0xA2: //central point
{
ESBYTE[EDI] = '*';
ESI+=2;
BREAK;
break;
}
CASE 0xA6: //ìíîãîòî÷èå
case 0xA6: //ìíîãîòî÷èå
{
ESBYTE[EDI] = ESBYTE[EDI+1] = ESBYTE[EDI+2] = '.';
EDI+=2;
78,67 → 84,67
}
}
 
else IF (BL == 0xC2) //òàáëèöó ïåðåêîäèðîâîê?
SWITCH(ESBYTE[ESI+1]) {
else if (BL == 0xC2) //òàáëèöó ïåðåêîäèðîâîê?
switch(ESBYTE[ESI+1]) {
case 0xAB: //"
CASE 0xBB: //"
case 0xBB: //"
{
ESBYTE[EDI] = '\"';
ESI++;
BREAK;
break;
}
CASE 0xB7: // _
case 0xB7: // _
{
ESBYTE[EDI] = '_';
ESI++;
BREAK;
break;
}
CASE 0xA0: // Alt+160 - íåðàçáèâàþùèé ïðîáåë
case 0xA0: // Alt+160 - íåðàçáèâàþùèé ïðîáåë
{
ESBYTE[EDI] = ' ';
ESI++;
BREAK;
break;
}
CASE 0xB0: // ãðàäóñ
case 0xB0: // ãðàäóñ
{
ESBYTE[EDI] = '\29';
ESI++;
BREAK;
break;
}
CASE 0xA9: // (c) --- âûëåò Î_î
case 0xA9: // (c) --- âûëåò Î_î
{
ESBYTE[EDI] = 'c';
ESI++;
BREAK;
break;
}
CASE 0xAE: // (r)
case 0xAE: // (r)
{
ESBYTE[EDI] = 'r';
ESI++;
BREAK;
break;
}
}
 
ELSE IF (BL >= 0x90) && (BL <= 0xAF)
else if (BL >= 0x90) && (BL <= 0xAF)
{
BL -= 0x10;
ESBYTE[EDI] = BL;
}
ELSE IF (BL >= 0x80) && (BL <= 0x8F)
else if (BL >= 0x80) && (BL <= 0x8F)
{
BL += 0x60;
ESBYTE[EDI] = BL;
}
ELSE IF (BL >= 0xB0) && (BL <= 0xBF)
else if (BL >= 0xB0) && (BL <= 0xBF)
{
BL -= 0x10;
ESBYTE[EDI] = BL;
}
ELSE ESBYTE[EDI] = BL;
else ESBYTE[EDI] = BL;
ESI++;
EDI++;
}
WHILE (EDI<ESI)
while (EDI<ESI)
{
ESBYTE[EDI] = ' ';
EDI++;
151,13 → 157,13
{
dword j=0, symbol=0;
char ch=0x00;
FOR (;j<2;j++)
for (;j<2;j++)
{
ch=ESBYTE[htmlcolor+j];
IF (ch==0x0d) || (ch=='\9') RETURN 0;
IF ((ch>='0') && (ch<='9')) ch -= '0';
IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
if (ch==0x0d) || (ch=='\9') RETURN 0;
if ((ch>='0') && (ch<='9')) ch -= '0';
if ((ch>='A') && (ch<='F')) ch -= 'A'-10;
if ((ch>='a') && (ch<='f')) ch -= 'a'-10;
symbol = symbol*0x10 + ch;
}
wintodos(#symbol);
165,3 → 171,4
}
 
 
#endif
/programs/cmm/lib/file_system.h
1,3 → 1,13
#ifndef INCLUDE_FILESYSTEM_H
#define INCLUDE_FILESYSTEM_H
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_STRING_H
#include "../lib/strings.h"
#endif
 
:struct f70{
dword func;
dword param1;
326,4 → 336,5
strcat(#size, " Kb");
 
return #size;
}
}
#endif
/programs/cmm/lib/gui.h
1,5 → 1,14
//#include "strings.h"
#ifndef INCLUDE_GUI_H
#define INCLUDE_GUI_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_STRING_H
#include "../lib/strings.h"
#endif
 
:void DrawRectangle(dword x,y,w,h,color1)
{
if (w<=0) || (h<=0) return;
168,4 → 177,6
col = strength * DSBYTE[color_image] / 10;
DSBYTE[color_image] = col;
}
}
}
 
#endif
/programs/cmm/lib/kolibri.h
1,5 → 1,5
//CODED by Veliant, Leency, Nable. GNU GPL licence.
 
#ifndef INCLUDE_KOLIBRI_H
#define INCLUDE_KOLIBRI_H
 
#startaddress 0
877,4 → 877,6
__generator = GetStartTime();
//mem_Init();
main();
}
}
 
#endif
/programs/cmm/lib/lexer.h
0,0 → 1,232
#ifndef INCLUDE_LEXER_H
#define INCLUDE_LEXER_H
 
#ifndef INCLUDE_STRING_H
#include "../lib/strings.h"
#endif
/** Splits text into tokens
* Author :Pavel Yakovlev
* Homepage:https://vk.com/pavelyakov39
*/
 
/** Example:
* lexer lex;
* lex.load("var a=123;");
* lex.next();
* lex.token; //TOKEN == 'var'
* lex.type ; //TYPE == LEX_VAR
*
* lex.next();
* lex.token; //TOKEN == 'a'
* lex.type ; //TYPE == LEX_VAR
*
* lex.next();
* lex.token; //TOKEN == '='
* lex.type ; //TYPE == LEX_IND
*
* lex.next();
* lex.token; //TOKEN == '123'
* lex.type ; //TYPE == LEX_DEC
*
* lex.next();
* lex.token; //TOKEN == ';'
* lex.type ; //TYPE == LEX_IND
*
* lex.next();
* lex.token; //TOKEN == ''
* lex.type ; //TYPE == LEX_END
*/
 
#define LEX_END 1
#define LEX_STR 2
#define LEX_DEC 3
#define LEX_VAR 4
#define LEX_FNC 5
#define LEX_IND 6
#define LEX_NUL 0
 
:char const_token_lexer[1024];
:struct lexer
{
byte cmd;
dword token,text;
byte type;
char quote;
signed count,length;
dword next(void);
dword back(void);
void load(dword _text);
void expected(dword _text);
};
 
 
:void expected(dword _text)
{
notify(_text);
ExitProcess();
}
 
:void lexer::load(dword _text)
{
text = _text;
}
 
:dword lexer::next(void)
{
char s;
dword pos,in;
pos = #const_token_lexer;
in = text;
NEXT_TOKEN:
length = 0;
loop()
{
s = DSBYTE[in];
if(s!=9)&&(s!=10)&&(s!=13)&&(s!=32)break;
in++;
text++;
}
if(s==0){type=LEX_END;DSBYTE[pos]=0;token="";return token;}
if(s=='/')
{
in++;
s = DSBYTE[in];
// Line comments
if(s=='/')
{
loop()
{
in++;
s = DSBYTE[in];
if(s==10)||(s==13)||(s==0)goto NEXT_TOKEN;
/* Add comments*/
}
}
if(s=='*')
{
loop()
{
in++;
s = DSBYTE[in];
if(s=='*')if(DSBYTE[in+1]=='/')
{
in+=2;
goto NEXT_TOKEN;
}
}
}
}
if (strchr("=<>!~&|#",s))
{
loop()
{
if (!strchr("=<>!~&|#",s)) break;
DSBYTE[pos] = s;
pos++;
in++;
s = DSBYTE[in];
}
type = LEX_IND;
}
else if (strchr(";(,)}{[]+-.*/:^%?$@№`",s))
{
DSBYTE[pos] = s;
pos++;
type = LEX_IND;
in++;
}
else if(s>='0')&&(s<='9')
{
loop()
{
if(s<'0')||(s>'9')if(s!='.')break;
DSBYTE[pos] = s;
pos++;
in++;
s = DSBYTE[in];
}
type = LEX_DEC;
}
else if(s>='A')&&(s<='z')&&(!strchr("[]\\^`",s))
{
loop()
{
if(s<'A')||(s>'z')if(s<'0')||(s>'9')break;
if(strchr("[]\\^`",s))break;
DSBYTE[pos] = s;
pos++;
in++;
s = DSBYTE[in];
}
loop()
{
s = DSBYTE[in];
if(s!=9)if(s!=10)if(s!=13)if(s!=32)break;
in++;
text++;
}
type = LEX_VAR;
if(s=='(')type = LEX_FNC;
}
else if(s=='"')||(s=='\'')
{
quote = s;
in++;
s = DSBYTE[in];
loop()
{
if(s=='\\')
{
in++;
s = DSBYTE[in];
if(!s){type = LEX_STR;goto GOTO_LEX_END;}
if(!cmd)switch(s)
{
case 'n':s='\n';break;
case 'r':s='\r';break;
case 't':s='\t';break;
}
else {
DSBYTE[pos] = '\\';
pos++;
}
goto LEX_STEP_1;
}
if(!s){type = LEX_STR;goto GOTO_LEX_END;}
else if(s==quote)break;
LEX_STEP_1:
DSBYTE[pos] = s;
pos++;
in++;
s = DSBYTE[in];
}
in++;
type = LEX_STR;
}
else {
in++;
type = LEX_NUL;
DSBYTE[pos] = s;
pos++;
}
GOTO_LEX_END:
length = in-text;
text = in;
DSBYTE[pos] = 0;
token = #const_token_lexer;
return token;
}
 
#endif
/programs/cmm/lib/list_box.h
1,5 → 1,11
//list_box
#ifndef INCLUDE_LIST_BOX_H
#define INCLUDE_LIST_BOX_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
struct llist
{
int x, y, w, h, min_h, line_h, text_y;
150,4 → 156,6
current=count-1;
first=count-visible;
return 1;
}
}
 
#endif
/programs/cmm/lib/mem.h
1,3 → 1,5
#ifndef INCLUDE_MEM_H
#define INCLUDE_MEM_H
 
dword mem_init()
{
96,99 → 98,4
#define mem_Free free
#define mem_Init mem_init
 
/*: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) //copy AL to EDI of ECX num (void *dest, size_t, char c )
{
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 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*/
#endif
/programs/cmm/lib/obj/box_lib.h
1,4 → 1,15
//BOX_LIB - Asper
#ifndef INCLUDE_BOX_LIB_H
#define INCLUDE_BOX_LIB_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
 
dword boxlib = #aEdit_box_lib;
char aEdit_box_lib[]="/sys/lib/box_lib.obj";
 
169,4 → 180,6
dword font_size_y;
dword font_color;
dword font_backgr_color;
};
};
 
#endif
/programs/cmm/lib/obj/http.h
1,5 → 1,15
//HTTP library
#ifndef INCLUDE_LIBHTTP_H
#define INCLUDE_LIBHTTP_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
 
dword libHTTP = #alibHTTP;
char alibHTTP[23] = "/sys/lib/http.obj\0";
 
65,4 → 75,6
:dword file_get_contents(dword url,...)
{
http_get(url,FLAG_HTTP11,"");
}
}
 
#endif
/programs/cmm/lib/obj/iconv.h
1,5 → 1,15
//convert text characters
#ifndef INCLUDE_LIBICONV_H
#define INCLUDE_LIBICONV_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
 
dword iconv_lib = #a_iconv_lib;
char a_iconv_lib[19]="/sys/lib/iconv.obj\0";
 
56,4 → 66,6
CH_CP1252,
CH_ISO8859_5,
CH_CP866
};
};
 
#endif
/programs/cmm/lib/obj/libimg_lib.h
1,5 → 1,25
//Asper
#ifndef INCLUDE_LIBIMG_H
#define INCLUDE_LIBIMG_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_MEM_H
#include "../lib/mem.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
 
#ifndef INCLUDE_LIBIO_H
#include "../lib/obj/libio_lib.h"
#endif
 
:byte init_imglib_check;
 
//library
dword libimg = #alibimg;
char alibimg[21] = "/sys/lib/libimg.obj\0";
100,3 → 120,5
$stc
return 0;
}
 
#endif
/programs/cmm/lib/obj/libini.h
1,3 → 1,14
#ifndef INCLUDE_LIBINI_H
#define INCLUDE_LIBINI_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
 
dword libini = #alibini;
char alibini[] = "/sys/lib/libini.obj";
 
23,3 → 34,5
//char aini_get_shortcut[] = "ini_get_shortcut";
char aini_get_color[] = "ini_get_color";
//char aini_set_color[] = "ini_set_color";
 
#endif
/programs/cmm/lib/obj/libio_lib.h
1,5 → 1,15
//Asper
#ifndef INCLUDE_LIBIO_H
#define INCLUDE_LIBIO_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
 
//library
dword libio = #alibio;
char alibio[21] = "/sys/lib/libio.obj\0"; //"libio.obj\0";
32,3 → 42,5
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
 
#endif
/programs/cmm/lib/obj/netcode.h
1,5 → 1,14
//Network library
#ifndef INCLUDE_NETCODE_H
#define INCLUDE_NETCODE_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
dword netcode_lib = #a_netcode_lib;
char a_netcode_lib[21]="/sys/lib/netcode.obj\0";
 
16,4 → 25,6
Кодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp.
 
int base64_decode(char inp[], char outp[], int len);
Декодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp.*/
Декодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp.*/
 
#endif
/programs/cmm/lib/obj/network.h
1,5 → 1,14
//Network library
#ifndef INCLUDE_NETWORK_H
#define INCLUDE_NETWORK_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
dword network_lib = #a_network_lib;
char a_network_lib[21]="/sys/lib/network.obj\0";
 
61,3 → 70,5
struct addrinfo *ai_next;
};
*/
 
#endif
/programs/cmm/lib/obj/proc_lib.h
1,3 → 1,13
#ifndef INCLUDE_PROCLIB_H
#define INCLUDE_PROCLIB_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
dword Proc_lib = #aProc_lib;
char aProc_lib[] = "/sys/lib/proc_lib.obj";
 
31,3 → 41,4
word y_start;
};
 
#endif
/programs/cmm/lib/obj/truetype.h
1,5 → 1,14
// Truetype library
#ifndef INCLUDE_LIBTRUETYPE_H
#define INCLUDE_LIBTRUETYPE_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
dword libtruetype = #att_libtruetype;
char att_libtruetype[22] = "/sys/lib/truetype.obj\0";
35,3 → 44,5
int index_map; // a cmap mapping for our chosen character encoding
int indexToLocFormat; // format needed to map from glyph index to glyph
};
 
#endif
/programs/cmm/lib/obj/xml.h
1,3 → 1,13
#ifndef INCLUDE_LIBXML_H
#define INCLUDE_LIBXML_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_DLL_H
#include "../lib/dll.h"
#endif
dword XML = #aXML_lib;
char aXML_lib[] = "/sys/lib/xml.obj";
 
123,4 → 133,6
dword strict; // (int)
dword reserved1; // (int)
AXElement reserved2; // (AXElement)
};
};
 
#endif
/programs/cmm/lib/patterns/libimg_load_skin.h
1,3 → 1,10
#ifndef INCLUDE_LIBIMG_LOAD_SKIN_H
#define INCLUDE_LIBIMG_LOAD_SKIN_H
 
#ifndef INCLUDE_LIBIMG_H
#include "../lib/obj/libimg_lib.h"
#endif
 
struct libimg_image {
dword image, w, h;
};
18,4 → 25,6
image_data = ESDWORD[struct_pointer + 24];
max_i = w * h * 4 + image_data;
for (i = image_data; i < max_i; i += 4) if (DSDWORD[i]==0) DSDWORD[i] = new_transparent_color;
}
}
 
#endif
/programs/cmm/lib/patterns/restart_process.h
1,3 → 1,10
#ifndef INCLUDE_RESTART_PROCESS_H
#define INCLUDE_RESTART_PROCESS_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
enum {
MULTIPLE,
SINGLE
16,4 → 23,6
}
}
RunProgram(proc_name, "");
}
}
 
#endif
/programs/cmm/lib/random.h
1,23 → 1,10
/*******************************************************************************
#ifndef INCLUDE_RANDOM_H
#define INCLUDE_RANDOM_H
 
MenuetOS MineSweeper
Copyright (C) 2003 Ivan Poddubny
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
*******************************************************************************/
#define MASK_RAND 123456789
#define IQ_RAND 12773
#define IA_RAND 16807
93,3 → 80,4
__generator = EAX;
}
 
#endif
/programs/cmm/lib/socket.h
1,3 → 1,10
#ifndef INCLUDE_SOCKET_H
#define INCLUDE_SOCKET_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#define SOCK_STREAM 1
#define SOCK_DGRAM 2
 
8,7 → 15,8
 
dword errorcode;
 
struct sockaddr_in{
struct sockaddr_in
{
word sin_family;
word sin_port;
dword sin_addr;
94,3 → 102,5
errorcode = EBX;
$pop ebx
}
 
#endif
/programs/cmm/lib/strings.h
1,3 → 1,14
#ifndef INCLUDE_STRING_H
#define INCLUDE_STRING_H
 
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
 
#ifndef INCLUDE_MEM_H
#include "../lib/mem.h"
#endif
 
//------------------------------------------------------------------------------
// strspn(dword text1,text2) --- example: strspn("12 year","1234567890") -> return 2
// strpbrk(dword text1,text2) --- example: strpbrk("this test", " ckfi") -> return "is test"
39,6 → 50,8
}
*/
 
 
 
inline int strspn(dword text1,text2)
{
dword beg;
376,7 → 389,7
}
 
 
inline fastcall signed int strchr( ESI,BL)
/*inline fastcall signed int strchr( ESI,BL)
{
int jj=0;
do{
385,9 → 398,20
IF(AL==BL) return jj;
} while(AL!=0);
return 0;
}*/
 
inline dword strchr(dword shb;char s)
{
char ss;
loop()
{
ss = DSBYTE[shb];
if(!ss)return 0;
if(ss==s)return shb;
shb++;
}
}
 
 
inline fastcall signed int strrchr( ESI,BL)
{
int jj=0, last=0;
732,28 → 756,50
{
char s;
dword ret,l;
//l = strlen(text);
ret = 0;
s = DSBYTE[text];
//if(l==6)
while(s)
{
ret <<= 4;
if(s>='A')&&(s<='F')ret |= s-'A'+10;
else if(s>='a')&&(s<='f')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'0';
text++;
s = DSBYTE[text];
}
/*else if(l==3) while(s)
return ret;
}
 
inline signed csshexdec(dword text)
{
char s;
dword ret,l;
byte tmp;
l = strlen(text);
ret = 0;
s = DSBYTE[text];
tmp = 0;
if(l==6) while(s)
{
ret <<= 4;
if(s>='A')&&(s<='F')ret |= s-'A'+10;
else if(s>='a')&&(s<='f')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'0';
text++;
s = DSBYTE[text];
}*/
}
else if(l==3) while(s)
{
ret |= tmp;
ret <<= 4;
ret |= tmp;
ret <<= 4;
if(s>='A')&&(s<='F')tmp = s-'A'+10;
else if(s>='a')&&(s<='f')tmp = s-'a'+10;
else if(s>='0')&&(s<='9')tmp = s-'0';
text++;
s = DSBYTE[text];
}
return ret;
}
 
841,6 → 887,19
return buf-ret;
}
 
inline signed strcoll(dword text1,text2)
{
char s,ss;
loop()
{
s = DSBYTE[text2];
ss=strchr(text1,s);
if(ss)return ss;
text2++;
}
return 0;
}
 
inline void debugi(dword d_int)
{
char tmpch[12];
854,3 → 913,4
#define stricmp strcmpi
#define strcmpn strncmp
 
#endif