1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
10 | ruby language support (C) Novell Inc. |
11 \----------------------------------------------------------------------/
13 Author: Duncan Mac-Vicar <dmacvicar@suse.de>
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version
18 2 of the License, or (at your option) any later version.
28 #include <ycp/YCPList.h>
31 // make the compiler happy when
32 // calling rb_define_method()
33 typedef VALUE (ruby_method)(...);
36 #define RB_FINALIZER(func) ((void (*)(...))func)
38 // this macro saves us from typing
39 // (ruby_method*) & method_name
40 // in rb_define_method
41 #define RB_METHOD(func) ((VALUE (*)(...))func)
48 * Load a Ruby module - equivalent to "use" in Ruby.
50 * Returns a YCPError on failure, YCPVoid on success.
52 static YCPValue loadModule( YCPList argList );
55 * Access the static (singleton) YRuby object. Create it if it isn't
60 static YRuby * yRuby();
63 * Destroy the static (singleton) YRuby object and unload the embedded Ruby
68 static YCPValue destroy();
74 * Protected constructor. Use one of the static methods rather than
75 * instantiate an object of this class yourself.
80 * Protected constructor. Use one of the static methods rather than
81 * instantiate an object of this class yourself.
90 * Returns the internal embedded Ruby interpreter.
98 YCPValue callInner (string module, string function, bool method,
99 YCPList argList, constTypePtr wanted_result_type);
104 static YRuby * _yRuby;