[prev in list] [next in list] [prev in thread] [next in thread]
List: openldap-technical
Subject: Need information related to multi thread support in OpenLDAP c sdk client
From: c.venugopal521 () gmail ! com
Date: 2024-04-29 7:48:44
Message-ID: 171437692444.1014223.15829176178613360536 () hypatia ! openldap ! org
[Download RAW message or body]
Hi Team,
We are working on migration of nsldap C sdk to OpenLDAP c sdk for our application \
client code. As part of this activity, replacing API one by one and also looking for \
constant replacement.
In NSLDAP C SDK:
/*
* Thread function callbacks (an API extension --
* LDAP_API_FEATURE_X_THREAD_FUNCTIONS).
*/
#define LDAP_OPT_THREAD_FN_PTRS 0x05 /* 5 - API extension */
/*
* Thread callback functions:
*/
typedef void *(LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_ALLOC_CALLBACK)( void );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_FREE_CALLBACK)( void *m );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_LOCK_CALLBACK)( void *m );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_MUTEX_UNLOCK_CALLBACK)( void *m );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_GET_ERRNO_CALLBACK)( void );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_SET_ERRNO_CALLBACK)( int e );
typedef int (LDAP_C LDAP_CALLBACK LDAP_TF_GET_LDERRNO_CALLBACK)(
char **matchedp, char **errmsgp, void *arg );
typedef void (LDAP_C LDAP_CALLBACK LDAP_TF_SET_LDERRNO_CALLBACK)( int err,
char *matched, char *errmsg, void *arg );
/*
* Structure to hold thread function pointers:
*/
struct ldap_thread_fns {
LDAP_TF_MUTEX_ALLOC_CALLBACK *ltf_mutex_alloc;
LDAP_TF_MUTEX_FREE_CALLBACK *ltf_mutex_free;
LDAP_TF_MUTEX_LOCK_CALLBACK *ltf_mutex_lock;
LDAP_TF_MUTEX_UNLOCK_CALLBACK *ltf_mutex_unlock;
LDAP_TF_GET_ERRNO_CALLBACK *ltf_get_errno;
LDAP_TF_SET_ERRNO_CALLBACK *ltf_set_errno;
LDAP_TF_GET_LDERRNO_CALLBACK *ltf_get_lderrno;
LDAP_TF_SET_LDERRNO_CALLBACK *ltf_set_lderrno;
void *ltf_lderrno_arg;
};
nsldap c sdk has thread function pointers option to support multi thread \
functionality for client programs. In our existing code, we are using \
'LDAP_OPT_THREAD_FN_PTRS' option with ldap_set_option API like "Client code usage: \
ldap_set_option(hLDAP, LDAP_OPT_THREAD_FN_PTRS, &tfns);".
Now, we are looking for similar functionality with in OpenLDAP to use it in our \
client program. Gone through OpenLDAP document and source code, but with my \
knowledge, did not get any equivalent one.
Could you please provide more details on this to achieve equivalent functionality of \
LDAP_OPT_THREAD_FN_PTRS with OpenLDAP?
Thank you
Venu
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic