QOF  0.8.7
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 
158 qof_error_register (const gchar * err_message, gboolean use_file);
159 
167 void
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 
198 
201 qof_error_check (QofSession * session);
202 
213 QofTime *
215 
217 QofTime *
218 qof_error_get_time (QofSession * session);
219 
232 
235 qof_error_get_id (QofSession * session);
236 
247 const gchar *
249 
251 const gchar *
253 
255 #endif /* _QOFERROR_H */
QofErrorId qof_error_register(const gchar *err_message, gboolean use_file)
Generate and register a new error.
Definition: qoferror.c:73
QofTime * qof_error_get_time(QofSession *session)
Alternative for applications.
Definition: qoferror.c:234
Encapsulates a connection to a backend (persistent store)
QofErrorId qof_error_check(QofSession *session)
Definition: qoferror.c:197
gint32 QofErrorId
The ID of this error.
Definition: qofbackend.h:54
QofErrorId qof_error_check_be(QofBackend *be)
Check for errors.
Definition: qoferror.c:204
QofTime * qof_error_get_time_be(QofBackend *be)
Get the time of the most recent error.
Definition: qoferror.c:221
const gchar * qof_error_get_message(QofSession *session)
Alternative for applications.
Definition: qoferror.c:285
void qof_error_set(QofSession *session, QofErrorId error)
Add an error to the stack for this session.
Definition: qoferror.c:112
struct QofError_s QofError
Definition: qoferror.h:118
QofErrorId qof_error_get_id(QofSession *session)
Alternative for applications.
Definition: qoferror.c:240
struct QofTime64 QofTime
Use a 64-bit signed int QofTime.
Definition: qoftime.h:112
void qof_error_clear(QofSession *session)
clear the error stack for the session.
Definition: qoferror.c:182
void qof_error_unregister(QofErrorId id)
Unregister an error.
Definition: qoferror.c:96
const gchar * qof_error_get_message_be(QofBackend *be)
Pop the most recent error and get the message.
Definition: qoferror.c:298
QofErrorId qof_error_get_id_be(QofBackend *be)
Pop the most recent error from the backend stack.
Definition: qoferror.c:266