Mercurial > hg > orthanc
annotate OrthancFramework/Sources/SQLite/SQLiteTypes.h @ 5726:e63538a6d9de find-refactoring-clean tip
integration find-refactoring->find-refactoring-clean
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Jul 2024 14:03:09 +0200 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * |
3063 | 4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@orthanc-labs.com>, |
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Medical Physics Department, CHU of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
6 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
7 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
8 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * Redistribution and use in source and binary forms, with or without |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * modification, are permitted provided that the following conditions are |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * met: |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * * Redistributions of source code must retain the above copyright |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * notice, this list of conditions and the following disclaimer. |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * * Redistributions in binary form must reproduce the above |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * copyright notice, this list of conditions and the following disclaimer |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * in the documentation and/or other materials provided with the |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * distribution. |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * * Neither the name of the CHU of Liege, nor the names of its |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * contributors may be used to endorse or promote products derived |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * from this software without specific prior written permission. |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 **/ |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 #pragma once |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 struct sqlite3; |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 struct sqlite3_context; |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 struct sqlite3_stmt; |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 #if !defined(ORTHANC_SQLITE_VERSION) |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 #error Please define macro ORTHANC_SQLITE_VERSION |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 #endif |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
2303 | 48 |
49 /** | |
50 * "sqlite3_value" is defined as: | |
51 * - "typedef struct Mem sqlite3_value;" up to SQLite <= 3.18.2 | |
52 * - "typedef struct sqlite3_value sqlite3_value;" since SQLite >= 3.19.0. | |
53 * We create our own copy of this typedef to get around this API incompatibility. | |
54 * https://github.com/mackyle/sqlite/commit/db1d90df06a78264775a14d22c3361eb5b42be17 | |
55 **/ | |
56 | |
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 #if ORTHANC_SQLITE_VERSION < 3019000 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 struct Mem; |
2303 | 59 #else |
60 struct sqlite3_value; | |
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 #endif |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 namespace Orthanc |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 { |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 namespace SQLite |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 { |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 namespace Internals |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 { |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 #if ORTHANC_SQLITE_VERSION < 3019000 |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 typedef struct ::Mem SQLiteValue; |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 #else |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 typedef struct ::sqlite3_value SQLiteValue; |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 #endif |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 } |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 } |
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 } |