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-2000 Kenneth W. Sodemann (stufflehead@bigfoot.com)
00005  *-------------------------------------------------------------------------
00006  * pr_query
00007  *
00008  * Synopsis:
00009  *    Handles the creation of problem report selection queries.
00010  *
00011  * $Id: pr_query.h,v 1.9 2000/11/13 16:22:35 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 
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

Generated at Sun Jan 7 09:55:03 2001 for libPRepS by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000