diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
commit | be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit | |
parent | Initial commit. (diff) | |
download | netdata-upstream.tar.xz netdata-upstream.zip |
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit')
-rw-r--r-- | web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/mrbgem.rake | 5 | ||||
-rw-r--r-- | web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/src/mruby-exit.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/mrbgem.rake b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/mrbgem.rake new file mode 100644 index 00000000..d193528d --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/mrbgem.rake @@ -0,0 +1,5 @@ +MRuby::Gem::Specification.new('mruby-exit') do |spec| + spec.license = 'MIT' + spec.author = 'mruby developers' + spec.summary = 'Kernel#exit method' +end diff --git a/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/src/mruby-exit.c b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/src/mruby-exit.c new file mode 100644 index 00000000..3e147f80 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-exit/src/mruby-exit.c @@ -0,0 +1,24 @@ +#include <stdlib.h> +#include <mruby.h> + +static mrb_value +f_exit(mrb_state *mrb, mrb_value self) +{ + mrb_int i = EXIT_SUCCESS; + + mrb_get_args(mrb, "|i", &i); + exit(i); + /* not reached */ + return mrb_nil_value(); +} + +void +mrb_mruby_exit_gem_init(mrb_state* mrb) +{ + mrb_define_method(mrb, mrb->kernel_module, "exit", f_exit, MRB_ARGS_OPT(1)); +} + +void +mrb_mruby_exit_gem_final(mrb_state* mrb) +{ +} |