]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/re.c
Added support for newSuperior.
[openldap] / servers / slurpd / re.c
index 5792850d7eda50bde168ead293cde90352deb902..00b22eace3287b7edf1418398a62f3a073770cf6 100644 (file)
 #include <ac/string.h>
 #include <ac/ctype.h>
 
-#include "../slapd/slap.h"
 #include "slurp.h"
 #include "globals.h"
 
+#include "../slapd/slap.h"
+
 /* Forward references */
 static Rh      *get_repl_hosts LDAP_P(( char *, int *, char ** ));
 static int     gettype LDAP_P(( char * ));
@@ -81,7 +82,7 @@ Re_free(
     }
 #if !defined( HAVE_LWP )
     /* This seems to have problems under SunOS lwp */
-    pthread_mutex_destroy( &re->re_mutex );
+    ldap_pvt_thread_mutex_destroy( &re->re_mutex );
 #endif /* HAVE_LWP */
     ch_free( re->re_timestamp );
     if (( rh = re->re_replicas ) != NULL ) {
@@ -147,7 +148,7 @@ Re_parse(
     re->re_refcnt = sglob->num_replicas;
 
     for (;;) {
-       if (( state == GOT_ALL ) || ( buf = str_getline( &rp )) == NULL ) {
+       if (( state == GOT_ALL ) || ( buf = ldif_getline( &rp )) == NULL ) {
            break;
        }
        /*
@@ -159,7 +160,7 @@ Re_parse(
            continue;
        }
        buflen = ( long ) strlen( buf );
-       if ( str_parse_line( buf, &type, &value, &len ) < 0 ) {
+       if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
            Debug( LDAP_DEBUG_ANY,
                    "Error: Re_parse: malformed replog file\n",
                    0, 0, 0 );
@@ -205,7 +206,7 @@ Re_parse(
     }
 
     for (;;) {
-       if (( buf = str_getline( &rp )) == NULL ) {
+       if (( buf = ldif_getline( &rp )) == NULL ) {
            break;
        }
        buflen = ( long ) strlen( buf );
@@ -213,7 +214,7 @@ Re_parse(
            type = "-";
            value = NULL;
        } else {
-           if ( str_parse_line( buf, &type, &value, &len ) < 0 ) {
+           if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
                Debug( LDAP_DEBUG_ANY,
                        "Error: malformed replog line \"%s\"\n",
                        buf, 0, 0 );
@@ -256,7 +257,7 @@ get_repl_hosts(
     char       **r_rp
 )
 {
-    char               buf[ LINE_WIDTH + 1 ];
+    char               buf[ LDIF_LINE_WIDTH + 1 ];
     char               *type, *value, *line, *p;
     Rh                 *rh = NULL;
     int                        nreplicas, len;
@@ -278,7 +279,7 @@ get_repl_hosts(
     for (;;) {
        /* If this is a reject log, we need to skip over the ERROR: line */
        if ( !strncmp( *r_rp, ERROR_STR, strlen( ERROR_STR ))) {
-           line = str_getline( r_rp );
+           line = ldif_getline( r_rp );
            if ( line == NULL ) {
                break;
            }
@@ -286,11 +287,11 @@ get_repl_hosts(
        if ( strncasecmp( *r_rp, "replica:", 7 )) {
            break;
        }
-       line = str_getline( r_rp );
+       line = ldif_getline( r_rp );
        if ( line == NULL ) {
            break;
        }
-       if ( str_parse_line( line, &type, &value, &len ) < 0 ) {
+       if ( ldif_parse_line( line, &type, &value, &len ) < 0 ) {
            return( NULL );
        }
        port = 0;
@@ -641,7 +642,7 @@ Re_lock(
     Re *re
 )
 {
-    return( pthread_mutex_lock( &re->re_mutex ));
+    return( ldap_pvt_thread_mutex_lock( &re->re_mutex ));
 }
 
 
@@ -655,7 +656,7 @@ Re_unlock(
     Re *re
 )
 {
-    return( pthread_mutex_unlock( &re->re_mutex ));
+    return( ldap_pvt_thread_mutex_unlock( &re->re_mutex ));
 }
 
 
@@ -696,7 +697,7 @@ Re_init(
    (*re)->re_mods = NULL;
    (*re)->re_next = NULL;
 
-   pthread_mutex_init( &((*re)->re_mutex), pthread_mutexattr_default );
+   ldap_pvt_thread_mutex_init( &((*re)->re_mutex) );
    return 0;
 }