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
00127 #define PROJECT_NAME_POS 0
00128 #define STATUS_NAME_POS 1
00129 #define PROBLEM_TYPE_NAME_POS 2
00130 #define SEVERITY_NAME_POS 3
00131 #define PR_TITLE_POS 4
00132 #define STATUS_ORDER_POS 5
00133 #define SEVERITY_ORDER_POS 6
00134 #define PR_NUMBER_POS 7
00135
00136 __BEGIN_DECLS
00144 typedef struct pr_query_struct pr_query_struct;
00145
00170 pr_query_struct *create_pr_query __P((gchar *user_id));
00171
00172
00199 pr_query_struct *create_pr_query_from_table __P((PGconn *conn,
00200 const gchar *user_id,
00201 gint query_pk));
00202
00203
00238 pr_query_struct *create_pr_query_from_table_li __P((const gchar *conn_str,
00239 const gchar *user_id,
00240 gint query_pk));
00241
00242
00252 void destroy_pr_query __P((pr_query_struct *pr_query));
00253
00254
00268 void add_project_restriction __P((pr_query_struct *q, gint pk));
00269
00270
00282 void clear_project_restrictions __P((pr_query_struct *q));
00283
00284
00298 void add_severity_restriction __P((pr_query_struct *q, gint pk));
00299
00300
00308 void clear_severity_restrictions __P((pr_query_struct *q));
00309
00310
00324 void add_status_restriction __P((pr_query_struct *q, gint pk));
00325
00326
00334 void clear_status_restrictions __P((pr_query_struct *q));
00335
00336
00350 void add_problem_type_restriction __P((pr_query_struct *q, gint pk));
00351
00352
00359 void clear_problem_type_restrictions __P((pr_query_struct *q));
00360
00361
00375 void add_submitter_restriction __P((pr_query_struct *q, gchar *id));
00376
00377
00385 void clear_submitter_restrictions __P((pr_query_struct *q));
00386
00387
00402 void add_responsible_restriction __P((pr_query_struct *q, gchar *id));
00403
00404
00412 void clear_responsible_restrictions __P((pr_query_struct *q));
00413
00414
00448 void set_raw_pr_where __P((pr_query_struct *q, const gchar *str));
00449
00450
00462 void clear_raw_pr_where __P((pr_query_struct *q));
00463
00464
00475 void set_order_by __P((pr_query_struct *q, const gchar *str));
00476
00477
00485 void clear_order_by __P((pr_query_struct *q));
00486
00487
00503 GString *create_query_string __P((const pr_query_struct *q));
00504
00505 __END_DECLS
00506 #endif