[Freeswitch-dev] quick question about the following lines of code

Moises Silva moises.silva at gmail.com
Fri Jun 17 21:21:29 MSD 2011


On Thu, Jun 16, 2011 at 1:57 PM, jesse <chat2jesse at 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 at sangoma.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20110617/87cb7819/attachment.html 


More information about the FreeSWITCH-dev mailing list