comparison SQLite/Plugins/IndexPlugin.cpp @ 569:f18e46d7dbf8 attach-custom-data

merged find-refactoring -> attach-custom-data
author Alain Mazy <am@orthanc.team>
date Tue, 24 Sep 2024 15:04:21 +0200
parents 54d518dcd74a
children
comparison
equal deleted inserted replaced
368:82f73188b58d 569:f18e46d7dbf8
1 /** 1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store 2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium 4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium 5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
6 * 8 *
7 * This program is free software: you can redistribute it and/or 9 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License 10 * modify it under the terms of the GNU Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of 11 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version. 12 * the License, or (at your option) any later version.
22 #include "SQLiteIndex.h" 24 #include "SQLiteIndex.h"
23 #include "../../Framework/Plugins/PluginInitialization.h" 25 #include "../../Framework/Plugins/PluginInitialization.h"
24 26
25 #include <Logging.h> 27 #include <Logging.h>
26 28
29 #include <google/protobuf/any.h>
30
31 #define ORTHANC_PLUGIN_NAME "sqlite-index"
32
27 33
28 extern "C" 34 extern "C"
29 { 35 {
30 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) 36 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
31 { 37 {
32 if (!OrthancDatabases::InitializePlugin(context, "SQLite", true)) 38 GOOGLE_PROTOBUF_VERIFY_VERSION;
39
40 if (!OrthancDatabases::InitializePlugin(context, ORTHANC_PLUGIN_NAME, "SQLite", true))
33 { 41 {
34 return -1; 42 return -1;
35 } 43 }
36 44
37 #if 0 45 #if 0
81 89
82 ORTHANC_PLUGINS_API void OrthancPluginFinalize() 90 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
83 { 91 {
84 LOG(WARNING) << "SQLite index is finalizing"; 92 LOG(WARNING) << "SQLite index is finalizing";
85 OrthancDatabases::IndexBackend::Finalize(); 93 OrthancDatabases::IndexBackend::Finalize();
94 google::protobuf::ShutdownProtobufLibrary();
86 } 95 }
87 96
88 97
89 ORTHANC_PLUGINS_API const char* OrthancPluginGetName() 98 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
90 { 99 {
91 return "sqlite-index"; 100 return ORTHANC_PLUGIN_NAME;
92 } 101 }
93 102
94 103
95 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion() 104 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
96 { 105 {