Main Page   File List   File Members  

pr_query.h

Go to the documentation of this file.
00001 #ifndef __PR_QUERY_H
00002 #define __PR_QUERY_H
00003 /*-------------------------------------------------------------------------
00004  * Copyright (c) 1999-2002 Kenneth W. Sodemann (stuffle@charter.net)
00005  *-------------------------------------------------------------------------
00006  * pr_query
00007  *
00008  * Synopsis:
00009  *    Handles the creation of problem report selection queries.
00010  *
00011  * $Id: pr_query.h,v 1.11 2002/01/30 00:40:02 stuffle Exp $
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to
00025  * Free Software Foundation, Inc.
00026  * 59 Temple Place, Suite 330 
00027  * Boston, MA  02111-1307  USA
00028  *-------------------------------------------------------------------------
00029  */
00063 #include <glib.h>
00064 #include <libpq-fe.h>
00065 
00066 /*
00067  * __BEGIN_DECLS should be used at the beginning of your declarations,
00068  * so that C++ compilers don't mangle their names.  Use __END_DECLS at
00069  * the end of C declarations. 
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 /* empty */
00078 # define __END_DECLS /* empty */
00079 #endif
00080 
00081 /*
00082  * The __P macro is used to wrap function prototypes, so that compilers
00083  * that don't understand ANSI C prototypes still work, and ANSI C
00084  * compilers can issue warnings about type mismatches. 
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

Generated on Sun Oct 20 18:15:09 2002 for libPRepS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002