[msitools] Fix database_new() usage after API change



commit e9cf5c17fe55779628503718139f3048b6eab5d2
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Thu Jan 17 19:41:54 2013 +0100

    Fix database_new() usage after API change

 tests/testdatabase.c  |   98 ++++++++++++++++++++++++------------------------
 tests/testrecord.c    |    2 +-
 tools/msibuild.c      |    4 +-
 tools/msiextract.vala |    2 +-
 tools/msiinfo.c       |   10 ++--
 tools/wixl/msi.vala   |    2 +-
 6 files changed, 59 insertions(+), 59 deletions(-)
---
diff --git a/tests/testdatabase.c b/tests/testdatabase.c
index c7f4e62..30c4d54 100644
--- a/tests/testdatabase.c
+++ b/tests/testdatabase.c
@@ -59,11 +59,11 @@ static void test_msidatabase(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new( msifile, msifile2, NULL);
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_TRANSACT, msifile2, NULL);
     ok(!hdb, "expected failure\n");
 
     /* create an empty database */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL );
     ok(hdb , "Failed to create database\n" );
 
     res = libmsi_database_commit(hdb, NULL);
@@ -73,7 +73,7 @@ static void test_msidatabase(void)
 
     g_object_unref( hdb );
 
-    hdb2 = libmsi_database_new( msifile, msifile2, NULL );
+    hdb2 = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_TRANSACT, msifile2, NULL );
     ok(hdb2 , "Failed to open database\n" );
 
     res = libmsi_database_commit(hdb2, NULL);
@@ -83,14 +83,14 @@ static void test_msidatabase(void)
 
     g_object_unref( hdb2 );
 
-    hdb2 = libmsi_database_new( msifile, msifile2, NULL );
+    hdb2 = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_TRANSACT, msifile2, NULL );
     ok( hdb2 , "Failed to open database\n" );
 
     g_object_unref( hdb2 );
 
     ok( -1 == access( msifile2, F_OK ), "uncommitted database should not exist\n");
 
-    hdb2 = libmsi_database_new( msifile, msifile2, NULL );
+    hdb2 = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_TRANSACT, msifile2, NULL );
     ok( hdb2 , "Failed to close database\n" );
 
     res = libmsi_database_commit(hdb2, NULL);
@@ -100,7 +100,7 @@ static void test_msidatabase(void)
 
     ok( -1 != access( msifile2, F_OK ), "committed database should exist\n");
 
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_READONLY, NULL );
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_READONLY, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     res = libmsi_database_commit(hdb, NULL);
@@ -108,7 +108,7 @@ static void test_msidatabase(void)
 
     g_object_unref( hdb );
 
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_TRANSACT, NULL );
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     g_object_unref( hdb );
@@ -116,15 +116,15 @@ static void test_msidatabase(void)
 
     unlink( msifile );
 
-    /* LIBMSI_DB_OPEN_CREATE deletes the database if MsiCommitDatabase isn't called */
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_CREATE, NULL );
+    /* LIBMSI_DB_FLAGS_CREATE deletes the database if MsiCommitDatabase isn't called */
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     g_object_unref( hdb );
 
     ok( -1 == access( msifile, F_OK ), "database should not exist\n");
 
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_CREATE, NULL );
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     res = libmsi_database_commit(hdb, NULL);
@@ -312,7 +312,7 @@ static void test_msiinsert(void)
     unlink(msifile);
 
     /* just libmsi_database_open should not create a file */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_new failed\n");
 
     /* create a table */
@@ -491,7 +491,7 @@ static void test_msibadqueries(void)
     unlink(msifile);
 
     /* just libmsi_database_open should not create a file */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     r = libmsi_database_commit(hdb, NULL);
@@ -500,7 +500,7 @@ static void test_msibadqueries(void)
     g_object_unref( hdb );
 
     /* open it readonly */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_READONLY, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_READONLY, NULL, NULL );
     ok(hdb , "Failed to open database r/o\n");
 
     /* add a table to it */
@@ -510,7 +510,7 @@ static void test_msibadqueries(void)
     g_object_unref( hdb );
 
     /* open it read/write */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL );
     ok(hdb , "Failed to open database r/w\n");
 
     /* a bunch of test queries that fail with the native MSI */
@@ -707,7 +707,7 @@ static LibmsiDatabase *create_db(void)
     unlink(msifile);
 
     /* create an empty database */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL );
     ok(hdb , "Failed to create database\n" );
 
     res = libmsi_database_commit(hdb, NULL);
@@ -954,7 +954,7 @@ static void test_msiexport(void)
     unlink(msifile);
 
     /* just libmsi_database_open should not create a file */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     /* create a table */
@@ -1022,7 +1022,7 @@ static void test_longstrings(void)
 
     unlink(msifile);
     /* just libmsi_database_open should not create a file */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     /* create a table */
@@ -1043,7 +1043,7 @@ static void test_longstrings(void)
     ok(r, "libmsi_database_commit failed\n");
     g_object_unref(hdb);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_READONLY, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_READONLY, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     hquery = libmsi_query_new(hdb, "select * from `strings` where `id` = 1", NULL);
@@ -1116,7 +1116,7 @@ static void test_streamtable(void)
 
     g_object_unref( hdb );
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     /* check the column types */
@@ -1342,7 +1342,7 @@ static void test_binary(void)
     unsigned r;
 
     /* insert a file into the Binary table */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     sql = "CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT  PRIMARY KEY `Name`, `ID`)";
@@ -1367,7 +1367,7 @@ static void test_binary(void)
     g_object_unref( hdb );
 
     /* read file from the Stream table */
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_READONLY, NULL );
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_READONLY, NULL, NULL );
     ok(hdb , "Failed to open database\n" );
 
     sql = "SELECT * FROM `_Streams`";
@@ -1726,7 +1726,7 @@ static void test_suminfo_import(void)
     int int_value;
     guint64 ft_value;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %u\n", r);
 
     r = add_table_to_db(hdb, suminfo);
@@ -1818,7 +1818,7 @@ static void test_msiimport(void)
     unsigned r, count;
     signed int i;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     r = add_table_to_db(hdb, test_data);
@@ -2038,7 +2038,7 @@ static void test_binary_import(void)
     create_file_data("Binary/filename1.ibd", "just some words", 15);
 
     /* import files into database */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb , "Failed to open database\n");
 
     r = libmsi_database_import(hdb, "bin_import.idt", NULL);
@@ -2463,7 +2463,7 @@ static LibmsiDatabase *create_package_db(const char *filename)
     unlink(msifile);
 
     /* create an empty database */
-    hdb = libmsi_database_new(filename, LIBMSI_DB_OPEN_CREATE, NULL );
+    hdb = libmsi_database_new(filename, LIBMSI_DB_FLAGS_CREATE, NULL, NULL );
     ok(hdb , "Failed to create database\n" );
 
     res = libmsi_database_commit(hdb, NULL);
@@ -2538,7 +2538,7 @@ static void test_try_transform(void)
 
     generate_transform_manual();
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, NULL );
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL );
     ok(hdb , "Failed to create database\n" );
 
     r = libmsi_database_apply_transform(hdb, mstfile, NULL);
@@ -3650,7 +3650,7 @@ static void test_integers(void)
     unsigned r;
 
     /* just libmsi_database_open should not create a file */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     /* create a table */
@@ -3778,7 +3778,7 @@ static void test_update(void)
     unsigned r;
 
     /* just libmsi_database_open should not create a file */
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     /* create the Control table */
@@ -4054,7 +4054,7 @@ static void test_special_tables(void)
     LibmsiDatabase *hdb = 0;
     unsigned r;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     sql = "CREATE TABLE `_Properties` ( "
@@ -4096,7 +4096,7 @@ static void test_tables_order(void)
     char buffer[100];
     unsigned sz;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     sql = "CREATE TABLE `foo` ( "
@@ -4203,7 +4203,7 @@ static void test_rows_order(void)
     char buffer[100];
     unsigned sz;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     sql = "CREATE TABLE `foo` ( "
@@ -4326,7 +4326,7 @@ static void test_collation(void)
     unsigned sz;
     gchar *str;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "libmsi_database_open failed\n");
 
     sql = "CREATE TABLE `bar` ( "
@@ -4599,7 +4599,7 @@ static void test_stringtable(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "CREATE TABLE `MOO` (`A` INT, `B` CHAR(72) PRIMARY KEY `A`)";
@@ -4640,7 +4640,7 @@ static void test_stringtable(void)
 
     g_object_unref(hdb);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_READONLY, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_READONLY, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "SELECT * FROM `MOO`";
@@ -4867,7 +4867,7 @@ static void test_defaultdatabase(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     r = libmsi_database_commit(hdb);
@@ -5151,7 +5151,7 @@ static void test_deleterow(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "CREATE TABLE `Table` ( `A` CHAR(72) NOT NULL PRIMARY KEY `A` )";
@@ -5175,7 +5175,7 @@ static void test_deleterow(void)
 
     g_object_unref(hdb);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_READONLY, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_READONLY, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "SELECT * FROM `Table`";
@@ -5216,7 +5216,7 @@ static void test_quotes(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "CREATE TABLE `Table` ( `A` CHAR(72) NOT NULL PRIMARY KEY `A` )";
@@ -5314,7 +5314,7 @@ static void test_carriagereturn(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "CREATE TABLE `Table`\r ( `A` CHAR(72) NOT NULL PRIMARY KEY `A` )";
@@ -5489,7 +5489,7 @@ static void test_noquotes(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "CREATE TABLE Table ( `A` CHAR(72) NOT NULL PRIMARY KEY `A` )";
@@ -5657,7 +5657,7 @@ static void test_forcecodepage(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "SELECT * FROM `_ForceCodepage`";
@@ -5681,7 +5681,7 @@ static void test_forcecodepage(void)
 
     g_object_unref(hdb);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "SELECT * FROM `_ForceCodepage`";
@@ -5782,7 +5782,7 @@ static void test_storages_table(void)
 
     g_object_unref(hdb);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL);
     ok(hdb , "Failed to open database\n");
 
     /* check the column types */
@@ -5888,7 +5888,7 @@ static void test_droptable(void)
     unsigned r;
     GError *error = NULL;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     sql = "CREATE TABLE `One` ( `A` INT PRIMARY KEY `A` )";
@@ -6080,10 +6080,10 @@ static void test_dbmerge(void)
     unsigned size;
     unsigned r;
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
-    href = libmsi_database_new("refdb.msi", LIBMSI_DB_OPEN_CREATE, NULL);
+    href = libmsi_database_new("refdb.msi", LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(href, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", r);
 
     /* szTableName is NULL */
@@ -7223,7 +7223,7 @@ static void test_createtable(void)
 
         g_object_unref(hdb);
 
-        hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, NULL);
+        hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, NULL);
         ok(hdb, "Expected LIBMSI_RESULT_SUCCESS, got %d\n", res);
 
         sql = "SELECT * FROM `a`";
@@ -7263,7 +7263,7 @@ static void test_embedded_nulls(void)
     char buffer[32];
     gchar *str;
 
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "failed to open database %u\n", r );
 
     write_file( "temp_file", control_table, sizeof(control_table) );
@@ -7295,7 +7295,7 @@ static void test_select_column_names(void)
 
     unlink(msifile);
 
-    hdb = libmsi_database_new( msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new( msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok(hdb, "failed to open database: %u\n", r );
 
     r = try_query( hdb, "CREATE TABLE `t` (`a` CHAR NOT NULL, `b` CHAR PRIMARY KEY `a`)");
diff --git a/tests/testrecord.c b/tests/testrecord.c
index 286c791..1542204 100644
--- a/tests/testrecord.c
+++ b/tests/testrecord.c
@@ -374,7 +374,7 @@ static void test_fieldzero (void)
 
     g_object_unref (rec);
 
-    hdb = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, NULL);
+    hdb = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, NULL);
     ok (hdb, "libmsi_database_open failed\n");
 
     query = "CREATE TABLE `drone` ( "
diff --git a/tools/msibuild.c b/tools/msibuild.c
index d9031c3..e4a7b1f 100644
--- a/tools/msibuild.c
+++ b/tools/msibuild.c
@@ -83,7 +83,7 @@ static gboolean open_database(const char *msifile, LibmsiDatabase **db,
 
     if (stat(msifile, &st) == -1)
     {
-        *db = libmsi_database_new(msifile, LIBMSI_DB_OPEN_CREATE, error);
+        *db = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_CREATE, NULL, error);
         if (!*db)
             goto end;
 
@@ -109,7 +109,7 @@ static gboolean open_database(const char *msifile, LibmsiDatabase **db,
     }
     else
     {
-        *db = libmsi_database_new(msifile, LIBMSI_DB_OPEN_TRANSACT, error);
+        *db = libmsi_database_new(msifile, LIBMSI_DB_FLAGS_TRANSACT, NULL, error);
         if (!*db)
             goto end;
     }
diff --git a/tools/msiextract.vala b/tools/msiextract.vala
index ba9b21a..18f526b 100644
--- a/tools/msiextract.vala
+++ b/tools/msiextract.vala
@@ -65,7 +65,7 @@ public int main (string[] args) {
 
     Libmsi.Database? db = null;
     try {
-        db = new Libmsi.Database (files[0], null);
+        db = new Libmsi.Database (files[0], Libmsi.DbFlags.READONLY, null);
     } catch (GLib.Error error) {
         GLib.stderr.printf (error.message);
         exit (1);
diff --git a/tools/msiinfo.c b/tools/msiinfo.c
index e6235dc..4dcaeca 100644
--- a/tools/msiinfo.c
+++ b/tools/msiinfo.c
@@ -196,7 +196,7 @@ static int cmd_streams(struct Command *cmd, int argc, char **argv, GError **erro
         cmd_usage(stderr, cmd);
     }
 
-    db = libmsi_database_new(argv[1], LIBMSI_DB_OPEN_READONLY, error);
+    db = libmsi_database_new(argv[1], LIBMSI_DB_FLAGS_READONLY, NULL, error);
     if (!db)
         goto end;
 
@@ -230,7 +230,7 @@ static int cmd_tables(struct Command *cmd, int argc, char **argv, GError **error
         cmd_usage(stderr, cmd);
     }
 
-    db = libmsi_database_new(argv[1], LIBMSI_DB_OPEN_READONLY, error);
+    db = libmsi_database_new(argv[1], LIBMSI_DB_FLAGS_READONLY, NULL, error);
     if (!db)
         goto end;
 
@@ -319,7 +319,7 @@ static int cmd_suminfo(struct Command *cmd, int argc, char **argv, GError **erro
         cmd_usage(stderr, cmd);
     }
 
-    db = libmsi_database_new(argv[1], LIBMSI_DB_OPEN_READONLY, error);
+    db = libmsi_database_new(argv[1], LIBMSI_DB_FLAGS_READONLY, NULL, error);
     if (!db)
         goto end;
 
@@ -383,7 +383,7 @@ static int cmd_extract(struct Command *cmd, int argc, char **argv, GError **erro
         cmd_usage(stderr, cmd);
     }
 
-    db = libmsi_database_new(argv[1], LIBMSI_DB_OPEN_READONLY, error);
+    db = libmsi_database_new(argv[1], LIBMSI_DB_FLAGS_READONLY, NULL, error);
     if (!db)
         goto end;
 
@@ -670,7 +670,7 @@ static int cmd_export(struct Command *cmd, int argc, char **argv, GError **error
         cmd_usage(stderr, cmd);
     }
 
-    db = libmsi_database_new(argv[1], LIBMSI_DB_OPEN_READONLY, error);
+    db = libmsi_database_new(argv[1], LIBMSI_DB_FLAGS_READONLY, NULL, error);
     if (!db)
         return 1;
 
diff --git a/tools/wixl/msi.vala b/tools/wixl/msi.vala
index 15092c5..2e3a7a4 100644
--- a/tools/wixl/msi.vala
+++ b/tools/wixl/msi.vala
@@ -664,7 +664,7 @@ namespace Wixl {
             string name;
             MsiTable table;
 
-            var db = new Libmsi.Database (filename, (string)2);
+            var db = new Libmsi.Database (filename, Libmsi.DbFlags.CREATE, null);
             info.save (db);
 
             var it = HashTableIter <string, MsiTable> (tables);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]