00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef QOF_QUERYCOREP_H
00025 #define QOF_QUERYCOREP_H
00026
00027 #include <sys/types.h>
00028 #include <time.h>
00029 #include <regex.h>
00030 #include <string.h>
00031
00032 #include "qofquerycore.h"
00033
00034
00035 void qof_query_core_init(void);
00036 void qof_query_core_shutdown (void);
00037
00038
00039
00040
00041
00042
00043
00044 typedef gint (*QofQueryPredicateFunc) (gpointer object,
00045 QofParam *getter,
00046 QofQueryPredData *pdata);
00047
00048
00049
00050
00051
00052 typedef gint (*QofCompareFunc) (gpointer a, gpointer b,
00053 gint compare_options,
00054 QofParam *getter);
00055
00056
00057 QofQueryPredicateFunc qof_query_core_get_predicate (gchar const *type);
00058 QofCompareFunc qof_query_core_get_compare (gchar const *type);
00059
00060
00061 gboolean qof_query_core_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2);
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 typedef struct {
00074 QofQueryPredData pd;
00075 QofStringMatch options;
00076 gboolean is_regex;
00077 gchar * matchstring;
00078 regex_t compiled;
00079 } query_string_def, *query_string_t;
00080
00081 typedef struct {
00082 QofQueryPredData pd;
00083 QofDateMatch options;
00084 Timespec date;
00085 } query_date_def, *query_date_t;
00086
00087 typedef struct {
00088 QofQueryPredData pd;
00089 QofNumericMatch options;
00090 gnc_numeric amount;
00091 } query_numeric_def, *query_numeric_t;
00092
00093 typedef struct {
00094 QofQueryPredData pd;
00095 QofGuidMatch options;
00096 GList * guids;
00097 } query_guid_def, *query_guid_t;
00098
00099 typedef struct {
00100 QofQueryPredData pd;
00101 gint32 val;
00102 } query_int32_def, *query_int32_t;
00103
00104 typedef struct {
00105 QofQueryPredData pd;
00106 gint64 val;
00107 } query_int64_def, *query_int64_t;
00108
00109 typedef struct {
00110 QofQueryPredData pd;
00111 double val;
00112 } query_double_def, *query_double_t;
00113
00114 typedef struct {
00115 QofQueryPredData pd;
00116 gboolean val;
00117 } query_boolean_def, *query_boolean_t;
00118
00119 typedef struct {
00120 QofQueryPredData pd;
00121 QofCharMatch options;
00122 gchar * char_list;
00123 } query_char_def, *query_char_t;
00124
00125 typedef struct {
00126 QofQueryPredData pd;
00127 GSList * path;
00128 KvpValue * value;
00129 } query_kvp_def, *query_kvp_t;
00130
00131 typedef struct {
00132 QofQueryPredData pd;
00133 QofGuidMatch options;
00134 QofCollection *coll;
00135 GList *guids;
00136 } query_coll_def, *query_coll_t;
00137
00138 typedef struct {
00139 QofQueryPredData pd;
00140 QofGuidMatch options;
00141 const GUID *guid;
00142 GList * guids;
00143 } query_choice_def, *query_choice_t;
00144
00145 #endif