|
From: doug s. <hig...@ho...> - 2013-05-18 13:17:29
|
>>
>> Uh, noticed now that at line 155 the function goes as far as calling a
>> "exit(0)" termination if a host is not found...
>>
>> This function was set to a "success or death" logic. Maybe it's better
>> that I write down a different function for what I need... what do you think?
> Sounds good. Then if other configurations want to join your method they can do so at leisure.
> Or another idea: move the exit(0) outside if not too hard, then do the wrapper function idea:
> void X3D_Initialize()
> {
> int ierr = X3D_Initialize0();
> if(ierr) exit(0);
> }
> Then you'd call the 0() function and the other guys would call the old one.
.
Oh - I'm looking at the code now. I was wrong on 2 counts:
1) Looks like X3D_initialize is in libeai -on the client side. I don't think it should get the ConsoleMessage treatment, because it will make linking libeai.lib and client harder.
2) And looks like there's only one place X3D_Initialize called, plus it's in some SWIG stuff. I think the SWIG stuff is already broken / out of date. So in that case you can change the function signature without doing a wrapper function.
-Doug
.
>>
>> Il 17/05/2013 18:37, Luca Cerutti ha scritto:
>>> 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.
>> ===============================================================
>>
>>
>> ------------------------------------------------------------------------------
>> 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
> ------------------------------------------------------------------------------
> 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
|