From gambas at ...1... Wed May 4 18:02:49 2005 From: gambas at ...1... (Benoit Minisini) Date: Wed, 4 May 2005 18:02:49 +0200 Subject: [Gambas-devel] gambas2 1.9.7 Message-ID: <200505041802.49404.gambas@...1...> Hi, I have just uploaded a new snapshot of the development version. The main changes are: - The interpreter can call functions in extern shared libraries now. You get new subroutines for dealing with memory and pointers. The READ and WRITE instructions can read from and write to memory. - The SHELL and EXEC instructions can run their process in a virtual terminal. - Deleted records are hidden from the database Result objects now. I hope this way Daniel will be happy :-) - Of course, the bug fixes of the 1.0.6 version have been merged. The current support for extern shared libraries is not as complete as what Daniel did in its gb.api component. The following is missing: - Support for alias (i.e. library function name different from the Gambas function name) - Support for callbacks. - Support for C-like structures. You can emulate them with the new memory allocation subroutines (Alloc, Free and Realloc) and the READ/WRITE instructions applied to the pointer returned by Alloc(). And I'm not sure that this support shouldn't go to a component like Daniel did. The interpreter is growing... :-( Here is the complete ChangeLog: ----8<------------------------------------------------------------------------ * Symbolic link to gambas IDE does not have the '.gambas' extension anymore. * 'gbi' was rewritten so that it can take a component name as argument, and create the information files only for this component. COMPILER * Support for declaring functions in extern shared libraries. The syntax is: EXTERN (args...) IN * New datatype named 'Pointer' that is a synonymous for 'Integer'. INTERPRETER * BUG: OPEN ... DIRECT now correctly works. * BUG: Opening a file with CREATE flag now always implies READ flag. * BUG: SEEK and READ now always work on files opened in DIRECT mode. * Support for calling functions in extern shared libraries. * If the startup class declares a public method named 'Application_Read', then the standard input is watched by the event loop. * New subroutines, Alloc(), Free() and Realloc() for allocating and freeing memory fragments. * A new subroutine, StrPtr(), that returns the null-terminated string located at the specified address. * You can use READ and WRITE to read from or write to memory, by using an integer as stream. The interpreter should raise an error and not crash if you supply an invalid memory address. * Now, if you use FOR INPUT/OUTPUT instead of FOR READ/WRITE with the EXEC or SHELL instruction, the executed process is plugged to a pseudo-terminal. This way, you can easily pilot a program that needs to be run in a terminal. * BUG: '_call' special method management has been fixed. DEVELOPMENT ENVIRONMENT * Support for the Pointer datatype. QT COMPONENT * BUG: I finally got rid of the spurious warning generated by the TableView control. DATABASE COMPONENT * BUG: Result methods now always return an error when the result is not available. * BUG: Now tables whose primary key fields are not necessarily the first ones work. * BUG: The PostgreSQL driver has been fixed. Now it works for any version greater or equal than 7.3. * Now deleted records are removed from the Result object. ----8<------------------------------------------------------------------------ Note that I'm going to Palerma tomorrow for a talk about Gambas (http://linux-meeting.org), and I won't come back to my computer until next Tuesday. Enjoy this new break-everything version! :-) -- Benoit Minisini mailto:gambas at ...1... From sourceforge-raindog2 at ...19... Wed May 4 18:56:35 2005 From: sourceforge-raindog2 at ...19... (Rob) Date: Wed, 4 May 2005 12:56:35 -0400 Subject: [Gambas-devel] Re: [Gambas-user] gambas2 1.9.7 In-Reply-To: <200505041802.49404.gambas@...1...> References: <200505041802.49404.gambas@...1...> Message-ID: <200505041256.35479.sourceforge-raindog2@...19...> On Wednesday 04 May 2005 12:02, Benoit Minisini wrote: > The READ and WRITE instructions can read from and write to memory. What, no PEEK and POKE? ;) I will package this as soon as I can. Rob From frankberg at ...136... Thu May 5 11:19:11 2005 From: frankberg at ...136... (Frank Berg) Date: Thu, 5 May 2005 11:19:11 +0200 Subject: [Gambas-devel] gambas2 1.9.7 References: <200505041802.49404.gambas@...1...> Message-ID: <001701c55153$bc978830$0200a8c0@...146...> > Hi, > > I have just uploaded a new snapshot of the development version. > i was try to compile it, there are 5 errors Compiling gambas2... /home/gambas/gambas2-1.9.7/app/src/gambas2/FFind.class:845: Missing ')' /bin/sh: line 1: 17041 Abgebrochen /usr/local/bin/gbc2 -ag Compiling Exec/Console/... /usr/local/share/gambas2/examples/Exec/Console/FConsole.class:19: Syntax error. End of line expected /bin/sh: line 1: 23570 Abgebrochen /usr/local/bin/gbc2 -ag Compiling Exec/MoviePlayer/... /usr/local/share/gambas2/examples/Exec/MoviePlayer/FMoviePlayer.class:39: Syntax error. End of line expected /bin/sh: line 1: 23572 Abgebrochen /usr/local/bin/gbc2 -ag Compiling Networking/HTTPGet/... /usr/local/share/gambas2/examples/Networking/HTTPGet/F.class:260: Missing ')' /bin/sh: line 1: 23592 Abgebrochen /usr/local/bin/gbc2 -ag Compiling Networking/HTTPPost/... /usr/local/share/gambas2/examples/Networking/HTTPPost/F.class:41: Missing ')' /bin/sh: line 1: 23594 Abgebrochen /usr/local/bin/gbc2 -ag frank From daniel.campos at ...103... Thu May 5 13:30:09 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Thu, 05 May 2005 13:30:09 +0200 Subject: [Gambas-devel] gambas2 1.9.7 In-Reply-To: <200505041802.49404.gambas@...1...> References: <200505041802.49404.gambas@...1...> Message-ID: <427A03C1.3040804@...103...> > >The current support for extern shared libraries is not as complete as what >Daniel did in its gb.api component. The following is missing: > >... > >And I'm not sure that this support shouldn't go to a component like Daniel >did. The interpreter is growing... :-( > > > I've been a bit busy, however I will finish soon the gb.api component. I think a component for this stuff is a good idea, as only programs which need that feature should increase the memory size in their programs. I will download and see what can I import from your model, and then, on Friday I suppose I will release the final version. Regards, D. Campos From daniel.campos at ...103... Thu May 5 17:25:48 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Thu, 05 May 2005 17:25:48 +0200 Subject: [Gambas-devel] Spanish translation / 1.9.7 Message-ID: <427A3AFC.8090300@...103...> Updated spanish translations. Regards, D. Campos -------------- next part -------------- A non-text attachment was scrubbed... Name: gambas-database-manager-es-1.9.7.po Type: text/x-gettext-translation Size: 17906 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gambas2-es-1.9.7.po Type: text/x-gettext-translation Size: 64097 bytes Desc: not available URL: From daniel.campos at ...103... Thu May 5 22:25:48 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Thu, 05 May 2005 22:25:48 +0200 Subject: [Gambas-devel] gambas2 1.9.7 In-Reply-To: <200505041802.49404.gambas@...1...> References: <200505041802.49404.gambas@...1...> Message-ID: <427A814C.1000303@...103...> > >- Deleted records are hidden from the database Result objects now. I hope this >way Daniel will be happy :-) > > Yes!!!! Cool!!! Thanks, D. Campos From marcelomiranda at ...293... Fri May 6 01:53:00 2005 From: marcelomiranda at ...293... (marcelomiranda at ...293...) Date: Thu, 5 May 2005 20:53:00 -0300 (BRST) Subject: [Gambas-devel] Re: Gambas-devel digest, Vol 1 #600 - 2 msgs In-Reply-To: <20050505031041.429E389554@...309...> References: <20050505031041.429E389554@...309...> Message-ID: <3242.192.168.1.1.1115337180.squirrel@...308...> Hi, congratulations gambas developers!!! Congratulations web site http://www.kudla.org ! Tanks for rpms packages for Mandrake Linux 10.1. I have sucessfull connection with gambas and postgresql. Se code below, in order: sub main() DIM hdb AS NEW Connection hdb.Name = "dbtest" hdb.type = "postgresql" hdb.Login = "marcelomiranda" hdb.Password = "mypassword" hdb.Open PRINT "Databases: " & hdb.Databases.Count PRINT "Tables: " & hdb.Tables.Count PRINT hdb.Port PRINT hdb.Users.Count hdb.Close end sub I not hdb.host used, not sucessfull!!! If print hdb.host, hdb.host is null printed. Bye, my friends. Tanks! Marcelo Miranda marcelomiranda at ...293... mirandamarcelo at ...307... AVISO------------------------------------------------------------- Esta mensagem pode conter informacao confidencial ou privilegiada. Se voce nao for o destinatario ou a pessoa autorizada a receber esta mensagem, nao pode usar, copiar ou divulgar as informacoes nela contidas ou tomar qualquer acao baseada nessas informacoes. Se voce recebeu esta mensagem por engano, favor avisar o remetente imediatamente, respondendo o e-mail e em seguida apagando-o. Obrigado pela cooperacao. DISCLAIMER-------------------------------------------------------- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on any information herein. If you have received this message in error, please advise the sender immediately by replying to this e-mail and delete this message. Thank you for your cooperation. ------------------------------------------------------------------ This email was sent using SquirrelMail - http://squirrelmail.org From frankberg at ...136... Fri May 6 08:30:27 2005 From: frankberg at ...136... (Frank Berg) Date: Fri, 6 May 2005 08:30:27 +0200 Subject: [Gambas-devel] gambas2 1.9.7 References: <200505041802.49404.gambas@...1...> <001701c55153$bc978830$0200a8c0@...146...> Message-ID: <000601c55205$17efc1f0$0200a8c0@...146...> hi, > Compiling gambas2... > /home/gambas/gambas2-1.9.7/app/src/gambas2/FFind.class:845: Missing ')' > /bin/sh: line 1: 17041 Abgebrochen /usr/local/bin/gbc2 -ag i was solve the problem of first error change -1 with - 1 .... ok now the next error comes: Compiling gambas2... /home/gambas/gambas2-1.9.7/app/src/gambas2/FOutput.class:54: Unknown identifier: Settings /bin/sh: line 1: 13427 Abgebrochen /usr/local/bin/gbc2 -ag frank From daniel.campos at ...103... Fri May 6 22:24:29 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Fri, 06 May 2005 22:24:29 +0200 Subject: [Gambas-devel] [Fwd: About compilation error] Message-ID: <427BD27D.8000704@...103...> (From Fabien) -------------- next part -------------- An embedded message was scrubbed... From: Subject: About compilation error Date: Fri, 6 May 2005 22:04:09 +0200 (CEST) Size: 16577 URL: From Karl.Reinl at ...16... Fri May 6 23:02:44 2005 From: Karl.Reinl at ...16... (Charlie Reinl) Date: Fri, 6 May 2005 23:02:44 +0200 Subject: [Gambas-devel] gambas-1.0.6 : * BUG: I finally got rid of the spurious warning generated by the TableView control. Message-ID: <200505062302.45180.Karl.Reinl@...16...> Salut Benoit, With my changes, which I keep under my knees ;-) BEGIN_PROPERTY(CTABLECOLS_Visible) if VPROP(GB_BOOLEAN) WIDGET->showColumn ( THIS->col ) ; else WIDGET->hideColumn ( THIS->col ); END_PROPERTY On 1.0.6 I'v get that now QApplication::postEvent: Unexpected null receiver Any hind for my ? Amicalment Charlie From frankberg at ...136... Sun May 8 08:30:50 2005 From: frankberg at ...136... (Frank Berg) Date: Sun, 8 May 2005 08:30:50 +0200 Subject: [Gambas-devel] [Fwd: About compilation error] References: <427BD27D.8000704@...103...> Message-ID: <000c01c55397$7a636ab0$0200a8c0@...146...> hi, i was try this out, but the last error in suse9.3 is the same as before: Installing the components... Compiling gb.settings... OK Installing gb.settings... Compiling gb.xml.rpc... OK Installing gb.xml.rpc... Compiling gb.form... OK Installing gb.form... make[2]: F?r das Ziel ?install-data-am? ist nichts zu tun. make[2]: Leaving directory `/home/gambas/gambas2-1.9.7/comp' make[1]: Leaving directory `/home/gambas/gambas2-1.9.7/comp' Making install in app make[1]: Entering directory `/home/gambas/gambas2-1.9.7/app' make[2]: Entering directory `/home/gambas/gambas2-1.9.7/app' Installing the development environment... Compiling gambas2... /home/gambas/gambas2-1.9.7/app/src/gambas2/FOutput.class:54: Unknown identifier: Settings /bin/sh: line 1: 14226 Abgebrochen /usr/local/bin/gbc2 -ag Compiling gambas-database-manager... OK you can see, the Settings components are compiled and installed ok, but in gambas2 is can't be found frank ----- Original Message ----- From: "Daniel Campos" To: Sent: Friday, May 06, 2005 10:24 PM Subject: [Gambas-devel] [Fwd: About compilation error] > (From Fabien) > From gambas at ...1... Mon May 9 14:15:21 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 9 May 2005 14:15:21 +0200 Subject: [Gambas-devel] gambas-1.0.6 : * BUG: I finally got rid of the spurious warning generated by the TableView control. In-Reply-To: <200505062302.45180.Karl.Reinl@...16...> References: <200505062302.45180.Karl.Reinl@...16...> Message-ID: <200505091415.21705.gambas@...1...> On Friday 06 May 2005 23:02, Charlie Reinl wrote: > Salut Benoit, > > With my changes, which I keep under my knees ;-) > > BEGIN_PROPERTY(CTABLECOLS_Visible) > if VPROP(GB_BOOLEAN) > WIDGET->showColumn ( THIS->col ) ; > else > WIDGET->hideColumn ( THIS->col ); > END_PROPERTY > > On 1.0.6 I'v get that now > > QApplication::postEvent: Unexpected null receiver > > Any hind for my ? > > Amicalment > Charlie > > You should backport to your code what I changed in CTableView.cpp. I just removed the calls in CTABLEVIEW_free() method that displayed these warnings. Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Mon May 9 15:47:07 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 9 May 2005 15:47:07 +0200 Subject: [Gambas-devel] gambas-1.0.6 : * BUG: I finally got rid of the spurious warning generated by the TableView control. In-Reply-To: <200505091415.21705.gambas@...1...> References: <200505062302.45180.Karl.Reinl@...16...> <200505091415.21705.gambas@...1...> Message-ID: <200505091547.07908.gambas@...1...> On Monday 09 May 2005 14:15, Benoit Minisini wrote: > On Friday 06 May 2005 23:02, Charlie Reinl wrote: > > Salut Benoit, > > > > With my changes, which I keep under my knees ;-) > > > > BEGIN_PROPERTY(CTABLECOLS_Visible) > > if VPROP(GB_BOOLEAN) > > WIDGET->showColumn ( THIS->col ) ; > > else > > WIDGET->hideColumn ( THIS->col ); > > END_PROPERTY > > > > On 1.0.6 I'v get that now > > > > QApplication::postEvent: Unexpected null receiver > > > > Any hind for my ? > > > > Amicalment > > Charlie > > You should backport to your code what I changed in CTableView.cpp. I just > removed the calls in CTABLEVIEW_free() method that displayed these > warnings. > > Regards, I told rubbish... The function that changed was the MyTable destructor, not CTABLEVIEW_free(). -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Mon May 9 17:28:34 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 9 May 2005 17:28:34 +0200 Subject: [Gambas-devel] gambas2 1.9.8 Message-ID: <200505091728.35006.gambas@...1...> Hi, I've just uploaded a new release of the development version, just for fixing the bug in the gambas compiler in the previous package. Note that now source packages are stored on the SourceForge FTP servers. YOu can't access them anymore directly on the web site. The syntax of EXTERN has been enhanced too: * A new keyword, LIBRARY, allows you to declare the name of the library for the next EXTERN declarations. In this case, IN becomes optional. * You can declare the real name of the extern function (if it is different from the name used with Gambas) by using the EXEC keyword at the end of the declaration. I join an example, that I take from Daniel Campos 'gb.api' web site and that I modified. Enjoy it! Regards, -- Benoit Minisini mailto:gambas at ...1... -------------- next part -------------- A non-text attachment was scrubbed... Name: NCurses-0.0.22.tar.gz Type: application/x-tgz Size: 710 bytes Desc: not available URL: From daniel.campos at ...103... Wed May 11 14:26:04 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Wed, 11 May 2005 14:26:04 +0200 Subject: [Gambas-devel] gb.api new version and documentation Message-ID: <4281F9DC.4020901@...103...> Hi: I've updated the gb.api component, examples and documentation: 1) The "ApiPointer" class exists no more. Instead pointers are managed with the "Integer" or "Pointer" data type, so it wastes less memory per each pointer defined. However, a static class called "Pointer" provides functions to manage memory easily. I think it is much more clear and intuitive that using the READ and WRITE functions. Now the memory allocations and freeings can be made using the Alloc and Free methods from Gambas. The "Pointer" class still provides the "AllocString" method to help in string allocations. 2) I've updated the documentation, adding the Structure and Callback management. It is updated in English and Spanish, but I'd need help from the French and German translations to update these versions (and of course, to be part of my little "Hall of Fame" :-)) Please be careful when translating, as the "Pointer" part as changed a lot and there are little changes everywhere. 3) I think Gambas could keep into its core the "Pointer" alias, the "Free", "Alloc" and "Realloc" methods, and let the rest of the code in a component: (a) All this code is needed just for very specific applications (b) Having the declarations in a component, declarations can be deleted from memory if not needed, saving memory. (c)I think is better also to use the "Api" class and the unknown method, as, for example, a line of code like this: "Api.gtk_init(NULL,NULL)" is more coherent with an object oriented language than simply a "misterious" new method in Gambas: "gtk_init(NULL,NULL)" The first one represents an object and a function related with the API, the second one makes difficult to a programmer to know where this new "Gambas function" comes from when reading code written by other people. (d) and "psicologically", having it in a component probably will prevent to use that feature for everything without stopping to think a little if all can be done without having to use external libraries. 4) All the new stuff is placed at: http://gambas.gnulinex.org/api Regards, D. Campos From daniel.campos at ...103... Wed May 11 14:51:48 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Wed, 11 May 2005 14:51:48 +0200 Subject: [Gambas-devel] gb.gtk updated Message-ID: <4281FFE4.5000203@...103...> Some fixes and improvementes: http://gambas.gnulinex.org/gtk Regards, D. Campos From gambas at ...1... Wed May 11 15:06:20 2005 From: gambas at ...1... (Benoit Minisini) Date: Wed, 11 May 2005 15:06:20 +0200 Subject: [Gambas-devel] gb.api new version and documentation In-Reply-To: <4281F9DC.4020901@...103...> References: <4281F9DC.4020901@...103...> Message-ID: <200505111506.21459.gambas@...1...> On Wednesday 11 May 2005 14:26, Daniel Campos wrote: > Hi: > > I've updated the gb.api component, examples and documentation: > > 1) The "ApiPointer" class exists no more. Instead pointers are managed > with the "Integer" or "Pointer" data type, so it wastes less memory per > each pointer defined. However, a static class called "Pointer" provides > functions to manage memory easily. I think it is much more clear and > intuitive that > using the READ and WRITE functions. Actually, the job of reading and writing data from a pointer was already existing in the READ and WRITE method (except for the string case). So it was logical to use them. Using a pointer as a stream allow to use other functions like PRINT, INPUT, LINE INPUT too. This could be interesting. But I admit it may be less clear for the user. > Now the memory allocations and > freeings can be made using the Alloc and Free methods from Gambas. > The "Pointer" class still provides the "AllocString" method to help in > string > allocations. The Alloc() subroutine will take a string as its argument too, and will behave the same way. > > 2) I've updated the documentation, adding the Structure and Callback > management. > It is updated in English and Spanish, but I'd need help from the French > and German > translations to update these versions (and of course, to be part of my > little "Hall of Fame" :-)) > Please be careful when translating, as the "Pointer" part as changed a > lot and there are > little changes everywhere. > > 3) I think Gambas could keep into its core the "Pointer" alias, the > "Free", "Alloc" and "Realloc" > methods, and let the rest of the code in a component: > > (a) All this code is needed just for very specific applications > This is the main reason for putting code outside the interpreter. But if you look at the way I did, you will see that there is not too much code added. Many features were already done by interpreter in many ways. Maybe the callback feature that I didn't implemented should stay in the component if it takes too much code to implement it. > (b) Having the declarations in a component, declarations can be > deleted from memory if not needed, saving memory. If you don't need them, why declaring them ? :-) Now EXTERN declarations are part of the class file format. I prefer they are managed by the compiler and the interpreter because: * They are tied to compiler and interpreter internals like native datatypes. * Calling convention is specific to the architecture. In general, I prefer not having architecture specific code in components. * Shared libraries extension change with the architecture. For example, libfoo.so.6.3 on Linux and libfoo.6.3.dylib on MacOSX. The user just have to specify "libfoo.6.3", and the interpreter will do the translation. > > (c)I think is better also to use the "Api" class and the unknown method, > as, for example, a line of code like this: > > "Api.gtk_init(NULL,NULL)" > > is more coherent with an object oriented language than simply a > "misterious" new method > in Gambas: > > "gtk_init(NULL,NULL)" > > The first one represents an object and a function related with the API, > the second one makes difficult to a programmer to know where this new > "Gambas function" comes from when reading code written by other people. I don't think so. EXTERN declarations are private to the class, so it is not a huge job to find where it comes from :-) And I think they will stay private. I think EXTERN calls must be used for writing components in Gambas that uses specific libraries, without the need of writing them in C/C++, which takes a longer time to do. > > (d) and "psicologically", having it in a component probably will prevent > to use that feature for everything without stopping to think a little if > all can be done without having to use external libraries. *This* argument is good :-) I think I will add a flag to the compiler (and the IDE) to enable/disable such "dangerous" features. > > 4) All the new stuff is placed at: http://gambas.gnulinex.org/api > > Regards, > > D. Campos > Regards, -- Benoit Minisini mailto:gambas at ...1... From daniel.campos at ...103... Fri May 13 13:09:04 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Fri, 13 May 2005 13:09:04 +0200 Subject: [Gambas-devel] API declaration error 1.9.8 Message-ID: <42848AD0.6010703@...103...> Hi Beno?t: The GTK+-2.0 library in current systems is called: "libgtk-x11-2.0.so" and "libgtk-x11-2.0.so.0" at /usr/lib Well, I didn't found a way to declare this function in Gambas, as it seems to add extensions ".so", ".so.0" where it wants, for example: LIBRARY "libgtk-x11-2.0" EXTERN gtk_init(Argc As Pointer,Argv As Pointer) ... gtk_init(0,0) Error: Can not find dynamic library "libgtk-x11-2.so.0" Or: LIBRARY "libgtk-x11-2.0.so" Error: Can not find dynamic library "libgtk-x11-2.0.so.so" Or: LIBRARY "libgtk-x11-2" Error: Can not find dynamic library "libgtk-x11-2.so" Couldn't you test if the "literal" name of the library exists in the PATH before changing and adding extensions, or may be add any symbol to specify you want that "literal" name instead of changing it? It is very confusing... The same problem happens to Glib, and GObject. Regards, D. Campos From daniel.campos at ...103... Fri May 13 13:14:51 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Fri, 13 May 2005 13:14:51 +0200 Subject: [Gambas-devel] API (2) Message-ID: <42848C2B.8090909@...103...> Well, finally I found that: "libgtk-x11-2.0.0" works for gtk+, and: ""libgobject-2.0.0" works for gobgect.... We need soon a tutorial about this or there will be more than a question called "Unable to call X library" in the gambas lists :-)))) Regards, D. Campos From daniel.campos at ...103... Fri May 13 13:24:59 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Fri, 13 May 2005 13:24:59 +0200 Subject: [Gambas-devel] Callbacks Message-ID: <42848E8B.1020701@...103...> Hi Beno?t: In finishing CallBacks management at gb.api. I have no problem to send the parameters to the callback, as GB.Push() allows to do that without problems, however, the return value is more complicated to manage: I've implemented a "SetReturn()" method to tell the callback the value to return, however it would be nice if the programmer could just act like in a normal function, that is "RETURN Value". However I have no way to know in gb.api the return value one I've called the function, even If I'm able to release or not that value.(GB.Call) "SetReturn" is problem if there are nested callbacks, too. Regards, D. Campos From daniel.campos at ...103... Fri May 13 18:00:49 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Fri, 13 May 2005 18:00:49 +0200 Subject: [Gambas-devel] gb.api update Message-ID: <4284CF31.3040009@...103...> Hi: I've updated the gb.api component: http://gambas.gnulinex.org/api/ I've removed the function definition and call from the component, as Gambas2 does it without problems. I've fixed the the CallBack and Structure management to work with the new model, and I've updated examples too. I have to rewrite the documentation, so: translators, wait a little! :-)) I also provide a way to get any symbol from a library as a pointer, I've noticed that Gambas interpreter lacks this feature, and some libraries (included all gambas components :-)), export some symbols (usually pointers to be used or filled by the main application) that are not functions. Regards, D. Campos From frankberg at ...136... Sat May 14 06:48:49 2005 From: frankberg at ...136... (Frank Berg) Date: Sat, 14 May 2005 06:48:49 +0200 Subject: [Gambas-devel] socket References: <002a01c4e4bf$909de590$c6f0fea9@...146...> <1103359471.3900.1.camel@...102...> Message-ID: <053b01c55840$38d48450$0200a8c0@...146...> hi daniel, i was try in the last month to listen (monitoring) the ax25 network frames, in the listen.c example i must use the socket command int fd fd=socket(AF_PACKET, SOCK_PACKET,htons(ETH_P_ALL)) in the example after this the command recvfrom(fd,...) is used to poll the buffer you was write me back i must use the udpSocket class, but there is no ip or port i can open and bind the class. please tell me, how this socket line / polling line is to make in gambas. and my next question is: i think it is not very good to use polling mode. but what can i do else frank ----- Original Message ----- From: "Daniel Campos" To: Sent: Saturday, December 18, 2004 10:44 AM Subject: Re: [Gambas-devel] socket > If you want to use datagrams, you have to use the UdpSocket class. > > Regards, > > D. Campos > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > From daniel.campos at ...103... Sat May 14 10:59:46 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Sat, 14 May 2005 10:59:46 +0200 Subject: [Gambas-devel] socket In-Reply-To: <053b01c55840$38d48450$0200a8c0@...146...> References: <002a01c4e4bf$909de590$c6f0fea9@...146...> <1103359471.3900.1.camel@...102...> <053b01c55840$38d48450$0200a8c0@...146...> Message-ID: <4285BE02.3070404@...103...> Hi Frank: Ah! this is not was you told me in the previous message :-))). You're not trying to work with datagrams, but with raw network data, that is, you're trying to write a kind of "sniffer" in Gambas, reading low level data and determining what of these frames are ax25 frames. You can not use the gb.net component for that, you should use "api calls" instead. You should define all the extern functions and constants you need (socket, etc...), and probably you'll need to work with the program as root too, as these kind of operations are not allowed by the Linux kernel for normal users... Regards, D. Campos Frank Berg escribi?: > hi daniel, > > i was try in the last month to listen (monitoring) the ax25 network > frames, > in the listen.c example i must use the socket command > > int fd > fd=socket(AF_PACKET, SOCK_PACKET,htons(ETH_P_ALL)) > > in the example after this the command recvfrom(fd,...) is used to poll > the buffer > > you was write me back i must use the udpSocket class, but there is no > ip or port i can open and bind the class. > > please tell me, how this socket line / polling line is to make in > gambas. and my next question is: i think it is not very good to use > polling mode. but what can i do else > > frank > > > ----- Original Message ----- From: "Daniel Campos" > > To: > Sent: Saturday, December 18, 2004 10:44 AM > Subject: Re: [Gambas-devel] socket > > >> If you want to use datagrams, you have to use the UdpSocket class. >> >> Regards, >> >> D. Campos >> >> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://productguide.itmanagersjournal.com/ >> _______________________________________________ >> Gambas-devel mailing list >> Gambas-devel at lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-devel >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > > From bergfr at ...305... Sat May 14 18:25:47 2005 From: bergfr at ...305... (Berg Frank) Date: Sat, 14 May 2005 18:25:47 +0200 Subject: [Gambas-devel] socket References: <002a01c4e4bf$909de590$c6f0fea9@...146...> <1103359471.3900.1.camel@...102...> <053b01c55840$38d48450$0200a8c0@...146...> <4285BE02.3070404@...103...> Message-ID: <000701c558a1$95e8ad40$7084060a@...155...> hi daniel, sorry, but i must ask again, i can`t found the lib*.so where all the net command`s is in. (socket, htons, recvfrom) socket and recvfrom i was found in /usr/include/sys/socket.h and htons in /usr/include/netinet/in.h but where is the *.so ??? frank ----- Original Message ----- From: "Daniel Campos" To: Sent: Saturday, May 14, 2005 10:59 AM Subject: Re: [Gambas-devel] socket Hi Frank: Ah! this is not was you told me in the previous message :-))). You're not trying to work with datagrams, but with raw network data, that is, you're trying to write a kind of "sniffer" in Gambas, reading low level data and determining what of these frames are ax25 frames. You can not use the gb.net component for that, you should use "api calls" instead. You should define all the extern functions and constants you need (socket, etc...), and probably you'll need to work with the program as root too, as these kind of operations are not allowed by the Linux kernel for normal users... Regards, D. Campos From daniel.campos at ...103... Sat May 14 19:54:46 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Sat, 14 May 2005 19:54:46 +0200 Subject: [Gambas-devel] socket In-Reply-To: <000701c558a1$95e8ad40$7084060a@...155...> References: <002a01c4e4bf$909de590$c6f0fea9@...146...> <1103359471.3900.1.camel@...102...> <053b01c55840$38d48450$0200a8c0@...146...> <4285BE02.3070404@...103...> <000701c558a1$95e8ad40$7084060a@...155...> Message-ID: <42863B66.2080101@...103...> It is just glibc, so you should declare: LIBRARY "libc.6" in gambas-1.9.8 Regards, D. Campos >hi daniel, >sorry, but i must ask again, i can`t found the lib*.so where all the net >command`s is in. >(socket, htons, recvfrom) >socket and recvfrom i was found in /usr/include/sys/socket.h >and htons in /usr/include/netinet/in.h > >but where is the *.so ??? > >frank > > > >----- Original Message ----- >From: "Daniel Campos" >To: >Sent: Saturday, May 14, 2005 10:59 AM >Subject: Re: [Gambas-devel] socket > > >Hi Frank: > > >Ah! this is not was you told me in the previous message :-))). You're >not trying >to work with datagrams, but with raw network data, that is, you're trying >to write a kind of "sniffer" in Gambas, reading low level data and >determining >what of these frames are ax25 frames. You can not use the gb.net component >for that, you should use "api calls" instead. You should define all the >extern >functions and constants you need (socket, etc...), and probably you'll >need to >work with the program as root too, as these kind of operations are not >allowed >by the Linux kernel for normal users... > >Regards, > >D. Campos > > > > >------------------------------------------------------- >This SF.Net email is sponsored by Oracle Space Sweepstakes >Want to be the first software developer in space? >Enter now for the Oracle Space Sweepstakes! >http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click >_______________________________________________ >Gambas-devel mailing list >Gambas-devel at lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/gambas-devel > > > > From daniel.campos at ...103... Mon May 16 15:41:15 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Mon, 16 May 2005 15:41:15 +0200 Subject: [Gambas-devel] gb.net and gb.net.curl fixes for Gambas2 Message-ID: <4288A2FB.8000203@...103...> Hi: I've placed here: http://gambas.gnulinex.org/net Some fixes for gb.net and gb.net.curl. Finally I found that it seems the GB_STREAM_DESC structure changed in any point in the past, so there's a field "handle" that wasn't managed by both components. This could be the fix for some strange and "aleatory" bugs when working with Socket, UdpSocket, SerialPort, HttpClient and FtpClient. Regards, D. Campos From frankberg at ...136... Mon May 16 16:38:18 2005 From: frankberg at ...136... (Frank Berg) Date: Mon, 16 May 2005 16:38:18 +0200 Subject: [Gambas-devel] socket References: <002a01c4e4bf$909de590$c6f0fea9@...146...> <1103359471.3900.1.camel@...102...> <053b01c55840$38d48450$0200a8c0@...146...> <4285BE02.3070404@...103...> <000701c558a1$95e8ad40$7084060a@...155...> <42863B66.2080101@...103...> Message-ID: <000b01c55a24$e7260c00$0200a8c0@...146...> hi, daniel solong its work great with the gb.api now i try to use an struct but i dount know how: struct sockaddr { sa_family_t sa_family /* adress family char sa_data[14] /* 14 byte of protokoll }; '###### private sa as ApiStruct private asize as integer ...... sa = NEW ApiStruct (["sa_family","sa_data"],[api.short,14]) asize=sa.size '###### how must i define the length of 14 byte of data. the rest are clear for me, but not define length of a char data string frank ----- Original Message ----- From: "Daniel Campos" To: Sent: Saturday, May 14, 2005 7:54 PM Subject: Re: [Gambas-devel] socket > It is just glibc, so you should declare: > > LIBRARY "libc.6" > > in gambas-1.9.8 > > Regards, > > D. Campos > > > From nobody at ...312... Fri May 20 18:48:34 2005 From: nobody at ...312... (nobody) Date: Fri, 20 May 2005 18:48:34 +0200 (MEST) Subject: [Gambas-devel] Re: document In-Reply-To: <20050520161609.6565A13D2FEC@...311...> References: <20050520161609.6565A13D2FEC@...311...> Message-ID: <20050520164834.7BB6113D5D03@...311...> L'adresse que vous demandez n'est plus valide. Soucieux d'ameliorer son support technique par mail, Free vous informe qu'un formulaire est desormais a votre disposition sur http://www.free.fr/contact/. Ce formulaire vise a faciliter et accelerer le traitement du probleme que vous nous soumettez en le prequalifiant. C'est pourquoi nous vous remercions de vous conformer a cette page et de renseigner les differents champs afin que notre service technique mail puisse vous apporter la reponse adequate. Nous vous prions de bien vouloir nous excuser de la gene occasionnee, et nous vous remercions de la confiance que vous nous temoignez. Le service Assistance Technique de Free. From oreip at ...1... Sat May 21 21:58:57 2005 From: oreip at ...1... (PV) Date: Sat, 21 May 2005 21:58:57 +0200 Subject: [Gambas-devel] Problem with .component file Message-ID: <428F9301.6080302@...1...> Hi all, I am writing a component for Gambas which adds four new hash and cypher classes (MD5, SHA1, SHA2 and AES), but I am experiencing a strange problem with the relative component file. In fact, if I use a gb.hash.component file like [Component] Key=gb.hash Name=Hash functions Name[it]=Funzioni di hash Author=Pierluigi Vittori Alpha=1 everything works fine, but if I add one more line like Controls=MD5,SHA1,SHA2,AES then, upon opening in gambas a project which includes the new library gb.hash, everything stops and an error shows up saying "Cannot open project file. Void key. FToolBox.AddToolBar.36" If i remove the "Controls=" line, everything goes back to normal. What am I doing wrong? :-) TIA, Piero P.S. If you are interested in this new component, please let me know and, when it is finished, I can send you the source code. From veerh01 at ...313... Mon May 23 10:45:55 2005 From: veerh01 at ...313... (H.R. ter Veer) Date: Mon, 23 May 2005 10:45:55 +0200 Subject: [Gambas-devel] some IDE changes i made Message-ID: <1116837955.17868.234724164@...314...> Hi all, In februari i added some small changes to the IDE from gambas 1.9.3: - a status-bar in the editor, showing the status of your file & where you are. - took the color-theme arrays out the form code and placed them in files - added exportable (and importable) color themes. (makes it possible to exchange them, logical extention to the extracted color-code). see screenshots. Is it worth implementing in the current develop version? Greetz Harm Richt ter Veer -- H.R. ter Veer veerh01 at ...313... -------------- next part -------------- A non-text attachment was scrubbed... Name: status-bar.jpg Type: image/jpeg Size: 67738 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: highlighters.jpg Type: image/jpeg Size: 34199 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: exportable-themes.jpg Type: image/jpeg Size: 65077 bytes Desc: not available URL: From drakaan at ...176... Thu May 26 16:15:33 2005 From: drakaan at ...176... (adrian stovall) Date: Thu, 26 May 2005 09:15:33 -0500 Subject: [Gambas-devel] Problem with .component file In-Reply-To: <428F9301.6080302@...1...> References: <428F9301.6080302@...1...> Message-ID: <6696aa870505260715152dd3e@...178...> I'm definitely interested in this component. I've searched several times for cryp/hashing components for Gambas, and found Gcrypto2 mentioned, but with no files to be found. Please send me what you come up with. Actually, if you want some more eyes looking at things, send me what you have now, and I'll see if I can help debug or develop it with you (I don't even need credit for helping, just want working crypto functionality). On 5/21/05, PV wrote: > Hi all, > > I am writing a component for Gambas which adds four new hash and cypher classes > (MD5, SHA1, SHA2 and AES), but I am experiencing a strange problem with the > relative component file. > In fact, if I use a gb.hash.component file like > > [Component] > Key=gb.hash > Name=Hash functions > Name[it]=Funzioni di hash > Author=Pierluigi Vittori > Alpha=1 > > everything works fine, but if I add one more line like > > Controls=MD5,SHA1,SHA2,AES > > then, upon opening in gambas a project which includes the new library gb.hash, > everything stops and an error shows up saying "Cannot open project file. Void > key. FToolBox.AddToolBar.36" > > If i remove the "Controls=" line, everything goes back to normal. > > What am I doing wrong? :-) > > TIA, > Piero > > P.S. If you are interested in this new component, please let me know and, when > it is finished, I can send you the source code. > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > -- 'Murphy was an optimist' - O'Toole's commentary on murpy's law 'Extremists suck' - Adrian Stovall [ http://drakaan.blogspot.com ] From oreip at ...1... Fri May 27 19:50:49 2005 From: oreip at ...1... (PV) Date: Fri, 27 May 2005 19:50:49 +0200 Subject: [Gambas-devel] Problem with .component file In-Reply-To: <6696aa870505260715152dd3e@...178...> References: <428F9301.6080302@...1...> <6696aa870505260715152dd3e@...178...> Message-ID: <42975DF9.5040100@...1...> On 26/05/2005 16:15, adrian stovall wrote: > I'm definitely interested in this component. I've searched several > times for cryp/hashing components for Gambas, and found Gcrypto2 > mentioned, but with no files to be found. Please send me what you > come up with. Actually, if you want some more eyes looking at things, > send me what you have now, and I'll see if I can help debug or develop > it with you (I don't even need credit for helping, just want working > crypto functionality). The code is still too messy and unfinished: give me a little time to fix it and then I'll be more than happy to share it. Take care, Piero From daniel.campos at ...103... Sun May 29 13:34:14 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Sun, 29 May 2005 13:34:14 +0200 Subject: [Gambas-devel] Gambas programs recognized as executables Message-ID: <4299A8B6.7000506@...103...> Hi: A Gambas program can be recognized by the Linux kernel as an executable, if the binfmt_misc module is enabled (this is the normal thing in all common modern Linux distributions). To test it, do at root in a console: echo ':Gambas:M::# Gambas Project File::/usr/bin/gbx:' > /proc/sys/fs/binfmt_misc/register for gambas, or: echo ':Gambas:M::# Gambas Project File::/usr/bin/gbx2:' > /proc/sys/fs/binfmt_misc/register for gambas2. Then, compile a gambas program, edit it (vi is a good option), and remove all from the beggining of the file to the phrase: "# Gambas Project File", so the first line in the gambas executable is just "# Gambas Project File". Then, try to execute the program. I've tested it with little programs and they run OK, however big programs like the Gambas ide, seems to fail, as it seems to lose some information about paths... Regards, D. Campos From daniel.campos at ...103... Mon May 30 15:09:16 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Mon, 30 May 2005 15:09:16 +0200 Subject: [Gambas-devel] Event seems to not raise Message-ID: <429B107C.5040404@...103...> Hi Beno?t: I'm writting (using gambas-1.9.8) a class that inherits from "Panel". Well, I've added an event (ElementClick) that should raise when an element receives the "MouseUp" event, however, this never happen... I send you a sample code Regards, D. Campos -------------- next part -------------- A non-text attachment was scrubbed... Name: TestGrid2.tar.gz Type: application/x-gzip Size: 4931 bytes Desc: not available URL: From gambas at ...1... Mon May 30 15:57:02 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 30 May 2005 15:57:02 +0200 Subject: [Gambas-devel] API declaration error 1.9.8 In-Reply-To: <42848AD0.6010703@...103...> References: <42848AD0.6010703@...103...> Message-ID: <200505301557.02895.gambas@...1...> On Friday 13 May 2005 13:09, Daniel Campos wrote: > Hi Beno?t: > > The GTK+-2.0 library in current systems is called: > > "libgtk-x11-2.0.so" and "libgtk-x11-2.0.so.0" at /usr/lib > > Well, I didn't found a way to declare this function in Gambas, as it seems > to add extensions ".so", ".so.0" where it wants, for example: > > LIBRARY "libgtk-x11-2.0" > > EXTERN gtk_init(Argc As Pointer,Argv As Pointer) > ... > gtk_init(0,0) > > Error: Can not find dynamic library "libgtk-x11-2.so.0" > > Or: > > LIBRARY "libgtk-x11-2.0.so" > > Error: Can not find dynamic library "libgtk-x11-2.0.so.so" > > Or: > > LIBRARY "libgtk-x11-2" > > Error: Can not find dynamic library "libgtk-x11-2.so" > > > Couldn't you test if the "literal" name of the library exists in the > PATH before changing > and adding extensions, or may be add any symbol to specify you want that > "literal" name > instead of changing it? It is very confusing... > > The same problem happens to Glib, and GObject. > > Regards, > > D. Campos > Here is how I fixed that: - Now you must not put the shared library extension in the library name. It is automatically added. - If you have to specify the library version number, you must add at the end of the library name the ':' character followed by the version. For example "libgtk-x11-2.0:0" will be transformed into "libgtk-x11-2.0.so.0" on Linux and "libgtk-x11-2.0.0.dylib" on MacOSX (for example). Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Mon May 30 16:04:00 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 30 May 2005 16:04:00 +0200 Subject: [Gambas-devel] some IDE changes i made In-Reply-To: <1116837955.17868.234724164@...314...> References: <1116837955.17868.234724164@...314...> Message-ID: <200505301604.00972.gambas@...1...> On Monday 23 May 2005 10:45, H.R. ter Veer wrote: > Hi all, > > In februari i added some small changes to the IDE from gambas 1.9.3: > - a status-bar in the editor, showing the status of your file & where > you are. > - took the color-theme arrays out the form code and placed them in files > - added exportable (and importable) color themes. (makes it possible to > exchange them, logical extention to the extracted color-code). > see screenshots. > > Is it worth implementing in the current develop version? > > Greetz > > Harm Richt ter Veer Hi, Sorry for the late answer... Actually, not yet: I will start the new IDE in July - Then it will be worth merging your code for that. Be patient ;-) Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Mon May 30 16:39:52 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 30 May 2005 16:39:52 +0200 Subject: [Gambas-devel] gb.gtk updated In-Reply-To: <4281FFE4.5000203@...103...> References: <4281FFE4.5000203@...103...> Message-ID: <200505301639.53309.gambas@...1...> On Wednesday 11 May 2005 14:51, Daniel Campos wrote: > Some fixes and improvementes: > > http://gambas.gnulinex.org/gtk > > Regards, > > D. Campos > > OK. Merged it... -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Mon May 30 17:12:36 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 30 May 2005 17:12:36 +0200 Subject: [Gambas-devel] Callbacks In-Reply-To: <42848E8B.1020701@...103...> References: <42848E8B.1020701@...103...> Message-ID: <200505301712.38011.gambas@...1...> On Friday 13 May 2005 13:24, Daniel Campos wrote: > Hi Beno?t: > > In finishing CallBacks management at gb.api. I have no problem > to send the parameters to the callback, as GB.Push() allows > to do that without problems, however, the return value is > more complicated to manage: > > I've implemented a "SetReturn()" method to tell the callback the > value to return, however it would be nice if the programmer could > just act like in a normal function, that is "RETURN Value". However > I have no way to know in gb.api the return value one I've called > the function, even If I'm able to release or not that value.(GB.Call) > > "SetReturn" is problem if there are nested callbacks, too. > > Regards, > > D. Campos > If you use GB.Call() to call the function, then the returned value of the called Gambas function automatically becomes the return value of the component C function, as if you have called GB.ReturnXXX(). I think it is what you need... :-) -- Benoit Minisini mailto:gambas at ...1... From daniel.campos at ...103... Mon May 30 17:43:18 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Mon, 30 May 2005 17:43:18 +0200 Subject: [Gambas-devel] Callbacks In-Reply-To: <200505301712.38011.gambas@...1...> References: <42848E8B.1020701@...103...> <200505301712.38011.gambas@...1...> Message-ID: <429B3496.3040103@...103...> >> >> >> > >If you use GB.Call() to call the function, then the returned value of the >called Gambas function automatically becomes the return value of the >component C function, as if you have called GB.ReturnXXX(). > >I think it is what you need... :-) > > May be I didn't understood fine, but I think this is not what I want, I follow the following process: 1) The library calls my callback in the gb.api component. 2) Into my callback, I "map" it to a Gambas function in the main program, so I pass the parameters using GB.Push() and then I call GB.Call(). 3) The main application returns any value. 4) I must convert that value to a C type and then use the "C" return, to return that value to the library. Regards, D. Campos From gambas at ...1... Mon May 30 17:52:35 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 30 May 2005 17:52:35 +0200 Subject: [Gambas-devel] Callbacks In-Reply-To: <429B3496.3040103@...103...> References: <42848E8B.1020701@...103...> <200505301712.38011.gambas@...1...> <429B3496.3040103@...103...> Message-ID: <200505301752.36588.gambas@...1...> On Monday 30 May 2005 17:43, Daniel Campos wrote: > >If you use GB.Call() to call the function, then the returned value of the > >called Gambas function automatically becomes the return value of the > >component C function, as if you have called GB.ReturnXXX(). > > > >I think it is what you need... :-) > > May be I didn't understood fine, but I think this is not what I want, I > follow the following process: > > 1) The library calls my callback in the gb.api component. > 2) Into my callback, I "map" it to a Gambas function in the main program, > so I pass the parameters using GB.Push() and then I call GB.Call(). > 3) The main application returns any value. > 4) I must convert that value to a C type and then use the "C" return, > to return > that value to the library. > > Regards, > > D. Campos > OK. So I have to add an API, something like GB.GetReturnValue() that will return a pointer to the GB_VALUE where the return value is stored. Sigh... I have to recompile everything when I add an API in the GB structure :-( Regards, -- Benoit Minisini mailto:gambas at ...1... From gambas at ...1... Mon May 30 18:15:31 2005 From: gambas at ...1... (Benoit Minisini) Date: Mon, 30 May 2005 18:15:31 +0200 Subject: [Gambas-devel] Callbacks In-Reply-To: <429B3496.3040103@...103...> References: <42848E8B.1020701@...103...> <200505301712.38011.gambas@...1...> <429B3496.3040103@...103...> Message-ID: <200505301815.32397.gambas@...1...> On Monday 30 May 2005 17:43, Daniel Campos wrote: > >If you use GB.Call() to call the function, then the returned value of the > >called Gambas function automatically becomes the return value of the > >component C function, as if you have called GB.ReturnXXX(). > > > >I think it is what you need... :-) > > May be I didn't understood fine, but I think this is not what I want, I > follow the following process: > > 1) The library calls my callback in the gb.api component. > 2) Into my callback, I "map" it to a Gambas function in the main program, > so I pass the parameters using GB.Push() and then I call GB.Call(). > 3) The main application returns any value. > 4) I must convert that value to a C type and then use the "C" return, > to return > that value to the library. > > Regards, > > D. Campos > > If GB.Call() returns a pointer to the GB_VALUE * structure including the return value, will it be sufficient ? You will have to the test the type yourself to decide what to return exactly. Regards, -- Benoit Minisini mailto:gambas at ...1... From daniel.campos at ...103... Mon May 30 22:00:06 2005 From: daniel.campos at ...103... (Daniel Campos) Date: Mon, 30 May 2005 22:00:06 +0200 Subject: [Gambas-devel] Callbacks In-Reply-To: <200505301815.32397.gambas@...1...> References: <42848E8B.1020701@...103...> <200505301712.38011.gambas@...1...> <429B3496.3040103@...103...> <200505301815.32397.gambas@...1...> Message-ID: <429B70C6.2010306@...103...> >> >> >> >> > >If GB.Call() returns a pointer to the GB_VALUE * structure including the >return value, will it be sufficient ? > >You will have to the test the type yourself to decide what to return exactly. > >Regards, > > Yes, it is sufficient. Thanks!