libidav/davqlparser.h

changeset 79
59c518ae0641
parent 78
ca7f024dd0f9
child 80
a2832c054c98
equal deleted inserted replaced
78:ca7f024dd0f9 79:59c518ae0641
31 31
32 #ifdef __cplusplus 32 #ifdef __cplusplus
33 extern "C" { 33 extern "C" {
34 #endif 34 #endif
35 35
36 #include <stdint.h>
36 #include "ucx/string.h" 37 #include "ucx/string.h"
37 #include "ucx/list.h" 38 #include "ucx/list.h"
38 39
39 /** 40 /**
40 * Enumeration of possible statement types. 41 * Enumeration of possible statement types.
165 * The statement type. 166 * The statement type.
166 */ 167 */
167 davqltype_t type; 168 davqltype_t type;
168 /** 169 /**
169 * The list of field expressions. 170 * The list of field expressions.
170 * <ul>
171 * <li>
172 * GET: the list of queried fields (may contain arbitrary expressions)
173 * </li>
174 * <li>
175 * SET: the list of DAV properties that shall receive new values
176 * (must be a list of IDENTIFIER expressions)
177 * </li>
178 * </ul>
179 * This may be <code>NULL</code> for GET queries, to request all properties.
180 */ 171 */
181 UcxList* fields; 172 UcxList* fields;
182 /** 173 /**
183 * The list of DavQLExpressions for the new DAV property values. 174 * The list of DavQLExpressions for the new DAV property values.
184 * This is <code>NULL</code> for GET queries. 175 * This is <code>NULL</code> for GET queries.
185 */ 176 */
186 UcxList* setvalues; 177 UcxList* setvalues;
187 /** 178 /**
188 * A DavQLExpression that denotes the queried path. 179 * A DavQLExpression that denotes the queried path.
189 */ 180 */
190 DavQLExpression from; 181 DavQLExpression path;
191 /** 182 /**
192 * Logical expression for selection. 183 * Logical expression for selection.
193 * <code>NULL</code>, if there is no where clause. 184 * <code>NULL</code>, if there is no where clause.
194 */ 185 */
195 DavQLExpression* where; 186 DavQLExpression* where;
198 * Defaults to SIZE_MAX (unbound recursion). 189 * Defaults to SIZE_MAX (unbound recursion).
199 */ 190 */
200 size_t depth; 191 size_t depth;
201 } DavQLStatement; 192 } DavQLStatement;
202 193
194
195 /**
196 * Starts an interactive debugger for a DavQLStatement.
197 *
198 * @param stmt the statement to debug
199 */
200 void dav_debug_ql_statement(DavQLStatement *stmt);
201
202 /**
203 * Parses a statement.
204 * @param stmt the sstr_t containing the statement
205 * @return a DavQLStatement object
206 */
207 DavQLStatement* dav_parse_statement(sstr_t stmt);
208
209 /**
210 * Implicitly converts a cstr to a sstr_t and calls dav_parse_statement.
211 */
212 #define dav_parse_cstr_statement(stmt) dav_parse_statement(S(stmt))
203 213
204 #ifdef __cplusplus 214 #ifdef __cplusplus
205 } 215 }
206 #endif 216 #endif
207 217

mercurial