Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/448#discussion_r239105138
--- Diff: nanofi/include/api/nanofi.h ---
@@ -71,62 +94,173 @@ typedef int c2_start_callback(char *);
void enable_async_c2(nifi_instance *, C2_Server *, c2_stop_callback *,
c2_start_callback *, c2_update_callback *);
+/**
+ * Creates a new, empty flow
+ * @param instance the instance new flow will belong to
+ * @return a pointer to the created flow
+ **/
+flow *create_new_flow(nifi_instance * instance);
-uint8_t run_processor(const processor *processor);
-
-flow *create_new_flow(nifi_instance *);
-flow *create_flow(nifi_instance *, const char *);
+/**
+ * Creates new flow and adds the first processor in case a valid name is
provided
+ * @deprecated as there is no proper indication of processor adding
errors,
+ * usage of "create_new_flow" and "add_processor is recommended instead
+ * @param instance the instance new flow will belong to
+ * @param first_processor name of the first processor to be instanciated
+ * @attention in case first processor is empty or doesn't name any
existing processor, an empty flow is returned.
+ * @return a pointer to the created flow
+ **/
+DEPRECATED flow *create_flow(nifi_instance * instance, const char *
first_processor);
-flow *create_getfile(nifi_instance *instance, flow *parent, GetFileConfig
*c);
+/**
+ * Add a getfile processor to "parent" flow.
+ * Creates new flow in instance in case "parent" is nullptr
+ * @deprecated as getfile processor can be added using "add_processor"
function,
+ * properties can be set using "set_property".
+ * @param instance the instance the flow belongs to
+ * @param parent the flow to be extended with a new getfile processor
+ * @param c configuration of the new processor
+ * @return parent in case it wasn't null, otherwise a pointer to a new flow
+ */
+DEPRECATED flow *create_getfile(nifi_instance *instance, flow *parent,
GetFileConfig *c);
-processor *add_processor(flow *, const char *);
+/**
+ * Extend a flow with a new processor
+ * @param flow the flow to be extended with the new processor
+ * @param name name of the new processor
+ * @return pointer to the new processor or nullptr in case it cannot be
instantiated (wrong name?)
+ */
+processor *add_processor(flow * flow, const char * name);
processor *add_python_processor(flow *, void
(*ontrigger_callback)(processor_session *session));
--- End diff --
This was starved off due to other work, but we will eventually need
directory specific accessor functions for languages , I would imagine. This
could be a candidate for that.
---