GnuCash c935c2f+
Loading...
Searching...
No Matches
qofquerycore-p.h
1/********************************************************************\
2 * qofquerycore-p.h -- Private API for providing core Query data types *
3 * Copyright (C) 2002 Derek Atkins <warlord@MIT.EDU> *
4 * *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License as *
7 * published by the Free Software Foundation; either version 2 of *
8 * the License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License*
16 * along with this program; if not, contact: *
17 * *
18 * Free Software Foundation Voice: +1-617-542-5942 *
19 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20 * Boston, MA 02110-1301, USA gnu@gnu.org *
21 * *
22\********************************************************************/
23
24#ifndef QOF_QUERYCOREP_H
25#define QOF_QUERYCOREP_H
26
27#include <sys/types.h>
28#include <time.h>
29#include <regex.h>
30#include <string.h>
31
32#include "qofquerycore.h"
33
34/* Initialize the Query Core registry and install the default type handlers */
35void qof_query_core_init(void);
36void qof_query_core_shutdown (void);
37
38/*
39 * An arbitrary Query Predicate. Given the object and the
40 * particular parameter get-function (obtained from the registry by
41 * the Query internals), compare the object's parameter to the
42 * predicate data.
43 */
44typedef gint (*QofQueryPredicateFunc) (gpointer object,
45 QofParam *getter,
46 QofQueryPredData *pdata);
47
48/* Lookup functions */
49QofQueryPredicateFunc qof_query_core_get_predicate (gchar const *type);
50QofCompareFunc qof_query_core_get_compare (gchar const *type);
51
52/* Compare two predicates */
53gboolean qof_query_core_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2);
54
55/* Predicate Data Structures:
56 *
57 * These are defined such that you can cast between these types and
58 * a QofQueryPredData.
59 *
60 * Note that these are provided for READ ONLY PURPOSES. You should NEVER
61 * write into these structures, change them, or use them to create a
62 * Query.
63 */
64
65typedef struct
66{
67 QofQueryPredData pd;
68 QofStringMatch options;
69 gboolean is_regex;
70 gchar * matchstring;
71 regex_t compiled;
73
74typedef struct
75{
76 QofQueryPredData pd;
77 QofDateMatch options;
78 time64 date;
80
81typedef struct
82{
83 QofQueryPredData pd;
84 QofNumericMatch options;
85 gnc_numeric amount;
87
88typedef struct
89{
90 QofQueryPredData pd;
91 QofGuidMatch options;
92 GList * guids;
94
95typedef struct
96{
97 QofQueryPredData pd;
98 gint32 val;
100
101typedef struct
102{
103 QofQueryPredData pd;
104 gint64 val;
106
107typedef struct
108{
109 QofQueryPredData pd;
110 double val;
112
113typedef struct
114{
115 QofQueryPredData pd;
116 gboolean val;
118
119typedef struct
120{
121 QofQueryPredData pd;
122 QofCharMatch options;
123 gchar * char_list;
125
126typedef struct
127{
128 QofQueryPredData pd;
129 GSList * path;
130 KvpValue * value;
132
133typedef struct
134{
135 QofQueryPredData pd;
136 QofGuidMatch options;
137 QofCollection *coll;
138 GList *guids;
140
141typedef struct
142{
143 QofQueryPredData pd;
144 QofGuidMatch options;
145 const GncGUID *guid;
146 GList * guids;
148
149#endif /* QOF_QUERYCOREP_H */
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition gnc-date.h:87
QofNumericMatch
Comparisons for QOF_TYPE_NUMERIC, QOF_TYPE_DEBCRED.
QofDateMatch
Comparisons for QOF_TYPE_DATE The QOF_DATE_MATCH_DAY comparison rounds the two time values to mid-day...
QofCharMatch
A CHAR type is for a RECNCell, Comparisons for QOF_TYPE_CHAR 'ANY' will match any character in the st...
QofGuidMatch
QofStringMatch
List of known core query data-types... Each core query type defines it's set of optional "comparator ...
API for providing core Query data types.
The type used to store guids in C.
Definition guid.h:75