44 |
44 |
45 /** |
45 /** |
46 * Enumeration of possible expression types. |
46 * Enumeration of possible expression types. |
47 */ |
47 */ |
48 typedef enum { |
48 typedef enum { |
|
49 DAVQL_UNDEFINED_TYP, |
49 DAVQL_NUMBER, DAVQL_STRING, DAVQL_TIMESTAMP, DAVQL_IDENTIFIER, |
50 DAVQL_NUMBER, DAVQL_STRING, DAVQL_TIMESTAMP, DAVQL_IDENTIFIER, |
50 DAVQL_UNARY, DAVQL_BINARY, DAVQL_LOGICAL, DAVQL_FUNCCALL |
51 DAVQL_UNARY, DAVQL_BINARY, DAVQL_LOGICAL, DAVQL_FUNCCALL |
51 } davqlexprtype_t; |
52 } davqlexprtype_t; |
52 |
53 |
53 /** |
54 /** |
109 * Default is false (ascending). |
110 * Default is false (ascending). |
110 */ |
111 */ |
111 _Bool descending; |
112 _Bool descending; |
112 } DavQLOrderCriterion; |
113 } DavQLOrderCriterion; |
113 |
114 |
|
115 /** |
|
116 * A tuple representing a field. |
|
117 */ |
|
118 typedef struct { |
|
119 /** |
|
120 * The field name. |
|
121 * <ul> |
|
122 * <li>GET: the identifier or an alias name</li> |
|
123 * <li>SET: the identifier</li> |
|
124 * </ul> |
|
125 */ |
|
126 sstr_t name; |
|
127 /** |
|
128 * The field expression. |
|
129 * <ul> |
|
130 * <li>GET: the queried property (identifier) or an expression</li> |
|
131 * <li>SET: the expression for the value to be set</li> |
|
132 * </ul> |
|
133 */ |
|
134 DavQLExpression *expr; |
|
135 } DavQLField; |
114 |
136 |
115 /** |
137 /** |
116 * Query statement object. |
138 * Query statement object. |
117 * Contains the binary information about the parsed query. |
139 * Contains the binary information about the parsed query. |
118 * |
140 * |
143 * UnaryOperator = "-" | "~"; |
165 * UnaryOperator = "-" | "~"; |
144 * BinaryOperator = "+" | "-" | "*" | "/" | "&" | "|" | "^"; |
166 * BinaryOperator = "+" | "-" | "*" | "/" | "&" | "|" | "^"; |
145 * LogicalOperator = " and " | " or " | " xor "; |
167 * LogicalOperator = " and " | " or " | " xor "; |
146 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!="; |
168 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!="; |
147 * |
169 * |
148 * FieldExpressions = "*", {",", Expression, " as ", String} |
170 * FieldExpressions = "*", {",", Expression, " as ", Identifier} |
149 * | FieldExpression, {",", FieldExpression} |
171 * | FieldExpression, {",", FieldExpression} |
150 * | "-"; |
172 * | "-"; |
151 * FieldExpression = Identifier |
173 * FieldExpression = Identifier |
152 * | Expression, " as ", String; |
174 * | Expression, " as ", Identifier; |
153 * SetExpressions = SetExpression, {",", SetExpressions}; |
175 * SetExpressions = SetExpression, {",", SetExpressions}; |
154 * SetExpression = Identifier, "=", Expression; |
176 * SetExpression = Identifier, "=", Expression; |
155 * |
177 * |
156 * Path = "%s" |
178 * Path = "%s" |
157 * | "/", {?Character? - " "} |
179 * | "/", {?Character? - " "} |