[Bf-blender-cvs] [23a88646691] functions: Splitup C API for separate components in different files
Jacques Lucke
noreply at git.blender.org
Fri Apr 5 11:34:48 CEST 2019
Commit: 23a8864669115d4a00978ee31924fa1249d05b58
Author: Jacques Lucke
Date: Fri Apr 5 11:32:34 2019 +0200
Branches: functions
https://developer.blender.org/rB23a8864669115d4a00978ee31924fa1249d05b58
Splitup C API for separate components in different files
===================================================================
M source/blender/blenkernel/intern/fcurve.c
M source/blender/functions/CMakeLists.txt
D source/blender/functions/FN-C.h
A source/blender/functions/FN_all-c.h
M source/blender/functions/FN_all.hpp
A source/blender/functions/FN_core-c.h
M source/blender/functions/FN_core.hpp
A source/blender/functions/FN_data_flow_nodes-c.h
M source/blender/functions/FN_data_flow_nodes.hpp
A source/blender/functions/FN_dependencies-c.h
M source/blender/functions/FN_dependencies.hpp
A source/blender/functions/FN_tuple_call-c.h
M source/blender/functions/FN_tuple_call.hpp
A source/blender/functions/FN_types-c.h
M source/blender/functions/FN_types.hpp
A source/blender/functions/backends/dependencies/dependencies-c.cpp
A source/blender/functions/backends/dependencies/dependencies-c.h
A source/blender/functions/backends/tuple_call/tuple_call-c.cpp
A source/blender/functions/backends/tuple_call/tuple_call-c.h
D source/blender/functions/c_wrapper.cpp
A source/blender/functions/core/core-c.cpp
A source/blender/functions/core/core-c.h
A source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.cpp
A source/blender/functions/frontends/data_flow_nodes/data_flow_nodes-c.h
A source/blender/functions/initialize.cpp
A source/blender/functions/types/tuple_access-c.cpp
A source/blender/functions/types/tuple_access-c.h
A source/blender/functions/types/types-c.cpp
A source/blender/functions/types/types-c.h
M source/blender/modifiers/intern/MOD_displace.c
M source/blender/modifiers/intern/MOD_functiondeform.c
M source/blender/modifiers/intern/MOD_functionpoints.c
M source/creator/creator.c
===================================================================
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 502a58e881e..505f1e5b9ee 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -57,7 +57,7 @@
#include "RNA_access.h"
-#include "FN-C.h"
+#include "FN_all-c.h"
#include "atomic_ops.h"
diff --git a/source/blender/functions/CMakeLists.txt b/source/blender/functions/CMakeLists.txt
index b8fee3654de..d0313d51a7a 100644
--- a/source/blender/functions/CMakeLists.txt
+++ b/source/blender/functions/CMakeLists.txt
@@ -27,9 +27,14 @@ set(SRC
FN_types.hpp
FN_functions.hpp
FN_data_flow_nodes.hpp
- FN-C.h
- c_wrapper.cpp
+ FN_all-c.h
+ FN_core-c.h
+ FN_types-c.h
+ FN_dependencies-c.h
+ FN_data_flow_nodes-c.h
+
+ initialize.cpp
core/type.hpp
core/parameter.hpp
@@ -43,6 +48,8 @@ set(SRC
core/source_info.hpp
core/source_info.cpp
core/dot_export.cpp
+ core/core-c.h
+ core/core-c.cpp
backends/tuple_call/cpp_types.hpp
backends/tuple_call/cpp_types.cpp
@@ -56,11 +63,15 @@ set(SRC
backends/tuple_call/lazy_to_normal.cpp
backends/tuple_call/execution_context.hpp
backends/tuple_call/execution_context.cpp
+ backends/tuple_call/tuple_call-c.h
+ backends/tuple_call/tuple_call-c.cpp
backends/dependencies/dependencies.hpp
backends/dependencies/dependencies.cpp
backends/dependencies/fgraph_dependencies.hpp
backends/dependencies/fgraph_dependencies.cpp
+ backends/dependencies/dependencies-c.h
+ backends/dependencies/dependencies-c.cpp
backends/llvm/initialize.hpp
backends/llvm/initialize.cpp
@@ -86,6 +97,10 @@ set(SRC
types/numeric.cpp
types/boolean.hpp
types/boolean.cpp
+ types/types-c.h
+ types/types-c.cpp
+ types/tuple_access-c.h
+ types/tuple_access-c.cpp
functions/object_input.hpp
functions/object_input.cpp
@@ -115,6 +130,8 @@ set(SRC
frontends/data_flow_nodes/inserters/sockets.cpp
frontends/data_flow_nodes/inserters/conversions.cpp
frontends/data_flow_nodes/util_wrappers.hpp
+ frontends/data_flow_nodes/data_flow_nodes-c.h
+ frontends/data_flow_nodes/data_flow_nodes-c.cpp
)
blender_add_lib(bf_functions "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/functions/FN-C.h b/source/blender/functions/FN-C.h
deleted file mode 100644
index 7e54a5c0ab9..00000000000
--- a/source/blender/functions/FN-C.h
+++ /dev/null
@@ -1,129 +0,0 @@
-#ifndef __FUNCTIONS_H__
-#define __FUNCTIONS_H__
-
-#include "BLI_utildefines.h"
-#include "BLI_alloca.h"
-#include "DNA_node_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/************ Generic *************/
-
-void FN_initialize(void);
-
-
-/************** Core *************/
-
-typedef struct OpaqueFnFunction *FnFunction;
-typedef struct OpaqueFnType *FnType;
-
-void FN_function_free(FnFunction fn);
-
-bool FN_function_has_signature(FnFunction, FnType *inputs, FnType *outputs);
-uint FN_input_amount(FnFunction fn);
-uint FN_output_amount(FnFunction fn);
-bool FN_input_has_type(FnFunction fn, uint index, FnType type);
-bool FN_output_has_type(FnFunction fn, uint index, FnType type);
-
-void FN_function_print(FnFunction fn);
-
-
-/************** Types *************/
-
-typedef struct OpaqueFnFloatList *FnFloatList;
-typedef struct OpaqueFnFVec3List *FnFVec3List;
-
-const char *FN_type_name(FnType type);
-void FN_type_free(FnType type);
-
-#define TYPE_GET_AND_BORROW(name) \
- FnType FN_type_get_##name(void); \
- FnType FN_type_borrow_##name(void);
-
-TYPE_GET_AND_BORROW(float);
-TYPE_GET_AND_BORROW(int32);
-TYPE_GET_AND_BORROW(fvec3);
-TYPE_GET_AND_BORROW(float_list);
-TYPE_GET_AND_BORROW(fvec3_list);
-#undef TYPE_GET_AND_BORROW
-
-#define LIST_TYPE(name, ptr_type, list_type) \
- uint FN_list_size_##name(list_type list); \
- ptr_type FN_list_data_##name(list_type list); \
- void FN_list_free_##name(list_type list);
-
-LIST_TYPE(float, float *, FnFloatList);
-LIST_TYPE(fvec3, float *, FnFVec3List);
-#undef LIST_TYPE
-
-/*************** Tuple Call ****************/
-
-typedef struct OpaqueFnTuple *FnTuple;
-typedef struct OpaqueFnTupleCallBody *FnTupleCallBody;
-
-FnTupleCallBody FN_tuple_call_get(FnFunction fn);
-void FN_tuple_call_invoke(
- FnTupleCallBody body, FnTuple fn_in, FnTuple fn_out, const char *caller_info);
-FnTuple FN_tuple_for_input(FnTupleCallBody body);
-FnTuple FN_tuple_for_output(FnTupleCallBody body);
-
-void FN_tuple_free(FnTuple tuple);
-
-void FN_tuple_set_float(FnTuple tuple, uint index, float value);
-void FN_tuple_set_int32(FnTuple tuple, uint index, int32_t value);
-void FN_tuple_set_fvec3(FnTuple tuple, uint index, float vector[3]);
-float FN_tuple_get_float(FnTuple tuple, uint index);
-int32_t FN_tuple_get_int32(FnTuple tuple, uint index);
-void FN_tuple_get_fvec3(FnTuple tuple, uint index, float dst[3]);
-FnFloatList FN_tuple_relocate_out_float_list(FnTuple tuple, uint index);
-FnFVec3List FN_tuple_relocate_out_fvec3_list(FnTuple tuple, uint index);
-
-uint fn_tuple_stack_prepare_size(FnTupleCallBody body);
-void fn_tuple_prepare_stack(
- FnTupleCallBody body,
- void *buffer,
- FnTuple *fn_in,
- FnTuple *fn_out);
-
-void fn_tuple_destruct(FnTuple tuple);
-
-#define FN_TUPLE_CALL_PREPARE_STACK(body, fn_in, fn_out) \
- FnTuple fn_in, fn_out; \
- void *fn_in##_##fn_out##_buffer = alloca(fn_tuple_stack_prepare_size(body)); \
- fn_tuple_prepare_stack(body, fn_in##_##fn_out##_buffer, &fn_in, &fn_out);
-
-#define FN_TUPLE_CALL_DESTRUCT_STACK(body, fn_in, fn_out) \
- fn_tuple_destruct(fn_in); \
- fn_tuple_destruct(fn_out);
-
-#define FN_TUPLE_CALL_PREPARE_HEAP(body, fn_in, fn_out) \
- FnTuple fn_in = FN_tuple_for_input(body); \
- FnTuple fn_out = FN_tuple_for_output(body); \
-
-#define FN_TUPLE_CALL_DESTRUCT_HEAP(body, fn_in, fn_out) \
- FN_tuple_free(fn_in); \
- FN_tuple_free(fn_out);
-
-
-/*************** Dependencies ****************/
-
-struct DepsNodeHandle;
-void FN_function_update_dependencies(
- FnFunction fn,
- struct DepsNodeHandle *deps_node);
-
-
-/************ Data Flow Nodes ****************/
-
-FnFunction FN_tree_to_function(bNodeTree *bnodetree);
-FnFunction FN_function_get_with_signature(
- bNodeTree *btree, FnType *inputs, FnType *outputs);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __FUNCTIONS_H__ */
diff --git a/source/blender/functions/FN_all-c.h b/source/blender/functions/FN_all-c.h
new file mode 100644
index 00000000000..ce881e47e3e
--- /dev/null
+++ b/source/blender/functions/FN_all-c.h
@@ -0,0 +1,20 @@
+#ifndef __FUNCTIONS_H__
+#define __FUNCTIONS_H__
+
+#include "FN_core-c.h"
+#include "FN_types-c.h"
+#include "FN_tuple_call-c.h"
+#include "FN_dependencies-c.h"
+#include "FN_data_flow_nodes-c.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void FN_initialize(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __FUNCTIONS_H__ */
diff --git a/source/blender/functions/FN_all.hpp b/source/blender/functions/FN_all.hpp
index 0c412deb3ff..434f97598a4 100644
--- a/source/blender/functions/FN_all.hpp
+++ b/source/blender/functions/FN_all.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "FN_all-c.h"
#include "FN_core.hpp"
#include "FN_types.hpp"
#include "FN_functions.hpp"
diff --git a/source/blender/functions/FN_core-c.h b/source/blender/functions/FN_core-c.h
new file mode 100644
index 00000000000..6ef593cae4a
--- /dev/null
+++ b/source/blender/functions/FN_core-c.h
@@ -0,0 +1,6 @@
+#ifndef __FUNCTIONS_CORE_C_H__
+#define __FUNCTIONS_CORE_C_H__
+
+#include "core/core-c.h"
+
+#endif /* __FUNCTIONS_CORE_C_H__ */
\ No newline at end of file
diff --git a/source/blender/functions/FN_core.hpp b/source/blender/functions/FN_core.hpp
index 4719aaea787..d2fd857ec83 100644
--- a/source/blender/functions/FN_core.hpp
+++ b/source/blender/functions/FN_core.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "FN_core-c.h"
#include "core/type.hpp"
#include "core/parameter.hpp"
#include "core/signature.hpp"
diff --git a/source/blender/functions/FN_data_flow_nodes-c.h b/source/blender/functions/FN_data_flow_nodes-c.h
new file mode 100644
index 00000000000..e91aacaf2ff
--- /dev/null
+++ b/source/blender/functions/FN_data_flow_nodes-c.h
@@ -0,0 +1,6 @@
+#ifndef __FUNCTIONS_DATA_FLOW_NODES_C_H__
+#define __FUNCTIONS_DATA_FLOW_NODES_C_H__
+
+#include "frontends/data_flow_nodes/data_flow_nodes-c.h"
+
+#endif /* __FUNCTIONS_DATA_FLOW_NODES_C_H__ */
\ No newline at end of file
diff --git a/source/blender/functions/FN_data_flow_nodes.hpp b/source/blender/functions/FN_data_flow_nodes.hpp
index 599b518ed1d..43c0aadfc69 100644
--- a/source/blender/functions/FN_data_flow_nodes.hpp
+++ b/source/blender/functions/FN_data_flow_nodes.hpp
@@ -1,3 +1,4 @@
#pragma once
+#include "FN_data_flow_nodes-c.h"
#include "frontends/data_flow_nodes/function_generation.hpp"
\ No newline at end of file
diff --git a/source/blender/functions/FN_dependencies-c.h b/source/blender/functions/FN_dependencies-c.h
new file mode 100644
index 00000000000..9561a931dfe
--- /dev/null
+++ b/source/blender/functions/FN_dependencies-c.h
@@ -0,0 +1,6 @@
+#ifndef __FUNCTION_DEPENDENCIES_C_H__
+#define __FUNCTION_DEPENDENCIES_C_H__
+
+#include "backends/dependencies/dependencies-c.h"
+
+#endif /* __FUNCTION_DEPENDENCIES_C_H__ */
\ No newline at end of file
diff --git a/source/blender/functions/FN_dependencies.hpp b/source/blender/functions/FN_dependencies.hpp
index f6c8b8f2928..ff1826b49c2 100644
--- a/source/blender/functions/FN_dependencies.hpp
+++ b/source/blender/functions/FN_dependencies.hpp
@@ -1,4 +1,5 @@
#pragma once
+#include "FN_dependencies-c.h"
#include "backends/dependencies/dependencies.hpp"
#include "backends/dependencies/fgraph_dependencies.hpp"
\ No newline at end of file
diff --git a/source/blender/functions/FN_tuple_call-c.h b/source/blender/functions/FN_tuple_call-c.h
new file mode 100644
index 00000000000..6ab4bc29f7c
--- /dev/null
+++ b/source/blender/functions/FN_tuple_call-c.h
@@ -0,0 +1,6 @@
+#ifndef __FUNCTIONS_TUPLE_CALL_C_H__
+#define __FUNCTIONS_TUPLE_CALL_C_H__
+
+#include "backends/tuple_call/tuple_call-c.h"
+
+#endif /* __FUNCTIONS_TUPLE_CALL_C_H__ */
\ No newline at end of file
diff --git a/source/blender/functions/FN_tuple_call.hpp b/source/blender/functions/FN_tuple_call.hpp
index f066b66a7fa..c19636c726c 100644
--- a/source/blender/functions/FN_tuple_call.hpp
+++ b/source/bl
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list