[fpc-pascal] Pure FPC ?

2014-01-26 Thread fredvs
Hello. Does it exist a option to compile fpc without Delphi compatibility ? If no, what do you think about that ? I know, it will be lot of work (like create a Delhi_Compatiblizer class...) PS : I absolutely do not want to hurt somebody, it is only a proposition. - Many thanks ;-) --

Re: [fpc-pascal] Error compile library on Linux.

2014-03-26 Thread fredvs
You recompiled the FPC? Or simple change of fpc.cfg options solves your problem? Oops, sorry for the delay. I only change fpc.cfg options and it solves the problem... Hum, im really sorry but i do not know what changes do the trick. (i did not save the old fpc.cfg-not-working, so, i cannot

Re: [fpc-pascal] Error compile library on Linux.

2014-03-26 Thread fredvs
@ Fabio Luis Girardi : Here my working *fpc.cfg* _ # # Config file generated by fpcmkcfg on 5-3-14 - 21:58:27 # Example fpc.cfg for Free Pascal Compiler # # -- # Defines (preprocessor) # -- # #

[fpc-pascal] Access fpc libraries with Java ?

2014-03-27 Thread fredvs
Hello. I try to access fpc libraries with Java. I can access those libraries with: = Python without problems, even callback functions... = fpc programs, of course... But with Java i get trouble... I try with JNA : https://github.com/twall/jna But without luck. Does somebody already had access

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-27 Thread fredvs
Yep, yep, yep, ... tetra * mega thanks. Hum, i have very poor knowledge with Java. Of course i can do a Hello World and some other things. But now, because of some fpc libraries, i explore the import native library part of java. And, what surprise me, in Java forum, was that lot of Java

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-27 Thread fredvs
Yep Leledumbo, this time you kill me. Your code is working PERFECTLY and trust me, even at StackOverflow.com, they do not know your trick, there are lot of questions for that without any working answer. Your GENIUS trick is to export name = Java_MyLib_MyProcedure. I do not know if that could be

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread fredvs
And then there are even specific tutorials if you look for JNI tutorial and maybe some language name and with the advent of Android this got even more, because this is the way how you interface native with Java code there... Hum, have you really test those tutorials ? You must be a very good

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread fredvs
It's JNI requirement, I wonder it could work without as it may corrupt the stack. The first parameter is the JVM environment, the second is the Java object (or class in case of static method), the rest is actual parameters to the function. Yep, you are right, it was working only for function

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-28 Thread fredvs
Welcome to real JNI programming :) Yep, i will study deeply JNI and the JNI Pascal wrapper. See you later. ;-) Thanks. - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Access-fpc-libraries-with-Java-tp5718791p5718810.html Sent from the

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-29 Thread fredvs
Custom Drawn Android Module Wizard has JNI wrapper, but they develop each independently and I have no idea which one is better. Choose wisely. Yes, but sadly, both do not implement the JStringToString() function from the original Delphi jni.pas. OK, i will try to implement JStringToString()

Re: [fpc-pascal] Some articles on Lazarus/Free Pascal.

2014-03-29 Thread fredvs
Whaw, super nice and lot of examples... Many thanks. - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Some-articles-on-Lazarus-Free-Pascal-tp5718816p5718817.html Sent from the Free Pascal - General mailing list archive at Nabble.com.

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-29 Thread fredvs
OK, i will try to implement JStringToString() function (or find the conversion-solution)... Done = function JStringtoString(PEnv: PJNIEnv; Obj: JObject; JavaStr: JString) : String; var ifcop : pjboolean; begin result := (PEnv^).GetStringUTFChars(PEnv, JavaStr, ifcop); end; He, he, he, ...

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-31 Thread fredvs
now the last obstacle : Callback procedures... Hum, i do not find why it is not working ;-( I follow jni c examples but with no luck. Does somebody knows how to deal with callback procedures and Java ? Here Library Pascal code : procedure formonclick(PEnv: PJNIEnv; Obj: JObject; aproc:

Re: [fpc-pascal] Access fpc libraries with Java ?

2014-03-31 Thread fredvs
Yep, i get it ;-) Explanations on Lazarus forum : = http://forum.lazarus.freepascal.org/index.php/topic,24063.msg144634.html#msg144634 No more obstacle now, Java is in the pocket. Cheers. - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] JNI/Android: Java events calling pascal code

2014-04-21 Thread fredvs
Hello. take a look here : = http://wiki.freepascal.org/Using_Pascal_Libraries_with_Java At = Dealing with callback procedures. - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] JNI/Android: Java events calling pascal code

2014-04-23 Thread fredvs
Hello. Hum, if you are not obliged to use Java media-player, you may use = https://github.com/fredvs/uoslib. That fpc audio library is Java-comatible and can do easy callbacks... - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/JNI

[fpc-pascal] java events calling pascal code vs java calling library.

2014-04-24 Thread fredvs
Hello. Could it be possible to have some infos ans arguments about this : Im newbie in Java-link-with-fpc and I would like to understand what can/cannot be done. Here what i understood (If im wrong, please, correct me...) = All Java os (Android and friends) can only deal with Java class. = If

Re: [fpc-pascal] java events calling pascal code vs java calling library.

2014-04-25 Thread fredvs
Many thanks Stephano. as my java exposure started only a few days ago. Same for me. I have successfully adapt some of my fpc native libraries into Java-native libraries. Im extremely happy with the result, all the functions/procedures are exported and working. Even callback procedures. I am

[fpc-pascal] Create and use a wrapper class in java

2014-04-27 Thread fredvs
Hello wonderful fpc people. Hum, i want to create a Java wrapper class to access some fpc Java native libraries. I have already asked it everywhere, looking in all Java doc, but... without luck. Here the unique answer i get (from codeguru.com) =

Re: [fpc-pascal] Create and use a wrapper class in java

2014-04-27 Thread fredvs
Hello Stephano. Did you put each class in a separate file? Yes, of course, it is the goal : = a separate wrapper class (TheWrapper.java), with all the methods defined to use the library, = and the main class (test.java) who uses that wrapper class. So, the same wrapper class way be used by

Re: [fpc-pascal] Create and use a wrapper class in java

2014-04-27 Thread fredvs
Something like `java test` of rather `java TheWrapper`? I did first compile both class with* javac test *and *javac TheWrapper.* = ok, both compile without error... Then i run *java test* and get the error message... try to get the wrapper class working with something that simply prints

Re: [fpc-pascal] Create and use a wrapper class in java

2014-04-27 Thread fredvs
Just a guess here, but what command did you use to run the `main class`? Yep, Ewald, you get it (and me too) :-) It seems that, indeed, i used the wrong run-parameter. And guess what... IT WORKS. Ok, Java is now completely in the basket of fpc libraries. Time to present to the lucky Java

Re: [fpc-pascal] Create and use a wrapper class in java

2014-04-28 Thread fredvs
PS : ASAP, i will update the fpc wiki... Done = http://wiki.freepascal.org/Using_Pascal_Libraries_with_Java - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Create-and-use-a-wrapper-class-in-java-tp5719072p5719082.html Sent from the

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

2014-05-02 Thread fredvs
In general, libraries and threading is not an easy story. Ok,..., but what is your advice to do a CallVoidMethod inside a thread ? PS: Everything, inside the thread is working perfectly, only CallVoidMethod does crash... Do you think i could have better result with a kind of post-messages ?

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

2014-05-03 Thread fredvs
Did you use AttachCurrentThread and DetachCurrentThread? Oops, what is that ? How must i use it ? Pay attention to the validity of local references as well as their number. Idem, what is local references as well as their number. ? PS: Im a beginner with Java but, apart CallVoidMethod in

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

2014-05-03 Thread fredvs
Posting some code might help. I may post code but not sure it will help. The code is the same as http://wiki.freepascal.org/Using_Pascal_Libraries_with_Java, section dealing with callback procedure ( but inside a thread). Hum, i would prefer some demo-working-code from somebody who knows how

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

2014-05-26 Thread fredvs
Hello. What is the best way to unthread a procedure ? I have try with a fptimer outside the thread but the thing that disturb me is that you need a tcomponent as owner to create it. And in the library i do not use any tcomponent... How to create a fptimer without owner ? I have try with

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

2014-05-26 Thread fredvs
Yep, Michael, thanks... Ok then for Nil owner... Hum, checksynchronize(), i do not realy understand how to use in the thread/loop... In the loop i do not use synchronize, because the procedure that is called is a java/method and synchronize is for procedure of object outside the thread... (Or i

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

2014-05-29 Thread fredvs
Hello Sven, hello Michael = many tanks. I have follow your advices... but... I have then create a object and a procedure inside that object. I use then queue() or synchronize() inside the thread to execute that procedure of object. That procedure call CallvoidMethod. OK, everything compiles but

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

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

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)

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:

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

2014-05-31 Thread fredvs
The question here is: where did you type it? Inside the loop in thread, after each queue()... and also just before end of thread. 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).

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

2014-06-01 Thread fredvs
@ Ewald and Sven = many thanks ;-) The ideal thing would be to find some java mechanism that allows him to `append` this checksynchronize to `the` main loop, some main-loop hook of sorts. Yep, i will be hyper-interested by that feature... So, until that day will come, i will use a Java-timer

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

2014-06-18 Thread fredvs
The ideal thing would be to find some java mechanism that allows him to `append` this checksynchronize to `the` main loop, some main-loop hook of sorts. Hum, if somebody have some idea how to implement it, he is very welcome to show his way... ;-) PS: By the other way, here some conclusions of

[fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-06-29 Thread fredvs
Hello. I want to test some fpc libraries with freeBSD. The compilation is ok but the library fail to run... There was exactly the same problem in a earlier topic : = http://lists.freepascal.org/pipermail/fpc-devel/2013-November/032950.html Is it solved in trunk fpc version ? Have try with FPC

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-06-29 Thread fredvs
Ooops, i forget to note something... My goal was to expose some pascal library to Java, of course those fpc libraries follow the Java-native-library-way. Those libraries loaded by a Java application work with Linux (tested on Mint 32/64) but fail to work with freeBSD... Thanks. Fred. -

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-07-03 Thread fredvs
Hello everybody... Hum... no answers or no ideas ? Thanks. Fred - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Calling-fpc-libraries-from-other-languages-on-freebsd-amd64-bis-tp5719667p5719700.html Sent from the Free Pascal - General

[fpc-pascal] Library does not compile on freeBSD

2014-08-01 Thread fredvs
Hello. I have a library-code who compiles perfectly on Linux 32/64 and Windows 32/64 with fpc 2.7 trunk. Sadly, when i try to compile same code on freeBSD with fpc 2.7 trunk too, i get that error message : /usr/bin/ld: /usr/home/fred/fpGUI-develop/lib/x86_64-freebsd/fpg_base.o: relocation

[fpc-pascal] LoadLibrary in freeBSD ?

2014-08-01 Thread fredvs
Hello. I try to load a linux-library in freeBSD with DynLibs.LoadLibrary(libfilename) but it does not load... Must the loaded library be pure freeBSD library ? I was thinking that freeBSD is able to run Linux applications. Is it not true for libraries or must i install something in freeBSD to

Re: [fpc-pascal] LoadLibrary in freeBSD ?

2014-08-01 Thread fredvs
Yep, i have some news from freeBSD. I have installed linux_base-f10 (linux emulator) but it seams that freeBSD can load only 32-bit-libraries. Here some comment from freeBSD site : FreeBSD provides 32-bit binary compatibility with Linux®, allowing users to install and run most 32-bit Linux®

Re: [fpc-pascal] Library does not compile on freeBSD

2014-08-02 Thread fredvs
Hello. Thanks to Graeme, it is possible to compile libraries on freeBSD ;-) The solution := Implementation {$IFDEF FREEBSD} // These are missing for FreeBSD in FPC's RTL const S_IRWXU = S_IRUSR or S_IWUSR or S_IXUSR; S_IRWXG = S_IRGRP or S_IWGRP or S_IXGRP; S_IRWXO = S_IROTH or

Re: [fpc-pascal] LoadLibrary in freeBSD ?

2014-08-02 Thread fredvs
Thanks Marco, thanks for your light ;-) Now that i can compile freeBSD libraries (see my last other topic), i will use that libraries (in place of Linux libraries). Write you later with the (positive, sure) results. Fred. - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] Library does not compile on freeBSD

2014-08-02 Thread fredvs
Hello. A other issue comes from lpk packages. Here answer from Super-Graeme that solve my problems... = ... The classic down side of using Lazarus Packages (*.lpk files). You applied a new compiler option to your project, but Lazarus doesn't apply that to any packages you are using. Same goes

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-08-02 Thread fredvs
Is it solved in trunk fpc version ? Why don't you try? I have install a brand new trunk version of fpc 2.7.1 64 bit on freeBSD 10 64 bit. The library was successfully compiled. But, sadly, i get hat error message while trying to run a java application who use the library (that java

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-08-03 Thread fredvs
Start providing source code so people can follow what you are trying to do instead of having to guess would be a nice step ;) First, fpGUI must be installed = https://github.com/graemeg/fpgui/tree/develop Then. go there = https://github.com/fredvs/fpGUIlib - Click on Download Zip. (middle

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-08-03 Thread fredvs
/tree/develop Then. go there = https://github.com/fredvs/fpGUIlib Select branch: = freebsd-fixes - Click on Download Zip. (middle/end of page) and unzip it. - In /fpGUIlib/src/ change in extrafpc.cfg the directory of fpGUI according yours. (maybe read ReadMe.txt, it is explained). - And finally

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-08-03 Thread fredvs
Yes, it is still me... You may try the compiled and binary java demo for Linux 64 bit := https://sites.google.com/site/fiensprototyping/demo_Java.tar.gz Download and unzip the demo. Then := -In terminal do: - cd /demo_Java (go in java demo path) Then run it with: - java

Re: [fpc-pascal] Calling fpc libraries from other languages on freebsd/amd64 (bis)

2014-08-04 Thread fredvs
Aaaargh, difficult t find help here... In the original thread [fpc-devel] (hack) calling fpc libraries from other languages on freebsd/amd64 of Michal Wallace michal.wallace at gmail.com Michael Wallace said that he has find the solution := Anyway, the problem appears to be in this file:

[fpc-pascal] fpc Libraries do not work in freeBSD

2014-08-04 Thread fredvs
Hello. Fpc library compiled on freeBSD are unusable. Python, Java and even fpc applications can not use them... Look at that (works with Linux): = The fpc library := library test ; {$mode objfpc} procedure fpctest(); begin writeln('OK, it works...'); end; exports fpctest

[fpc-pascal] http://free-pascal-develop.nabble.com/ ?

2014-08-05 Thread fredvs
Hello. For fpc-general it exists : http://free-pascal-general.1045716.n5.nabble.com/ Nable is a easy to use forum-web site. Does it exist a nabble web page for fpc-develop (with all fpc-devel archives) ? Thanks. - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] http://free-pascal-develop.nabble.com/ ?

2014-08-06 Thread fredvs
I'm the one who registered FPC general to Nabble a couple of years ago. Many thanks, Leledumbo. I find it very useful, sometimes i check fp-general mailing list from foreign computers, with Nabble i may respond too ;-) might want to register FPC develop as well. Hum, im already registered

[fpc-pascal] LoadLibrary(freeBSDlibrary) does not work...

2014-08-21 Thread fredvs
Hello. I try to dynamically load libraries in freeBSD 64 bit with DynLibs.LoadLibrary(reeBSDlibrary), with a fpc-64-bit-freeBSD application (compilation has no errors.) But at LoadLibrary(freeBSDlibrary), program crash... ;-) Here the error message from gdb = Program received signal SIGSEGV,

Re: [fpc-pascal] LoadLibrary(freeBSDlibrary) does not work...

2014-08-21 Thread fredvs
Hum, little rectif... It seems that LoadLibrary is not the guilty. I was able to dynamically load some freeBSD 64 bit libraries. The crash comes somewhere else, (maybe from DynLibs.GetProcedureAddress). I will do more investigations to find what is wrong with dealing libraries for fpc

[fpc-pascal] freeBSD and GetProcedureAddress() ?

2014-09-03 Thread fredvs
Hello everybody. Hum, i try to dynamically load (and run) some freeBSD libraries with a fpc-freeBSD-appliction. For testing, i use some library included in /usr/lib (so im sure that the library is working on freeBSD). Those test is fully working with Linux. I can load the library with

Re: [fpc-pascal] Free Pascal Directories

2014-10-06 Thread fredvs
Hello. I use Geany and fpGUI for ages now. ;-) All you have to do = In Geany: - Click on Define construct command = In Compile command = fpc %f @extrafpc.cfg extrafpc.cfp is a text file with all your -fu and -fi needed. Here example of a fpGUI extrafpc.cfg = -fPIC

Re: [fpc-pascal] fpGUI Thread-safe

2014-10-15 Thread fredvs
i use lot of (complicated) threads with fpGUI = works perfect and no problems... I even have done hard-core test. The only thing that i noticed is when using synchronize() with fpc 2.7.1 = i have better synchronization with fpGUI-build-in postmessage(). If queue() (fpc = 2.7.1) is used =

Re: [fpc-pascal] Cross-compile vs native

2015-01-28 Thread fredvs
Hello. I do main development on Linux 64. For Windows, i use wine on Linux 64, (fpc.exe 32/64 installed without problem) and compile the source via wine-fpc.exe. The advantage is that you do not have to copy your source to a virtual machine or a other native Windows. And you may test your exe

Re: [fpc-pascal] Cross-compile vs native

2015-01-30 Thread fredvs
You may also install Lazarus.exe via wine. With the SeupLazarus.exe, it install fpc.exe too ;-) - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-compile-vs-native-tp5720834p5720891.html Sent from the Free Pascal - General mailing

Re: [fpc-pascal] SDL_Net vs Synapse

2015-01-05 Thread fredvs
Hello Sandro and many thanks for the link. Hum, i do not know SDL, is it a alternative to PortAudio ? Does it deal with mp3 and other audio formats ? Thanks. Fre;D - Many thanks ;-) -- View this message in context:

[fpc-pascal] Internet audio streaming ?

2015-03-16 Thread fredvs
Hello. I have some problem with audio internet streaming. I would like to do it with mpg123 + portaudio libraries but... Here is the procedure used by mpg123 = mpg123_open_fd = function( mh:Tmpg123_handle; fd: Integer). I have sent to mpg123-forum that question = Hello and congratulation for

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread fredvs
@ Andrew Check for writeln's in the htmlthread unit you added. Hum, i did not add htmlthread unit (only fphttpclient and pipes). What do you mean ? @ Martin It should work, because TProcess relies on this function to do it's job. Yes, maybe, but it does not work ;-( Could it be a problem

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread fredvs
Check for writeln's in the htmlthread unit you added. Oops, i think i get it (sorry it is Sunday). ;-( - CreatePipeHandles (InHandle,OutHandle, PipeBufferSize); - Writeln('Input Handle = ' + inttostr(InHandle) + ' Output Handle = ' + inttostr(OutHandle)); = Linux = Input Handle = 3 Output

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-22 Thread fredvs
Yep, there is a answer from mpg123 creator in forum list ;-) = In Linux, no problem, i use the Input-Handle of a pipe as file descriptor. = mpg123_open_fd(MyMP123Handle, InputHandle) But if using Input-Handle of a pipe in Windows, at mpg123_read() i get that error: MPG123_BAD_RVA What

[fpc-pascal] fpHttpClient and Https support ?

2015-03-20 Thread fredvs
Hello. First of all, congratulation for fpHttpClient.pas. It works directly, like charms, without to install any dependencies. = wow. I am able to do internet audio streaming with it, perfect. ;-) Hum, while trying to access Https sites, i get errors. ;-( In begin of fpHttpClient.pas, there is

Re: [fpc-pascal] fpHttpClient and Https support ?

2015-03-21 Thread fredvs
Excellent, thanks. PS : Do you remember a old topic in Lazarus forum about uos and internet audio streaming ? (It was you who converts and helps me to install uos to GitHub). Now uos does internet audio streaming ! = https://github.com/fredvs/uos Thanks Sergio. - Many thanks ;-) -- View

Re: [fpc-pascal] fpHttpClient and Https support ?

2015-03-21 Thread fredvs
And, by the way, who may i thank for that excellent fpHttpClient.pas ? I plead guilty. Michael. Ha, so MANY THANKS Michael for your excellent. brilliant and easy to use fpHttpClient.pas Fre;D - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] fpHttpClient and Https support ?

2015-03-21 Thread fredvs
Ooops, in earlier topic = Thanks Silvio. ;-) And, by the way, who may i thank for that excellent fpHttpClient.pas ? Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/fpHttpClient-and-Https-support-tp5721435p5721443.html Sent from

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Hello. Added Pipes in uses section. Changed = AssignPipe(InHandle, FOutHandle); Into = CreatePipeHandles (InHandle, FOutHandle, PipeBufferSize); Then in code = var Http: TFPHTTPClient; Output: THandleStream = nil; URL: String; begin Http := TFPHTTPClient.Create(nil); Output :=

[fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Hello. In Unix systems File Descriptor can be created with fpPipe(FDInput, FDOutput). Then FDInput/FDOutput may be used as file descriptors. Ok, perfect. But fpPipe is part of BaseUnix/Unix... So the question is: How to create such of File Descriptor with Windows?... Many thanks. Fre;D 1)

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Hello. In Unix systems File Descriptor can be created with fpPipe(FDInput, FDOutput). Then FDInput/FDOutput may be used as file descriptors. Ok, perfect. But fpPipe is part of BaseUnix/Unix... So the question is: How to create such of File Descriptor with Windows?... See unit pipes,

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
Re-hello. Tried with this too = Change = Output: THandleStream = nil; into = Output: TOutputPipeStream = nil; and Change = Output := THandleStream.Create(FOutHandle); into = Output:=TOutputPipeStream.Create (FOutHandle); = Compiles + works perfect in Linux ;-) = Compiles ok but does

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-21 Thread fredvs
What do you do with the inHandle ? Michael. It is used by mp123 mp3-decoder library. =function mpg123_open_fd(mph: Tmpg123_handle; fd: integer); fp (file descriptor) := InHandle ; It seems that InHandle as file descriptor does not work on Windows. But in *nix system, it works. -

Re: [fpc-pascal] Internet audio streaming ?

2015-03-19 Thread fredvs
Hello everybody and thanks for so much answers. By the way, Andrew Haines explained how to do. 1) - Use fpPipe in BaseUnix/Unix to create a fifo. 2) - Create a THandleStream using the returned input value of fpPipe. 3) - Use mpg123_open_fd from the output value from fpPipe 4) - Use an instance

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
Hello. Sorry to sorry to bother you with that file descriptors again... ;-( There are some answers there on mpg123 forum. They explain that simple stdin/stdout file descriptors would work. Of course all what they explained is in C ;-( OK, but how can i use simple stdin/stdout file descriptors

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
It's not if developers wouldn't decide to make their libraries so *nix centric... Or when they will decide to develop their libraries with something else than C, that gives them compilers choice that are not compatible together (a library compiled with CGwin is not compatible with one compiled

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
@ Michael = They are available in default variables in the system unit: StdInputHandle,StdOutputHandle,StdErrHandle Yep, good to know, thank-you ;-) Sadly, it does not solve the problem... ;-( @ Andrew you could use mpg123_replace_reader_handle and mpg123_open_handle Ok, good idea, i will

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-25 Thread fredvs
@ Andrew Hum,... by the way,.. if,.. fortuitously (and by chance) you have already try it with your PulseAudio wrapper, could it be possible to show some code ? Ooops, i just check my mail now and =... Andrew, you are a Angel ;-) Tetra billion of thanks. PS: I will test it and give you news

Re: [fpc-pascal] File Descriptor in Windows ?

2015-03-26 Thread fredvs
Hello. For info, here answer from mpg123 creator = __ 4) Assisgn input pipe stream = mpg123_open_fd(MyMPHandle,InHandle); = Crash on Windows, OK on Linux. I don't have my head wrapped around the pascal bindings, but are you handing

Re: [fpc-pascal] Use sleep in thread

2015-03-01 Thread fredvs
Ooops, in previous mail you should read (sorry)= there are dire warnings that TThread.Create() shouldn't be overridden. Should this be in the documentation if it's a significant issue? It's the first time I hear it, I've been doing it forever, just like in the example in the same wiki

Re: [fpc-pascal] Use sleep in thread

2015-03-01 Thread fredvs
there are dire warnings that TThread.Create() shouldn't be overridden. Should this be in the documentation if it's a significant issue? It's the first time I hear it, I've been doing it forever, just like in the example in the same wiki page. Hum... same for me here... ;-( Do you think

Re: [fpc-pascal] Use sleep in thread

2015-02-25 Thread fredvs
Hello. You may use RTLEvents to pause a thread. = Program Project1; {$mode objfpc}{$H+} uses {$IFDEF UNIX} cthreads, {$ENDIF} Classes; Type { THelloThread } THelloThread = class(TThread) fSleepTime,fThreadNum:integer; fEvent:PRTLEvent; procedure Execute; override;

Re: [fpc-pascal] Internet audio streaming ?

2015-03-19 Thread fredvs
Hello Andrew. I am very interested by your PulseAudio bindings. Hum, how many dependencies has PulseAudio ? Could it be possible (like for PortAudio) to only dynamically load pulseaudio.so library ? Or does PulseAudio need to be installed because of too many dependencies ? Is PulseAudio usable

Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-08 Thread fredvs
Where is it? Hum, from previous mail ;) = You may download src from = = http://cairographics.org/releases/cairo-1.14.2.tar.xz = unzip it. = $ cd cairo-1.14.2 = $ ./configure --disable-libX11 (or --disable-X11 ?) (or --enable-X11=no ?) = $ make = $ sudo make install Fre;D - Many

Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-07 Thread fredvs
If you build the library from source, you can select various output streams during the configure script. = $ sudo apt-get build-dep cairo $ cd cairo $ ./configure --disable-libX11 $ make $ sudo make install Fre;D - Many thanks ;-) -- View this message in context:

Re: [fpc-pascal] Using Cairo lib on Linux without X

2015-04-08 Thread fredvs
$ sudo apt-get build-dep cairo Interesting. That works in Ubuntu but not in Mint. They are more and more distinct. Ooops, indeed, just try on my Mint 17 = E: Impossible to find source for cairo package... I guess I must download the Cairo sources from somewhere before doing cd cairo.

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-20 Thread fredvs
Hello. Sorry to come back with that story... ;-( I have used inside a script LD_LIBRARY_PATH` and at end runs the espeak executable. So a Tprocess run the script. Ok, it works but... now i do not have access to espeak anymore, not possible to cancel the speech. AProcess.terminate has impact

Re: [fpc-pascal] Multipe path in TProcess.Environment ?

2015-06-21 Thread fredvs
@ Thomas = tanks for answer. Unix uses a colon as path delimiter, not semicolon. I don't know about LD_PRELOAD, but it should work at least for LD_LIBRARY_PATH. Ha, ok... (by the way, what character is colon ?) So LD_PRELOAD and LD_LIBRARY_PATH are unix only ? What about Windows, what should

[fpc-pascal] Multipe path in TProcess.Environment ?

2015-06-21 Thread fredvs
Hello. If a TProcess runs a executable who needs a library, that does the trick = TProcess.Environment.Text := 'LD_PRELOAD='/the/directory/of/thelibrary.so' ; You may also use this = (it seems bad ;-( = http://xahlee.info/UnixResource_dir/_/ldpath.html ) = TProcess.Environment.Text :=

Re: [fpc-pascal] Multipe path in TProcess.Environment ?

2015-06-21 Thread fredvs
Ha, ok... (by the way, what character is colon ?) = https://en.wikipedia.org/wiki/Colon_%28punctuation%29 = OK. But = So LD_PRELOAD and LD_LIBRARY_PATH are unix only ? What about Windows, what should be the TProcess.Environment.Text ? = not OK. Thanks. Fre;D - Many thanks ;-) --

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-20 Thread fredvs
Re_hello. Huh, i am loosed... Here the working script run by TProcess (but that cannot be canceled)= #!/bin/sh LIBPORTAUDIO=libportaudio.so #portaudio library ESPEAKBIN=espeak #espeak binary CALLDIR=${0%/*}/#

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-20 Thread fredvs
@ Giuliano = thanks for advice ;-) Hum, finally, using = AProcess.Environment.Text := 'LD_PRELOAD=/home/fred/sak/sak/sakit/liblinux64/libportaudio_x64.so' ; It works ;-) ( was a wrong character...) So, many, many thanks, i get the solution. Many thanks to everybody. Fre;D - Many

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-20 Thread fredvs
@ Ewald = many thanks for your help. Your advices are very promising... I will test it and write later the result. Write you soon. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/loadlibrary-unsafe-tp5721801p5721865.html Sent

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-20 Thread fredvs
Re-re-re-Hello. This one does not work too ;-( = - AProcess.Environment.Text := 'LD_PRELOAD=/home/fred/sak/sak/sakit/liblinux64/libportaudio.so' ; ??? Many thanks. Fre;D - Many thanks ;-) -- View this message in context:

[fpc-pascal] fpchmod(thefile, S_IRWXU) not for freeBSD ?

2015-06-25 Thread fredvs
Hello. This to advice that fpchmod(thefile, S_IRWXU) is not working with freeBSD. This because some const are missing for FreeBSD in FPC's RTL. But, thanks to Graeme, this solves the thing = ... {$IFDEF FREEBSD} const S_IRWXU = S_IRUSR or S_IWUSR or S_IXUSR; S_IRWXG = S_IRGRP or S_IWGRP or

Re: [fpc-pascal] Multipe path in TProcess.Environment ?

2015-06-25 Thread fredvs
@ Tomas and Michael. Sorry for delay... = many thanks for answers. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Multipe-path-in-TProcess-Environment-tp5721893p5721912.html Sent from the Free Pascal - General mailing list

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-20 Thread fredvs
@ Waldo = thanks for help. ;-) But TProcess.Environment kills the script... No script needed anymore ;-) The script will become a program.ini... = Works perfectly. TProcess.Environment.Text := 'LD_PRELOAD='/the/directory/of/thelibrary.so' ; = And now, canclel_speech (= TProcess.terminate)

[fpc-pascal] loadlibrary() unsafe ?

2015-06-11 Thread fredvs
Hello. Here the thing: a open-source program, eSpeak (voice synthezer) uses 2 libraries: espeak-library and portaudio. In eSpeak source = - For the Windows version, the libraries are included in the executable (static linked). To do run the program = it is easy = just run the executable via

Re: [fpc-pascal] loadlibrary() unsafe ?

2015-06-12 Thread fredvs
@ Ewald and Mark = thanks for answer. ;-) Yep, i agree, the process is exotic but works so good. I have to agree too, following Martin Schreiber way: = export LD_PRELOAD=$LIBPORTAUDIO, before to run the executable works too. And is maybe safer. And do not need dynlibs in uses section. And no

  1   2   3   4   5   6   >