GnuCash c935c2f+
Loading...
Searching...
No Matches
qofbackend.h
Go to the documentation of this file.
1/********************************************************************\
2 * qofbackend.h: api for data storage backend *
3 * This program is free software; you can redistribute it and/or *
4 * modify it under the terms of the GNU General Public License as *
5 * published by the Free Software Foundation; either version 2 of *
6 * the License, or (at your option) any later version. *
7 * *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU General Public License*
14 * along with this program; if not, contact: *
15 * *
16 * Free Software Foundation Voice: +1-617-542-5942 *
17 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
18 * Boston, MA 02110-1301, USA gnu@gnu.org *
19 * *
20\********************************************************************/
44#ifndef QOF_BACKEND_H
45#define QOF_BACKEND_H
46
47#include "qofinstance.h"
48#ifdef __cplusplus
49extern "C"
50{
51#endif
52
53#define QOF_MOD_BACKEND "qof.backend"
54
128
129typedef struct QofBackend QofBackend;
130
131 /* The following functions are used in C files. */
136
137/* Temporary wrapper so that we don't have to expose qof-backend.hpp to Transaction.c */
138 gboolean qof_backend_can_rollback (QofBackend*);
139 void qof_backend_rollback_instance (QofBackend*, QofInstance*);
140
150 gboolean
151 qof_load_backend_library(const gchar *directory, const gchar* module_name);
152
155
158
159 void qof_book_set_backend (QofBook *book, QofBackend *);
160
161
163typedef void (*QofBePercentageFunc) (/*@ null @*/ const char *message, double percent);
164
165#ifdef __cplusplus
166}
167#endif
168#endif /* QOF_BACKEND_H */
void qof_backend_set_error(QofBackend *, QofBackendError)
Set the error on the specified QofBackend.
QofBackendError
The errors that can be reported to the GUI & other front-end users.
Definition qofbackend.h:58
QofBackend * qof_book_get_backend(const QofBook *book)
Retrieve the backend used by this book.
Definition qofbook.cpp:440
QofBackendError qof_backend_get_error(QofBackend *)
Get the last backend error.
void(* QofBePercentageFunc)(const char *message, double percent)
DOCUMENT ME!
Definition qofbackend.h:163
gboolean qof_load_backend_library(const gchar *directory, const gchar *module_name)
Load a QOF-compatible backend shared library.
void qof_finalize_backend_libraries(void)
Finalize all loaded backend shareable libraries.
@ ERR_BACKEND_ALLOC
internal memory allocation failure
Definition qofbackend.h:72
@ ERR_BACKEND_MOD_DESTROY
commit of object update failed because another user has deleted the object
Definition qofbackend.h:77
@ ERR_RPC_CANT_ACCEPT
can't accept connection
Definition qofbackend.h:122
@ ERR_FILEIO_FILE_EACCES
No read access permission for the given file.
Definition qofbackend.h:100
@ ERR_SQL_DB_BUSY
database is busy, cannot upgrade version
Definition qofbackend.h:115
@ ERR_BACKEND_NO_SUCH_DB
the named database doesn't exist
Definition qofbackend.h:63
@ ERR_BACKEND_BAD_URL
Can't parse url.
Definition qofbackend.h:62
@ ERR_RPC_BAD_VERSION
RPC Version Mismatch.
Definition qofbackend.h:124
@ ERR_BACKEND_STORE_EXISTS
File exists, data would be destroyed.
Definition qofbackend.h:67
@ ERR_BACKEND_NO_HANDLER
no backend handler found for this access method (ENOSYS)
Definition qofbackend.h:60
@ ERR_BACKEND_LOCKED
in use by another user (ETXTBSY)
Definition qofbackend.h:66
@ ERR_FILEIO_WRITE_ERROR
couldn't write to the file
Definition qofbackend.h:97
@ ERR_NETIO_SHORT_READ
not enough bytes received
Definition qofbackend.h:107
@ ERR_SQL_MISSING_DATA
database doesn't contain expected data
Definition qofbackend.h:112
@ ERR_NETIO_WRONG_CONTENT_TYPE
wrong kind of server, wrong data served
Definition qofbackend.h:108
@ ERR_BACKEND_SERVER_ERR
error in response from server
Definition qofbackend.h:71
@ ERR_FILEIO_FILE_EMPTY
file exists, is readable, but is empty
Definition qofbackend.h:90
@ ERR_FILEIO_FILE_LOCKERR
mangled locks (unspecified error)
Definition qofbackend.h:91
@ ERR_BACKEND_NO_BACKEND
Backend * pointer was unexpectedly null.
Definition qofbackend.h:61
@ ERR_FILEIO_NO_ENCODING
file does not specify encoding
Definition qofbackend.h:99
@ ERR_BACKEND_DATA_CORRUPT
data in db is corrupt
Definition qofbackend.h:70
@ ERR_SQL_DB_TOO_OLD
database is old and needs upgrading
Definition qofbackend.h:113
@ ERR_RPC_HOST_UNK
Host unknown.
Definition qofbackend.h:120
@ ERR_SQL_DB_TOO_NEW
database is newer, we can't write to it
Definition qofbackend.h:114
@ ERR_BACKEND_CANT_CONNECT
bad dbname/login/passwd or network failure
Definition qofbackend.h:64
@ ERR_FILEIO_FILE_BAD_READ
read failed or file prematurely truncated
Definition qofbackend.h:89
@ ERR_BACKEND_MODIFIED
commit of object update failed because another user has modified the object
Definition qofbackend.h:75
@ ERR_FILEIO_READ_ERROR
Could not open the file for reading.
Definition qofbackend.h:98
@ ERR_FILEIO_FILE_UPGRADE
file will be upgraded and not be able to be read by prior versions - warn users
Definition qofbackend.h:103
@ ERR_RPC_NOT_ADDED
object not added
Definition qofbackend.h:126
@ ERR_FILEIO_UNKNOWN_FILE_TYPE
didn't recognize the file type
Definition qofbackend.h:94
@ ERR_SQL_DBI_UNTESTABLE
could not complete test for LibDBI bug
Definition qofbackend.h:117
@ ERR_NETIO_NOT_GNCXML
whatever it is, we can't parse it.
Definition qofbackend.h:109
@ ERR_BACKEND_MISC
undetermined error
Definition qofbackend.h:79
@ ERR_RPC_FAILED
Operation failed.
Definition qofbackend.h:125
@ ERR_FILEIO_BACKUP_ERROR
couldn't make a backup of the file
Definition qofbackend.h:96
@ ERR_BACKEND_TOO_NEW
file/db version newer than what we can read
Definition qofbackend.h:69
@ ERR_FILEIO_RESERVED_WRITE
User attempt to write to a directory reserved for internal use by GnuCash.
Definition qofbackend.h:101
@ ERR_FILEIO_PARSE_ERROR
couldn't parse the data in the file
Definition qofbackend.h:95
@ ERR_BACKEND_PERM
user login successful, but no permissions to access the desired object
Definition qofbackend.h:73
@ ERR_FILEIO_FILE_NOT_FOUND
not found / no such file
Definition qofbackend.h:92
@ ERR_RPC_NO_CONNECTION
no connection to server
Definition qofbackend.h:123
@ ERR_BACKEND_READONLY
cannot write to file/directory
Definition qofbackend.h:68
@ ERR_FILEIO_FILE_TOO_OLD
file version so old we can't read it
Definition qofbackend.h:93
@ ERR_BACKEND_CONN_LOST
Lost connection to server.
Definition qofbackend.h:65
@ ERR_QOF_OVERFLOW
EOVERFLOW - generated by strtol or strtoll.
Definition qofbackend.h:81
@ ERR_SQL_BAD_DBI
LibDBI has numeric errors.
Definition qofbackend.h:116
@ ERR_RPC_CANT_BIND
can't bind to address
Definition qofbackend.h:121
Object instance holds common fields that most gnucash objects use.
QofBook reference.
Definition qofbook-p.hpp:47