From: plugwash Date: Sun, 30 Mar 2008 21:39:57 +0000 (+0000) Subject: * make disabling/enabling a timer on windows reset it like on linux X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/82d4e52fba54be50d719f6185ec381f2dc87fc6c * make disabling/enabling a timer on windows reset it like on linux * fix some line ending issues git-svn-id: file:///svnroot/lcore/trunk@10 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/Makefile b/Makefile index 2926076..2ac49d3 100755 --- a/Makefile +++ b/Makefile @@ -1,23 +1,23 @@ -all: lcoretest - -lcoretest: *.pas *.inc lcoretest.dpr - fpc -Sd -dipv6 lcoretest.dpr - -clean: - -rm *.o - -rm *.ppu - -rm *.exe - -rm *.dcu - -rm lcoretest - -date := $(shell date +%Y%m%d) - -zip: - mkdir -p lcorewin32_$(date) - cp -a *.pas lcorewin32_$(date) - cp -a *.inc lcorewin32_$(date) - cp -a *.dpr lcorewin32_$(date) - cp -a Makefile lcorewin32_$(date) - -rm ../lcorewin32_$(date).zip - zip -r ../lcorewin32_$(date).zip lcorewin32_$(date) +all: lcoretest + +lcoretest: *.pas *.inc lcoretest.dpr + fpc -Sd -dipv6 lcoretest.dpr + +clean: + -rm *.o + -rm *.ppu + -rm *.exe + -rm *.dcu + -rm lcoretest + +date := $(shell date +%Y%m%d) + +zip: + mkdir -p lcorewin32_$(date) + cp -a *.pas lcorewin32_$(date) + cp -a *.inc lcorewin32_$(date) + cp -a *.dpr lcorewin32_$(date) + cp -a Makefile lcorewin32_$(date) + -rm ../lcorewin32_$(date).zip + zip -r ../lcorewin32_$(date).zip lcorewin32_$(date) rm -rf lcorewin32_$(date) \ No newline at end of file diff --git a/fd_utils.pas b/fd_utils.pas index b07a110..de89e5f 100755 --- a/fd_utils.pas +++ b/fd_utils.pas @@ -31,11 +31,11 @@ Procedure FD_Clr(fd:longint;var fds:fdSet); Procedure FD_Zero(var fds:fdSet); Procedure FD_Set(fd:longint;var fds:fdSet); Function FD_IsSet(fd:longint;var fds:fdSet):boolean; - -{$ifdef fpc} - {$ifndef ver1_0} - {$define useinline} - {$endif} + +{$ifdef fpc} + {$ifndef ver1_0} + {$define useinline} + {$endif} {$endif} implementation diff --git a/lcoregtklaz.pas b/lcoregtklaz.pas index bbf4418..b09dbfc 100755 --- a/lcoregtklaz.pas +++ b/lcoregtklaz.pas @@ -1,7 +1,7 @@ -{ Copyright (C) 2005 Bas Steendijk and Peter Green - For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package - ----------------------------------------------------------------------------- } +{ Copyright (C) 2005 Bas Steendijk and Peter Green + For conditions of distribution and use, see copyright notice in zlib_license.txt + which is included in the package + ----------------------------------------------------------------------------- } unit lcoregtklaz; {$mode delphi} diff --git a/lcoreselect.pas b/lcoreselect.pas index bae8fe4..0d99f6a 100755 --- a/lcoreselect.pas +++ b/lcoreselect.pas @@ -6,11 +6,11 @@ For conditions of distribution and use, see copyright notice in zlib_license.txt which is included in the package ----------------------------------------------------------------------------- } - -{$ifdef fpc} - {$ifndef ver1_0} - {$define useinline} - {$endif} + +{$ifdef fpc} + {$ifndef ver1_0} + {$define useinline} + {$endif} {$endif} unit lcoreselect; @@ -213,7 +213,7 @@ var var fdsrmaster , fdswmaster : fdset ; - + function getfdsrmaster : fdset; {$ifdef fpc}inline;{$endif} begin result := fdsrmaster; @@ -222,8 +222,8 @@ function getfdswmaster : fdset; {$ifdef fpc}inline;{$endif} begin result := fdswmaster; end; - - + + Function doSelect(timeOut:PTimeVal):longint;//inline; var localtimeval : ttimeval; diff --git a/lloopback.pas b/lloopback.pas index 7e26d7c..167aa65 100755 --- a/lloopback.pas +++ b/lloopback.pas @@ -11,14 +11,14 @@ type implementation -uses -{$ifdef ver1_0} - linux; -{$else} - baseunix,unix,unixutil; -{$endif} -{$i unixstuff.inc} - +uses +{$ifdef ver1_0} + linux; +{$else} + baseunix,unix,unixutil; +{$endif} +{$i unixstuff.inc} + constructor tlloopback.create(aowner:tcomponent); begin inherited create(aowner); diff --git a/lsignal.pas b/lsignal.pas index 49e51b2..833c56e 100755 --- a/lsignal.pas +++ b/lsignal.pas @@ -37,7 +37,7 @@ var firstsignal : tlsignal; blockset : sigset; signalloopback : tlloopback ; - + implementation {$include unixstuff.inc} @@ -193,9 +193,9 @@ end; initialization fillchar(blockset,sizeof(blockset),0); blockset[0] := $FFFFFFFF - (1 shl sigstop) - (1 shl sigkill) - (1 shl sigsegv); - {$ifdef ver1_0} - saction.sa_mask := blockset[0]; - {$else} + {$ifdef ver1_0} + saction.sa_mask := blockset[0]; + {$else} saction.sa_mask := blockset; {$endif} end. diff --git a/lsocket.pas b/lsocket.pas index f4c8349..c37a66a 100755 --- a/lsocket.pas +++ b/lsocket.pas @@ -630,6 +630,6 @@ end; result := winsock.recv(fd,buf,size,0); end; {$endif} - + end. diff --git a/uint32.inc b/uint32.inc index 897db79..4f2caad 100755 --- a/uint32.inc +++ b/uint32.inc @@ -1,6 +1,6 @@ -{ Copyright (C) 2005 Bas Steendijk and Peter Green - For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package +{ Copyright (C) 2005 Bas Steendijk and Peter Green + For conditions of distribution and use, see copyright notice in zlib_license.txt + which is included in the package ----------------------------------------------------------------------------- } type {delphi 3 and before do not have a 32 bits unsigned integer type, diff --git a/unixstuff.inc b/unixstuff.inc index 76a7f52..f8c7396 100755 --- a/unixstuff.inc +++ b/unixstuff.inc @@ -26,16 +26,16 @@ {$define dup2 := fpdup2} {$ifndef ver1_9_2} {$define flock := fpflock} - {$ifndef ver1_9_4} - procedure Execl(Todo:string);inline; - var - p : ppchar; - begin - p := unixutil.StringToPPChar(Todo,1); - if (p=nil) or (p^=nil) then exit; - fpexecv(p^,p); - end; - {$endif} + {$ifndef ver1_9_4} + procedure Execl(Todo:string);inline; + var + p : ppchar; + begin + p := unixutil.StringToPPChar(Todo,1); + if (p=nil) or (p^=nil) then exit; + fpexecv(p^,p); + end; + {$endif} {$endif} procedure gettimeofday(var tv:ttimeval);inline; begin diff --git a/wcore.pas b/wcore.pas index 40505ef..f88aa53 100755 --- a/wcore.pas +++ b/wcore.pas @@ -30,6 +30,9 @@ interface end; tltimer=class(tlcomponent) + private + fenabled : boolean; + procedure setenabled(newvalue : boolean); public ontimer:tnotifyevent; initialevent:boolean; @@ -37,8 +40,8 @@ interface prevtimer:tltimer; nexttimer:tltimer; interval:integer; {miliseconds, default 1000} - enabled:boolean; nextts:integer; + property enabled:boolean read fenabled write setenabled; constructor create(aowner:tcomponent);override; destructor destroy;override; end; @@ -96,6 +99,13 @@ end; {------------------------------------------------------------------------------} +procedure tltimer.setenabled(newvalue : boolean); +begin + fenabled := newvalue; + nextts := 0; + initialdone := false; +end; + constructor tltimer.create; begin inherited create(AOwner); diff --git a/zlib_license.txt b/zlib_license.txt index a8a88f5..3ec19c1 100755 --- a/zlib_license.txt +++ b/zlib_license.txt @@ -1,19 +1,19 @@ -Copyright (c) 2005 Bas Steendijk and Peter Green - -This software is provided 'as-is', without any express or implied warranty. -In no event will the authors be held liable for any damages arising from the -use of this software. - -Permission is granted to anyone to use this software for any purpose, including -commercial applications, and to alter it and redistribute it freely, subject to -the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software in a - product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source distribution. +Copyright (c) 2005 Bas Steendijk and Peter Green + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the +use of this software. + +Permission is granted to anyone to use this software for any purpose, including +commercial applications, and to alter it and redistribute it freely, subject to +the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution.