zeek/testing/builtin-plugins/Files/py-lib-plugin/plugin/src/pylib.bif
Arne Welzel 1912ba7002 cirrus: Add smoke testing for builtin plugins
This adds two example plugins within testing/builtin-plugins/Files:

* protocol-plugin copied over from testing/btest/plugins/protocol-plugin

* py-lib-plugin that embeds Python to have a dependency on an external
  shared library which was already available in CI and fun to use, too.

Closes #2837
2023-03-08 22:32:29 +01:00

18 lines
282 B
C++

module Python;
%%{
extern "C" {
#include <Python.h>
}
%%}
function version%(%): string
%{
return zeek::make_intrusive<zeek::StringVal>(Py_GetVersion());
%}
function run_simple_string%(s: string%): bool
%{
PyRun_SimpleString(s->CheckString());
return zeek::val_mgr->True();
%}