typelib_ruby.cc
Go to the documentation of this file.
00001 #include "typelib.hh"
00002 
00003 #include <typelib/typevisitor.hh>
00004 #include <typelib/pluginmanager.hh>
00005 #include <typelib/importer.hh>
00006 #include <utilmm/configfile/configset.hh>
00007 
00008 using namespace Typelib;
00009 using utilmm::config_set;
00010 using std::string;
00011 
00012 using namespace typelib_ruby;
00013 static VALUE mTypelib   = Qnil;
00014 
00015 /**********************************************************************
00016  *
00017  * Extension of the standard libraries
00018  *
00019  */
00020 
00021 static VALUE kernel_is_immediate(VALUE klass, VALUE object)
00022 { return IMMEDIATE_P(object) ? Qtrue : Qfalse; }
00023 /* call-seq:
00024  *  numeric?    => true or false
00025  *
00026  * Returns true if the receiver is either a Fixnum or a Float
00027  */
00028 static VALUE kernel_is_numeric(VALUE klass, VALUE object)
00029 { 
00030     return (FIXNUM_P(object) || TYPE(object) == T_FLOAT || TYPE(object) == T_BIGNUM) ? Qtrue : Qfalse;
00031 }
00032 
00033 
00034 static VALUE typelib_with_dyncall(VALUE klass)
00035 {
00036     return
00037 #ifdef WITH_DYNCALL
00038         Qtrue;
00039 #else
00040         Qfalse;
00041 #endif
00042 }
00043 
00044 extern "C" void Init_typelib_ruby()
00045 {
00046     mTypelib  = rb_define_module("Typelib");
00047 #ifdef WITH_DYNCALL
00048     Typelib_init_functions();
00049 #endif
00050     Typelib_init_values();
00051     Typelib_init_strings();
00052     Typelib_init_registry();
00053     Typelib_init_memory();
00054     
00055     rb_define_singleton_method(mTypelib, "with_dyncall?", RUBY_METHOD_FUNC(typelib_with_dyncall), 0);
00056     rb_define_singleton_method(rb_mKernel, "immediate?", RUBY_METHOD_FUNC(kernel_is_immediate), 1);
00057     rb_define_singleton_method(rb_mKernel, "numeric?", RUBY_METHOD_FUNC(kernel_is_numeric), 1);
00058 }
00059 


typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Thu Jan 2 2014 11:38:41