3 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include <ac/stdlib.h>
13 #include <ac/string.h>
14 #include <ac/socket.h>
15 #include <ac/unistd.h>
17 #include "slapcommon.h"
20 main( int argc, char **argv )
23 int rc = EXIT_SUCCESS;
25 slap_tool_init( "slapindex", SLAPINDEX, argc, argv );
27 if( !be->be_entry_open ||
28 !be->be_entry_close ||
29 !be->be_entry_first ||
31 !be->be_entry_reindex )
33 fprintf( stderr, "%s: database doesn't support necessary operations.\n",
38 if( be->be_entry_open( be, 0 ) != 0 ) {
39 fprintf( stderr, "%s: could not open database.\n",
44 for ( id = be->be_entry_first( be );
46 id = be->be_entry_next( be ) )
51 printf("indexing id=%08lx\n", (long) id );
54 rtn = be->be_entry_reindex( be, id );
56 if( rtn != LDAP_SUCCESS ) {
58 if( continuemode ) continue;
63 (void) be->be_entry_close( be );