forked from KolibriOS/kolibrios
b6bb3d2c62
git-svn-id: svn://kolibrios.org@7107 a494cfbc-eb01-0410-851d-a64ba20cac60
870 lines
28 KiB
Plaintext
870 lines
28 KiB
Plaintext
Š®¬¯¨«ïâ®à ï§ëª ¯à®£à ¬¬¨à®¢ ¨ï Oberon-07/11 ¤«ï i386
|
||
Windows/Linux/KolibriOS.
|
||
------------------------------------------------------------------------------
|
||
|
||
‘®áâ ¢ ¯à®£à ¬¬ë
|
||
|
||
1. Compiler.kex (KolibriOS) - ¨á¯®«ï¥¬ë© ä ©« ª®¬¯¨«ïâ®à .
|
||
‚室 - ⥪áâ®¢ë¥ ä ©«ë ¬®¤ã«¥© á à áè¨à¥¨¥¬ ".ob07", ª®¤¨à®¢ª ANSI
|
||
¨«¨ UTF-8 á BOM-ᨣ âãன.
|
||
‚ë室 - ¨á¯®«ï¥¬ë© ä ©« ä®à¬ â PE, ELF ¨«¨ MENUET01/MS COFF.
|
||
<09> à ¬¥âàë:
|
||
1) ¨¬ï £« ¢®£® ¬®¤ã«ï
|
||
2) ⨯ ¯à¨«®¦¥¨ï ¨ ¯« âä®à¬
|
||
"con" - Windows console
|
||
"gui" - Windows GUI
|
||
"dll" - Windows DLL
|
||
"elf" - Linux
|
||
"kos" - KolibriOS
|
||
"obj" - KolibriOS DLL
|
||
3) à §¬¥à áâíª ¢ ¬¥£ ¡ ©â å, ¥®¡ï§ ⥫ìë© ¯ à ¬¥âà, ¯® 㬮«ç ¨î -
|
||
1 Œ¡, ¤«ï ELF ¨£®à¨àã¥âáï. …᫨ 2-© ¯ à ¬¥âà = "obj" (KolibriOS DLL),
|
||
â® 3-© ¯ à ¬¥âà § ¤ ¥âáï è¥áâ ¤æ â¨à¨çë¬ ç¨á«®¬
|
||
(0x00000001 .. 0xffffffff) ¨ ®¯à¥¤¥«ï¥â ¢¥àá¨î ¯à®£à ¬¬ë,
|
||
¯® 㬮«ç ¨î - 0x00010000 (v1.0).
|
||
<09> ¯à¨¬¥à:
|
||
"C:\oberon-07\example.ob07" con 1
|
||
"C:\oberon-07\example.ob07" obj 0x00020005 (* v2.5 *)
|
||
‚ á«ãç ¥ ãᯥ让 ª®¬¯¨«ï樨, ª®¬¯¨«ïâ®à ¯¥à¥¤ ¥â ª®¤ § ¢¥à襨ï 0,
|
||
¨ ç¥ 1. <20>à¨ à ¡®â¥ ª®¬¯¨«ïâ®à ¢ KolibriOS, ª®¤ § ¢¥àè¥¨ï ¥
|
||
¯¥à¥¤ ¥âáï. ‘®®¡é¥¨ï ª®¬¯¨«ïâ®à ¢ë¢®¤ïâáï ª®á®«ì (Windows,
|
||
KolibriOS), ¢ â¥à¬¨ « (Linux).
|
||
2. <09> ¯ª Lib - ¡¨¡«¨®â¥ª ¬®¤ã«¥©
|
||
|
||
------------------------------------------------------------------------------
|
||
Žâ«¨ç¨ï ®â ®à¨£¨ «
|
||
|
||
1. <09> áè¨à¥ ¯á¥¢¤®¬®¤ã«ì SYSTEM
|
||
2. <09> §à¥è¥ ᨬ¢®« "_" ¢ ¨¤¥â¨ä¨ª â®à å
|
||
3. „®¡ ¢«¥ë á¨áâ¥¬ë¥ ä« £¨
|
||
4. Ž¯¥à â®à CASE ॠ«¨§®¢ ¢ ᮮ⢥âá⢨¨ á á¨â ªá¨á®¬ ¨ ᥬ ⨪®©
|
||
¤ ®£® ®¯¥à â®à ¢ ï§ëª¥ Oberon (Revision 1.10.90)
|
||
5. <09> áè¨à¥ ¡®à áâ ¤ àâëå ¯à®æ¥¤ãà
|
||
6. ‘¥¬ ⨪ ®åà ë/¯à®¢¥àª¨ ⨯ ãâ®ç¥ ¤«ï ã«¥¢®£® 㪠§ ⥫ï
|
||
7. ‘¥¬ ⨪ DIV ¨ MOD ãâ®ç¥ ¤«ï ®âà¨æ ⥫ìëå ç¨á¥«
|
||
8. „®¡ ¢«¥ë ®¤®áâà®çë¥ ª®¬¬¥â ਨ ( ç¨ îâáï á ¯ àë ᨬ¢®«®¢ "//")
|
||
9. <09> §à¥è¥ íªá¯®àâ ¯¥à¥¬¥ëå ⨯®¢ ARRAY ¨ RECORD (⮫쪮 ¤«ï ç⥨ï)
|
||
10. <09> §à¥è¥® á«¥¤®¢ ¨¥ ®â ⨯ -㪠§ ⥫ï
|
||
11. „®¡ ¢«¥ë ¯á¥¢¤®¨¬ë ⨯®¢ (TYPE A = B)
|
||
|
||
------------------------------------------------------------------------------
|
||
Žá®¡¥®á⨠ॠ«¨§ 樨
|
||
|
||
1. Žá®¢ë¥ ⨯ë
|
||
|
||
’¨¯ „¨ ¯ §® § 票© <20> §¬¥à, ¡ ©â
|
||
|
||
INTEGER -2147483648 .. 2147483647 4
|
||
REAL 1.40E-45 .. 3.34E+38 4
|
||
LONGREAL 4.94E-324 .. 1.70E+308 8
|
||
CHAR ᨬ¢®« ASCII (0X .. 0FFX) 1
|
||
BOOLEAN FALSE, TRUE 1
|
||
SET ¬®¦¥á⢮ ¨§ 楫ëå ç¨á¥« {0 .. 31} 4
|
||
|
||
2. Œ ªá¨¬ «ì ï ¤«¨ ¨¤¥â¨ä¨ª â®à®¢ - 255 ᨬ¢®«®¢
|
||
3. Œ ªá¨¬ «ì ï ¤«¨ áâப®¢ëå ª®áâ â - 255 ᨬ¢®«®¢
|
||
4. Œ ªá¨¬ «ì ï ¤«¨ áâப ¨á室®£® ª®¤ - 511 ᨬ¢®«®¢
|
||
5. Œ ªá¨¬ «ì ï à §¬¥à®áâì ®âªàëâëå ¬ áᨢ®¢ - 5
|
||
6. Œ ªá¨¬ «ì®¥ ª®«¨ç¥á⢮ ®¡ê¥ëå ⨯®¢-§ ¯¨á¥© - 2047
|
||
7. <09>à®æ¥¤ãà NEW § ¯®«ï¥â ã«ï¬¨ ¢ë¤¥«¥ë© ¡«®ª ¯ ¬ïâ¨
|
||
8. ƒ«®¡ «ìë¥ ¨ «®ª «ìë¥ ¯¥à¥¬¥ë¥ ¨¨æ¨ «¨§¨àãîâáï ã«ï¬¨
|
||
9. ‚ ®â«¨ç¨¥ ®â ¬®£¨å Oberon-ॠ«¨§ 権, á¡®à騪 ¬ãá®à ¨ ¤¨ ¬¨ç¥áª ï
|
||
¬®¤ã«ì®áâì ®âáãâáâ¢ãîâ
|
||
|
||
------------------------------------------------------------------------------
|
||
<09>ᥢ¤®¬®¤ã«ì SYSTEM
|
||
|
||
<20>ᥢ¤®¬®¤ã«ì SYSTEM ᮤ¥à¦¨â ¨§ª®ã஢¥¢ë¥ ¨ ¥¡¥§®¯ áë¥ ¯à®æ¥¤ãàë,
|
||
®è¨¡ª¨ ¯à¨ ¨á¯®«ì§®¢ ¨¨ ¯à®æ¥¤ãà ¯á¥¢¤®¬®¤ã«ï SYSTEM ¬®£ã⠯ਢ¥á⨠ª
|
||
¯®¢à¥¦¤¥¨î ¤ ëå ¢à¥¬¥¨ ¢ë¯®«¥¨ï ¨ ¢ ਩®¬ã § ¢¥àè¥¨î ¯à®£à ¬¬ë.
|
||
|
||
PROCEDURE ADR(v: «î¡®© ⨯): INTEGER
|
||
v - ¯¥à¥¬¥ ï, ¯à®æ¥¤ãà ¨«¨ áâப®¢ ï ª®áâ â ;
|
||
¢®§¢à é ¥â ¤à¥á v
|
||
|
||
PROCEDURE SIZE(T): INTEGER
|
||
¢®§¢à é ¥â à §¬¥à ⨯ T
|
||
|
||
PROCEDURE TYPEID(T): INTEGER
|
||
T - ⨯-§ ¯¨áì ¨«¨ ⨯-㪠§ ⥫ì,
|
||
¢®§¢à é ¥â ®¬¥à ⨯ ¢ â ¡«¨æ¥ ⨯®¢-§ ¯¨á¥©
|
||
|
||
PROCEDURE INF(T): T
|
||
T - REAL ¨«¨ LONGREAL,
|
||
¢®§¢à é ¥â á¯¥æ¨ «ì®¥ ¢¥é¥á⢥®¥ § 票¥ "¡¥áª®¥ç®áâì"
|
||
|
||
PROCEDURE GET(a: INTEGER;
|
||
VAR v: «î¡®© ®á®¢®© ⨯, PROCEDURE, POINTER)
|
||
v := <20> ¬ïâì[a]
|
||
|
||
PROCEDURE PUT(a: INTEGER; x: «î¡®© ®á®¢®© ⨯, PROCEDURE, POINTER)
|
||
<09> ¬ïâì[a] := x
|
||
|
||
PROCEDURE MOVE(Source, Dest, n: INTEGER)
|
||
Š®¯¨àã¥â n ¡ ©â ¯ ¬ï⨠¨§ Source ¢ Dest,
|
||
®¡« á⨠Source ¨ Dest ¥ ¤®«¦ë ¯¥à¥ªàë¢ âìáï
|
||
|
||
PROCEDURE COPY(VAR Source: «î¡®© ⨯; VAR Dest: «î¡®© ⨯; n: INTEGER)
|
||
Š®¯¨àã¥â n ¡ ©â ¯ ¬ï⨠¨§ Source ¢ Dest.
|
||
<09>ª¢¨¢ «¥â®
|
||
SYSTEM.MOVE(SYSTEM.ADR(Source), SYSTEM.ADR(Dest), n)
|
||
|
||
PROCEDURE CODE(s: ARRAY OF CHAR)
|
||
‚áâ ¢ª ¬ 訮£® ª®¤
|
||
s - áâப®¢ ï ª®áâ â è¥áâ ¤æ â¨à¨çëå æ¨äà
|
||
ª®«¨ç¥á⢮ æ¨äà ¤®«¦® ¡ëâì ç¥âë¬
|
||
¯à¨¬¥à: SYSTEM.CODE("B801000000") (* mov eax, 1 *)
|
||
|
||
’ ª¦¥ ¢ ¬®¤ã«¥ SYSTEM ®¯à¥¤¥«¥ ⨯ CARD16 (2 ¡ ©â ). „«ï ⨯ CARD16 ¥
|
||
¤®¯ã᪠îâáï ¨ª ª¨¥ ï¢ë¥ ®¯¥à 樨, § ¨áª«î票¥¬ ¯à¨á¢ ¨¢ ¨ï.
|
||
<EFBFBD>८¡à §®¢ ¨ï CARD16 -> INTEGER ¨ INTEGER -> CARD16 ¬®£ãâ ¡ëâì ॠ«¨§®¢ ë
|
||
â ª:
|
||
|
||
PROCEDURE Card16ToInt(w: SYSTEM.CARD16): INTEGER;
|
||
VAR i: INTEGER;
|
||
BEGIN
|
||
SYSTEM.PUT(SYSTEM.ADR(i), w)
|
||
RETURN i
|
||
END Card16ToInt;
|
||
|
||
PROCEDURE IntToCard16(i: INTEGER): SYSTEM.CARD16;
|
||
VAR w: SYSTEM.CARD16;
|
||
BEGIN
|
||
SYSTEM.GET(SYSTEM.ADR(i), w)
|
||
RETURN w
|
||
END IntToCard16;
|
||
|
||
”ãªæ¨¨ ¯á¥¢¤®¬®¤ã«ï SYSTEM ¥«ì§ï ¨á¯®«ì§®¢ âì ¢ ª®áâ âëå ¢ëà ¦¥¨ïå.
|
||
|
||
------------------------------------------------------------------------------
|
||
‘¨áâ¥¬ë¥ ä« £¨
|
||
|
||
<20>ਠ®¡ê¥¨¨ ¯à®æ¥¤ãàëå ⨯®¢ ¨ £«®¡ «ìëå ¯à®æ¥¤ãà, ¯®á«¥ ª«î祢®£®
|
||
á«®¢ PROCEDURE ¬®¦¥â ¡ëâì 㪠§ ä« £ ᮣ« è¥¨ï ¢ë§®¢ : [stdcall], [cdecl]
|
||
¨«¨ [winapi]. <20> ¯à¨¬¥à:
|
||
|
||
PROCEDURE [cdecl] MyProc(x, y, z: INTEGER): INTEGER;
|
||
|
||
…᫨ 㪠§ ä« £ [winapi], â® ¯à¨¨¬ ¥âáï ᮣ« 襨¥ stdcall ¨
|
||
¯à®æ¥¤ãàã-äãªæ¨î ¬®¦® ¢ë§¢ âì ª ª ᮡá⢥® ¯à®æ¥¤ãàã, ¢¥ ¢ëà ¦¥¨ï.
|
||
”« £ [winapi] ¤®áâ㯥 ⮫쪮 ¤«ï ¯« âä®à¬ë Windows.
|
||
<20>ਠ®¡ê¥¨¨ ⨯®¢-§ ¯¨á¥©, ¯®á«¥ ª«î祢®£® á«®¢ RECORD ¬®¦¥â ¡ëâì
|
||
㪠§ ä« £ [noalign] ¨«¨ [union]. ”« £ [noalign] ®§ ç ¥â ®âáãâá⢨¥
|
||
¢ëà ¢¨¢ ¨ï ¯®«¥© § ¯¨á¨, ä« £ [union] ®§ ç ¥â, çâ® á¬¥é¥¨ï ¢á¥å ¯®«¥©
|
||
§ ¯¨á¨ à ¢ë ã«î, ¯à¨ í⮬ à §¬¥à § ¯¨á¨ à ¢¥ à §¬¥àã ¨¡®«ì襣® ¯®«ï.
|
||
‡ ¯¨á¨ RECORD [union] ... END ᮮ⢥âáâ¢ãîâ ®¡ê¥¤¨¥¨ï¬ (union) ¢ ï§ëª¥ C.
|
||
‡ ¯¨á¨ á á¨á⥬묨 ä« £ ¬¨ ¥ ¬®£ãâ ¨¬¥âì ¡ §®¢®£® ⨯ ¨ ¥ ¬®£ãâ ¡ëâì
|
||
¡ §®¢ë¬¨ ⨯ ¬¨ ¤«ï ¤àã£¨å § ¯¨á¥©.
|
||
„«ï ¨á¯®«ì§®¢ ¨ï á¨á⥬ëå ä« £®¢, âॡã¥âáï ¨¬¯®àâ¨à®¢ âì SYSTEM.
|
||
|
||
------------------------------------------------------------------------------
|
||
Ž¯¥à â®à CASE
|
||
|
||
‘¨â ªá¨á ®¯¥à â®à CASE:
|
||
|
||
CaseStatement =
|
||
CASE Expression OF ‘ase {"|" ‘ase}
|
||
[ELSE StatementSequence] END.
|
||
Case = [CaseLabelList ":" StatementSequence].
|
||
CaseLabelList = CaseLabels {"," CaseLabels}.
|
||
CaseLabels = ConstExpression [".." ConstExpression].
|
||
|
||
<20> ¯à¨¬¥à:
|
||
|
||
CASE x OF
|
||
|-1: DoSomething1
|
||
| 1: DoSomething2
|
||
| 0: DoSomething3
|
||
ELSE
|
||
DoSomething4
|
||
END
|
||
|
||
‚ ¬¥âª å ¢ ਠ⮢ ¬®¦® ¨á¯®«ì§®¢ âì ª®áâ âë¥ ¢ëà ¦¥¨ï, ¢¥âª ELSE
|
||
¥®¡ï§ ⥫ì . …᫨ ¥ ¢ë¯®«¥ ¨ ®¤¨ ¢ ਠ⠨ ELSE ®âáãâáâ¢ã¥â, â®
|
||
¯à®£à ¬¬ ¯à¥àë¢ ¥âáï á ®è¨¡ª®© ¢à¥¬¥¨ ¢ë¯®«¥¨ï.
|
||
|
||
------------------------------------------------------------------------------
|
||
<09>஢¥àª ¨ ®åà ⨯ ã«¥¢®£® 㪠§ ⥫ï
|
||
|
||
Žà¨£¨ «ì®¥ á®®¡é¥¨¥ ® ï§ëª¥ ¥ ®¯à¥¤¥«ï¥â ¯®¢¥¤¥¨¥ ¯à®£à ¬¬ë ¯à¨
|
||
¢ë¯®«¥¨¨ ®åà ë p(T) ¨ ¯à®¢¥àª¨ ⨯ p IS T ¯à¨ p = NIL. ‚® ¬®£¨å
|
||
Oberon-ॠ«¨§ æ¨ïå ¢ë¯®«¥¨¥ â ª®© ®¯¥à 樨 ¯à¨¢®¤¨â ª ®è¨¡ª¥ ¢à¥¬¥¨
|
||
¢ë¯®«¥¨ï. ‚ ¤ ®© ॠ«¨§ 樨 ®åà ⨯ ã«¥¢®£® 㪠§ â¥«ï ¥ ¯à¨¢®¤¨â ª
|
||
®è¨¡ª¥, ¯à®¢¥àª ⨯ ¤ ¥â १ã«ìâ â FALSE. ‚ à拉 á«ãç ¥¢ íâ® ¯®§¢®«ï¥â
|
||
§ ç¨â¥«ì® ᮪à â¨âì ç áâ®â㠯ਬ¥¥¨ï ®åà ë ⨯ .
|
||
|
||
------------------------------------------------------------------------------
|
||
„®¯®«¨â¥«ìë¥ áâ ¤ àâë¥ ¯à®æ¥¤ãàë
|
||
|
||
DISPOSE(VAR v: «î¡®©_㪠§ ⥫ì)
|
||
Žá¢®¡®¦¤ ¥â ¯ ¬ïâì, ¢ë¤¥«¥ãî ¯à®æ¥¤ãன NEW ¤«ï
|
||
¤¨ ¬¨ç¥áª®© ¯¥à¥¬¥®© v^, ¨ ¯à¨á¢ ¨¢ ¥â ¯¥à¥¬¥®© v
|
||
§ 票¥ NIL.
|
||
|
||
LSR(x, n: INTEGER): INTEGER
|
||
‹®£¨ç¥áª¨© ᤢ¨£ x n ¡¨â ¢¯à ¢®.
|
||
|
||
MIN(a, b: INTEGER): INTEGER
|
||
Œ¨¨¬ã¬ ¨§ ¤¢ãå § 票©.
|
||
|
||
MAX(a, b: INTEGER): INTEGER
|
||
Œ ªá¨¬ã¬ ¨§ ¤¢ãå § 票©.
|
||
|
||
BITS(x: INTEGER): SET
|
||
ˆâ¥à¯à¥â¨àã¥â x ª ª § 票¥ ⨯ SET.
|
||
‚믮«ï¥âáï íâ ¯¥ ª®¬¯¨«ï樨.
|
||
|
||
LENGTH(s: ARRAY OF CHAR): INTEGER
|
||
„«¨ 0X-§ ¢¥à襮© áâப¨ s, ¡¥§ ãç¥â ᨬ¢®« 0X.
|
||
…᫨ ᨬ¢®« 0X ®âáãâáâ¢ã¥â, äãªæ¨ï ¢®§¢à é ¥â ¤«¨ã
|
||
¬ áᨢ s.
|
||
|
||
------------------------------------------------------------------------------
|
||
DIV ¨ MOD
|
||
|
||
x y x DIV y x MOD y
|
||
|
||
5 3 1 2
|
||
-5 3 -2 1
|
||
5 -3 -2 -1
|
||
-5 -3 1 -2
|
||
|
||
------------------------------------------------------------------------------
|
||
‘ªàëâë¥ ¯ à ¬¥âàë ¯à®æ¥¤ãà
|
||
|
||
<20>¥ª®â®àë¥ ¯à®æ¥¤ãàë ¬®£ãâ ¨¬¥âì áªàëâë¥ ¯ à ¬¥âàë, ®¨ ®âáãâáâ¢ãîâ ¢ ᯨ᪥
|
||
ä®à¬ «ìëå ¯ à ¬¥â஢, ® ãç¨âë¢ îâáï ª®¬¯¨«ïâ®à®¬ ¯à¨ âà á«ï樨 ¢ë§®¢®¢.
|
||
<EFBFBD>â® ¢®§¬®¦® ¢ á«¥¤ãîé¨å á«ãç ïå:
|
||
|
||
1. <09>à®æ¥¤ãà ¨¬¥¥â ä®à¬ «ìë© ¯ à ¬¥âà ®âªàëâë© ¬ áᨢ:
|
||
PROCEDURE Proc(x: ARRAY OF ARRAY OF LONGREAL);
|
||
‚맮¢ âà ᫨àã¥âáï â ª:
|
||
Proc(SYSTEM.ADR(x), LEN(x), LEN(x[0])
|
||
2. <09>à®æ¥¤ãà ¨¬¥¥â ä®à¬ «ìë© ¯ à ¬¥âà-¯¥à¥¬¥ãî ⨯ RECORD:
|
||
PROCEDURE Proc(VAR x: Rec);
|
||
‚맮¢ âà ᫨àã¥âáï â ª:
|
||
Proc(SYSTEM.TYPEID(Rec), SYSTEM.ADR(x))
|
||
3. <09>à®æ¥¤ãà ï¥âáï ¢«®¦¥®©, £«ã¡¨ ¢«®¦¥¨ï k,
|
||
¤«ï £«®¡ «ìëå ¯à®æ¥¤ãà k = 0:
|
||
PROCEDURE Proc(p1, ..., pn);
|
||
‚맮¢ âà ᫨àã¥âáï â ª:
|
||
Proc(base(k - 1), base(k - 2), ..., base(0), p1, ..., pn),
|
||
£¤¥ base(m) - ¤à¥á ¡ §ë ª ¤à áâíª ®å¢ âë¢ î饩 ¯à®æ¥¤ãàë £«ã¡¨ë
|
||
¢«®¦¥¨ï m (¨á¯®«ì§ã¥âáï ¤«ï ¤®áâ㯠ª «®ª «ìë¬ ¯¥à¥¬¥ë¬
|
||
®å¢ âë¢ î饩 ¯à®æ¥¤ãàë)
|
||
|
||
------------------------------------------------------------------------------
|
||
Œ®¤ã«ì RTL
|
||
|
||
‚ᥠ¯à®£à ¬¬ë ¥ï¢® ¨á¯®«ì§ãîâ ¬®¤ã«ì RTL. Š®¬¯¨«ïâ®à âà ᫨àã¥â
|
||
¥ª®â®àë¥ ®¯¥à 樨 (¯à®¢¥àª ¨ ®åà ⨯ , áà ¢¥¨¥ áâப, á®®¡é¥¨ï ®¡
|
||
®è¨¡ª å ¢à¥¬¥¨ ¢ë¯®«¥¨ï ¨ ¤à.) ª ª ¢ë§®¢ë ¯à®æ¥¤ãà í⮣® ¬®¤ã«ï. <20>¥
|
||
á«¥¤ã¥â  ¢ë§ë¢ âì í⨠¯à®æ¥¤ãàë, § ¨áª«î票¥¬ ¯à®æ¥¤ãàë SetClose:
|
||
|
||
PROCEDURE SetClose(proc: PROC), £¤¥ TYPE PROC = PROCEDURE
|
||
|
||
SetClose § ç ¥â ¯à®æ¥¤ãàã proc (¡¥§ ¯ à ¬¥â஢) ¢ë§ë¢ ¥¬®© ¯à¨ ¢ë£à㧪¥
|
||
dll-¡¨¡«¨®â¥ª¨ (Windows), ¥á«¨ ¯à¨«®¦¥¨¥ ª®¬¯¨«¨àã¥âáï ª ª Windows DLL. „«ï
|
||
¯à®ç¨å ⨯®¢ ¯à¨«®¦¥¨© ¨ ¯« âä®à¬ ¢ë§®¢ ¯à®æ¥¤ãàë SetClose ¥ ¢«¨ï¥â
|
||
¯®¢¥¤¥¨¥ ¯à®£à ¬¬ë.
|
||
‘®®¡é¥¨ï ®¡ ®è¨¡ª å ¢à¥¬¥¨ ¢ë¯®«¥¨ï ¢ë¢®¤ïâáï ¢ ¤¨ «®£®¢ëå ®ª å
|
||
(Windows), ¢ â¥à¬¨ « (Linux), ¤®áªã ®â« ¤ª¨ (KolibriOS).
|
||
|
||
------------------------------------------------------------------------------
|
||
Œ®¤ã«ì API
|
||
|
||
‘ãé¥áâ¢ãîâ âਠॠ«¨§ 樨 ¬®¤ã«ï API: ¤«ï Windows, Linux ¨ KolibriOS. Š ª ¨
|
||
¬®¤ã«ì RTL, ¬®¤ã«ì API ¥ ¯à¥¤ § ç¥ ¤«ï ¯àאַ£® ¨á¯®«ì§®¢ ¨ï. Ž
|
||
®¡¥á¯¥ç¨¢ ¥â ªà®áᯫ âä®à¬¥®áâì ª®¬¯¨«ïâ®à .
|
||
|
||
------------------------------------------------------------------------------
|
||
ƒ¥¥à æ¨ï ¨á¯®«ï¥¬ëå ä ©«®¢ DLL
|
||
|
||
<20> §à¥è ¥âáï íªá¯®àâ¨à®¢ âì ⮫쪮 ¯à®æ¥¤ãàë. „«ï í⮣®, ¯à®æ¥¤ãà ¤®«¦
|
||
室¨âìáï ¢ £« ¢®¬ ¬®¤ã«¥ ¯à®£à ¬¬ë, ¨ ¥¥ ¨¬ï ¤®«¦® ¡ëâì ®â¬¥ç¥® ᨬ¢®«®¬
|
||
íªá¯®àâ ("*"). KolibriOS DLL ¢á¥£¤ íªá¯®àâ¨àãîâ ¨¤¥â¨ä¨ª â®àë "version"
|
||
(¢¥àá¨ï ¯à®£à ¬¬ë) ¨ "lib_init" - ¤à¥á ¯à®æ¥¤ãàë ¨¨æ¨ «¨§ 樨 DLL:
|
||
|
||
PROCEDURE [stdcall] lib_init(): INTEGER
|
||
|
||
<EFBFBD>â ¯à®æ¥¤ãà ¤®«¦ ¡ëâì ¢ë§¢ ¯¥à¥¤ ¨á¯®«ì§®¢ ¨¥¬ DLL.
|
||
<EFBFBD>à®æ¥¤ãà ¢á¥£¤ ¢®§¢à é ¥â 1.
|
||
‚ áâ®ï饥 ¢à¥¬ï £¥¥à æ¨ï DLL ¤«ï Linux ¥ ॠ«¨§®¢ .
|
||
|
||
==============================================================================
|
||
==============================================================================
|
||
|
||
<09>¨¡«¨®â¥ª (KolibriOS)
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Out - ª®á®«ìë© ¢ë¢®¤
|
||
|
||
PROCEDURE Open
|
||
ä®à¬ «ì® ®âªàë¢ ¥â ª®á®«ìë© ¢ë¢®¤
|
||
|
||
PROCEDURE Int(x, width: INTEGER)
|
||
¢ë¢®¤ 楫®£® ç¨á« x;
|
||
width - ª®«¨ç¥á⢮ § ª®¬¥áâ, ¨á¯®«ì§ã¥¬ëå ¤«ï ¢ë¢®¤
|
||
|
||
PROCEDURE Real(x: LONGREAL; width: INTEGER)
|
||
¢ë¢®¤ ¢¥é¥á⢥®£® ç¨á« x ¢ ¯« ¢ î饬 ä®à¬ â¥;
|
||
width - ª®«¨ç¥á⢮ § ª®¬¥áâ, ¨á¯®«ì§ã¥¬ëå ¤«ï ¢ë¢®¤
|
||
|
||
PROCEDURE Char(x: CHAR)
|
||
¢ë¢®¤ ᨬ¢®« x
|
||
|
||
PROCEDURE FixReal(x: LONGREAL; width, p: INTEGER)
|
||
¢ë¢®¤ ¢¥é¥á⢥®£® ç¨á« x ¢ 䨪á¨à®¢ ®¬ ä®à¬ â¥;
|
||
width - ª®«¨ç¥á⢮ § ª®¬¥áâ, ¨á¯®«ì§ã¥¬ëå ¤«ï ¢ë¢®¤ ;
|
||
p - ª®«¨ç¥á⢮ § ª®¢ ¯®á«¥ ¤¥áïâ¨ç®© â®çª¨
|
||
|
||
PROCEDURE Ln
|
||
¯¥à¥å®¤ á«¥¤ãîéãî áâபã
|
||
|
||
PROCEDURE String(s: ARRAY OF CHAR)
|
||
¢ë¢®¤ áâப¨ s
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE In - ª®á®«ìë© ¢¢®¤
|
||
|
||
VAR Done: BOOLEAN
|
||
¯à¨¨¬ ¥â § 票¥ TRUE ¢ á«ãç ¥ ãᯥ讣® ¢ë¯®«¥¨ï
|
||
®¯¥à 樨 ¢¢®¤ , ¨ ç¥ FALSE
|
||
|
||
PROCEDURE Open
|
||
ä®à¬ «ì® ®âªàë¢ ¥â ª®á®«ìë© ¢¢®¤,
|
||
â ª¦¥ ¯à¨á¢ ¨¢ ¥â ¯¥à¥¬¥®© Done § 票¥ TRUE
|
||
|
||
PROCEDURE Int(VAR x: INTEGER)
|
||
¢¢®¤ ç¨á« ⨯ INTEGER
|
||
|
||
PROCEDURE Char(VAR x: CHAR)
|
||
¢¢®¤ ᨬ¢®«
|
||
|
||
PROCEDURE Real(VAR x: REAL)
|
||
¢¢®¤ ç¨á« ⨯ REAL
|
||
|
||
PROCEDURE LongReal(VAR x: LONGREAL)
|
||
¢¢®¤ ç¨á« ⨯ LONGREAL
|
||
|
||
PROCEDURE String(VAR s: ARRAY OF CHAR)
|
||
¢¢®¤ áâப¨
|
||
|
||
PROCEDURE Ln
|
||
®¦¨¤ ¨¥ ¦ â¨ï ENTER
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Console - ¤®¯®«¨â¥«ìë¥ ¯à®æ¥¤ãàë ª®á®«ì®£® ¢ë¢®¤
|
||
|
||
CONST
|
||
|
||
‘«¥¤ãî騥 ª®áâ âë ®¯à¥¤¥«ïîâ 梥⠪®á®«ì®£® ¢ë¢®¤
|
||
|
||
Black = 0 Blue = 1 Green = 2
|
||
Cyan = 3 Red = 4 Magenta = 5
|
||
Brown = 6 LightGray = 7 DarkGray = 8
|
||
LightBlue = 9 LightGreen = 10 LightCyan = 11
|
||
LightRed = 12 LightMagenta = 13 Yellow = 14
|
||
White = 15
|
||
|
||
PROCEDURE Cls
|
||
®ç¨á⪠®ª ª®á®«¨
|
||
|
||
PROCEDURE SetColor(FColor, BColor: INTEGER)
|
||
ãáâ ®¢ª 梥⠪®á®«ì®£® ¢ë¢®¤ : FColor - 梥â ⥪áâ ,
|
||
BColor - 梥â ä® , ¢®§¬®¦ë¥ § 票ï - ¢ë襯¥à¥ç¨á«¥ë¥
|
||
ª®áâ âë
|
||
|
||
PROCEDURE SetCursor(x, y: INTEGER)
|
||
ãáâ ®¢ª ªãàá®à ª®á®«¨ ¢ ¯®§¨æ¨î (x, y)
|
||
|
||
PROCEDURE GetCursor(VAR x, y: INTEGER)
|
||
§ ¯¨áë¢ ¥â ¢ ¯ à ¬¥âàë ⥪ã騥 ª®®à¤¨ âë ªãàá®à ª®á®«¨
|
||
|
||
PROCEDURE GetCursorX(): INTEGER
|
||
¢®§¢à é ¥â ⥪ãéãî x-ª®®à¤¨ âã ªãàá®à ª®á®«¨
|
||
|
||
PROCEDURE GetCursorY(): INTEGER
|
||
¢®§¢à é ¥â ⥪ãéãî y-ª®®à¤¨ âã ªãàá®à ª®á®«¨
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE ConsoleLib - ®¡¥à⪠¡¨¡«¨®â¥ª¨ console.obj
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Math - ¬ ⥬ â¨ç¥áª¨¥ äãªæ¨¨
|
||
|
||
CONST
|
||
|
||
pi = 3.141592653589793D+00
|
||
e = 2.718281828459045D+00
|
||
|
||
VAR
|
||
|
||
Inf, nInf: LONGREAL
|
||
¯®«®¦¨â¥«ì ï ¨ ®âà¨æ ⥫ì ï ¡¥áª®¥ç®áâì
|
||
|
||
PROCEDURE IsNan(x: LONGREAL): BOOLEAN
|
||
¢®§¢à é ¥â TRUE, ¥á«¨ x - ¥ ç¨á«®
|
||
|
||
PROCEDURE IsInf(x: LONGREAL): BOOLEAN
|
||
¢®§¢à é ¥â TRUE, ¥á«¨ x - ¡¥áª®¥ç®áâì
|
||
|
||
PROCEDURE sqrt(x: LONGREAL): LONGREAL
|
||
ª¢ ¤à âë© ª®à¥ì x
|
||
|
||
PROCEDURE exp(x: LONGREAL): LONGREAL
|
||
íªá¯®¥â x
|
||
|
||
PROCEDURE ln(x: LONGREAL): LONGREAL
|
||
âãà «ìë© «®£ à¨ä¬ x
|
||
|
||
PROCEDURE sin(x: LONGREAL): LONGREAL
|
||
á¨ãá x
|
||
|
||
PROCEDURE cos(x: LONGREAL): LONGREAL
|
||
ª®á¨ãá x
|
||
|
||
PROCEDURE tan(x: LONGREAL): LONGREAL
|
||
â £¥á x
|
||
|
||
PROCEDURE arcsin(x: LONGREAL): LONGREAL
|
||
àªá¨ãá x
|
||
|
||
PROCEDURE arccos(x: LONGREAL): LONGREAL
|
||
પ®á¨ãá x
|
||
|
||
PROCEDURE arctan(x: LONGREAL): LONGREAL
|
||
àªâ £¥á x
|
||
|
||
PROCEDURE arctan2(y, x: LONGREAL): LONGREAL
|
||
àªâ £¥á y/x
|
||
|
||
PROCEDURE power(base, exponent: LONGREAL): LONGREAL
|
||
¢®§¢¥¤¥¨¥ ç¨á« base ¢ á⥯¥ì exponent
|
||
|
||
PROCEDURE log(base, x: LONGREAL): LONGREAL
|
||
«®£ à¨ä¬ x ¯® ®á®¢ ¨î base
|
||
|
||
PROCEDURE sinh(x: LONGREAL): LONGREAL
|
||
£¨¯¥à¡®«¨ç¥áª¨© á¨ãá x
|
||
|
||
PROCEDURE cosh(x: LONGREAL): LONGREAL
|
||
£¨¯¥à¡®«¨ç¥áª¨© ª®á¨ãá x
|
||
|
||
PROCEDURE tanh(x: LONGREAL): LONGREAL
|
||
£¨¯¥à¡®«¨ç¥áª¨© â £¥á x
|
||
|
||
PROCEDURE arcsinh(x: LONGREAL): LONGREAL
|
||
®¡à âë© £¨¯¥à¡®«¨ç¥áª¨© á¨ãá x
|
||
|
||
PROCEDURE arccosh(x: LONGREAL): LONGREAL
|
||
®¡à âë© £¨¯¥à¡®«¨ç¥áª¨© ª®á¨ãá x
|
||
|
||
PROCEDURE arctanh(x: LONGREAL): LONGREAL
|
||
®¡à âë© £¨¯¥à¡®«¨ç¥áª¨© â £¥á x
|
||
|
||
PROCEDURE round(x: LONGREAL): LONGREAL
|
||
®ªà㣫¥¨¥ x ¤® ¡«¨¦ ©è¥£® 楫®£®
|
||
|
||
PROCEDURE frac(x: LONGREAL): LONGREAL;
|
||
¤à®¡ ï ç áâì ç¨á« x
|
||
|
||
PROCEDURE floor(x: LONGREAL): LONGREAL
|
||
¨¡®«ì襥 楫®¥ ç¨á«® (¯à¥¤áâ ¢«¥¨¥ ª ª LONGREAL),
|
||
¥ ¡®«ìè¥ x: floor(1.2) = 1.0
|
||
|
||
PROCEDURE ceil(x: LONGREAL): LONGREAL
|
||
¨¬¥ì襥 楫®¥ ç¨á«® (¯à¥¤áâ ¢«¥¨¥ ª ª LONGREAL),
|
||
¥ ¬¥ìè¥ x: ceil(1.2) = 2.0
|
||
|
||
PROCEDURE sgn(x: LONGREAL): INTEGER
|
||
¥á«¨ x > 0 ¢®§¢à é ¥â 1
|
||
¥á«¨ x < 0 ¢®§¢à é ¥â -1
|
||
¥á«¨ x = 0 ¢®§¢à é ¥â 0
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Debug - ¢ë¢®¤ ¤®áªã ®â« ¤ª¨
|
||
ˆâ¥àä¥©á ª ª ¬®¤ã«ì Out
|
||
|
||
PROCEDURE Open
|
||
®âªàë¢ ¥â ¤®áªã ®â« ¤ª¨
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE File - à ¡®â á ä ©«®¢®© á¨á⥬®©
|
||
|
||
TYPE
|
||
|
||
FNAME = ARRAY 520 OF CHAR
|
||
|
||
FS = POINTER TO rFS
|
||
|
||
rFS = RECORD (* ¨ä®à¬ 樮 ï áâàãªâãà ä ©« *)
|
||
subfunc, pos, hpos, bytes, buffer: INTEGER;
|
||
name: FNAME
|
||
END
|
||
|
||
FD = POINTER TO rFD
|
||
|
||
rFD = RECORD (* áâàãªâãà ¡«®ª ¤ ëå ¢å®¤ ª â «®£ *)
|
||
attr: INTEGER;
|
||
ntyp: CHAR;
|
||
reserved: ARRAY 3 OF CHAR;
|
||
time_create, date_create,
|
||
time_access, date_access,
|
||
time_modif, date_modif,
|
||
size, hsize: INTEGER;
|
||
name: FNAME
|
||
END
|
||
|
||
CONST
|
||
|
||
SEEK_BEG = 0
|
||
SEEK_CUR = 1
|
||
SEEK_END = 2
|
||
|
||
PROCEDURE Load(FName: ARRAY OF CHAR; VAR size: INTEGER): INTEGER;
|
||
‡ £à㦠¥â ¢ ¯ ¬ïâì ä ©« á ¨¬¥¥¬ FName, § ¯¨áë¢ ¥â ¢ ¯ à ¬¥âà
|
||
size à §¬¥à ä ©« , ¢®§¢à é ¥â ¤à¥á § £à㦥®£® ä ©«
|
||
¨«¨ 0 (®è¨¡ª ). <20>ਠ¥®¡å®¤¨¬®áâ¨, à ᯠª®¢ë¢ ¥â
|
||
ä ©« (kunpack).
|
||
|
||
PROCEDURE GetFileInfo(FName: ARRAY OF CHAR; VAR Info: rFD): BOOLEAN
|
||
‡ ¯¨áë¢ ¥â áâàãªâãàã ¡«®ª ¤ ëå ¢å®¤ ª â «®£ ¤«ï ä ©«
|
||
¨«¨ ¯ ¯ª¨ á ¨¬¥¥¬ FName ¢ ¯ à ¬¥âà Info.
|
||
<09>ਠ®è¨¡ª¥ ¢®§¢à é ¥â FALSE.
|
||
|
||
PROCEDURE Exists(FName: ARRAY OF CHAR): BOOLEAN
|
||
¢®§¢à é ¥â TRUE, ¥á«¨ ä ©« á ¨¬¥¥¬ FName áãé¥áâ¢ã¥â
|
||
|
||
PROCEDURE Close(VAR F: FS)
|
||
®á¢®¡®¦¤ ¥â ¯ ¬ïâì, ¢ë¤¥«¥ãî ¤«ï ¨ä®à¬ 樮®© áâàãªâãàë
|
||
ä ©« F ¨ ¯à¨á¢ ¨¢ ¥â F § 票¥ NIL
|
||
|
||
PROCEDURE Open(FName: ARRAY OF CHAR): FS
|
||
¢®§¢à é ¥â 㪠§ â¥«ì ¨ä®à¬ 樮ãî áâàãªâãàã ä ©« á
|
||
¨¬¥¥¬ FName, ¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â NIL
|
||
|
||
PROCEDURE Delete(FName: ARRAY OF CHAR): BOOLEAN
|
||
㤠«ï¥â ä ©« á ¨¬¥¥¬ FName, ¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â FALSE
|
||
|
||
PROCEDURE Seek(F: FS; Offset, Origin: INTEGER): INTEGER
|
||
ãáâ ¢«¨¢ ¥â ¯®§¨æ¨î ç⥨ï-§ ¯¨á¨ ä ©« F Offset,
|
||
®â®á¨â¥«ì® Origin = (SEEK_BEG - ç «® ä ©« ,
|
||
SEEK_CUR - ⥪ãé ï ¯®§¨æ¨ï, SEEK_END - ª®¥æ ä ©« ),
|
||
¢®§¢à é ¥â ¯®§¨æ¨î ®â®á¨â¥«ì® ç « ä ©« , ¯à¨¬¥à:
|
||
Seek(F, 0, SEEK_END)
|
||
ãáâ ¢«¨¢ ¥â ¯®§¨æ¨î ª®¥æ ä ©« ¨ ¢®§¢à é ¥â ¤«¨ã
|
||
ä ©« ; ¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â -1
|
||
|
||
PROCEDURE Read(F: FS; Buffer, Count: INTEGER): INTEGER
|
||
—¨â ¥â ¤ ë¥ ¨§ ä ©« ¢ ¯ ¬ïâì. F - 㪠§ ⥫ì
|
||
¨ä®à¬ 樮ãî áâàãªâãàã ä ©« , Buffer - ¤à¥á ®¡« áâ¨
|
||
¯ ¬ïâ¨, Count - ª®«¨ç¥á⢮ ¡ ©â, ª®â®à®¥ âॡã¥âáï ¯à®ç¨â âì
|
||
¨§ ä ©« ; ¢®§¢à é ¥â ª®«¨ç¥á⢮ ¡ ©â, ª®â®à®¥ ¡ë«® ¯à®ç¨â ®
|
||
¨ ᮮ⢥âáâ¢ãî騬 ®¡à §®¬ ¨§¬¥ï¥â ¯®§¨æ¨î ç⥨ï/§ ¯¨á¨ ¢
|
||
¨ä®à¬ 樮®© áâàãªâãॠF.
|
||
|
||
PROCEDURE Write(F: FS; Buffer, Count: INTEGER): INTEGER
|
||
‡ ¯¨áë¢ ¥â ¤ ë¥ ¨§ ¯ ¬ï⨠¢ ä ©«. F - 㪠§ ⥫ì
|
||
¨ä®à¬ 樮ãî áâàãªâãàã ä ©« , Buffer - ¤à¥á ®¡« áâ¨
|
||
¯ ¬ïâ¨, Count - ª®«¨ç¥á⢮ ¡ ©â, ª®â®à®¥ âॡã¥âáï § ¯¨á âì
|
||
¢ ä ©«; ¢®§¢à é ¥â ª®«¨ç¥á⢮ ¡ ©â, ª®â®à®¥ ¡ë«® § ¯¨á ® ¨
|
||
ᮮ⢥âáâ¢ãî騬 ®¡à §®¬ ¨§¬¥ï¥â ¯®§¨æ¨î ç⥨ï/§ ¯¨á¨ ¢
|
||
¨ä®à¬ 樮®© áâàãªâãॠF.
|
||
|
||
PROCEDURE Create(FName: ARRAY OF CHAR): FS
|
||
ᮧ¤ ¥â ®¢ë© ä ©« á ¨¬¥¥¬ FName (¯®«®¥ ¨¬ï), ¢®§¢à é ¥â
|
||
㪠§ â¥«ì ¨ä®à¬ 樮ãî áâàãªâãàã ä ©« ,
|
||
¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â NIL
|
||
|
||
PROCEDURE CreateDir(DirName: ARRAY OF CHAR): BOOLEAN
|
||
ᮧ¤ ¥â ¯ ¯ªã á ¨¬¥¥¬ DirName, ¢á¥ ¯à®¬¥¦ãâ®çë¥ ¯ ¯ª¨
|
||
¤®«¦ë áãé¥á⢮¢ âì, ¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â FALSE
|
||
|
||
PROCEDURE DeleteDir(DirName: ARRAY OF CHAR): BOOLEAN
|
||
㤠«ï¥â ¯ãáâãî ¯ ¯ªã á ¨¬¥¥¬ DirName,
|
||
¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â FALSE
|
||
|
||
PROCEDURE DirExists(DirName: ARRAY OF CHAR): BOOLEAN
|
||
¢®§¢à é ¥â TRUE, ¥á«¨ ¯ ¯ª á ¨¬¥¥¬ DirName áãé¥áâ¢ã¥â
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Read - ç⥨¥ ®á®¢ëå ⨯®¢ ¤ ëå ¨§ ä ©« F
|
||
|
||
<09>à®æ¥¤ãàë ¢®§¢à é îâ TRUE ¢ á«ãç ¥ ãᯥ让 ®¯¥à 樨 çâ¥¨ï ¨
|
||
ᮮ⢥âáâ¢ãî騬 ®¡à §®¬ ¨§¬¥ïîâ ¯®§¨æ¨î ç⥨ï/§ ¯¨á¨ ¢
|
||
¨ä®à¬ 樮®© áâàãªâãॠF
|
||
|
||
PROCEDURE Char(F: File.FS; VAR x: CHAR): BOOLEAN
|
||
|
||
PROCEDURE Int(F: File.FS; VAR x: INTEGER): BOOLEAN
|
||
|
||
PROCEDURE Real(F: File.FS; VAR x: REAL): BOOLEAN
|
||
|
||
PROCEDURE LongReal(F: File.FS; VAR x: LONGREAL): BOOLEAN
|
||
|
||
PROCEDURE Boolean(F: File.FS; VAR x: BOOLEAN): BOOLEAN
|
||
|
||
PROCEDURE Set(F: File.FS; VAR x: SET): BOOLEAN
|
||
|
||
PROCEDURE Card16(F: File.FS; VAR x: SYSTEM.CARD16): BOOLEAN
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Write - § ¯¨áì ®á®¢ëå ⨯®¢ ¤ ëå ¢ ä ©« F
|
||
|
||
<09>à®æ¥¤ãàë ¢®§¢à é îâ TRUE ¢ á«ãç ¥ ãᯥ让 ®¯¥à 樨 § ¯¨á¨ ¨
|
||
ᮮ⢥âáâ¢ãî騬 ®¡à §®¬ ¨§¬¥ïîâ ¯®§¨æ¨î ç⥨ï/§ ¯¨á¨ ¢
|
||
¨ä®à¬ 樮®© áâàãªâãॠF
|
||
|
||
PROCEDURE Char(F: File.FS; x: CHAR): BOOLEAN
|
||
|
||
PROCEDURE Int(F: File.FS; x: INTEGER): BOOLEAN
|
||
|
||
PROCEDURE Real(F: File.FS; x: REAL): BOOLEAN
|
||
|
||
PROCEDURE LongReal(F: File.FS; x: LONGREAL): BOOLEAN
|
||
|
||
PROCEDURE Boolean(F: File.FS; x: BOOLEAN): BOOLEAN
|
||
|
||
PROCEDURE Set(F: File.FS; x: SET): BOOLEAN
|
||
|
||
PROCEDURE Card16(F: File.FS; x: SYSTEM.CARD16): BOOLEAN
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE DateTime - ¤ â , ¢à¥¬ï
|
||
|
||
CONST ERR = -7.0D5
|
||
|
||
PROCEDURE Now(VAR Year, Month, Day, Hour, Min, Sec: INTEGER)
|
||
§ ¯¨áë¢ ¥â ¢ ¯ à ¬¥âàë ª®¬¯®¥âë ⥪ã饩 á¨á⥬®© ¤ âë ¨
|
||
¢à¥¬¥¨
|
||
|
||
PROCEDURE Encode(Year, Month, Day, Hour, Min, Sec: INTEGER): LONGREAL
|
||
¢®§¢à é ¥â ¤ âã, ¯®«ãç¥ãî ¨§ ª®¬¯®¥â®¢
|
||
Year, Month, Day, Hour, Min, Sec;
|
||
¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â ª®áâ âã ERR = -7.0D5
|
||
|
||
PROCEDURE Decode(Date: LONGREAL; VAR Year, Month, Day,
|
||
Hour, Min, Sec: INTEGER): BOOLEAN
|
||
¨§¢«¥ª ¥â ª®¬¯®¥âë
|
||
Year, Month, Day, Hour, Min, Sec ¨§ ¤ âë Date;
|
||
¯à¨ ®è¨¡ª¥ ¢®§¢à é ¥â FALSE
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE Args - ¯ à ¬¥âàë ¯à®£à ¬¬ë
|
||
|
||
VAR argc: INTEGER
|
||
ª®«¨ç¥á⢮ ¯ à ¬¥â஢ ¯à®£à ¬¬ë, ¢ª«îç ï ¨¬ï
|
||
¨á¯®«ï¥¬®£® ä ©«
|
||
|
||
PROCEDURE GetArg(n: INTEGER; VAR s: ARRAY OF CHAR)
|
||
§ ¯¨áë¢ ¥â ¢ áâபã s n-© ¯ à ¬¥âà ¯à®£à ¬¬ë,
|
||
㬥à æ¨ï ¯ à ¬¥â஢ ®â 0 ¤® argc - 1,
|
||
ã«¥¢®© ¯ à ¬¥âà -- ¨¬ï ¨á¯®«ï¥¬®£® ä ©«
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE KOSAPI
|
||
|
||
PROCEDURE sysfunc1(arg1: INTEGER): INTEGER
|
||
PROCEDURE sysfunc2(arg1, arg2: INTEGER): INTEGER
|
||
...
|
||
PROCEDURE sysfunc7(arg1, arg2, ..., arg7: INTEGER): INTEGER
|
||
Ž¡¥à⪨ ¤«ï äãªæ¨© API ï¤à KolibriOS.
|
||
arg1 .. arg7 ᮮ⢥âáâ¢ãîâ ॣ¨áâà ¬
|
||
eax, ebx, ecx, edx, esi, edi, ebp;
|
||
¢®§¢à é îâ § 票¥ ॣ¨áâà eax ¯®á«¥ á¨á⥬®£® ¢ë§®¢ .
|
||
|
||
PROCEDURE sysfunc22(arg1, arg2: INTEGER; VAR res2: INTEGER): INTEGER
|
||
Ž¡¥à⪠¤«ï äãªæ¨© API ï¤à KolibriOS.
|
||
arg1 - ॣ¨áâà eax, arg2 - ॣ¨áâà ebx,
|
||
res2 - § 票¥ ॣ¨áâà ebx ¯®á«¥ á¨á⥬®£® ¢ë§®¢ ;
|
||
¢®§¢à é ¥â § 票¥ ॣ¨áâà eax ¯®á«¥ á¨á⥬®£® ¢ë§®¢ .
|
||
|
||
PROCEDURE malloc(size: INTEGER): INTEGER
|
||
‚뤥«ï¥â ¡«®ª ¯ ¬ïâ¨.
|
||
size - à §¬¥à ¡«®ª ¢ ¡ ©â å,
|
||
¢®§¢à é ¥â ¤à¥á ¢ë¤¥«¥®£® ¡«®ª
|
||
|
||
PROCEDURE free(ptr: INTEGER): INTEGER
|
||
Žá¢®¡®¦¤ ¥â à ¥¥ ¢ë¤¥«¥ë© ¡«®ª ¯ ¬ïâ¨ á ¤à¥á®¬ ptr,
|
||
¢®§¢à é ¥â 0
|
||
|
||
PROCEDURE realloc(ptr, size: INTEGER): INTEGER
|
||
<09>¥à¥à á¯à¥¤¥«ï¥â ¡«®ª ¯ ¬ïâ¨,
|
||
ptr - ¤à¥á à ¥¥ ¢ë¤¥«¥®£® ¡«®ª ,
|
||
size - ®¢ë© à §¬¥à,
|
||
¢®§¢à é ¥â 㪠§ â¥«ì ¯¥à¥à á¯à¥¤¥«¥ë© ¡«®ª,
|
||
0 ¯à¨ ®è¨¡ª¥
|
||
|
||
PROCEDURE GetCommandLine(): INTEGER
|
||
‚®§¢à é ¥â ¤à¥á áâப¨ ¯ à ¬¥â஢
|
||
|
||
PROCEDURE GetName(): INTEGER
|
||
‚®§¢à é ¥â ¤à¥á áâப¨ á ¨¬¥¥¬ ¯à®£à ¬¬ë
|
||
|
||
PROCEDURE LoadLib(name: ARRAY OF CHAR): INTEGER
|
||
‡ £à㦠¥â DLL á ¯®«ë¬ ¨¬¥¥¬ name. ‚®§¢à é ¥â ¤à¥á â ¡«¨æë
|
||
íªá¯®àâ . <20>ਠ®è¨¡ª¥ ¢®§¢à é ¥â 0.
|
||
|
||
PROCEDURE GetProcAdr(name: ARRAY OF CHAR; lib: INTEGER): INTEGER
|
||
name - ¨¬ï ¯à®æ¥¤ãàë
|
||
lib - ¤à¥á â ¡«¨æë íªá¯®àâ DLL
|
||
‚®§¢à é ¥â ¤à¥á ¯à®æ¥¤ãàë. <20>ਠ®è¨¡ª¥ ¢®§¢à é ¥â 0.
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE ColorDlg - à ¡®â á ¤¨ «®£®¬ "Color Dialog"
|
||
|
||
TYPE
|
||
|
||
Dialog = POINTER TO RECORD (* áâàãªâãà ¤¨ «®£ *)
|
||
status: INTEGER (* á®áâ®ï¨¥ ¤¨ «®£ :
|
||
0 - ¯®«ì§®¢ â¥«ì ¦ « Cancel
|
||
1 - ¯®«ì§®¢ â¥«ì ¦ « OK
|
||
2 - ¤¨ «®£ ®âªàëâ *)
|
||
|
||
color: INTEGER (* ¢ë¡à ë© æ¢¥â *)
|
||
END
|
||
|
||
PROCEDURE Create(draw_window: DRAW_WINDOW): Dialog
|
||
ᮧ¤ âì ¤¨ «®£
|
||
draw_window - ¯à®æ¥¤ãà ¯¥à¥à¨á®¢ª¨ ®á®¢®£® ®ª
|
||
(TYPE DRAW_WINDOW = PROCEDURE);
|
||
¯à®æ¥¤ãà ¢®§¢à é ¥â 㪠§ ⥫ì áâàãªâãàã ¤¨ «®£
|
||
|
||
PROCEDURE Show(cd: Dialog)
|
||
¯®ª § âì ¤¨ «®£
|
||
cd - 㪠§ ⥫ì áâàãªâãàã ¤¨ «®£ , ª®â®àë© ¡ë« ᮧ¤ à ¥¥
|
||
¯à®æ¥¤ãன Create
|
||
|
||
PROCEDURE Destroy(VAR cd: Dialog)
|
||
ã¨ç⮦¨âì ¤¨ «®£
|
||
cd - 㪠§ ⥫ì áâàãªâãàã ¤¨ «®£
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE OpenDlg - à ¡®â á ¤¨ «®£®¬ "Open Dialog"
|
||
|
||
TYPE
|
||
|
||
Dialog = POINTER TO RECORD (* áâàãªâãà ¤¨ «®£ *)
|
||
status: INTEGER (* á®áâ®ï¨¥ ¤¨ «®£ :
|
||
0 - ¯®«ì§®¢ â¥«ì ¦ « Cancel
|
||
1 - ¯®«ì§®¢ â¥«ì ¦ « OK
|
||
2 - ¤¨ «®£ ®âªàëâ *)
|
||
|
||
FileName: ARRAY 4096 OF CHAR (* ¨¬ï ¢ë¡à ®£® ä ©« *)
|
||
FilePath: ARRAY 4096 OF CHAR (* ¯®«®¥ ¨¬ï ¢ë¡à ®£®
|
||
ä ©« *)
|
||
END
|
||
|
||
PROCEDURE Create(draw_window: DRAW_WINDOW; type: INTEGER; def_path,
|
||
filter: ARRAY OF CHAR): Dialog
|
||
ᮧ¤ âì ¤¨ «®£
|
||
draw_window - ¯à®æ¥¤ãà ¯¥à¥à¨á®¢ª¨ ®á®¢®£® ®ª
|
||
(TYPE DRAW_WINDOW = PROCEDURE)
|
||
type - ⨯ ¤¨ «®£
|
||
0 - ®âªàëâì
|
||
1 - á®åà ¨âì
|
||
2 - ¢ë¡à âì ¯ ¯ªã
|
||
def_path - ¯ãâì ¯® 㬮«ç ¨î, ¯ ¯ª def_path ¡ã¤¥â ®âªàëâ
|
||
¯à¨ ¯¥à¢®¬ § ¯ã᪥ ¤¨ «®£
|
||
filter - ¢ áâப¥ § ¯¨á ® ¯¥à¥ç¨á«¥¨¥ à áè¨à¥¨© ä ©«®¢,
|
||
ª®â®àë¥ ¡ã¤ãâ ¯®ª § ë ¢ ¤¨ «®£®¢®¬ ®ª¥, à áè¨à¥¨ï
|
||
à §¤¥«ïîâáï ᨬ¢®«®¬ "|", ¯à¨¬¥à: "ASM|TXT|INI"
|
||
¯à®æ¥¤ãà ¢®§¢à é ¥â 㪠§ ⥫ì áâàãªâãàã ¤¨ «®£
|
||
|
||
PROCEDURE Show(od: Dialog; Width, Height: INTEGER)
|
||
¯®ª § âì ¤¨ «®£
|
||
od - 㪠§ ⥫ì áâàãªâãàã ¤¨ «®£ , ª®â®àë© ¡ë« ᮧ¤ à ¥¥
|
||
¯à®æ¥¤ãன Create
|
||
Width ¨ Height - è¨à¨ ¨ ¢ëá®â ¤¨ «®£®¢®£® ®ª
|
||
|
||
PROCEDURE Destroy(VAR od: Dialog)
|
||
ã¨ç⮦¨âì ¤¨ «®£
|
||
od - 㪠§ ⥫ì áâàãªâãàã ¤¨ «®£
|
||
|
||
------------------------------------------------------------------------------
|
||
MODULE kfonts - à ¡®â á kf-èà¨äâ ¬¨
|
||
|
||
CONST
|
||
|
||
bold = 1
|
||
italic = 2
|
||
underline = 4
|
||
strike_through = 8
|
||
smoothing = 16
|
||
bpp32 = 32
|
||
|
||
TYPE
|
||
|
||
TFont = POINTER TO TFont_desc (* 㪠§ ⥫ì èà¨äâ *)
|
||
|
||
PROCEDURE LoadFont(file_name: ARRAY OF CHAR): TFont
|
||
§ £à㧨âì èà¨äâ ¨§ ä ©«
|
||
file_name ¨¬ï kf-ä ©«
|
||
१-â: 㪠§ ⥫ì èà¨äâ/NIL (®è¨¡ª )
|
||
|
||
PROCEDURE SetSize(Font: TFont; font_size: INTEGER): BOOLEAN
|
||
ãáâ ®¢¨âì à §¬¥à èà¨äâ
|
||
Font 㪠§ ⥫ì èà¨äâ
|
||
font_size à §¬¥à èà¨äâ
|
||
१-â: TRUE/FALSE (®è¨¡ª )
|
||
|
||
PROCEDURE Enabled(Font: TFont; font_size: INTEGER): BOOLEAN
|
||
¯à®¢¥à¨âì, ¥áâì «¨ èà¨äâ, § ¤ ®£® à §¬¥à
|
||
Font 㪠§ ⥫ì èà¨äâ
|
||
font_size à §¬¥à èà¨äâ
|
||
१-â: TRUE/FALSE (èà¨äâ ¥â)
|
||
|
||
PROCEDURE Destroy(VAR Font: TFont)
|
||
¢ë£à㧨âì èà¨äâ, ®á¢®¡®¤¨âì ¤¨ ¬¨ç¥áªãî ¯ ¬ïâì
|
||
Font 㪠§ ⥫ì èà¨äâ
|
||
<09>à¨á¢ ¨¢ ¥â ¯¥à¥¬¥®© Font § 票¥ NIL
|
||
|
||
PROCEDURE TextHeight(Font: TFont): INTEGER
|
||
¯®«ãç¨âì ¢ëá®âã áâப¨ ⥪áâ
|
||
Font 㪠§ ⥫ì èà¨äâ
|
||
१-â: ¢ëá®â áâப¨ ⥪áâ ¢ ¯¨ªá¥«ïå
|
||
|
||
PROCEDURE TextWidth(Font: TFont;
|
||
str, length, params: INTEGER): INTEGER
|
||
¯®«ãç¨âì è¨à¨ã áâப¨ ⥪áâ
|
||
Font 㪠§ ⥫ì èà¨äâ
|
||
str ¤à¥á áâப¨ ⥪áâ ¢ ª®¤¨à®¢ª¥ Win-1251
|
||
length ª®«¨ç¥á⢮ ᨬ¢®«®¢ ¢ áâப¥ ¨«¨ -1, ¥á«¨ áâப
|
||
§ ¢¥àè ¥âáï ã«¥¬
|
||
params ¯ à ¬¥âàë-ä« £¨ á¬. ¨¦¥
|
||
१-â: è¨à¨ áâப¨ ⥪áâ ¢ ¯¨ªá¥«ïå
|
||
|
||
PROCEDURE TextOut(Font: TFont;
|
||
canvas, x, y, str, length, color, params: INTEGER)
|
||
¢ë¢¥á⨠⥪áâ ¢ ¡ãä¥à
|
||
¤«ï ¢ë¢®¤ ¡ãä¥à ¢ ®ª®, ¨á¯®«ì§®¢ âì ä.65 ¨«¨
|
||
ä.7 (¥á«¨ ¡ãä¥à 24-¡¨âë©)
|
||
Font 㪠§ ⥫ì èà¨äâ
|
||
canvas ¤à¥á £à ä¨ç¥áª®£® ¡ãä¥à
|
||
áâàãªâãà ¡ãä¥à :
|
||
Xsize dd
|
||
Ysize dd
|
||
picture rb Xsize * Ysize * 4 (32 ¡¨â )
|
||
¨«¨ Xsize * Ysize * 3 (24 ¡¨â )
|
||
x, y ª®®à¤¨ âë ⥪áâ ®â®á¨â¥«ì® «¥¢®£® ¢¥à奣®
|
||
㣫 ¡ãä¥à
|
||
str ¤à¥á áâப¨ ⥪áâ ¢ ª®¤¨à®¢ª¥ Win-1251
|
||
length ª®«¨ç¥á⢮ ᨬ¢®«®¢ ¢ áâப¥ ¨«¨ -1, ¥á«¨ áâப
|
||
§ ¢¥àè ¥âáï ã«¥¬
|
||
color 梥â ⥪áâ 0x00RRGGBB
|
||
params ¯ à ¬¥âàë-ä« £¨:
|
||
1 ¦¨àë©
|
||
2 ªãàᨢ
|
||
4 ¯®¤ç¥àªãâë©
|
||
8 ¯¥à¥ç¥àªãâë©
|
||
16 ¯à¨¬¥¨âì ᣫ ¦¨¢ ¨¥
|
||
32 ¢ë¢®¤ ¢ 32-¡¨âë© ¡ãä¥à
|
||
¢®§¬®¦® ¨á¯®«ì§®¢ ¨¥ ä« £®¢ ¢ «î¡ëå á®ç¥â ¨ïå
|
||
------------------------------------------------------------------------------
|
||
MODULE RasterWorks - ®¡¥à⪠¡¨¡«¨®â¥ª¨ Rasterworks.obj
|
||
------------------------------------------------------------------------------
|
||
MODULE libimg - ®¡¥à⪠¡¨¡«¨®â¥ª¨ libimg.obj
|
||
------------------------------------------------------------------------------
|
||
MODULE NetDevices - ®¡¥à⪠¤«ï ä.74 (à ¡®â á á¥â¥¢ë¬¨ ãáâனá⢠¬¨)
|
||
------------------------------------------------------------------------------ |