diff --git a/src/graph/plugins/CMakeLists.txt b/src/graph/plugins/CMakeLists.txt index a27923c..62ae908 100644 --- a/src/graph/plugins/CMakeLists.txt +++ b/src/graph/plugins/CMakeLists.txt @@ -1 +1,9 @@ -add_subdirectory("./http") \ No newline at end of file +option(ENABLE_PLUGIN_HTTP "Enable http plugin" ON) +if(ENABLE_PLUGIN_HTTP) + add_subdirectory("./http") +endif() + +option(ENABLE_PLUGIN_STAR "Enable star plugin" ON) +if(ENABLE_PLUGIN_STAR) + add_subdirectory("./star") +endif() \ No newline at end of file diff --git a/src/graph/plugins/star/CMakeLists.txt b/src/graph/plugins/star/CMakeLists.txt new file mode 100644 index 0000000..68e52b4 --- /dev/null +++ b/src/graph/plugins/star/CMakeLists.txt @@ -0,0 +1,3 @@ +file(GLOB_RECURSE STAR_SOURCES "./*.c") +add_library(star SHARED ${STAR_SOURCES}) +set_target_properties(star PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") \ No newline at end of file diff --git a/src/graph/plugins/star/star.c b/src/graph/plugins/star/star.c new file mode 100644 index 0000000..0acd089 --- /dev/null +++ b/src/graph/plugins/star/star.c @@ -0,0 +1,23 @@ +#include + +int run(); +int destroy(); + +plugin_t plugin = {.version=1, .run_method=&run, .destroy_method=&destroy, .update_callback=0, .argc=0, .argv=0}; + +int run() { + point_t points[6] = { + {2/4.0, 2/2.0}, + {3/4.0, 0/2.0}, + {0/4.0, 1/2.0}, + {4/4.0, 1/2.0}, + {1/4.0, 0/2.0}, + {2/4.0, 2/2.0} + }; + + plugin.update_callback(0, "star", points, 6); + + return 0; +} + +int destroy() { return 0; } \ No newline at end of file