libidav/davqlexec.h

Sun, 11 Jun 2023 21:21:34 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 11 Jun 2023 21:21:34 +0200
changeset 755
283d3d7a657a
parent 747
efbd59642577
permissions
-rw-r--r--

fix UAF in davql select exec

104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
365
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
4 * Copyright 2018 Olaf Wintermann. All rights reserved.
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 #ifndef DAVQLEXEC_H
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #define DAVQLEXEC_H
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 #include <stdarg.h>
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include "davqlparser.h"
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33 #include "webdav.h"
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
35 #include <cx/buffer.h>
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 #ifdef __cplusplus
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 extern "C" {
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 #endif
344
72791e299d64 removes openssl dependencies for base64
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 185
diff changeset
40
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
41 typedef struct DavQLCmd DavQLCmd;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
42 typedef struct DavQLStackObj DavQLStackObj;
128
649eb328674a implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 126
diff changeset
43 typedef struct DavQLRes DavQLRes;
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
44
365
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
45 typedef struct DavQLArg DavQLArg;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
46 typedef struct DavQLArgList DavQLArgList;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
47
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
48 typedef void*(*davql_func)(); // TODO: interface?
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49
365
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
50 struct DavQLArg {
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
51 int type;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
52 union DavQLArgValue{
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
53 int d;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
54 unsigned int u;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
55 char *s;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
56 time_t t;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
57 } value;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
58 DavQLArg *next;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
59 };
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
60
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
61 struct DavQLArgList {
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
62 DavQLArg *first;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
63 DavQLArg *current;
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
64 };
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
65
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 typedef enum {
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 DAVQL_OK = 0,
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 DAVQL_UNSUPPORTED_FORMATCHAR,
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
69 DAVQL_UNKNOWN_FORMATCHAR,
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
70 DAVQL_OOM
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 } davqlerror_t;
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
73 typedef enum {
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
74 DAVQL_CMD_INT = 0,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
75 DAVQL_CMD_STRING,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
76 DAVQL_CMD_TIMESTAMP,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
77 DAVQL_CMD_RES_IDENTIFIER,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
78 DAVQL_CMD_PROP_IDENTIFIER,
139
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
79 //DAVQL_CMD_OP_UNARY_ADD,
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
80 DAVQL_CMD_OP_UNARY_SUB,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
81 DAVQL_CMD_OP_UNARY_NEG,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
82 DAVQL_CMD_OP_BINARY_ADD,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
83 DAVQL_CMD_OP_BINARY_SUB,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
84 DAVQL_CMD_OP_BINARY_MUL,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
85 DAVQL_CMD_OP_BINARY_DIV,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
86 DAVQL_CMD_OP_BINARY_AND,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
87 DAVQL_CMD_OP_BINARY_OR,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
88 DAVQL_CMD_OP_BINARY_XOR,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
89 DAVQL_CMD_OP_LOGICAL_NOT,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
90 DAVQL_CMD_OP_LOGICAL_AND,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
91 DAVQL_CMD_OP_LOGICAL_OR_L,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
92 DAVQL_CMD_OP_LOGICAL_OR,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
93 DAVQL_CMD_OP_LOGICAL_XOR,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
94 DAVQL_CMD_OP_EQ,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
95 DAVQL_CMD_OP_NEQ,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
96 DAVQL_CMD_OP_LT,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
97 DAVQL_CMD_OP_GT,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
98 DAVQL_CMD_OP_LE,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
99 DAVQL_CMD_OP_GE,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
100 DAVQL_CMD_OP_LIKE,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
101 DAVQL_CMD_OP_UNLIKE,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
102 DAVQL_CMD_CALL
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
103 } davqlcmdtype_t;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
104
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
105 typedef enum {
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
106 DAVQL_RES_NAME = 0,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
107 DAVQL_RES_PATH,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
108 DAVQL_RES_HREF,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
109 DAVQL_RES_CONTENTLENGTH,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
110 DAVQL_RES_CONTENTTYPE,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
111 DAVQL_RES_CREATIONDATE,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
112 DAVQL_RES_LASTMODIFIED,
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
113 DAVQL_RES_ISCOLLECTION
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
114 } davqlresprop_t;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
115
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
116 struct DavQLCmd {
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
117 davqlcmdtype_t type;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
118 union DavQLCmdData {
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
119 int64_t integer;
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
120 cxmutstr string;
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
121 time_t timestamp;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
122 davqlresprop_t resprop;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
123 DavPropName property;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
124 davql_func func;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
125 } data;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
126 };
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
127
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
128 struct DavQLStackObj {
348
b79fb94f9e0a davqlexec handles xml properties now (not really, but it doesn't destroy everything)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 344
diff changeset
129 int32_t type; // 0: int, 1: string, 2: xml
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
130 uint32_t length;
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
131 union DavQLStackData {
348
b79fb94f9e0a davqlexec handles xml properties now (not really, but it doesn't destroy everything)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 344
diff changeset
132 int64_t integer;
b79fb94f9e0a davqlexec handles xml properties now (not really, but it doesn't destroy everything)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 344
diff changeset
133 char *string;
b79fb94f9e0a davqlexec handles xml properties now (not really, but it doesn't destroy everything)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 344
diff changeset
134 DavXmlNode *node;
124
41939c8f3f9c expression compiler generates byte code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 123
diff changeset
135 } data;
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 };
128
649eb328674a implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 126
diff changeset
137
649eb328674a implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 126
diff changeset
138 struct DavQLRes {
649eb328674a implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 126
diff changeset
139 DavResource *resource;
649eb328674a implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 126
diff changeset
140 int depth;
649eb328674a implemented minimal executor features and added missing ucx files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 126
diff changeset
141 };
134
4bccc18820e8 implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
142
4bccc18820e8 implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
143 typedef struct DavCompiledField {
4bccc18820e8 implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
144 char *ns;
4bccc18820e8 implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
145 char *name;
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
146 CxBuffer *code;
134
4bccc18820e8 implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
147 } DavCompiledField;
139
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
148
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
149 typedef struct DavOrderCriterion {
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
150 int type; // 0: resprop, 1: property
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
151 union DavQLColumn {
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
152 davqlresprop_t resprop;
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
153 CxHashKey property;
139
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
154 } column;
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
155 _Bool descending;
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
156 } DavOrderCriterion;
365
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
157
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
158 DavQLArgList* dav_ql_get_args(DavQLStatement *st, va_list ap);
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
159 void dav_ql_free_arglist(DavQLArgList *args);
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
160
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
161 int dav_ql_getarg_int(DavQLArgList *args);
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
162 unsigned int dav_ql_getarg_uint(DavQLArgList *args);
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
163 char* dav_ql_getarg_str(DavQLArgList *args);
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
164 time_t dav_ql_getarg_time(DavQLArgList *args);
f04ab0420512 fixes misuse of vaarg on all platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 348
diff changeset
165
135
664aeaec8d25 replaced old davql (still buggy)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 134
diff changeset
166 DavResult dav_statement_exec(DavSession *sn, DavQLStatement *st, ...);
664aeaec8d25 replaced old davql (still buggy)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 134
diff changeset
167 DavResult dav_statement_execv(DavSession *sn, DavQLStatement *st, va_list ap);
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
169 CxBuffer* dav_path_string(cxmutstr src, DavQLArgList *args, davqlerror_t *error);
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
170 cxmutstr dav_format_string(const CxAllocator *a, cxstring fstr, DavQLArgList *ap, davqlerror_t *error);
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171
135
664aeaec8d25 replaced old davql (still buggy)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 134
diff changeset
172 DavResult dav_exec_select(DavSession *sn, DavQLStatement *st, va_list ap);
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
173
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
174 int dav_identifier2resprop(cxstring src, davqlresprop_t *prop);
139
c6424aebcf5e implemented davql order by
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 135
diff changeset
175
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
176 CxBuffer* dav_compile_expr(DavContext *ctx, const CxAllocator *a, DavQLExpression *lexpr, DavQLArgList *ap);
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177
747
efbd59642577 ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 365
diff changeset
178 int dav_exec_expr(CxBuffer *bcode, DavResource *res, DavQLStackObj *result);
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179
134
4bccc18820e8 implemented execution of field list expressions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
180
104
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 #ifdef __cplusplus
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 }
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 #endif
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 #endif /* DAVQLEXEC_H */
6fb4d24d9df9 added davqlexec source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187

mercurial