]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldapsearch.c
Update for new password codes for MSVC5
[openldap] / clients / tools / ldapsearch.c
index 6a3a90d51156ed221279ebad588a0d38314ad6b6..6a66a80ad16f96c7e421d2075dcdb92317580252 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 #include <ac/string.h>
 #include <ac/unistd.h>
 
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
 #include <ldap.h>
 
 #include "ldif.h"
@@ -21,7 +26,7 @@
 #define DEFSEP         "="
 
 static void
-usage( char *s )
+usage( const char *s )
 {
        fprintf( stderr,
 "usage: %s [options] filter [attributes...]\nwhere:\n"
@@ -339,7 +344,8 @@ main( int argc, char **argv )
 #endif
 
        if ( verbose ) {
-               fprintf( stderr, "ldap_init( %s, %d )\n",
+               fprintf( stderr,
+                       (ldapport ? "ldap_init( %s, %d )\n" : "ldap_init( %s, <DEFAULT> )\n"),
                        (ldaphost != NULL) ? ldaphost : "<DEFAULT>",
                        ldapport );
        }
@@ -560,7 +566,8 @@ static int dosearch(
 }
 
 
-void print_entry(
+static void
+print_entry(
        LDAP    *ld,
        LDAPMessage     *entry,
        int             attrsonly)
@@ -665,7 +672,6 @@ void print_entry(
                                                                bvals[i]->bv_len ); 
                                                printf( "%s%s", a, sep );
                                                puts( notprint ? "NOT PRINTABLE" : bvals[ i ]->bv_val );
-                                               puts( "\n" );
                                        }
                                }
                        }
@@ -679,7 +685,7 @@ void print_entry(
 }
 
 
-int
+static int
 write_ldif( int type, char *name, char *value, ber_len_t vallen )
 {
        char    *ldif;