00001 /* Copyright 2005 The Apache Software Foundation or its licensors, as 00002 * applicable. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /** 00018 * @file lcn_query_parser.h 00019 * @brief Routines for creating queries from a user provided string 00020 */ 00021 00022 #ifndef _LCN_QUERY_PARSER_H 00023 #define _LCN_QUERY_PARSER_H 00024 00025 #include "lcn_types.h" 00026 #include "lcn_query.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif /* __cplusplus */ 00031 00032 /** A query parser. */ 00033 typedef struct lcn_query_parser_t lcn_query_parser_t; 00034 00035 /** Create a query parser @a parser, which uses @a default_field and 00036 * @a default_occur and is allocated from @a pool. */ 00037 lcn_error_t * 00038 lcn_query_parser_create (lcn_query_parser_t **parser, 00039 lcn_char_t *default_field, 00040 lcn_boolean_clause_occur_t default_occur, 00041 apr_pool_t *pool); 00042 00043 /** Use @a parser to create @a query from @a input, allocated in @a pool. */ 00044 lcn_error_t * 00045 lcn_query_parser_parse (lcn_query_t **query, 00046 lcn_query_parser_t *parser, 00047 lcn_char_t *input, 00048 apr_pool_t *pool); 00049 00050 #ifdef __cplusplus 00051 } 00052 #endif /* __cplusplus */ 00053 00054 #endif /* _LCN_QUERY_PARSER_H */