Subject: Export default functions in the API

Export default functions in the API

From: Sofian Brabez <>
Date: Wed, 27 Jan 2010 12:01:03 +0100

Hi folks,

What do you think replace #define functions by real functions in LIBSSH2_API ?

Let me explain more with libssh2_session_init example below.

Presently we have this definition in include/libssh2.h :

#define libssh2_session_init() libssh2_session_init_ex(NULL, NULL, NULL,

Like that libssh2_session_init is not part of LIBSSH2_API and
we can't lookup this symbol because it doesn't exist in shared library:

nm src/.libs/|grep session_init
00013e90 T libssh2_session_init_ex

After change with the following diff in attachment, we don't have
the problem anymore:

nm src/.libs/ |grep session_init
0001b92a T libssh2_session_init
0001b84f T libssh2_session_init_ex

Do you think it's a good idea to change all #define functions ?


Sofian Brabez
Security R&D Engineer


Received on 2010-01-27