[Gambas-user] CallBack from external library

Brian G brian at westwoodsvcs.com
Fri Feb 19 15:45:57 CET 2021


When you pass a function name, i believe gambas interfaces the function to the external library. 
Extern signal(sig As Integer, sighandler As Pointer) As Pointer In "libc:6" 
Public Sub _signal(Sig As Integer) ' signal handler for waiting 
'some code 
Catch 
Error.Raise("Changed _Signal pid = " & Str(getpid()) & Error.text & " " & Error.where) 
Stop 
End 

set it like this 

signal(ChangeSignal, _signal) 

MAybe I am not sure just what your asking ... lol 

Thank You 
Brian G 


From: "Brian" <brian at westwoodsvcs.com> 
To: "Gambas mailing list" <user at lists.gambas-basic.org> 
Sent: Friday, February 19, 2021 6:35:46 AM 
Subject: Re: [Gambas-user] CallBack from external library 

I would assume if you export the module in your program, then the library could call the module.function name if in fact the library knows the module name. The other way would be to pass the library the module as on object.. ie module to call back to. I think Ben does that in quite a few places.. 

Cheers 
Brian G 


From: "jose rodriguez" <jose.rodriguez at cenpalab.cu> 
To: "Gambas mailing list" <user at lists.gambas-basic.org> 
Sent: Thursday, February 18, 2021 6:25:31 AM 
Subject: Re: [Gambas-user] CallBack from external library 

February 18, 2021 9:22 AM, "Bruce Steers" < [ mailto:bsteers4 at gmail.com?to=%22Bruce%20Steers%22%20 | bsteers4 at gmail.com ] > wrote: 



Oh wait , you want to know if gambas functions can be called from the external library not the other way round? 
You'd have to ask on the list of the external library in question. 
How would we know how the external library works? 




I would assume the question is regarding a self-programmed (or at least self-modified) library. 

Regards, 

Joe1962 


----[ http://gambaswiki.org/wiki/doc/netiquette ]---- 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210219/0bf0045b/attachment.htm>


More information about the User mailing list