blob: 80bcc385b5928a076e1462b139045d7d6a157755 [file] [log] [blame]
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00001/* statement.c - the statement type
2 *
Florent Xiclunac934f322010-09-03 23:47:32 +00003 * Copyright (C) 2005-2010 Gerhard Häring <gh@ghaering.de>
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00004 *
5 * This file is part of pysqlite.
6 *
7 * This software is provided 'as-is', without any express or implied
8 * warranty. In no event will the authors be held liable for any damages
9 * arising from the use of this software.
10 *
11 * Permission is granted to anyone to use this software for any purpose,
12 * including commercial applications, and to alter it and redistribute it
13 * freely, subject to the following restrictions:
14 *
15 * 1. The origin of this software must not be misrepresented; you must not
16 * claim that you wrote the original software. If you use this software
17 * in a product, an acknowledgment in the product documentation would be
18 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
21 * 3. This notice may not be removed or altered from any source distribution.
22 */
23
24#include "statement.h"
25#include "cursor.h"
26#include "connection.h"
27#include "microprotocols.h"
28#include "prepare_protocol.h"
29#include "sqlitecompat.h"
30
31/* prototypes */
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +000032static int pysqlite_check_remaining_sql(const char* tail);
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000033
34typedef enum {
35 LINECOMMENT_1,
36 IN_LINECOMMENT,
37 COMMENTSTART_1,
38 IN_COMMENT,
39 COMMENTEND_1,
40 NORMAL
41} parse_remaining_sql_state;
42
Gerhard Häringe7ea7452008-03-29 00:45:29 +000043typedef enum {
44 TYPE_LONG,
45 TYPE_FLOAT,
Gerhard Häringe7ea7452008-03-29 00:45:29 +000046 TYPE_UNICODE,
47 TYPE_BUFFER,
48 TYPE_UNKNOWN
49} parameter_type;
50
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +000051int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* connection, PyObject* sql)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000052{
53 const char* tail;
54 int rc;
Guido van Rossum83857e32007-05-09 23:37:01 +000055 const char* sql_cstr;
56 Py_ssize_t sql_cstr_len;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000057
58 self->st = NULL;
59 self->in_use = 0;
60
Marc-André Lemburg4cc0f242008-08-07 18:54:33 +000061 sql_cstr = _PyUnicode_AsStringAndSize(sql, &sql_cstr_len);
Guido van Rossumfa9a1212007-08-29 03:34:29 +000062 if (sql_cstr == NULL) {
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000063 rc = PYSQLITE_SQL_WRONG_TYPE;
64 return rc;
65 }
66
Thomas Wouters477c8d52006-05-27 19:21:47 +000067 self->in_weakreflist = NULL;
Guido van Rossum83857e32007-05-09 23:37:01 +000068 Py_INCREF(sql);
69 self->sql = sql;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000070
Benjamin Petersond7b03282008-09-13 15:58:53 +000071 Py_BEGIN_ALLOW_THREADS
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000072 rc = sqlite3_prepare(connection->db,
73 sql_cstr,
74 -1,
75 &self->st,
76 &tail);
Benjamin Petersond7b03282008-09-13 15:58:53 +000077 Py_END_ALLOW_THREADS
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000078
79 self->db = connection->db;
80
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +000081 if (rc == SQLITE_OK && pysqlite_check_remaining_sql(tail)) {
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000082 (void)sqlite3_finalize(self->st);
83 self->st = NULL;
84 rc = PYSQLITE_TOO_MUCH_SQL;
85 }
86
87 return rc;
88}
89
Gerhard Häringe7ea7452008-03-29 00:45:29 +000090int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObject* parameter, int allow_8bit_chars)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000091{
92 int rc = SQLITE_OK;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000093 PY_LONG_LONG longlongval;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000094 const char* buffer;
95 char* string;
96 Py_ssize_t buflen;
Gerhard Häringe7ea7452008-03-29 00:45:29 +000097 parameter_type paramtype;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000098
99 if (parameter == Py_None) {
100 rc = sqlite3_bind_null(self->st, pos);
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000101 goto final;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000102 }
103
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000104 if (PyLong_CheckExact(parameter)) {
105 paramtype = TYPE_LONG;
106 } else if (PyFloat_CheckExact(parameter)) {
107 paramtype = TYPE_FLOAT;
108 } else if (PyUnicode_CheckExact(parameter)) {
109 paramtype = TYPE_UNICODE;
110 } else if (PyLong_Check(parameter)) {
111 paramtype = TYPE_LONG;
112 } else if (PyFloat_Check(parameter)) {
113 paramtype = TYPE_FLOAT;
114 } else if (PyUnicode_Check(parameter)) {
Gerhard Häring6117f422008-09-22 06:04:51 +0000115 paramtype = TYPE_UNICODE;
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000116 } else if (PyObject_CheckBuffer(parameter)) {
117 paramtype = TYPE_BUFFER;
118 } else {
119 paramtype = TYPE_UNKNOWN;
120 }
121
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000122 switch (paramtype) {
123 case TYPE_LONG:
124 /* in the overflow error case, longval/longlongval is -1, and an exception is set */
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000125 longlongval = PyLong_AsLongLong(parameter);
126 rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)longlongval);
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000127 break;
128 case TYPE_FLOAT:
129 rc = sqlite3_bind_double(self->st, pos, PyFloat_AsDouble(parameter));
130 break;
131 case TYPE_UNICODE:
Petri Lehtinen023fe332012-02-01 22:18:19 +0200132 string = _PyUnicode_AsStringAndSize(parameter, &buflen);
Victor Stinner86999502010-05-19 01:27:23 +0000133 if (string != NULL)
Petri Lehtinen023fe332012-02-01 22:18:19 +0200134 rc = sqlite3_bind_text(self->st, pos, string, buflen, SQLITE_TRANSIENT);
Victor Stinner86999502010-05-19 01:27:23 +0000135 else
136 rc = -1;
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000137 break;
138 case TYPE_BUFFER:
139 if (PyObject_AsCharBuffer(parameter, &buffer, &buflen) == 0) {
140 rc = sqlite3_bind_blob(self->st, pos, buffer, buflen, SQLITE_TRANSIENT);
141 } else {
142 PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
143 rc = -1;
144 }
145 break;
146 case TYPE_UNKNOWN:
147 rc = -1;
148 }
149
150final:
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000151 return rc;
152}
153
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000154/* returns 0 if the object is one of Python's internal ones that don't need to be adapted */
155static int _need_adapt(PyObject* obj)
156{
157 if (pysqlite_BaseTypeAdapted) {
158 return 1;
159 }
160
161 if (PyLong_CheckExact(obj) || PyFloat_CheckExact(obj)
Christian Heimes9c4756e2008-05-26 13:22:05 +0000162 || PyUnicode_CheckExact(obj) || PyByteArray_CheckExact(obj)) {
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000163 return 0;
164 } else {
165 return 1;
166 }
167}
168
169void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* parameters, int allow_8bit_chars)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000170{
171 PyObject* current_param;
172 PyObject* adapted;
173 const char* binding_name;
174 int i;
175 int rc;
176 int num_params_needed;
177 int num_params;
178
179 Py_BEGIN_ALLOW_THREADS
180 num_params_needed = sqlite3_bind_parameter_count(self->st);
181 Py_END_ALLOW_THREADS
182
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000183 if (PyTuple_CheckExact(parameters) || PyList_CheckExact(parameters) || (!PyDict_Check(parameters) && PySequence_Check(parameters))) {
184 /* parameters passed as sequence */
185 if (PyTuple_CheckExact(parameters)) {
186 num_params = PyTuple_GET_SIZE(parameters);
187 } else if (PyList_CheckExact(parameters)) {
188 num_params = PyList_GET_SIZE(parameters);
189 } else {
190 num_params = PySequence_Size(parameters);
191 }
192 if (num_params != num_params_needed) {
193 PyErr_Format(pysqlite_ProgrammingError, "Incorrect number of bindings supplied. The current statement uses %d, and there are %d supplied.",
194 num_params_needed, num_params);
195 return;
196 }
197 for (i = 0; i < num_params; i++) {
198 if (PyTuple_CheckExact(parameters)) {
199 current_param = PyTuple_GET_ITEM(parameters, i);
200 Py_XINCREF(current_param);
201 } else if (PyList_CheckExact(parameters)) {
202 current_param = PyList_GET_ITEM(parameters, i);
203 Py_XINCREF(current_param);
204 } else {
205 current_param = PySequence_GetItem(parameters, i);
206 }
207 if (!current_param) {
208 return;
209 }
210
211 if (!_need_adapt(current_param)) {
212 adapted = current_param;
213 } else {
Benjamin Petersond7b03282008-09-13 15:58:53 +0000214 adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)&pysqlite_PrepareProtocolType, NULL);
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000215 if (adapted) {
216 Py_DECREF(current_param);
217 } else {
218 PyErr_Clear();
219 adapted = current_param;
220 }
221 }
222
223 rc = pysqlite_statement_bind_parameter(self, i + 1, adapted, allow_8bit_chars);
224 Py_DECREF(adapted);
225
226 if (rc != SQLITE_OK) {
227 if (!PyErr_Occurred()) {
228 PyErr_Format(pysqlite_InterfaceError, "Error binding parameter %d - probably unsupported type.", i);
229 }
230 return;
231 }
232 }
233 } else if (PyDict_Check(parameters)) {
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000234 /* parameters passed as dictionary */
235 for (i = 1; i <= num_params_needed; i++) {
236 Py_BEGIN_ALLOW_THREADS
237 binding_name = sqlite3_bind_parameter_name(self->st, i);
238 Py_END_ALLOW_THREADS
239 if (!binding_name) {
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000240 PyErr_Format(pysqlite_ProgrammingError, "Binding %d has no name, but you supplied a dictionary (which has only names).", i);
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000241 return;
242 }
243
244 binding_name++; /* skip first char (the colon) */
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000245 if (PyDict_CheckExact(parameters)) {
246 current_param = PyDict_GetItemString(parameters, binding_name);
247 Py_XINCREF(current_param);
248 } else {
249 current_param = PyMapping_GetItemString(parameters, (char*)binding_name);
250 }
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000251 if (!current_param) {
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000252 PyErr_Format(pysqlite_ProgrammingError, "You did not supply a value for binding %d.", i);
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000253 return;
254 }
255
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000256 if (!_need_adapt(current_param)) {
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000257 adapted = current_param;
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000258 } else {
Benjamin Petersond7b03282008-09-13 15:58:53 +0000259 adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)&pysqlite_PrepareProtocolType, NULL);
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000260 if (adapted) {
261 Py_DECREF(current_param);
262 } else {
263 PyErr_Clear();
264 adapted = current_param;
265 }
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000266 }
267
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000268 rc = pysqlite_statement_bind_parameter(self, i, adapted, allow_8bit_chars);
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000269 Py_DECREF(adapted);
270
271 if (rc != SQLITE_OK) {
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000272 if (!PyErr_Occurred()) {
273 PyErr_Format(pysqlite_InterfaceError, "Error binding parameter :%s - probably unsupported type.", binding_name);
274 }
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000275 return;
276 }
277 }
278 } else {
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000279 PyErr_SetString(PyExc_ValueError, "parameters are of unsupported type");
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000280 }
281}
282
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000283int pysqlite_statement_recompile(pysqlite_Statement* self, PyObject* params)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000284{
285 const char* tail;
286 int rc;
Guido van Rossum83857e32007-05-09 23:37:01 +0000287 const char* sql_cstr;
288 Py_ssize_t sql_len;
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000289 sqlite3_stmt* new_st;
290
Marc-André Lemburg4cc0f242008-08-07 18:54:33 +0000291 sql_cstr = _PyUnicode_AsStringAndSize(self->sql, &sql_len);
Guido van Rossumfa9a1212007-08-29 03:34:29 +0000292 if (sql_cstr == NULL) {
Guido van Rossum83857e32007-05-09 23:37:01 +0000293 rc = PYSQLITE_SQL_WRONG_TYPE;
294 return rc;
295 }
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000296
Benjamin Petersond7b03282008-09-13 15:58:53 +0000297 Py_BEGIN_ALLOW_THREADS
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000298 rc = sqlite3_prepare(self->db,
299 sql_cstr,
300 -1,
301 &new_st,
302 &tail);
Benjamin Petersond7b03282008-09-13 15:58:53 +0000303 Py_END_ALLOW_THREADS
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000304
305 if (rc == SQLITE_OK) {
306 /* The efficient sqlite3_transfer_bindings is only available in SQLite
307 * version 3.2.2 or later. For older SQLite releases, that might not
308 * even define SQLITE_VERSION_NUMBER, we do it the manual way.
309 */
310 #ifdef SQLITE_VERSION_NUMBER
311 #if SQLITE_VERSION_NUMBER >= 3002002
Christian Heimes38053212007-12-14 01:24:44 +0000312 /* The check for the number of parameters is necessary to not trigger a
313 * bug in certain SQLite versions (experienced in 3.2.8 and 3.3.4). */
314 if (sqlite3_bind_parameter_count(self->st) > 0) {
315 (void)sqlite3_transfer_bindings(self->st, new_st);
316 }
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000317 #endif
318 #else
319 statement_bind_parameters(self, params);
320 #endif
321
322 (void)sqlite3_finalize(self->st);
323 self->st = new_st;
324 }
325
326 return rc;
327}
328
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000329int pysqlite_statement_finalize(pysqlite_Statement* self)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000330{
331 int rc;
332
333 rc = SQLITE_OK;
334 if (self->st) {
335 Py_BEGIN_ALLOW_THREADS
336 rc = sqlite3_finalize(self->st);
337 Py_END_ALLOW_THREADS
338 self->st = NULL;
339 }
340
341 self->in_use = 0;
342
343 return rc;
344}
345
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000346int pysqlite_statement_reset(pysqlite_Statement* self)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000347{
348 int rc;
349
350 rc = SQLITE_OK;
351
352 if (self->in_use && self->st) {
353 Py_BEGIN_ALLOW_THREADS
354 rc = sqlite3_reset(self->st);
355 Py_END_ALLOW_THREADS
356
357 if (rc == SQLITE_OK) {
358 self->in_use = 0;
359 }
360 }
361
362 return rc;
363}
364
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000365void pysqlite_statement_mark_dirty(pysqlite_Statement* self)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000366{
367 self->in_use = 1;
368}
369
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000370void pysqlite_statement_dealloc(pysqlite_Statement* self)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000371{
372 int rc;
373
374 if (self->st) {
375 Py_BEGIN_ALLOW_THREADS
376 rc = sqlite3_finalize(self->st);
377 Py_END_ALLOW_THREADS
378 }
379
380 self->st = NULL;
381
382 Py_XDECREF(self->sql);
383
Thomas Wouters477c8d52006-05-27 19:21:47 +0000384 if (self->in_weakreflist != NULL) {
385 PyObject_ClearWeakRefs((PyObject*)self);
386 }
387
Christian Heimes90aa7642007-12-19 02:45:37 +0000388 Py_TYPE(self)->tp_free((PyObject*)self);
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000389}
390
391/*
392 * Checks if there is anything left in an SQL string after SQLite compiled it.
393 * This is used to check if somebody tried to execute more than one SQL command
394 * with one execute()/executemany() command, which the DB-API and we don't
395 * allow.
396 *
397 * Returns 1 if there is more left than should be. 0 if ok.
398 */
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000399static int pysqlite_check_remaining_sql(const char* tail)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000400{
401 const char* pos = tail;
402
403 parse_remaining_sql_state state = NORMAL;
404
405 for (;;) {
406 switch (*pos) {
407 case 0:
408 return 0;
409 case '-':
410 if (state == NORMAL) {
411 state = LINECOMMENT_1;
412 } else if (state == LINECOMMENT_1) {
413 state = IN_LINECOMMENT;
414 }
415 break;
416 case ' ':
417 case '\t':
418 break;
419 case '\n':
420 case 13:
421 if (state == IN_LINECOMMENT) {
422 state = NORMAL;
423 }
424 break;
425 case '/':
426 if (state == NORMAL) {
427 state = COMMENTSTART_1;
428 } else if (state == COMMENTEND_1) {
429 state = NORMAL;
430 } else if (state == COMMENTSTART_1) {
431 return 1;
432 }
433 break;
434 case '*':
435 if (state == NORMAL) {
436 return 1;
437 } else if (state == LINECOMMENT_1) {
438 return 1;
439 } else if (state == COMMENTSTART_1) {
440 state = IN_COMMENT;
441 } else if (state == IN_COMMENT) {
442 state = COMMENTEND_1;
443 }
444 break;
445 default:
446 if (state == COMMENTEND_1) {
447 state = IN_COMMENT;
448 } else if (state == IN_LINECOMMENT) {
449 } else if (state == IN_COMMENT) {
450 } else {
451 return 1;
452 }
453 }
454
455 pos++;
456 }
457
458 return 0;
459}
460
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000461PyTypeObject pysqlite_StatementType = {
Martin v. Löwis9f2e3462007-07-21 17:22:18 +0000462 PyVarObject_HEAD_INIT(NULL, 0)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000463 MODULE_NAME ".Statement", /* tp_name */
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000464 sizeof(pysqlite_Statement), /* tp_basicsize */
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000465 0, /* tp_itemsize */
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000466 (destructor)pysqlite_statement_dealloc, /* tp_dealloc */
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000467 0, /* tp_print */
468 0, /* tp_getattr */
469 0, /* tp_setattr */
Mark Dickinsone94c6792009-02-02 20:36:42 +0000470 0, /* tp_reserved */
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000471 0, /* tp_repr */
472 0, /* tp_as_number */
473 0, /* tp_as_sequence */
474 0, /* tp_as_mapping */
475 0, /* tp_hash */
476 0, /* tp_call */
477 0, /* tp_str */
478 0, /* tp_getattro */
479 0, /* tp_setattro */
480 0, /* tp_as_buffer */
Gerhard Häringe7ea7452008-03-29 00:45:29 +0000481 Py_TPFLAGS_DEFAULT, /* tp_flags */
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000482 0, /* tp_doc */
483 0, /* tp_traverse */
484 0, /* tp_clear */
485 0, /* tp_richcompare */
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000486 offsetof(pysqlite_Statement, in_weakreflist), /* tp_weaklistoffset */
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000487 0, /* tp_iter */
488 0, /* tp_iternext */
489 0, /* tp_methods */
490 0, /* tp_members */
491 0, /* tp_getset */
492 0, /* tp_base */
493 0, /* tp_dict */
494 0, /* tp_descr_get */
495 0, /* tp_descr_set */
496 0, /* tp_dictoffset */
497 (initproc)0, /* tp_init */
498 0, /* tp_alloc */
499 0, /* tp_new */
500 0 /* tp_free */
501};
502
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000503extern int pysqlite_statement_setup_types(void)
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000504{
Thomas Woutersfc7bb8c2007-01-15 15:49:28 +0000505 pysqlite_StatementType.tp_new = PyType_GenericNew;
506 return PyType_Ready(&pysqlite_StatementType);
Thomas Wouters49fd7fa2006-04-21 10:40:58 +0000507}