QOF: qoferror.h Source File

QOF 0.7.5

qoferror.h
Go to the documentation of this file.
1 /********************************************************************
2 * qoferror.h
3 *
4 * Sun Sep 10 19:55:48 2006
5 * Copyright 2006 Neil Williams
6 * linux@codehelp.co.uk
7 *******************************************************************/
8 /*
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23
24 #ifndef _QOFERROR_H
25 #define _QOFERROR_H
26
27 #include "qofsession.h"
28
118 typedef struct QofError_s QofError;
119
121 #define QOF_MOD_ERROR "qof-error-module"
122
124 #define QOF_SUCCESS 0
125
131 #define QOF_FATAL -1
132
157 QofErrorId
158 qof_error_register (const gchar * err_message, gboolean use_file);
159
167 void
168 qof_error_unregister (QofErrorId id);
169
175 void
176 qof_error_set (QofSession * session, QofErrorId error);
177
178 void
179 qof_error_set_be (QofBackend * be, QofErrorId error);
180
186 void
187 qof_error_clear (QofSession * session);
188
196 QofErrorId
197 qof_error_check_be (QofBackend * be);
198
200 QofErrorId
201 qof_error_check (QofSession * session);
202
213 QofTime *
214 qof_error_get_time_be (QofBackend * be);
215
217 QofTime *
218 qof_error_get_time (QofSession * session);
219
230 QofErrorId
231 qof_error_get_id_be (QofBackend * be);
232
234 QofErrorId
235 qof_error_get_id (QofSession * session);
236
247 const gchar *
248 qof_error_get_message_be (QofBackend * be);
249
251 const gchar *
252 qof_error_get_message (QofSession * session);
253
255 #endif /* _QOFERROR_H */
qof_error_register
QofErrorId qof_error_register(const gchar *err_message, gboolean use_file)
Generate and register a new error.
Definition: qoferror.c:91
qof_error_get_time
QofTime * qof_error_get_time(QofSession *session)
Alternative for applications.
Definition: qoferror.c:264
qofsession.h
Encapsulates a connection to a backend (persistent store)
_QofSession
Definition: qofsession-p.h:35
qof_error_check
QofErrorId qof_error_check(QofSession *session)
Definition: qoferror.c:227
QofErrorId
gint32 QofErrorId
The ID of this error.
Definition: qofbackend.h:54
qof_error_check_be
QofErrorId qof_error_check_be(QofBackend *be)
Check for errors.
Definition: qoferror.c:234
qof_error_get_time_be
QofTime * qof_error_get_time_be(QofBackend *be)
Get the time of the most recent error.
Definition: qoferror.c:251
qof_error_get_message
const gchar * qof_error_get_message(QofSession *session)
Alternative for applications.
Definition: qoferror.c:336
qof_error_set
void qof_error_set(QofSession *session, QofErrorId error)
Add an error to the stack for this session.
Definition: qoferror.c:133
QofError
struct QofError_s QofError
Definition: qoferror.h:118
qof_error_get_id
QofErrorId qof_error_get_id(QofSession *session)
Alternative for applications.
Definition: qoferror.c:288
QofTime
struct QofTime64 QofTime
Use a 64-bit signed int QofTime.
Definition: qoftime.h:120
qof_error_clear
void qof_error_clear(QofSession *session)
clear the error stack for the session.
Definition: qoferror.c:209
qof_error_unregister
void qof_error_unregister(QofErrorId id)
Unregister an error.
Definition: qoferror.c:117
qof_error_get_message_be
const gchar * qof_error_get_message_be(QofBackend *be)
Pop the most recent error and get the message.
Definition: qoferror.c:364
QofBackend_s
Definition: qofbackend-p.h:283
qof_error_get_id_be
QofErrorId qof_error_get_id_be(QofBackend *be)
Pop the most recent error from the backend stack.
Definition: qoferror.c:314