Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread fredvs
@ Ewald = thanks.
Hum, i did use checksynchronize but it did not help...
Must it be used with fptimer.ontimer too ?
And why fptimer.ontimer is not executed ?
Will i have more luck with other timer like epiktimer from Graeme (or the
new one from Michael) ?
Thanks.

PS : I will try with some more checksynchronize in main thread...



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Java-crash-when-fpc-library-CallVoidMethod-in-a-thread-tp5719098p5719431.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread Michael Van Canneyt



On Fri, 30 May 2014, fredvs wrote:


@ Ewald = thanks.
Hum, i did use checksynchronize but it did not help...


When do you call it.


Must it be used with fptimer.ontimer too ?


No.


And why fptimer.ontimer is not executed ?


If CheckSynchronize is not executed at regular intervals, 
fptimer.ontimer is not used.



Will i have more luck with other timer like epiktimer from Graeme (or the
new one from Michael) ?


AFAIK: 
Those are not the same kind of timers. They just tell you how much time passed,

they do not deliver events at specified intervals.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread fredvs
re-@ Ewald :

 It *must* be called in the context of the main thread (the thread that
 loaded the library)

OOps, so do you mean that CheckSynchronize must be called by Java ?
So i have to add a custom procedure in the fpc library (who will be only a
fpc CheckSynchronize()) ?

Is it that that you mean, calling CheckSynchronize from the main Java class
(not from the main thread of the library) ?

Thanks.





-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Java-crash-when-fpc-library-CallVoidMethod-in-a-thread-tp5719098p5719433.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread Michael Van Canneyt



On Fri, 30 May 2014, fredvs wrote:


re-@ Ewald :


It *must* be called in the context of the main thread (the thread that
loaded the library)


OOps, so do you mean that CheckSynchronize must be called by Java ?
So i have to add a custom procedure in the fpc library (who will be only a
fpc CheckSynchronize()) ?

Is it that that you mean, calling CheckSynchronize from the main Java class
(not from the main thread of the library) ?


It must be called at regular intervals from the main thread of the library.
Whether this is triggered from Java, or you have some loop in your main 
thread that triggers this, is something that is in fact irrelevant for the functioning.


I don't know enough about your architecture to comment on how to do it.
I suspect though, that you will need to make it callable from Java and 
call it at regular intervals from Java code.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread mokashe.ram
Hi

Could any one help me on the replacement of MemAvail and MaxAvail function
in free pascal 32 bit OS(windows 7).

Thanks,

Sudarshan Mokashe



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/replacement-of-MemAvail-and-MaxAvail-tp5719435.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread Michael Van Canneyt



On Fri, 30 May 2014, mokashe.ram wrote:


Hi

Could any one help me on the replacement of MemAvail and MaxAvail function
in free pascal 32 bit OS(windows 7).


These functions have almost no meaning in a modern OS.

They depend on available RAM, OS usage, number of programs currently running, 
size of swap file etc.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread mokashe.ram
 Thanks For Your This Prompt Reply...
but in promgram these functions are already used in my applcation developed
in TP7, sonow i am migration this applcation to free pascal. how can i
replace using free pascal?



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/replacement-of-MemAvail-and-MaxAvail-tp5719435p5719437.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread Michael Van Canneyt



On Fri, 30 May 2014, mokashe.ram wrote:


Thanks For Your This Prompt Reply...
but in promgram these functions are already used in my applcation developed
in TP7, sonow i am migration this applcation to free pascal. how can i
replace using free pascal?


Throw away the code that uses these functions. 
It is useless code and will not work correctly anyway.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread Ewald

On 30 May 2014, at 10:46, fredvs wrote:

 re-@ Ewald :
 
 It *must* be called in the context of the main thread (the thread that
 loaded the library)
 
 OOps, so do you mean that CheckSynchronize must be called by Java ?
 So i have to add a custom procedure in the fpc library (who will be only a
 fpc CheckSynchronize()) ?
 
 Is it that that you mean, calling CheckSynchronize from the main Java class
 (not from the main thread of the library) ?
 


Have you got an event/main loop?

If you have something like
While true do
Begin
... code ...
End;

Simply append CheckSynchronize at the end of this block:
While true do
Begin
... code ...

CheckSynchronize;
End;

If you have an eventloop, but you haven't got access to the actual code of the 
loop, you should look for mechanisms that hook up to this loop (something like 
http://wiki.freepascal.org/Main_Loop_Hooks ?); how this can be done in java, I 
do not know. You could even try using a timer to accomplish this (it is far 
from ideal, but you can experiment further then ;-) ), as long as it is a timer 
that doesn't execute it's events in it's own different thread (if applicable).

As you can see, I am rather vague on the subject, because (1) I am not a java 
programmer and (2) I don't know enough of your architecture to make any 
specific comment.

--
Ewald

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread mokashe.ram
  Ok Thanks Michael ...

Thanks,
Sudarshan Mokashe



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/replacement-of-MemAvail-and-MaxAvail-tp5719435p5719440.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] FCGI TRequest URI

2014-05-30 Thread Dimitrios Chr. Ioannidis

Hi,

  i'm trying to find out why the TRequest.URI property always return 
empty string in my setup. I have configured the web server apache like this


Directory /path/cgi/dir
  SetHandler fcgid-script
  Order allow,deny
  Allow from all
/Directory

ScriptAlias /test /path/cgi/dir/fpc-fcgi-app.fcgi

and when i'm trying to get the uri with something like ARequest.URI it's 
always empty. The BaseURL, Host etc are ok.


Any hints ?

I'm using fpc 2.6.5 ( latest fixes branch ) and apache from debian 
wheezy ( 2.2.2 i think ).


regards,

--
Dimitrios Chr. Ioannidis



smime.p7s
Description: Κρυπτογραφημένη υπογραφή S/MIME
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FCGI TRequest URI

2014-05-30 Thread Michael Van Canneyt



On Fri, 30 May 2014, Dimitrios Chr. Ioannidis wrote:


Hi,

 i'm trying to find out why the TRequest.URI property always return empty 
string in my setup. I have configured the web server apache like this


Directory /path/cgi/dir
 SetHandler fcgid-script
 Order allow,deny
 Allow from all
/Directory

ScriptAlias /test /path/cgi/dir/fpc-fcgi-app.fcgi

and when i'm trying to get the uri with something like ARequest.URI it's 
always empty. The BaseURL, Host etc are ok.


Any hints ?


Nope. Seems like something that needs to be debugged :(

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FCGI TRequest URI

2014-05-30 Thread Dimitrios Chr. Ioannidis

Hi,

Στις 30/5/2014 12:57 μμ, ο/η Michael Van Canneyt έγραψε:



On Fri, 30 May 2014, Dimitrios Chr. Ioannidis wrote:

snip
and when i'm trying to get the uri with something like ARequest.URI 
it's always empty. The BaseURL, Host etc are ok.


Any hints ?


Nope. Seems like something that needs to be debugged :(


your answer implies that the apache configuration is correct so there 
must be a problem in the cgi params assignement code.


I'll take a look cause i want to use your wstmodule for web service 
toolkit, and you use the ARequest.URI as a parameter to construct the wsdl.


regards,

--
Dimitrios Chr. Ioannidis



smime.p7s
Description: Κρυπτογραφημένη υπογραφή S/MIME
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FCGI TRequest URI

2014-05-30 Thread Michael Van Canneyt



On Fri, 30 May 2014, Dimitrios Chr. Ioannidis wrote:


Hi,

Στις 30/5/2014 12:57 μμ, ο/η Michael Van Canneyt έγραψε:



On Fri, 30 May 2014, Dimitrios Chr. Ioannidis wrote:

snip
and when i'm trying to get the uri with something like ARequest.URI it's 
always empty. The BaseURL, Host etc are ok.


Any hints ?


Nope. Seems like something that needs to be debugged :(


your answer implies that the apache configuration is correct so there must be 
a problem in the cgi params assignement code.


I'll take a look cause i want to use your wstmodule for web service toolkit, 
and you use the ARequest.URI as a parameter to construct the wsdl.


Normally, it should be read from the REQUEST_URI environment variable.

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Fri, 30 May 2014, mokashe.ram wrote:

  Thanks For Your This Prompt Reply...
 but in promgram these functions are already used in my applcation developed
 in TP7, sonow i am migration this applcation to free pascal. how can i
 replace using free pascal?

Michael is right, there's no *real* replacement, because modern OSes
handle the memory differently, and the available memory can change
anytime, even between or during the query function itself... But if you
just want to get the code compiled, with the absolute certainity that it
*will* break runtime, you can for MaxAvail just declare a dummy function
which returns High(LongInt); or some other large constant.

For MemAvail, the problem is that some code uses it to allocate all
available memory in one go, this won't work. But you can still declare a
dummy function, which returns 'some amount', so you can get the code
compiled. However, the original functionality what this code does will not
work, or will not work properly.

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] TZipper and special file names like atenção.txt (#26213)

2014-05-30 Thread Reinier Olislagers
On 27/05/2014 00:41, silvioprog wrote:
 Perfect! :)

Please feel free to open that bug report if you haven't already

Thanks.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread fredvs
Yep, yep, yep some very good news...

1) Added a new procedure in fpc library:
 = 
procedure uos_checksynchro(PEnv: PJNIEnv; Obj: JObject) ; cdecl;
begin
checksynchronize();
end; 

2) And, of course, in fpc library exported as:
 =
exports
...
uos_checksynchro name 'Java_uos_checksynchro', 
...

3) Added in Java wrapper class:
public static native void checksynchro();

4) In main Java application:
After that the fpc thread (who does a CallVoidMethod) was called by Java
(with  uos.play(0);):

= uos.checksynchro();

5) And guess what... The CallVoidMethod is executed...

So, first conclusion : it is possible to synchronize a CallVoidMethod inside
a thread but Java main thread must call fpc-checksynchronize().

Hum, so maybe, (im new in Java) use a Java-timer who calls
uos.checksynchro(); at regular time...

1) @ Ewald = Oops i read just your answer now, i will study it...
2) @ Ewald = i prefer your solution (if i can do it work) because i prefer
not oblige Java-users to use a Java-timer.

PS : All other solutions are welcome...

PS2 : All those problems of synchronize CallVoidMethod inside a thread are
problems only for uos (audio library).
For fpGUI library, no any problems (because fpGUI library does not use
threads...), those Java developers have now the best widgetset for their
Java applications.

PS3 : Hum, if one day, i need a fptimer in a fpc library, is it possible to
use fptimer.ontimer who works with Java ?

Many thanks.

Fred.






-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Java-crash-when-fpc-library-CallVoidMethod-in-a-thread-tp5719098p5719447.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread fredvs
Please read my earlier post before this one

@ Ewald, i have try with :

 While true do
Begin
... code ...

CheckSynchronize;
End; 

But this does not work...

Thanks



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Java-crash-when-fpc-library-CallVoidMethod-in-a-thread-tp5719098p5719448.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread Ewald
On 05/30/2014 01:15 PM, fredvs wrote:
 Please read my earlier post before this one

 @ Ewald, i have try with :

  While true do
 Begin
 ... code ...

 CheckSynchronize;
 End; 

 But this does not work...

The question here is: where did you type it?

Anyway, as you've already gotten it to work, there is no need to try
this; the next thing to go for, is probably be to try to get this
`CheckSynchronize;` integrated into java in a decent manner (applicable
to most use cases, that is). Good luck with that :-)

-- 

Ewald

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-05-30 Thread Sven Barth
Am 30.05.2014 13:09 schrieb fredvs fi...@hotmail.com:
 Hum, so maybe, (im new in Java) use a Java-timer who calls
 uos.checksynchro(); at regular time...

If the timer event runs in the same thread as your current call to
checksynchro resides then it will work. If it's executed by a different
thread then not.

 PS3 : Hum, if one day, i need a fptimer in a fpc library, is it possible
to
 use fptimer.ontimer who works with Java ?

With your current usage of checksynchro fptimer.OnTimer should work as well
(you can't currently use it without a CheckSynchronize though).

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] WST ERangeError RunError(201)

2014-05-30 Thread Dimitrios Chr. Ioannidis

Hi,

  when i'm trying to switch to debug an app which uses wst i always get 
a FPC_ANSISTR_RANGECHECK ( ERangeError ).


 Without debug enabled all is working fine. I'm using fpc 2.6.5 ( fixes 
branch ) and lazarus 1.2.3 at debian wheezy x86_64, and I made the 
following change all is working and i can debug my app.


Index: server_service_intf.pas
===
--- server_service_intf.pas(revision 3031)
+++ server_service_intf.pas(working copy)
@@ -485,7 +485,7 @@
   end;
   //Extract the base ContentType : type / subtype *( ; parameter )
   j := Length(s);
-  for i := 0 to Pred(Length(s)) do begin
+  for i := 1 to Pred(Length(s)) do begin
 if ( s[i] = ';' ) then begin
   j := ( i - 1 );
   Break;


FYI, this is the backtrace

#0 HANDLEERRORADDRFRAME(201, 0x7fffd630, 0x439bd0) at 
../inc/system.inc:962

#1 HANDLEERRORFRAME(201, 0x7fffd630) at ../inc/system.inc:992
#2 fpc_ansistr_checkrange(0x77f4a3d0, 0) at ../inc/astrings.inc:559
#3 HANDLEREQUEST(0x77f68240, 0x77fefd88) at 
../../3rdparty/wst/server_service_intf.pas:489
#4 HANDLESERVICEREQUEST(0x77fefd88, 0x0) at 
../../3rdparty/wst/server_service_intf.pas:259
#5 PROCESSSERVICEREQUEST(0x77f6a2c0, 0x77f9a730, 0x77f6a0c0, 
0x77f69e10 'SOAP') at 
../../3rdparty/wst/ide/lazarus/wstmodule/wstmodule.pas:230
#6 HANDLEREQUEST(0x77f6a2c0, 0x77f9a730, 0x77f6a0c0) at 
../../3rdparty/wst/ide/lazarus/wstmodule/wstmodule.pas:273
#7 HANDLEREQUEST(0x77f820c0, 0x77f9a730, 0x77f6a0c0) at 
src/base/custweb.pp:374
#8 DOHANDLEREQUEST(0x77f820c0, 0x77f9a730, 0x77f6a0c0) at 
src/base/custweb.pp:474

#9 RUN(0x77f820c0) at src/base/custweb.pp:263
#10 DORUN(0x77f8a0c0) at src/base/custweb.pp:646
#11 RUN(0x77f8a0c0) at src/custapp.pp:286
#12 main at prjLoyaltyfcgi.lpr:13


regards,

--
Dimitrios Chr. Ioannidis



smime.p7s
Description: Κρυπτογραφημένη υπογραφή S/MIME
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread Jonas Maebe

On 30 May 2014, at 11:37, mokashe.ram wrote:

 but in promgram these functions are already used in my applcation developed
 in TP7, sonow i am migration this applcation to free pascal. how can i
 replace using free pascal?

Set the global variable ReturnNilIfGrowHeapFails to true, and in all places 
where you checked whether memavail/maxavail was large enough, instead allocate 
the memory and check whether the returned pointer is different from nil.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] replacement of MemAvail and MaxAvail

2014-05-30 Thread waldo kitty

On 5/30/2014 5:37 AM, mokashe.ram wrote:

  Thanks For Your This Prompt Reply...
but in promgram these functions are already used in my applcation developed
in TP7, sonow i am migration this applcation to free pascal. how can i
replace using free pascal?


take them out... what do you need them for? ;)

--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Typinfo incompatibilities between FPC and Delphi

2014-05-30 Thread Kenneth Cochran
I'm attempting to port GExperts from Delphi to Lazaurus and noticed the
definition of TPropInfo differs from Delphi's.

In FPC's TPropInfo the PropType field is PTypeInfo whereas in Delphi it is
PPTypeInfo. I'm not sure what is actually gained by this extra level of
indirection but it exists none the less.

Are there any plans to update TPropInfo to be compatible with Delphi or do
I need to  wrap dependent code with compiler conditionals?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal