Fix the mess with ldb includes.
[metze/samba/wip.git] / source4 / lib / ldb / examples / ldbreader.c
index 766e161543aeb9223992787a4759f9ca7971e9d2..3496baf4ce29c1f5f52b44d5959108d5c25b4799 100644 (file)
@@ -18,9 +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., 51 Franklin Street, Fifth Floor, 
-   Boston, MA  02110-1301  USA
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
 /** \example ldbreader.c
@@ -31,9 +29,7 @@ It lists / dumps the records in a LDB database to standard output.
 
 */
 
-#include "ldb_includes.h"
 #include "ldb.h"
-#include "ldb_errors.h"
 
 /*
   ldb_ldif_write takes a function pointer to a custom output
@@ -69,7 +65,7 @@ int main(int argc, const char **argv)
          Note that you can use the context structure as a parent
          for talloc allocations as well
        */
-       ldb = ldb_init(NULL);
+       ldb = ldb_init(NULL, NULL);
 
        /*
          We now open the database. In this example we just hard code the connection path.
@@ -90,8 +86,9 @@ int main(int argc, const char **argv)
          quite fine grained results with the LDAP search syntax, however it is a bit
          confusing to start with. See RFC2254.
        */
-       if (LDB_SUCCESS != ldb_search(ldb, NULL, LDB_SCOPE_DEFAULT,
-                                     expression, NULL, &resultMsg) ) {
+       if (LDB_SUCCESS != ldb_search(ldb, ldb, &resultMsg,
+                                     NULL, LDB_SCOPE_DEFAULT, NULL,
+                                     "%s", expression)) {
                printf("Problem in search\n");
                exit(-1);
        }