Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
query_util.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 /*
22  * query_utils.h
23  *
24  * Created on: 18 Feb 2016
25  * Author: tyrrells
26  */
27 
28 #ifndef IRODS_LIB_INCLUDE_QUERY_UTIL_H_
29 #define IRODS_LIB_INCLUDE_QUERY_UTIL_H_
30 
31 
32 #include "irods_util_library.h"
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 
45 IRODS_UTIL_LOCAL void InitGenQuery (genQueryInp_t *query_p);
46 
47 
53 IRODS_UTIL_LOCAL void ClearGenQuery (genQueryInp_t *query_p);
54 
55 
65 IRODS_UTIL_LOCAL genQueryOut_t *ExecuteQueryString (rcComm_t *connection_p, char *query_s);
66 
67 
76 IRODS_UTIL_LOCAL genQueryOut_t *ExecuteGenQuery (rcComm_t *connection_p, genQueryInp_t * const query_p);
77 
78 
79 
89 IRODS_UTIL_LOCAL bool SetQuerySelectClauses (genQueryInp_t *in_query_p, int num_columns, const int * const columns_p, const int * const values_p);
90 
91 
102 IRODS_UTIL_LOCAL bool SetQueryWhereClauses (genQueryInp_t *in_query_p, int num_columns, const int *columns_p, const char **clauses_ss, const char **ops_ss);
103 
104 
111 IRODS_UTIL_LOCAL int PrintQueryOutput (FILE *out_f, const genQueryOut_t *query_result_p);
112 
113 
115 IRODS_UTIL_LOCAL QueryResults *GenerateQueryResults (const genQueryOut_t *results_p);
116 
117 
118 
120 IRODS_UTIL_LOCAL void ClearQueryResult (QueryResult *result_p);
121 
122 
124 IRODS_UTIL_LOCAL bool FillInQueryResult (QueryResult *query_result_p, const sqlResult_t *sql_result_p, const int num_rows);
125 
126 
127 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* IRODS_LIB_INCLUDE_QUERY_UTIL_H_ */
QueryResult
A datatype for accessing a single result of a search on an iRODS server.
Definition: query.h:40
irods_util_library.h
QueryResults
A datatype for holding an array of the results of a search on an iRODS server.
Definition: query.h:62
IRODS_UTIL_LOCAL
#define IRODS_UTIL_LOCAL
Definition: irods_util_library.h:47