adamdebreceni commented on code in PR #1987:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1987#discussion_r2485671069


##########
minifi-api/include/minifi-c/minifi-c.h:
##########
@@ -0,0 +1,228 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef MINIFI_API_INCLUDE_MINIFI_C_MINIFI_C_H_
+#define MINIFI_API_INCLUDE_MINIFI_C_MINIFI_C_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define STRINGIFY_HELPER(X) #X
+#define STRINGIFY(X) STRINGIFY_HELPER(X)
+
+#define MINIFI_API_MAJOR_VERSION 0
+#define MINIFI_API_MINOR_VERSION 1
+#define MINIFI_API_PATCH_VERSION 0
+#define MINIFI_API_VERSION STRINGIFY(MINIFI_API_MAJOR_VERSION) "." 
STRINGIFY(MINIFI_API_MINOR_VERSION) "." STRINGIFY(MINIFI_API_PATCH_VERSION)
+#define MINIFI_API_VERSION_TAG "MINIFI_API_VERSION=[" MINIFI_API_VERSION "]"
+#define MINIFI_NULL 0
+#define OWNED
+
+typedef uint32_t MinifiBool;
+#define MINIFI_TRUE MinifiBool(1)
+#define MINIFI_FALSE MinifiBool(0)
+
+typedef enum MinifiInputRequirement {
+  MINIFI_INPUT_REQUIRED = 0,
+  MINIFI_INPUT_ALLOWED = 1,
+  MINIFI_INPUT_FORBIDDEN = 2
+} MinifiInputRequirement;
+
+typedef struct MinifiStringView {
+  const char* data;
+  uint32_t length;
+} MinifiStringView;
+
+typedef struct MinifiRelationship {
+  MinifiStringView name;
+  MinifiStringView description;
+} MinifiRelationship;
+
+typedef struct MinifiOutputAttribute {
+  MinifiStringView name;
+  uint32_t relationships_count;
+  const MinifiRelationship* relationships_ptr;
+  MinifiStringView description;
+} MinifiOutputAttribute;
+
+typedef struct MinifiDynamicProperty {
+  MinifiStringView name;
+  MinifiStringView value;
+  MinifiStringView description;
+  MinifiBool supports_expression_language;
+} MinifiDynamicProperty;
+
+#define MINIFI_DECLARE_HANDLE(name) typedef struct name ## _T* name
+#define MINIFI_DECLARE_CONST_HANDLE(name) typedef const struct name ## _T* name
+
+MINIFI_DECLARE_CONST_HANDLE(MinifiPropertyValidator);
+MINIFI_DECLARE_HANDLE(MinifiFlowFile);
+MINIFI_DECLARE_HANDLE(MinifiLogger);
+MINIFI_DECLARE_HANDLE(MinifiProcessContext);
+MINIFI_DECLARE_HANDLE(MinifiProcessSession);
+MINIFI_DECLARE_HANDLE(MinifiInputStream);
+MINIFI_DECLARE_HANDLE(MinifiOutputStream);
+MINIFI_DECLARE_HANDLE(MinifiConfigure);
+MINIFI_DECLARE_HANDLE(MinifiExtension);
+MINIFI_DECLARE_HANDLE(MinifiPublishedMetrics);
+
+typedef struct MinifiExtensionCreateInfo {
+  MinifiStringView name;
+  MinifiBool(*initialize)(void*, MinifiConfigure);
+  void* user_data;
+} MinifiExtensionCreateInfo;
+
+typedef enum MinifiStatus {
+  MINIFI_SUCCESS = 0,
+  MINIFI_UNKNOWN_ERROR = 1,
+  MINIFI_NOT_SUPPORTED_PROPERTY = 2,
+  MINIFI_DYNAMIC_PROPERTIES_NOT_SUPPORTED = 3,
+  MINIFI_PROPERTY_NOT_SET = 4,
+  MINIFI_VALIDATION_FAILED = 5,
+  MINIFI_PROCESSOR_YIELD = 6
+} MinifiStatus;
+
+typedef struct MinifiProperty {
+  MinifiStringView name;
+  MinifiStringView display_name;
+  MinifiStringView description;
+  MinifiBool is_required;
+  MinifiBool is_sensitive;
+  uint32_t dependent_properties_count;
+  const MinifiStringView* dependent_properties_ptr;
+  uint32_t exclusive_of_properties_count;
+  const MinifiStringView* exclusive_of_property_names_ptr;
+  const MinifiStringView* exclusive_of_property_values_ptr;
+
+  const MinifiStringView* default_value;
+  uint32_t allowed_values_count;
+  const MinifiStringView* allowed_values_ptr;
+  MinifiPropertyValidator validator;
+
+  uint32_t types_count;
+  const MinifiStringView* types_ptr;
+  MinifiBool supports_expression_language;
+} MinifiProperty;
+
+typedef enum MinifiLogLevel {
+  MINIFI_TRACE = 0,
+  MINIFI_DEBUG = 1,
+  MINIFI_INFO = 2,
+  MINIFI_WARNING = 3,
+  MINIFI_ERROR = 4,
+  MINIFI_CRITICAL = 5,
+  MINIFI_OFF = 6
+} MinifiLogLevel;
+
+typedef struct MinifiProcessorMetadata {
+  MinifiStringView uuid;
+  MinifiStringView name;
+  MinifiLogger logger;  // borrowed reference, live until the processor is live
+} MinifiProcessorMetadata;
+
+typedef struct MinifiProcessorCallbacks {
+  OWNED void*(*create)(MinifiProcessorMetadata);
+  void(*destroy)(OWNED void*);
+  MinifiBool(*isWorkAvailable)(void*);
+  void(*restore)(void*, OWNED MinifiFlowFile);
+  MinifiBool(*getTriggerWhenEmpty)(void*);
+  MinifiStatus(*onTrigger)(void*, MinifiProcessContext, MinifiProcessSession);
+  MinifiStatus(*onSchedule)(void*, MinifiProcessContext);
+  void(*onUnSchedule)(void*);
+  OWNED MinifiPublishedMetrics(*calculateMetrics)(void*);
+} MinifiProcessorCallbacks;
+
+typedef struct MinifiProcessorClassDescription {
+  MinifiStringView module_name;
+  MinifiStringView full_name;  // '::'-delimited fully qualified name e.g. 
'org::apache::nifi::minifi::GenerateFlowFile'
+  MinifiStringView description;
+  uint32_t class_properties_count;
+  const MinifiProperty* class_properties_ptr;
+  uint32_t dynamic_properties_count;
+  const MinifiDynamicProperty* dynamic_properties_ptr;
+  uint32_t class_relationships_count;
+  const MinifiRelationship* class_relationships_ptr;
+  uint32_t output_attributes_count;
+  const MinifiOutputAttribute* output_attributes_ptr;
+  MinifiBool supports_dynamic_properties;
+  MinifiBool supports_dynamic_relationships;
+  MinifiInputRequirement input_requirement;
+  MinifiBool is_single_threaded;
+
+  MinifiProcessorCallbacks callbacks;
+} MinifiProcessorClassDescription;
+
+typedef enum MinifiStandardPropertyValidator {

Review Comment:
   I agree that there are only property validators currently, but from a 
`MinifiValidator` name I would have no idea what it validates



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to