|
From: Luca C. <ce...@sy...> - 2013-05-17 16:49:34
|
Doug, I did not know of the ConsoleMessage() function. As of now the code calls the X3D_error function that uses the perror function. I thought of the return value because I'd like the caller application to manage the missing socket comunication (e.g. by trying a "server" restart if it knows how to do it... which is my case). I'll apply your suggestion. Il 17/05/2013 18:33, doug sanden ha scritto: >> Hi, >> I've noticed that the initialization process of the EAI through >> \src\libeai\EAI_C_Control.c -> X3D_Initialize >> >> only print error messages on the standard output if the initialization >> goes wrong. >> Since the same function could be used from a non-console application or >> library, wouldn't it be better if it returns a boolean value or, even >> better, an int error code? >> >> If you value it useful I could make the upgrade. >> > Luca, > I haven't looked at the code but here's some thoughts that popped to mind: > instead of printf() you could call ConsoleMessage() which is meant to show the message on non-console configurations (and default to printf on console configurations). Some configurations use statusbarHud.c which has a [!] menu button which then renders the messages as pixel text over the scene window. I think John gave the Android version a separate text window. > If a return value would break something, could you do something like this: make that change but also change the name to int X3D_Initialize0() with a 0 in the name, and then make a function X3D_Initialize() with the old signature (that returns no value) and calls the 0() function? Then whoever can use the return value calls the 0 function and all the old code keeps calling the old way. > -Doug > ------------------------------------------------------------------------------ > AlienVault Unified Security Management (USM) platform delivers complete > security visibility with the essential security capabilities. Easily and > efficiently configure, manage, and operate all of your security controls > from a single console and one unified framework. Download a free trial. > http://p.sf.net/sfu/alienvault_d2d > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > -- =============================================================== Luca Cerutti Profutura s.r.l. - Corso Tortona 17 - 10153 Torino phone: +39 (0)11 8392363 - fax: +39 (0)11 837802 e-mail: ce...@sy... http://www.synarea.com Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente. This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003. =============================================================== |