Fix the mess with ldb includes.
[metze/samba/wip.git] / source4 / lib / ldb / tools / ldbdel.c
index 9e0f3a3fac9c4bcc08ca2f39202fd7aef3bb1ad1..232f51681a9fcfba431aab4cdbc1b31f3005440c 100644 (file)
@@ -18,8 +18,7 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
 /*
@@ -32,7 +31,7 @@
  *  Author: Andrew Tridgell
  */
 
-#include "ldb_includes.h"
+#include "ldb.h"
 #include "tools/cmdline.h"
 
 static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn)
@@ -41,7 +40,7 @@ static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn)
        const char *attrs[] = { NULL };
        struct ldb_result *res;
        
-       ret = ldb_search(ldb, dn, LDB_SCOPE_SUBTREE, "distinguishedName=*", attrs, &res);
+       ret = ldb_search(ldb, ldb, &res, dn, LDB_SCOPE_SUBTREE, attrs, "distinguishedName=*");
        if (ret != LDB_SUCCESS) return -1;
 
        for (i = 0; i < res->count; i++) {
@@ -78,9 +77,7 @@ int main(int argc, const char **argv)
        int ret = 0, i;
        struct ldb_cmdline *options;
 
-       ldb_global_init();
-
-       ldb = ldb_init(NULL);
+       ldb = ldb_init(NULL, NULL);
 
        options = ldb_cmdline_process(ldb, argc, argv, usage);