From 6844ba662e2ebfc0d08408fdd3d3b853a4320eca Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Thu, 17 Jan 2013 19:10:21 +0100 Subject: libmsi: simplify LibmsiDatabase, use flags --- include/libmsi-database.h | 1 + include/libmsi-types.h | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libmsi-database.h b/include/libmsi-database.h index 756270e..cceb306 100644 --- a/include/libmsi-database.h +++ b/include/libmsi-database.h @@ -43,6 +43,7 @@ GType libmsi_database_get_type (void) G_GNUC_CONST; LibmsiDatabase * libmsi_database_new (const gchar *path, + guint flags, const char *persist, GError **error); diff --git a/include/libmsi-types.h b/include/libmsi-types.h index 73edcf4..58eefe0 100644 --- a/include/libmsi-types.h +++ b/include/libmsi-types.h @@ -74,11 +74,13 @@ typedef enum LibmsiColInfo LIBMSI_COL_INFO_TYPES = 1 } LibmsiColInfo; -#define LIBMSI_DB_OPEN_READONLY (const char *)0 -#define LIBMSI_DB_OPEN_TRANSACT (const char *)1 -#define LIBMSI_DB_OPEN_CREATE (const char *)2 - -#define LIBMSI_DB_OPEN_PATCHFILE 32 / sizeof(*LIBMSI_DB_OPEN_READONLY) +typedef enum LibmsiDbFlags +{ + LIBMSI_DB_FLAGS_READONLY = 1 << 0, + LIBMSI_DB_FLAGS_CREATE = 1 << 1, + LIBMSI_DB_FLAGS_TRANSACT = 1 << 2, + LIBMSI_DB_FLAGS_PATCH = 1 << 3, +} LibmsiDbFlags; typedef enum LibmsiDBError { -- cgit