[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeswitch-dev
Subject:    Re: [Freeswitch-dev] quick question about the following lines of
From:       Moises Silva <moises.silva () gmail ! com>
Date:       2011-06-17 17:21:29
Message-ID: BANLkTinAS0aqj_pApqccBR3f2oQ4fx=qVw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Thu, Jun 16, 2011 at 1:57 PM, jesse <chat2jesse@gmail.com> wrote:

> in file switch_loadable_module.c:
>
>
> switch_loadable_module_load_file(char *path, char *filename, switch_bool_t
> global, switch_loadable_module_t **new_module)
>
> #ifdef WIN32
>   dso = switch_dso_open("FreeSwitch.dll", load_global, &derr);
> #elif defined (MACOSX) || defined(DARWIN)
>   dso = switch_dso_open(SWITCH_PREFIX_DIR "/lib/libfreeswitch.dylib",
> load_global, &derr);
> #else
>   dso = switch_dso_open(NULL, load_global, &derr);
> #endif
>
>
>

> why the else case is dso open "NULL"? shouldn't it be
>  lib/libfreeswitch.so?
>

Looks cleaner this way to me. Read the man page for dlopen(). If NULL is
provided, the handle for the main program will be returned and dlsym() will
look into the main program and libraries loaded at startup for the symbol.

Moises Silva
Senior Software Engineer, Software Development Manager
Sangoma Technologies Inc. | 100 Renfrew Drive, Suite 100, Markham ON L3R 9R6
Canada
t. 1 905 474 1990 x128 | e. moy@sangoma.com

[Attachment #5 (text/html)]

<div class="gmail_quote">On Thu, Jun 16, 2011 at 1:57 PM, jesse <span \
dir="ltr">&lt;<a href="mailto:chat2jesse@gmail.com">chat2jesse@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> in file  switch_loadable_module.c:  \
<div><br></div><div><br></div><div>switch_loadable_module_load_file(char *path, char \
*filename, switch_bool_t global, switch_loadable_module_t \
**new_module)<br><div><br></div><div><div><div>

#ifdef WIN32</div><div>   dso = switch_dso_open(&quot;FreeSwitch.dll&quot;, \
load_global, &amp;derr);</div><div>#elif defined (MACOSX) || \
defined(DARWIN)</div><div>   dso = switch_dso_open(SWITCH_PREFIX_DIR \
&quot;/lib/libfreeswitch.dylib&quot;, load_global, &amp;derr);</div>

<div>#else</div><div>   dso = switch_dso_open(NULL, load_global, \
&amp;derr);</div><div>#endif</div></div><div><br></div><div>  \
</div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex;"> \
<div><div><div></div><div><br></div><div>why the else case is dso open \
&quot;NULL&quot;? shouldn&#39;t it be   \
lib/libfreeswitch.so?</div></div></div></blockquote><div><br></div><div>Looks cleaner \
this way to me. Read the man page for dlopen(). If NULL is provided, the handle for \
the main program will be returned and dlsym() will look into the main program and \
libraries loaded at startup for the symbol.</div> <div>  </div><div>Moises \
Silva<br>Senior Software Engineer, Software Development Manager<br>Sangoma \
Technologies Inc. | 100 Renfrew Drive, Suite 100, Markham ON L3R 9R6 Canada<br>t. 1 \
905 474 1990 x128 | e.  <a href="mailto:moy@sangoma.com" \
target="_blank">moy@sangoma.com</a><br> <br><br></div></div>



_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
http://www.cluecon.com 877-7-4ACLUE

FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
http://www.freeswitch.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic