00001 #ifndef __PR_QUERY_H
00002 #define __PR_QUERY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00063 #include <glib.h>
00064 #include <libpq-fe.h>
00065
00066
00067
00068
00069
00070
00071 #undef __BEGIN_DECLS
00072 #undef __END_DECLS
00073 #ifdef __cplusplus
00074 # define __BEGIN_DECLS extern "C" {
00075 # define __END_DECLS }
00076 #else
00077 # define __BEGIN_DECLS
00078 # define __END_DECLS
00079 #endif
00080
00081
00082
00083
00084
00085
00086 #undef __P
00087 #if defined (__STDC__) || defined (_AIX) \
00088 || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
00089 || defined(WIN32) || defined(__cplusplus)
00090 # define __P(protos) protos
00091 #else
00092 # define __P(protos) ()
00093 #endif
00094
00141 #define PROJECT_NAME_POS 0
00142 #define STATUS_NAME_POS 1
00143 #define PROBLEM_TYPE_NAME_POS 2
00144 #define SEVERITY_NAME_POS 3
00145 #define PR_TITLE_POS 4
00146 #define STATUS_ORDER_POS 5
00147 #define SEVERITY_ORDER_POS 6
00148 #define PR_NUMBER_POS 7
00149 #define SUBMITTER_POS 8
00150 #define RESPONSIBLE_POS 9
00151 #define CREATION_DATE_POS 10
00152
00153 __BEGIN_DECLS
00161 typedef struct pr_query_struct pr_query_struct;
00162
00187 pr_query_struct *create_pr_query __P((gchar *user_id));
00188
00189
00216 pr_query_struct *create_pr_query_from_table __P((PGconn *conn,
00217 const gchar *user_id,
00218 gint query_pk));
00219
00220
00255 pr_query_struct *create_pr_query_from_table_li __P((const gchar *conn_str,
00256 const gchar *user_id,
00257 gint query_pk));
00258
00259
00269 void destroy_pr_query __P((pr_query_struct *pr_query));
00270
00271
00285 void add_project_restriction __P((pr_query_struct *q, gint pk));
00286
00287
00299 void clear_project_restrictions __P((pr_query_struct *q));
00300
00301
00315 void add_severity_restriction __P((pr_query_struct *q, gint pk));
00316
00317
00325 void clear_severity_restrictions __P((pr_query_struct *q));
00326
00327
00341 void add_status_restriction __P((pr_query_struct *q, gint pk));
00342
00343
00351 void clear_status_restrictions __P((pr_query_struct *q));
00352
00353
00367 void add_problem_type_restriction __P((pr_query_struct *q, gint pk));
00368
00369
00376 void clear_problem_type_restrictions __P((pr_query_struct *q));
00377
00378
00392 void add_submitter_restriction __P((pr_query_struct *q, gchar *id));
00393
00394
00402 void clear_submitter_restrictions __P((pr_query_struct *q));
00403
00404
00419 void add_responsible_restriction __P((pr_query_struct *q, gchar *id));
00420
00421
00429 void clear_responsible_restrictions __P((pr_query_struct *q));
00430
00431
00465 void set_raw_pr_where __P((pr_query_struct *q, const gchar *str));
00466
00467
00479 void clear_raw_pr_where __P((pr_query_struct *q));
00480
00481
00492 void set_order_by __P((pr_query_struct *q, const gchar *str));
00493
00494
00502 void clear_order_by __P((pr_query_struct *q));
00503
00504
00520 GString *create_query_string __P((const pr_query_struct *q));
00521
00522 __END_DECLS
00523 #endif