rename GNUNET_PQ_QueryStatus to GNUNET_DB_QueryStatus
[oweals/gnunet.git] / src / include / gnunet_db_lib.h
1 /*
2   This file is part of GNUnet
3   Copyright (C) 2017 GNUnet e.V.
4
5   GNUnet is free software; you can redistribute it and/or modify it under the
6   terms of the GNU General Public License as published by the Free Software
7   Foundation; either version 3, or (at your option) any later version.
8
9   GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY
10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12
13   You should have received a copy of the GNU General Public License along with
14   GNUnet; see the file COPYING.  If not, If not, see <http://www.gnu.org/licenses/>
15 */
16 /**
17  * @file include/gnunet_db_lib.h
18  * @brief shared defintions for transactional databases
19  * @author Christian Grothoff
20  */
21 #ifndef GNUNET_DB_LIB_H
22 #define GNUNET_DB_LIB_H
23
24
25 /**
26  * Status code returned from functions running database commands.
27  * Can be combined with a function that returns the number
28  * of results, so non-negative values indicate success.
29  */
30 enum GNUNET_DB_QueryStatus
31 {
32   /**
33    * A hard error occurred, retrying will not help.
34    */
35   GNUNET_DB_STATUS_HARD_ERROR = -2,
36
37   /**
38    * A soft error occurred, retrying the transaction may succeed.
39    */
40   GNUNET_DB_STATUS_SOFT_ERROR = -1,
41
42   /**
43    * The transaction succeeded, but yielded zero results.
44    */
45   GNUNET_DB_STATUS_SUCCESS_NO_RESULTS = 0,
46
47   /**
48    * The transaction succeeded, and yielded one result.
49    */
50   GNUNET_DB_STATUS_SUCCESS_ONE_RESULT = 1
51
52 };
53
54 #endif