[fp] changes in rtl & examples
git-svn-id: svn://kolibrios.org@790 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
2dae596c61
commit
350d7e1cc7
42
programs/develop/fp/examples/Makefile.fpc
Normal file
42
programs/develop/fp/examples/Makefile.fpc
Normal file
@ -0,0 +1,42 @@
|
||||
[target]
|
||||
programs=example ray
|
||||
|
||||
[default]
|
||||
target=win32
|
||||
cpu=i386
|
||||
|
||||
[compiler]
|
||||
options=-dKOLIBRI
|
||||
unittargetdir=build
|
||||
targetdir=bin
|
||||
sourcedir=src
|
||||
|
||||
[prerules]
|
||||
ifdef KFPCDIR
|
||||
override KFPCDIR:=$(subst \,/,$(KFPCDIR))
|
||||
ifeq ($(wildcard $(KFPCDIR)/bin),)
|
||||
override KFPCDIR=wrong
|
||||
endif
|
||||
else
|
||||
override KFPCDIR=wrong
|
||||
endif
|
||||
|
||||
ifeq ($(KFPCDIR),wrong)
|
||||
$(error The KFPCDIR environment is wrong)
|
||||
endif
|
||||
|
||||
#UNITSDIR:=$(wildcard $(FPCDIR)/units/$(CPU_TARGET)-kolibri)
|
||||
UNITSDIR:=$(wildcard $(KFPCDIR)/units)
|
||||
KOSEXT=.kex
|
||||
EXE2KEX=$(KFPCDIR)/bin/exe2kos
|
||||
|
||||
[rules]
|
||||
ifneq ($(TARGET_PROGRAMS),)
|
||||
KOSFILES=$(addsuffix $(KOSEXT),$(TARGET_PROGRAMS))
|
||||
endif
|
||||
|
||||
fpc_all: $(KOSFILES)
|
||||
|
||||
%$(KOSEXT): %$(EXEEXT)
|
||||
@$(EXE2KEX) $(COMPILER_TARGETDIR)/$^ $(COMPILER_TARGETDIR)/$@
|
||||
@$(DEL) $(COMPILER_TARGETDIR)/$^
|
@ -1,21 +0,0 @@
|
||||
@echo off
|
||||
|
||||
set NAME=%1
|
||||
set NAMEEXE=%NAME%.exe
|
||||
set NAMEKEX=%NAME%.kex
|
||||
|
||||
set BUILD=-FUbuild
|
||||
set UNTS=-Fu..\units
|
||||
|
||||
fpc %NAME%.pp -n -Twin32 -Se5 -XXs -Sg -O3pPENTIUM3 -CfSSE -WB0 %BUILD% %UNTS%
|
||||
if errorlevel 1 goto error
|
||||
|
||||
..\exe2kos\exe2kos.exe %NAMEEXE% %NAMEKEX%
|
||||
del %NAMEEXE%
|
||||
move %NAMEKEX% bin
|
||||
goto end
|
||||
|
||||
:error
|
||||
echo An error occured while building %NAME%
|
||||
|
||||
:end
|
@ -1 +0,0 @@
|
||||
@_build example
|
@ -1 +0,0 @@
|
||||
@call _build.bat ray
|
@ -1 +1,21 @@
|
||||
„«ï ç « ¥®¡å®¦¨¬® ᮡà âì RTL ¨ ã⨫¨âã exe2kos.
|
||||
„«ï ç « ¥®¡å®¦¨¬® ᮡà âì RTL (../rtl/build.sh ¨«¨ ..\rtl\build.bat) ¨
|
||||
ã⨫¨âã exe2kos (../utils/exe2kos/build.sh ¨«¨ ..\utils\exe2kos\exe2kos.bat).
|
||||
“¡¥¤¨â¥áì çâ®, ®â®á¨â¥«ì® ¤ ®© ¯ ¯ª¨, áãé¥áâ¢ãîâ ä ©« ../bin/exe2kos ¤«ï
|
||||
Linux ¨«¨ ..\bin\exe2kos.exe ¤«ï Windows. ’ ª ¦¥ ã¡¥¤¨â¥áì çâ® áãé¥áâ¢ã¥â ¥
|
||||
¯ãáâ ï ¤¨à¥ªâ®à¨ï ../units/rtl ¤«ï Linux ¨«¨ ..\units\rtl ¤«ï Windows.
|
||||
|
||||
<EFBFBD>¥à¥¬¥ ï ®ªà㦥¨ï FPCDIR ¤®«¦ 㪠§ë¢ âì ¯ ¯ªã á FreePascal (¯ãâì
|
||||
㪠§ë¢ ¥âáï ¡¥§ § ¢¥àè î饣® á«íè ¨«¨ ®¡à ⮣® á«íè ).
|
||||
|
||||
<EFBFBD>¥à¥¬¥ ï ®ªà㦥¨ï KFPCDIR ¤®«¦ 㪠§ë¢ âì ¯ ¯ªã á ¯à®¥ªâ®¬ KolibriOS
|
||||
FreePascal (¯ãâì 㪠§ë¢ ¥âáï ¡¥§ § ¢¥àè î饣® á«íè ¨«¨ ®¡à ⮣® á«íè ). ‚ í⮩
|
||||
¯ ¯ª¥ ¤®«¦ë 室¨âìáï â ª¨¥ ¤¨à¥ªâ®à¨¨: bin, examples, rtl, units, utils.
|
||||
|
||||
<EFBFBD>®á«¥ í⮣® ¢ë¯®«¨â¥ á«¥¤ãî騥 ª®¬ ¤ë ¢ ¤ ®© ¯ ¯ª¥ (¡¥§ § ª $ ¨ ¯à®¡¥«
|
||||
¯®á«¥ ¥£®):
|
||||
$ fpcmake -Twin32
|
||||
$ make
|
||||
|
||||
…᫨ ¢ë ¢á¥ ᤥ« ¨ ¯à ¢¨«ì®, â® ¢ ¯ ¯ª¥ bin ¯®ï¢ïâáï ¨á¯®«ï¥¬ë¥ ä ©«ë á
|
||||
à áè¨à¥¨¥¬ kex.
|
||||
build - ¢à¥¬¥ ï ¯ ¯ª , ¨á¯®«ì§ã¥¬ ï ¯à¨ á¡®àª¥, ¬®¦¥â¥ 㤠«¨âì ¥ñ.
|
@ -4,37 +4,36 @@
|
||||
|
||||
{$mode objfpc}
|
||||
{$smartlink on}
|
||||
{$apptype console}
|
||||
|
||||
{ <EFBFBD> ¤ ë© ¬®¬¥â à áᬠâਢ ¥âáï ¢ë¯®«¥¨¥ ¯à¨«®¤¥¨ï ⮫쪮 ª ª ª®á®«ì®¥,
|
||||
â.¥. ¤¨à¥ªâ¨¢ console ®¡ï§ ⥫ì , ¯®¢¥¤¥¨¥ ¯à®£à ¬¬ë ¯à¨ ®âáãâá⢨¨ í⮩
|
||||
¤¨à¥ªâ¨¢ë ¯à¥¤®¯à¥¤¥«¨âì ¥«ì§ï. ƒ à â¨à®¢ ® ¥«ì§ï ¨á¯®«ì§®¢ âì äãªæ¨¨
|
||||
Write, WriteLn, Read, ReadLn ®â®á¨â¥«ì® áâ ¤ à⮩ ª®á®«¨ ¢¢®¤ /¢ë¢®¤ .
|
||||
}
|
||||
{$apptype gui}
|
||||
|
||||
program Example;
|
||||
|
||||
{ ‚ᥠäãªæ¨¨ ¨¬¥î騥 ¢ ᢮¥¬ ¨¬¥¨ ¯à¥ä¨ªá 'kos_' ïîâáï ¯« âä®à¬®§ ¢¨á¨¬ë¬¨
|
||||
¨ ॠ«¨§®¢ ë ⮫쪮 ¯®¤ KolibriOS. ˆå ¨á¯®«ì§®¢ ¨¥ ¢ «î¡ëå ¯à®£à ¬¬ëå
|
||||
¨ ॠ«¨§®¢ ë ⮫쪮 ¤«ï KolibriOS. ˆå ¨á¯®«ì§®¢ ¨¥ ¢ «î¡ëå ¯à®£à ¬¬ëå
|
||||
¯à¨«®¦¥¨ïå ª ⥣®à¨ç¥áª¨ ¥ ४®¬¥¤®¢ ®, ¢ë®á¨â¥ ¢á¥ ¬¥â®¤ë, ¨á¯®«ì§ãî騥
|
||||
í⨠äãªæ¨¨, ¢ ®â¤¥«ìë¥ ¬®¤ã«¨ (¨ ¨á¯®«ì§ã©â¥ ¥®¡å®¤¨¬ë¥ ¡áâà ªæ¨¨).
|
||||
}
|
||||
í⨠äãªæ¨¨, ¢ ®â¤¥«ìë¥ ¬®¤ã«¨ (¨ ¨á¯®«ì§ã©â¥ ¥®¡å®¤¨¬ë¥ ¡áâà ªæ¨¨). }
|
||||
|
||||
|
||||
procedure DoPaint;
|
||||
{ ‚뢮¤ ᮤ¥à¦¨¬®£® ®ª ¯à¨«®¦¥¨ï }
|
||||
begin
|
||||
kos_begindraw();
|
||||
{®¯à¥¤¥«¥¨¥ ¯ à ¬¥â஢ ®ª }
|
||||
|
||||
{ ®¯à¥¤¥«¥¨¥ ¯ à ¬¥â஢ ®ª }
|
||||
kos_definewindow(200, 200, 200, 50, $23AABBCC);
|
||||
{kos_definewindow ¥ ¨¬¥¥â ¯ à ¬¥âà ¤«ï ¢ë¢®¤ § £®«®¢ª ,
|
||||
¤¥« ¥¬ íâ® ®â¤¥«ì®© äãªæ¨¥© kos_setcaption}
|
||||
{®â®¡à ¦¥¨¥ § £®«®¢ª ®ª }
|
||||
|
||||
{ kos_definewindow ¥ ¨¬¥¥â ¯ à ¬¥âà ¤«ï ¢ë¢®¤ § £®«®¢ª ,
|
||||
¤¥« ¥¬ íâ® ®â¤¥«ì®© äãªæ¨¥© kos_setcaption }
|
||||
|
||||
{ ®â®¡à ¦¥¨¥ § £®«®¢ª ®ª }
|
||||
kos_setcaption('<27><>ˆŒ…<C592> <20><>Žƒ<C5BD>€ŒŒ›');
|
||||
{¢ë¢®¤ á®®¡é¥¨ï}
|
||||
|
||||
{ ¢ë¢®¤ á®®¡é¥¨ï }
|
||||
kos_drawtext(3, 8, '<27> ¦¬¨â¥ «î¡ãî ª« ¢¨èã...');
|
||||
kos_enddraw();
|
||||
end;
|
||||
|
||||
|
||||
procedure DoKey;
|
||||
{ Ž¡à ¡®âª ᮡëâ¨ï ¦ â¨ï ª« ¢¨è¨ }
|
||||
var
|
||||
@ -42,11 +41,13 @@ var
|
||||
Notes: array[0..3] of Byte;
|
||||
begin
|
||||
Key := kos_getkey();
|
||||
{ áâà ¨¢ ¥¬ ¡ãä¥à ¤«ï ®â}
|
||||
|
||||
{ áâà ¨¢ ¥¬ ¡ãä¥à ¤«ï ®â }
|
||||
Notes[0] := $90;
|
||||
Notes[1] := Key shr 8;
|
||||
Notes[2] := $00;
|
||||
{¢®á¯à®¨§¢®¤¨¬}
|
||||
|
||||
{ ¢®á¯à®¨§¢®¤¨¬ }
|
||||
kos_speaker(@Notes);
|
||||
end;
|
||||
|
||||
@ -56,9 +57,10 @@ function DoButton: Boolean;
|
||||
var
|
||||
Button: DWord;
|
||||
begin
|
||||
{¯®«ãç¨âì ª®¤ ¦ ⮩ ª«¨¢¨è¨}
|
||||
{ ¯®«ãç¨âì ª®¤ ¦ ⮩ ª«¨¢¨è¨ }
|
||||
Button := kos_getbutton();
|
||||
{¥á«¨ [x], â® ¢¥àãâì «®¦ì, § ç¨â á¯à®¢®æ¨à®¢ âì § ªàë⨥ ¯à¨«®¦¥¨ï}
|
||||
|
||||
{ ¥á«¨ [x], â® ¢¥àãâì «®¦ì, § ç¨â á¯à®¢®æ¨à®¢ âì § ªàë⨥ ¯à¨«®¦¥¨ï }
|
||||
Result := Button <> 1;
|
||||
end;
|
||||
|
||||
@ -67,35 +69,30 @@ function ProcessMessage: Boolean;
|
||||
{ Ž¦¨¤ ¨¥ ¨ ®¡à ¡®âª ᮡë⨩.
|
||||
|
||||
@return: ‚®§¢à é ¥â False, ¥á«¨ ¡ë«® ᮡë⨥ ª § ¢¥àè¥¨î ¯à¨«®¦¥¨ï.
|
||||
@rtype: True ¨«¨ False }
|
||||
@rtype : True ¨«¨ False }
|
||||
var
|
||||
Event: DWord;
|
||||
begin
|
||||
Result := True;
|
||||
{®¦¨¤ ¥¬ ᮡëâ¨ï ®â á¨á⥬ë}
|
||||
|
||||
{ ®¦¨¤ ¥¬ ᮡëâ¨ï ®â á¨á⥬ë }
|
||||
Event := kos_getevent();
|
||||
case Event of
|
||||
SE_PAINT : DoPaint; {¯¥à¥à¨á®¢ª ®ª }
|
||||
SE_KEYBOARD: DoKey; {ᮡë⨥ ®â ª« ¢¨ âãàë}
|
||||
SE_BUTTON : Result := DoButton; {ᮡ먥 ®â ª®¯ª¨, ¬®¦¥â ®¯à¥¤¥«¨âì
|
||||
§ ¢¥à襨¥ ¯à¨«®¦¥¨ï, ¥á«¨ ¢¥à¥â False}
|
||||
SE_PAINT : DoPaint; { ¯¥à¥à¨á®¢ª ®ª }
|
||||
SE_KEYBOARD: DoKey; { ᮡë⨥ ®â ª« ¢¨ âãàë }
|
||||
SE_BUTTON : Result := DoButton; { ᮡë⨥ ®â ª®¯ª¨, ¬®¦¥â ®¯à¥¤¥«¨âì
|
||||
§ ¢¥à襨¥ ¯à¨«®¦¥¨ï, ¥á«¨ ¢¥à¥â False }
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure MainLoop;
|
||||
{ ƒ« ¢ë© 横« ¯à¨«®¦¥¨ï }
|
||||
var
|
||||
ThreadSlot: TThreadSlot;
|
||||
begin
|
||||
{ áâà ¨¢ ¥¬ ᮡëâ¨ï, ª®â®àë¥ ¬ë £®â®¢ë ®¡à ¡ âë¢ âì}
|
||||
{ áâà ¨¢ ¥¬ ᮡëâ¨ï, ª®â®àë¥ ¬ë £®â®¢ë ®¡à ¡ âë¢ âì }
|
||||
kos_maskevents(ME_PAINT or ME_KEYBOARD or ME_BUTTON);
|
||||
{®¡à ¡®âª ᮡë⨩}
|
||||
|
||||
{ ®¡à ¡®âª ᮡë⨩ }
|
||||
while ProcessMessage do;
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
WriteLn('Look for a new window, I''m just a konsole ;-)');
|
||||
MainLoop;
|
||||
end.
|
67
programs/develop/fp/rtl/Makefile.fpc
Normal file
67
programs/develop/fp/rtl/Makefile.fpc
Normal file
@ -0,0 +1,67 @@
|
||||
#
|
||||
# Makefile.fpc for Free Pascal KolibriOS RTL
|
||||
#
|
||||
|
||||
[package]
|
||||
main=rtl
|
||||
|
||||
[target]
|
||||
loaders=$(LOADERS)
|
||||
units=system objpas buildrtl
|
||||
#implicitunits=sysinitpas sysinitcyg sysinitgprof \
|
||||
# ctypes strings \
|
||||
# lineinfo lnfodwrf heaptrc matrix \
|
||||
# windows winsock winsock2 initc cmem dynlibs signals \
|
||||
# dos crt objects messages \
|
||||
# rtlconsts sysconst sysutils math types \
|
||||
# strutils dateutils varutils variants typinfo fgl classes \
|
||||
# convutils stdconvs cpu mmx charset ucomplex getopts \
|
||||
# winevent sockets printer \
|
||||
# video mouse keyboard fmtbcd \
|
||||
# winsysut sharemem
|
||||
|
||||
#rsts=math varutils typinfo variants classes dateutils sysconst
|
||||
|
||||
[require]
|
||||
nortl=y
|
||||
|
||||
[install]
|
||||
fpcpackage=y
|
||||
|
||||
[default]
|
||||
target=win32
|
||||
cpu=i386
|
||||
|
||||
[compiler]
|
||||
unittargetdir=../units/rtl
|
||||
includedir=$(INC) $(PROCINC)
|
||||
sourcedir=$(INC) $(PROCINC)
|
||||
|
||||
[prerules]
|
||||
RTL=$(FPCDIR)/rtl
|
||||
INC=$(RTL)/inc
|
||||
PROCINC=$(RTL)/$(CPU_TARGET)
|
||||
OBJPASDIR=$(RTL)/objpas
|
||||
|
||||
[rules]
|
||||
.NOTPARALLEL:
|
||||
SYSTEMPPU=$(addsuffix $(PPUEXT),system)
|
||||
|
||||
include $(INC)/makefile.inc
|
||||
SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
|
||||
|
||||
include $(PROCINC)/makefile.cpu
|
||||
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
|
||||
|
||||
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
|
||||
|
||||
# Unit specific rules
|
||||
|
||||
system$(PPUEXT): system.pp $(SYSDEPS)
|
||||
$(COMPILER) -Us -Sg system.pp
|
||||
|
||||
objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc system$(PPUEXT)
|
||||
$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
|
||||
|
||||
buildrtl$(PPUEXT): buildrtl.pp system$(PPUEXT) objpas$(PPUEXT)
|
||||
$(COMPILER) -Fi$(OBJPASDIR)/sysutils -Fi$(OBJPASDIR)/classes -Fu$(PROCINC) -I$(OBJPASDIR) -I$(INC) -Fu$(INC) -Fu$(OBJPASDIR) buildrtl
|
@ -1,21 +1,3 @@
|
||||
@echo off
|
||||
|
||||
set FPRTL={FreePascal RTL source code, example c:\fp\src\rtl}
|
||||
set INCS=-Fi%FPRTL%\inc;%FPRTL%\i386;%FPRTL%\objpas;%FPRTL%\objpas\sysutils;%FPRTL%\objpas\classes
|
||||
set UNTS=-Fu%FPRTL%\inc;%FPRTL%\i386;%FPRTL%\objpas
|
||||
set BUILDPATH=..\units
|
||||
set FPCARGS=-n -Twin32 -Sge5 -O3pPENTIUM3 -CfSSE -di386 -FU%BUILDPATH% %INCS% %UNTS%
|
||||
|
||||
fpc system.pp -Us %FPCARGS%
|
||||
if errorlevel 1 goto error
|
||||
|
||||
fpc %FPRTL%\objpas\objpas.pp %FPCARGS%
|
||||
if errorlevel 1 goto error
|
||||
|
||||
fpc buildrtl.pp %FPCARGS%
|
||||
if errorlevel 0 goto end
|
||||
|
||||
:error
|
||||
echo An error occured while building RTL
|
||||
|
||||
:end
|
||||
fpcmake -Twin32
|
||||
make
|
3
programs/develop/fp/rtl/build.sh
Executable file
3
programs/develop/fp/rtl/build.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
fpcmake -Twin32
|
||||
make
|
@ -152,5 +152,8 @@ begin
|
||||
end;
|
||||
|
||||
if InOutRes <> 0 then
|
||||
begin
|
||||
FreeMem(KosFile);
|
||||
FileRec(f).Handle := DWord(-1);
|
||||
end;
|
||||
end;
|
||||
|
@ -1,4 +1,4 @@
|
||||
{cp866}
|
||||
{utf8}
|
||||
unit System;
|
||||
|
||||
{$i _defines.inc}
|
||||
@ -56,16 +56,16 @@ begin
|
||||
begin
|
||||
while Args^ <> #0 do
|
||||
begin
|
||||
{<EFBFBD>யãáâ¨âì «¨¤¨àãî騥 ¯à®¡¥«ë}
|
||||
{Пропустить лидирующие пробелы}
|
||||
while Args^ in [#1..#32] do Inc(Args);
|
||||
if Args^ = #0 then Break;
|
||||
|
||||
{‡ ¯®¬¨âì 㪠§ â¥«ì ¯ à ¬¥âà}
|
||||
{Запомнить указатель на параметр}
|
||||
SetLength(Ptrs, Argc);
|
||||
Ptrs[Argc - 1] := Args;
|
||||
Inc(Argc);
|
||||
|
||||
{<EFBFBD>யãáâ¨âì ⥪ã騩 ¯ à ¬¥âà}
|
||||
{Пропустить текущий параметр}
|
||||
InQuotes := False;
|
||||
while (Args^ <> #0) and (not (Args^ in [#1..#32]) or InQuotes) do
|
||||
begin
|
||||
@ -73,7 +73,7 @@ begin
|
||||
Inc(Args);
|
||||
end;
|
||||
|
||||
{“áâ ®¢¨âì ®ª®ç ¨¥ ¯ à ¬¥âà }
|
||||
{Установить окончание параметра}
|
||||
if Args^ in [#1..#32] then
|
||||
begin
|
||||
Args^ := #0;
|
||||
@ -81,12 +81,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Argv := GetMem(Argc * SizeOf(PChar)); {XXX: ¯ ¬ïâì ¥ ®á¢®¡®¦¤ ¥âáï}
|
||||
Argv := GetMem(Argc * SizeOf(PChar)); {XXX: память не освобождается}
|
||||
Argv[0] := PKosHeader(0)^.path;
|
||||
for I := 1 to Argc - 1 do
|
||||
begin
|
||||
Argv[I] := Ptrs[I - 1];
|
||||
{ˆáª«îç¨âì ª ¢ë窨 ¨§ áâப¨}
|
||||
{Исключить кавычки из строки}
|
||||
Args := Argv[I];
|
||||
L := 0;
|
||||
while Args^ <> #0 do begin Inc(Args); Inc(L); end;
|
||||
@ -118,7 +118,7 @@ end;
|
||||
|
||||
procedure Randomize;
|
||||
begin
|
||||
randseed := 0; {GetTickCount()}
|
||||
randseed := kos_timecounter();
|
||||
end;
|
||||
|
||||
const
|
||||
@ -136,7 +136,6 @@ begin
|
||||
end;
|
||||
|
||||
{$i kos_stdio.inc}
|
||||
{-$i kos_term.inc}
|
||||
|
||||
procedure SysInitStdIO;
|
||||
begin
|
||||
@ -158,15 +157,15 @@ begin
|
||||
begin
|
||||
if ExitCode <> 0 then
|
||||
begin
|
||||
{XXX: ®¡ï§ ⥫쮥 ãá«®¢¨¥ ®¤®¯®â®çë© Konsole}
|
||||
{XXX: обязательное условие на однопоточный Konsole}
|
||||
Write(StdErr, '[Error #', ExitCode,', press any key]');
|
||||
{®¦¨¤ âì ¦ â¨ï ª« ¢¨è¨}
|
||||
{ожидать нажатия клавиши}
|
||||
Konsole.KeyPressed;
|
||||
while Konsole.KeyPressed = 0 do kos_delay(2);
|
||||
{TODO: ¨á¯à ¢¨âì ª®áïª ¯à¨ ¯¥à¥à¨á®¢ª¥ Konsole}
|
||||
{íâ® ¥¢®§¬®¦®, â ª ª ª ªãç ®á¢®¡®¦¤ ¥âáï ¥é¥ ¤® ¢ë§®¢ í⮩ ¯à®æ¥¤ãàë}
|
||||
{¬®¦® ¯¨á âì ᢮© ¤¨á¯¥âç¥à ¯ ¬ïâ¨, ® íâ® á«®¦®}
|
||||
{ ¥á«¨ ¢ Konsole ¨á¯®«ì§®¢ âì ¢ë¤¥«¥¨¥ ¯ ¬ï⨠¯àï¬ãî ç¥à¥§ KosAPI?!}
|
||||
{TODO: исправить косяк при перерисовке Konsole}
|
||||
{это невозможно, так как куча освобождается еще до вызова этой процедуры}
|
||||
{можно написать свой диспетчер памяти, но это сложно}
|
||||
{а если в Konsole использовать выделение памяти напрямую через KosAPI?!}
|
||||
end;
|
||||
Close(StdErr);
|
||||
Close(StdOut);
|
||||
|
@ -1,12 +1,13 @@
|
||||
{utf8}
|
||||
unit sysutils;
|
||||
|
||||
{$i _defines.inc}
|
||||
{$mode objfpc}
|
||||
{$h+}
|
||||
|
||||
interface
|
||||
|
||||
{$mode objfpc}
|
||||
{ force ansistrings }
|
||||
{$h+}
|
||||
|
||||
{$DEFINE HAS_SLEEP}
|
||||
{-$DEFINE HAS_OSERROR}
|
||||
@ -150,7 +151,7 @@ begin
|
||||
fsFromCurrent: Position := FilePos(FileRecordByHandle(Handle)^.F) + FOffset;
|
||||
fsFromEnd: Position := FileSize(FileRecordByHandle(Handle)^.F) + FOffset;
|
||||
end;
|
||||
{TODO: 能恥丞<EFBFBD> 嵼栽╞皸潳剁 [0..filesize]}
|
||||
{TODO: проверка соответствия [0..filesize]}
|
||||
Seek(FileRecordByHandle(Handle)^.F, Position);
|
||||
Result := Position;
|
||||
end;
|
||||
@ -175,15 +176,16 @@ function FileExists(const FileName: String): Boolean;
|
||||
var
|
||||
F: File;
|
||||
begin
|
||||
{$i-}
|
||||
Assign(F, FileName);
|
||||
try
|
||||
Reset(F);
|
||||
FileSize(F);
|
||||
if IOResult = 0 then
|
||||
begin
|
||||
Result := True;
|
||||
except
|
||||
Result := False;
|
||||
end;
|
||||
Close(F);
|
||||
end else
|
||||
Result := False;
|
||||
{$i+}
|
||||
end;
|
||||
|
||||
function DirectoryExists(const Directory: String): Boolean;
|
||||
|
5
programs/develop/fp/utils/exe2kos/build.bat
Normal file
5
programs/develop/fp/utils/exe2kos/build.bat
Normal file
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
fpc -Twin32 exe2kos.pp
|
||||
del *.o
|
||||
del *.ppu
|
||||
move exe2kos.exe ..\..\bin
|
5
programs/develop/fp/utils/exe2kos/build.sh
Executable file
5
programs/develop/fp/utils/exe2kos/build.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
fpc -Tlinux exe2kos.pp &&
|
||||
rm *.o &&
|
||||
rm *.ppu &&
|
||||
mv exe2kos ../../bin
|
Loading…
Reference in New Issue
Block a user