Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h @ 5577:9e74e761b108 find-refactoring
integration mainline->find-refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 26 Apr 2024 17:43:22 +0200 |
parents | 738f80622e91 d7eaa568da15 |
children | 3f13db27b399 |
comparison
equal
deleted
inserted
replaced
5574:5a13483d12c5 | 5577:9e74e761b108 |
---|---|
1085 _OrthancPluginLoadDicomInstanceMode_INTERNAL = 0x7fffffff | 1085 _OrthancPluginLoadDicomInstanceMode_INTERNAL = 0x7fffffff |
1086 } OrthancPluginLoadDicomInstanceMode; | 1086 } OrthancPluginLoadDicomInstanceMode; |
1087 | 1087 |
1088 | 1088 |
1089 /** | 1089 /** |
1090 * The log levels supported by Orthanc. | |
1091 * | |
1092 * These values must match those of enumeration "LogLevel" in the | |
1093 * Orthanc Core. | |
1094 **/ | |
1095 typedef enum | |
1096 { | |
1097 OrthancPluginLogLevel_Error = 0, /*!< Error log level */ | |
1098 OrthancPluginLogLevel_Warning = 1, /*!< Warning log level */ | |
1099 OrthancPluginLogLevel_Info = 2, /*!< Info log level */ | |
1100 OrthancPluginLogLevel_Trace = 3, /*!< Trace log level */ | |
1101 | |
1102 _OrthancPluginLogLevel_INTERNAL = 0x7fffffff | |
1103 } OrthancPluginLogLevel; | |
1104 | |
1105 | |
1106 /** | |
1107 * The log categories supported by Orthanc. | |
1108 * | |
1109 * These values must match those of enumeration "LogCategory" in the | |
1110 * Orthanc Core. | |
1111 **/ | |
1112 typedef enum | |
1113 { | |
1114 OrthancPluginLogCategory_Generic = (1 << 0), /*!< Generic (default) category */ | |
1115 OrthancPluginLogCategory_Plugins = (1 << 1), /*!< Plugin engine related logs (shall not be used by plugins) */ | |
1116 OrthancPluginLogCategory_Http = (1 << 2), /*!< HTTP related logs */ | |
1117 OrthancPluginLogCategory_Sqlite = (1 << 3), /*!< SQLite related logs (shall not be used by plugins) */ | |
1118 OrthancPluginLogCategory_Dicom = (1 << 4), /*!< DICOM related logs */ | |
1119 OrthancPluginLogCategory_Jobs = (1 << 5), /*!< jobs related logs */ | |
1120 OrthancPluginLogCategory_Lua = (1 << 6), /*!< Lua related logs (shall not be used by plugins) */ | |
1121 | |
1122 _OrthancPluginLogCategory_INTERNAL = 0x7fffffff | |
1123 } OrthancPluginLogCategory; | |
1124 | |
1125 | |
1126 /** | |
1090 * @brief A 32-bit memory buffer allocated by the core system of Orthanc. | 1127 * @brief A 32-bit memory buffer allocated by the core system of Orthanc. |
1091 * | 1128 * |
1092 * A memory buffer allocated by the core system of Orthanc. When the | 1129 * A memory buffer allocated by the core system of Orthanc. When the |
1093 * content of the buffer is not useful anymore, it must be free by a | 1130 * content of the buffer is not useful anymore, it must be free by a |
1094 * call to ::OrthancPluginFreeMemoryBuffer(). | 1131 * call to ::OrthancPluginFreeMemoryBuffer(). |
1969 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) || | 2006 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) || |
1970 sizeof(int32_t) != sizeof(OrthancPluginConstraintType) || | 2007 sizeof(int32_t) != sizeof(OrthancPluginConstraintType) || |
1971 sizeof(int32_t) != sizeof(OrthancPluginMetricsType) || | 2008 sizeof(int32_t) != sizeof(OrthancPluginMetricsType) || |
1972 sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) || | 2009 sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) || |
1973 sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason) || | 2010 sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason) || |
1974 sizeof(int32_t) != sizeof(OrthancPluginLoadDicomInstanceMode)) | 2011 sizeof(int32_t) != sizeof(OrthancPluginLoadDicomInstanceMode) || |
2012 sizeof(int32_t) != sizeof(OrthancPluginLogLevel) || | |
2013 sizeof(int32_t) != sizeof(OrthancPluginLogCategory)) | |
1975 { | 2014 { |
1976 /* Mismatch in the size of the enumerations */ | 2015 /* Mismatch in the size of the enumerations */ |
1977 return 0; | 2016 return 0; |
1978 } | 2017 } |
1979 | 2018 |
9478 const char* threadName) | 9517 const char* threadName) |
9479 { | 9518 { |
9480 return context->InvokeService(context, _OrthancPluginService_SetCurrentThreadName, threadName); | 9519 return context->InvokeService(context, _OrthancPluginService_SetCurrentThreadName, threadName); |
9481 } | 9520 } |
9482 | 9521 |
9483 typedef enum | 9522 |
9484 { | 9523 typedef struct |
9485 // these values must match LogLevel in the Orthanc Core | 9524 { |
9486 OrthancPluginLogLevel_Error = 0, /*!< Error log level */ | 9525 /* Note: This structure is also defined in Logging.h and it must be binary compatible */ |
9487 OrthancPluginLogLevel_Warning = 1, /*!< Warning log level */ | |
9488 OrthancPluginLogLevel_Info = 2, /*!< Info log level */ | |
9489 OrthancPluginLogLevel_Trace = 3, /*!< Trace log level */ | |
9490 | |
9491 // Force the enum to be 32 bits | |
9492 OrthancPluginLogLevel_INTERNAL = 0x7FFFFFFF | |
9493 } OrthancPluginLogLevel; | |
9494 | |
9495 typedef enum | |
9496 { | |
9497 // these values must match LogCategory in the Orthanc Core | |
9498 OrthancPluginLogCategory_Generic = (1 << 0), /*!< Generic (default) category */ | |
9499 OrthancPluginLogCategory_Plugins = (1 << 1), /*!< Plugin engine related logs (shall not be used by plugins) */ | |
9500 OrthancPluginLogCategory_Http = (1 << 2), /*!< HTTP related logs */ | |
9501 OrthancPluginLogCategory_Sqlite = (1 << 3), /*!< SQLite related logs (shall not be used by plugins) */ | |
9502 OrthancPluginLogCategory_Dicom = (1 << 4), /*!< DICOM related logs */ | |
9503 OrthancPluginLogCategory_Jobs = (1 << 5), /*!< jobs related logs */ | |
9504 OrthancPluginLogCategory_Lua = (1 << 6), /*!< Lua related logs (shall not be used by plugins) */ | |
9505 | |
9506 // Force the enum to be 32 bits | |
9507 OrthancPluginLogCategory_INTERNAL = 0x7FFFFFFF | |
9508 } OrthancPluginLogCategory; | |
9509 | |
9510 | |
9511 // note: this structure is also defined in Logging.h and it must be binary compatible | |
9512 typedef struct | |
9513 { | |
9514 const char* message; | 9526 const char* message; |
9515 const char* plugin; | 9527 const char* plugin; |
9516 const char* file; | 9528 const char* file; |
9517 uint32_t line; | 9529 uint32_t line; |
9518 OrthancPluginLogCategory category; | 9530 OrthancPluginLogCategory category; |
9522 | 9534 |
9523 /** | 9535 /** |
9524 * @brief Log a message. | 9536 * @brief Log a message. |
9525 * | 9537 * |
9526 * Log a message using the Orthanc logging system. | 9538 * Log a message using the Orthanc logging system. |
9527 * | 9539 * |
9528 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | 9540 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
9529 * @param message The message to be logged. | 9541 * @param message The message to be logged. |
9530 * @param plugin The plugin name. | 9542 * @param plugin The plugin name. |
9531 * @param file The filename in the plugin code. | 9543 * @param file The filename in the plugin code. |
9532 * @param line The file line in the plugin code. | 9544 * @param line The file line in the plugin code. |
9544 { | 9556 { |
9545 _OrthancPluginLogMessage m; | 9557 _OrthancPluginLogMessage m; |
9546 m.message = message; | 9558 m.message = message; |
9547 m.plugin = plugin; | 9559 m.plugin = plugin; |
9548 m.file = file; | 9560 m.file = file; |
9561 m.line = line; | |
9549 m.category = category; | 9562 m.category = category; |
9550 m.line = line; | |
9551 m.level = level; | 9563 m.level = level; |
9552 context->InvokeService(context, _OrthancPluginService_LogMessage, &m); | 9564 context->InvokeService(context, _OrthancPluginService_LogMessage, &m); |
9553 } | 9565 } |
9554 | 9566 |
9555 | 9567 |