libidav/davqlparser.h

changeset 98
237844f263b4
parent 96
896022673e0e
child 102
e9ae1318a559
--- a/libidav/davqlparser.h	Fri Apr 17 16:26:53 2015 +0200
+++ b/libidav/davqlparser.h	Tue Apr 21 12:13:41 2015 +0200
@@ -46,6 +46,7 @@
  * Enumeration of possible expression types.
  */
 typedef enum {
+    DAVQL_UNDEFINED_TYP,
     DAVQL_NUMBER, DAVQL_STRING, DAVQL_TIMESTAMP, DAVQL_IDENTIFIER,
     DAVQL_UNARY, DAVQL_BINARY, DAVQL_LOGICAL, DAVQL_FUNCCALL
 } davqlexprtype_t;
@@ -111,6 +112,27 @@
     _Bool descending;
 } DavQLOrderCriterion;
 
+/**
+ * A tuple representing a field.
+ */
+typedef struct {
+    /**
+     * The field name.
+     * <ul>
+     * <li>GET: the identifier or an alias name</li>
+     * <li>SET: the identifier</li>
+     * </ul>
+     */
+    sstr_t name;
+    /**
+     * The field expression.
+     * <ul>
+     * <li>GET: the queried property (identifier) or an expression</li>
+     * <li>SET: the expression for the value to be set</li>
+     * </ul>
+     */
+    DavQLExpression *expr;
+} DavQLField;
 
 /**
  * Query statement object.
@@ -145,11 +167,11 @@
  * LogicalOperator = " and " | " or " | " xor ";
  * Comparison      = | "=" | "<" | ">" | "<=" | ">=" | "!=";
  * 
- * FieldExpressions = "*", {",", Expression, " as ", String}
+ * FieldExpressions = "*", {",", Expression, " as ", Identifier}
  *                  | FieldExpression, {",", FieldExpression}
  *                  | "-";
  * FieldExpression  = Identifier
- *                  | Expression, " as ", String;
+ *                  | Expression, " as ", Identifier;
  * SetExpressions   = SetExpression, {",", SetExpressions};
  * SetExpression    = Identifier, "=", Expression;
  * 
@@ -204,15 +226,10 @@
      */
     char* errormessage;
     /**
-     * The list of field expressions.
+     * The list of DavQLFields.
      */
     UcxList* fields;
     /**
-     * The list of DavQLExpressions for the new DAV property values.
-     * This is <code>NULL</code> for GET queries.
-     */
-    UcxList* setvalues;
-    /**
      * A string that denotes the queried path.
      */
     sstr_t path;

mercurial