From 377666075f7eb5ee07e0c76ed18ce417f7491150 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Mon, 17 Dec 2012 12:28:19 +0100 Subject: database: make export() GObject-like --- libmsi/libmsi-database.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libmsi') diff --git a/libmsi/libmsi-database.c b/libmsi/libmsi-database.c index de1456a..33e0702 100644 --- a/libmsi/libmsi-database.c +++ b/libmsi/libmsi-database.c @@ -1333,8 +1333,11 @@ done: * * row4 : data data data ... data */ -LibmsiResult libmsi_database_export( LibmsiDatabase *db, const char *szTable, - int fd ) +gboolean +libmsi_database_export (LibmsiDatabase *db, + const char *table, + int fd, + GError **error) { unsigned r = LIBMSI_RESULT_OUTOFMEMORY; @@ -1344,9 +1347,13 @@ LibmsiResult libmsi_database_export( LibmsiDatabase *db, const char *szTable, return LIBMSI_RESULT_INVALID_HANDLE; g_object_ref(db); - r = _libmsi_database_export( db, szTable, fd ); + r = _libmsi_database_export(db, table, fd); g_object_unref(db); - return r; + + if (r != LIBMSI_RESULT_SUCCESS) + g_set_error (error, LIBMSI_RESULT_ERROR, r, G_STRFUNC); + + return r == LIBMSI_RESULT_SUCCESS; } typedef struct _tagMERGETABLE -- cgit