--- a/libidav/davqlparser.h Sun Apr 16 14:12:24 2023 +0200 +++ b/libidav/davqlparser.h Fri Apr 21 21:25:32 2023 +0200 @@ -34,8 +34,8 @@ #endif #include <stdint.h> -#include "ucx/string.h" -#include "ucx/list.h" +#include <cx/string.h> +#include <cx/list.h> /** * Enumeration of possible statement types. @@ -74,10 +74,13 @@ DAVQL_LIKE, DAVQL_UNLIKE // comparisons } davqloperator_t; -typedef struct { +typedef struct DavQLToken DavQLToken; +struct DavQLToken { davqltokenclass_t tokenclass; - sstr_t value; -} DavQLToken; + cxstring value; + DavQLToken *prev; + DavQLToken *next; +}; /** * An expression within a DAVQL query. @@ -92,7 +95,7 @@ * The original expression text. * Contains the literal value, if type is LITERAL. */ - sstr_t srctext; + cxstring srctext; /** * The expression type. */ @@ -139,7 +142,7 @@ * <li>SET: the identifier</li> * </ul> */ - sstr_t name; + cxstring name; /** * The field expression. * <ul> @@ -242,7 +245,7 @@ /** * The original query text. */ - sstr_t srctext; + cxstring srctext; /** * The statement type. */ @@ -258,11 +261,11 @@ /** * The list of DavQLFields. */ - UcxList* fields; + CxList* fields; /** * A string that denotes the queried path. */ - sstr_t path; + cxstring path; /** * Logical expression for selection. * <code>NULL</code>, if there is no where clause. @@ -273,7 +276,7 @@ * This is <code>NULL</code> for SET queries and may be <code>NULL</code> * if the result doesn't need to be sorted. */ - UcxList* orderby; + CxList* orderby; /** * The recursion depth for the statement. * Defaults to 1. @@ -284,7 +287,7 @@ /** * A list of all required arguments */ - UcxList* args; + CxList* args; } DavQLStatement; /** Infinity recursion depth for a DavQLStatement. */ @@ -350,12 +353,12 @@ * @param stmt the sstr_t containing the statement * @return a DavQLStatement object */ -DavQLStatement* dav_parse_statement(sstr_t stmt); +DavQLStatement* dav_parse_statement(cxstring stmt); /** * Implicitly converts a cstr to a sstr_t and calls dav_parse_statement. */ -#define dav_parse_cstr_statement(stmt) dav_parse_statement(S(stmt)) +#define dav_parse_cstr_statement(stmt) dav_parse_statement(cx_str(stmt)) /** * Frees a DavQLStatement.