#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 */
*/
#define LDIF_SIZE_NEEDED(tlen,vlen) \
((tlen) + 4 + LDIF_BASE64_LEN(vlen) \
- + ((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 */
-
-#ifdef __cplusplus
-}
-#endif
+ + ((LDIF_BASE64_LEN(vlen) + (tlen) + 3) / LINE_WIDTH * 2 ))
+
+
+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 ));
+
+LDAP_END_DECL
#endif /* _LDIF_H */
#ifndef _LTHREAD_H
#define _LTHREAD_H
+#include <portable.h>
+
+LDAP_BEGIN_DECL
+
#if defined ( THREAD_NEXT_CTHREADS )
#define _THREAD
typedef int pthread_cond_t;
#endif /* no threads support */
+
+LDAP_END_DECL
+
#endif /* _LTHREAD_H */
--- /dev/null
+#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 */
/* 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 )