mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-02 21:19:53 -05:00
more ldap_cdefs.h, less bridge.h
This commit is contained in:
parent
6949ab31ac
commit
46c3cddad4
4 changed files with 67 additions and 20 deletions
|
|
@ -13,9 +13,9 @@
|
|||
#ifndef _LDIF_H
|
||||
#define _LDIF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <ldap_cdefs.h>
|
||||
|
||||
LDAP_BEGIN_DECL
|
||||
|
||||
#define LINE_WIDTH 76 /* maximum length of LDIF lines */
|
||||
|
||||
|
|
@ -34,23 +34,14 @@ extern "C" {
|
|||
*/
|
||||
#define LDIF_SIZE_NEEDED(tlen,vlen) \
|
||||
((tlen) + 4 + LDIF_BASE64_LEN(vlen) \
|
||||
+ ((LDIF_BASE64_LEN(vlen) + tlen + 3) / LINE_WIDTH * 2 ))
|
||||
+ ((LDIF_BASE64_LEN(vlen) + (tlen) + 3) / LINE_WIDTH * 2 ))
|
||||
|
||||
|
||||
#ifdef NEEDPROTOS
|
||||
int str_parse_line( char *line, char **type, char **value, int *vlen);
|
||||
char * str_getline( char **next );
|
||||
void put_type_and_value( char **out, char *t, char *val, int vlen );
|
||||
char *ldif_type_and_value( char *type, char *val, int vlen );
|
||||
#else /* NEEDPROTOS */
|
||||
int str_parse_line();
|
||||
char * str_getline();
|
||||
void put_type_and_value();
|
||||
char *ldif_type_and_value();
|
||||
#endif /* NEEDPROTOS */
|
||||
int str_parse_line LDAP_P(( char *line, char **type, char **value, int *vlen));
|
||||
char * str_getline LDAP_P(( char **next ));
|
||||
void put_type_and_value LDAP_P(( char **out, char *t, char *val, int vlen ));
|
||||
char *ldif_type_and_value LDAP_P(( char *type, char *val, int vlen ));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
LDAP_END_DECL
|
||||
|
||||
#endif /* _LDIF_H */
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
#ifndef _LTHREAD_H
|
||||
#define _LTHREAD_H
|
||||
|
||||
#include <portable.h>
|
||||
|
||||
LDAP_BEGIN_DECL
|
||||
|
||||
#if defined ( THREAD_NEXT_CTHREADS )
|
||||
|
||||
#define _THREAD
|
||||
|
|
@ -222,4 +226,7 @@ typedef int pthread_condattr_t;
|
|||
typedef int pthread_cond_t;
|
||||
|
||||
#endif /* no threads support */
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
#endif /* _LTHREAD_H */
|
||||
|
|
|
|||
46
include/lthread_rdwr.h
Normal file
46
include/lthread_rdwr.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#ifndef _LTHREAD_RDWR_H
|
||||
#define _LTHREAD_RDWR_H 1
|
||||
|
||||
/********************************************************
|
||||
* An example source module to accompany...
|
||||
*
|
||||
* "Using POSIX Threads: Programming with Pthreads"
|
||||
* by Brad nichols, Dick Buttlar, Jackie Farrell
|
||||
* O'Reilly & Associates, Inc.
|
||||
*
|
||||
********************************************************
|
||||
*
|
||||
* Include file for reader/writer locks
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ldap_cdefs.h>
|
||||
|
||||
LDAP_BEGIN_DECL
|
||||
|
||||
typedef struct rdwr_var {
|
||||
int readers_reading;
|
||||
int writer_writing;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t lock_free;
|
||||
} pthread_rdwr_t;
|
||||
|
||||
typedef void * pthread_rdwrattr_t;
|
||||
|
||||
#define pthread_rdwrattr_default NULL;
|
||||
|
||||
int pthread_rdwr_init_np LDAP_P((pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp));
|
||||
int pthread_rdwr_rlock_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
int pthread_rdwr_runlock_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
int pthread_rdwr_wlock_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
int pthread_rdwr_wunlock_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
|
||||
#ifdef LDAP_DEBUG
|
||||
int pthread_rdwr_rchk_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
int pthread_rdwr_wchk_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
int pthread_rdwr_rwchk_np LDAP_P((pthread_rdwr_t *rdwrp));
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
#endif /* _LTHREAD_RDWR_H */
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
/* thread.c - glue routines to provide a consistent thread interface */
|
||||
#include <stdio.h>
|
||||
#include "lthread.h"
|
||||
|
||||
#define DISABLE_BRIDGE
|
||||
#include "portable.h"
|
||||
|
||||
#include <lthread.h>
|
||||
|
||||
#if defined( THREAD_NEXT_CTHREADS )
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue