本文整理汇总了C++中rb_undef_method函数的典型用法代码示例。如果您正苦于以下问题:C++ rb_undef_method函数的具体用法?C++ rb_undef_method怎么用?C++ rb_undef_method使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rb_undef_method函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Init_gtk_table
void
Init_gtk_table(VALUE mGtk)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TABLE, "Table", mGtk);
RG_DEF_METHOD(initialize, -1);
RG_DEF_METHOD(resize, 2);
RG_DEF_METHOD(attach, -1);
RG_DEF_METHOD(attach_defaults, 5);
G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "row_spacing", tbl_set_row_spacing, 2);
rb_undef_method(RG_TARGET_NAMESPACE, "row_spacing=");
G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "column_spacing", tbl_set_col_spacing, 2);
rb_undef_method(RG_TARGET_NAMESPACE, "column_spacing=");
RG_DEF_METHOD(get_row_spacing, 1);
rb_undef_method(RG_TARGET_NAMESPACE, "row_spacing");
RG_DEF_METHOD(get_column_spacing, 1);
rb_undef_method(RG_TARGET_NAMESPACE, "column_spacing");
RG_DEF_METHOD(set_row_spacings, 1);
RG_DEF_METHOD(set_column_spacings, 1);
/* deprecated
RG_DEF_METHOD(row_spacings, 0);
RG_DEF_METHOD(column_spacings, 0);
*/
RG_DEF_METHOD(default_row_spacing, 0);
RG_DEF_METHOD(default_column_spacing, 0);
RG_DEF_METHOD(size, 0);
}
开发者ID:Vasfed,项目名称:ruby-gnome2,代码行数:27,代码来源:rbgtk-table.c
示例2: Init_rpm_spec
void
Init_rpm_spec(void)
{
rpm_cSpec = rb_define_class_under(rpm_mRPM, "Spec", rb_cData);
rb_define_singleton_method(rpm_cSpec, "open", spec_s_open, 1);
rb_define_singleton_method(rpm_cSpec, "new", spec_s_open, 1);
rb_define_method(rpm_cSpec, "buildroot", rpm_spec_get_buildroot, 0);
rb_define_method(rpm_cSpec, "buildsubdir", rpm_spec_get_buildsubdir, 0);
rb_define_method(rpm_cSpec, "buildarchs", rpm_spec_get_buildarchs, 0);
rb_define_method(rpm_cSpec, "buildrequires", rpm_spec_get_buildrequires, 0);
rb_define_method(rpm_cSpec, "buildconflicts", rpm_spec_get_buildconflicts, 0);
rb_define_method(rpm_cSpec, "build_restrictions", rpm_spec_get_build_restrictions, 0);
rb_define_method(rpm_cSpec, "sources", rpm_spec_get_sources, 0);
rb_define_method(rpm_cSpec, "packages", rpm_spec_get_packages, 0);
rb_define_method(rpm_cSpec, "build", rpm_spec_build, -1);
rb_define_method(rpm_cSpec, "expand_macros", rpm_spec_expand_macros, 1);
rb_undef_method(rpm_cSpec, "dup");
rb_undef_method(rpm_cSpec, "clone");
id_ba = rb_intern("buildarchs");
id_br = rb_intern("buildrequires");
id_bc = rb_intern("buildconflicts");
id_src = rb_intern("sources");
id_pkg = rb_intern("packages");
id_rest = rb_intern("build_restrictions");
}
开发者ID:daviddavis,项目名称:rpm.rb,代码行数:26,代码来源:spec.c
示例3: Init_minisat
void Init_minisat()
{
rb_mMiniSat = rb_define_module("MiniSat");
rb_cSolver = rb_define_class_under(rb_mMiniSat, "Solver", rb_cObject);
rb_define_alloc_func(rb_cSolver, solver_alloc);
rb_define_method(rb_cSolver, "new_var", solver_new_var, 0);
rb_define_method(rb_cSolver, "add_clause", solver_add_clause, -1);
rb_define_method(rb_cSolver, "<<", solver_add_clause_2, 1);
rb_define_method(rb_cSolver, "[]", solver_ref_var, 1);
rb_define_method(rb_cSolver, "solve", solver_solve, -1);
rb_define_method(rb_cSolver, "simplify", solver_simplify, 0);
rb_define_method(rb_cSolver, "simplify_db", solver_simplify_db, 0);
rb_define_method(rb_cSolver, "var_size", solver_var_size, 0);
rb_define_method(rb_cSolver, "clause_size", solver_clause_size, 0);
rb_define_method(rb_cSolver, "to_s", solver_to_s, 0);
rb_define_method(rb_cSolver, "solved?", solver_solved_p, 0);
rb_define_method(rb_cSolver, "satisfied?", solver_satisfied_p, 0);
rb_cVariable = rb_define_class_under(rb_mMiniSat, "Variable", rb_cObject);
rb_undef_method(CLASS_OF(rb_cVariable), "new");
rb_define_method(rb_cVariable, "[email protected]", variable_pos, 0);
rb_define_method(rb_cVariable, "[email protected]", variable_neg, 0);
rb_define_method(rb_cVariable, "value", variable_value, 0);
rb_cLiteral = rb_define_class_under(rb_mMiniSat, "Literal", rb_cObject);
rb_undef_method(CLASS_OF(rb_cLiteral), "new");
}
开发者ID:PhilipCastiglione,项目名称:ruby-minisat,代码行数:28,代码来源:minisat.c
示例4: Init_gtk_handle_box
void
Init_gtk_handle_box(VALUE mGtk)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HANDLE_BOX, "HandleBox", mGtk);
RG_DEF_METHOD(initialize, 0);
rb_undef_method(RG_TARGET_NAMESPACE, "shadow");
rb_undef_method(RG_TARGET_NAMESPACE, "shadow=");
rb_undef_method(RG_TARGET_NAMESPACE, "set_shadow");
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:10,代码来源:rbgtkhandlebox.c
示例5: Init_wkhtml_native
void Init_wkhtml_native() {
//Global initialization of library and when Ruby shuts down
wkhtmltopdf_init(USE_GRAPHICS_INT);
wkhtmltoimage_init(USE_GRAPHICS_INT);
rb_set_end_proc(Deinit_wkhtml_native, Qnil);
idReady = rb_intern("ready");
mWkHtml = rb_define_module("WkHtml");
rb_define_const(mWkHtml, "LIBRARY_VERSION", rb_obj_freeze(rb_str_new_cstr(wkhtmltopdf_version())));
rb_define_const(mWkHtml, "USE_GRAPHICS", INT2BOOL(USE_GRAPHICS_INT));
mWkHtmlToPdf = rb_define_module_under(mWkHtml, "ToPdf");
cWkHtmlToPdfGlobalSettings = rb_define_class_under(mWkHtmlToPdf, "GlobalSettings", rb_cObject);
rb_define_alloc_func(cWkHtmlToPdfGlobalSettings, wkhtml_topdf_globalsettings_alloc);
rb_define_method(cWkHtmlToPdfGlobalSettings, "[]=", wkhtml_topdf_globalsettings_aset, 2);
rb_define_method(cWkHtmlToPdfGlobalSettings, "[]", wkhtml_topdf_globalsettings_aref, 1);
cWkHtmlToPdfObjectSettings = rb_define_class_under(mWkHtmlToPdf, "ObjectSettings", rb_cObject);
rb_define_alloc_func(cWkHtmlToPdfObjectSettings, wkhtml_topdf_objectsettings_alloc);
rb_define_method(cWkHtmlToPdfObjectSettings, "[]=", wkhtml_topdf_objectsettings_aset, 2);
rb_define_method(cWkHtmlToPdfObjectSettings, "[]", wkhtml_topdf_objectsettings_aref, 1);
cWkHtmlToPdfConverter = rb_define_class_under(mWkHtmlToPdf, "Converter", rb_cObject);
/*
TODO
rb_define_singleton_method(klass, "new", constructor, 1); //Uses Data_Wrap_Struct -> rb_obj_call_init(t_data, 1, argv);
rb_define_method(klass, "initialize", initialize, 1);
*/
rb_define_singleton_method(cWkHtmlToPdfConverter, "create", wkhtml_topdf_converter_create, 1);
rb_define_method(cWkHtmlToPdfConverter, "add_object", wkhtml_topdf_converter_add_object, 2);
rb_define_method(cWkHtmlToPdfConverter, "convert", wkhtml_topdf_converter_convert, 0);
rb_define_method(cWkHtmlToPdfConverter, "http_error_code", wkhtml_topdf_converter_http_error_code, 0);
rb_define_method(cWkHtmlToPdfConverter, "get_output", wkhtml_topdf_converter_get_output, 0);
//Force use of factory method
rb_undef_alloc_func(cWkHtmlToPdfConverter);
rb_undef_method(rb_singleton_class(cWkHtmlToPdfConverter), "new");
mWkHtmlToImage = rb_define_module_under(mWkHtml, "ToImage");
cWkHtmlToImageGlobalSettings = rb_define_class_under(mWkHtmlToImage, "GlobalSettings", rb_cObject);
rb_define_alloc_func(cWkHtmlToImageGlobalSettings, wkhtml_toimage_globalsettings_alloc);
rb_define_method(cWkHtmlToImageGlobalSettings, "[]=", wkhtml_toimage_globalsettings_aset, 2);
rb_define_method(cWkHtmlToImageGlobalSettings, "[]", wkhtml_toimage_globalsettings_aref, 1);
cWkHtmlToImageConverter = rb_define_class_under(mWkHtmlToImage, "Converter", rb_cObject);
rb_define_singleton_method(cWkHtmlToImageConverter, "create", wkhtml_toimage_converter_create, 2);
rb_define_method(cWkHtmlToImageConverter, "convert", wkhtml_toimage_converter_convert, 0);
rb_define_method(cWkHtmlToImageConverter, "http_error_code", wkhtml_toimage_converter_http_error_code, 0);
rb_define_method(cWkHtmlToImageConverter, "get_output", wkhtml_toimage_converter_get_output, 0);
//Force use of factory method
rb_undef_alloc_func(cWkHtmlToImageConverter);
rb_undef_method(rb_singleton_class(cWkHtmlToImageConverter), "new");
}
开发者ID:carsonreinke,项目名称:wkhtml,代码行数:55,代码来源:wkhtml.c
示例6: Init_gtk_frame
void
Init_gtk_frame(VALUE mGtk)
{
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FRAME, "Frame", mGtk);
RG_DEF_METHOD(initialize, -1);
RG_DEF_METHOD(set_label_align, 2);
RG_DEF_METHOD(label_align, 0);
rb_undef_method(RG_TARGET_NAMESPACE, "shadow");
rb_undef_method(RG_TARGET_NAMESPACE, "shadow=");
rb_undef_method(RG_TARGET_NAMESPACE, "set_shadow");
}
开发者ID:masaakiaoyagi,项目名称:ruby-gnome2,代码行数:12,代码来源:rbgtkframe.c
示例7: Init_rpm_transaction
void
Init_rpm_transaction(void)
{
rpm_cTransaction = rb_define_class_under(rpm_mRPM, "Transaction", rb_cData);
#if RPM_VERSION_CODE < RPM_VERSION(4,9,0) || RPM_VERSION_CODE >= RPM_VERSION(5,0,0)
rb_define_method(rpm_cTransaction, "db", rpm_transaction_get_db, 0);
#else
rb_define_method(rpm_cTransaction, "init_iterator", rpm_transaction_init_iterator, 2);
#endif
rb_define_method(rpm_cTransaction, "script_file", rpm_transaction_get_script_file, 0);
rb_define_method(rpm_cTransaction, "script_file=", rpm_transaction_set_script_file, 1);
rb_define_method(rpm_cTransaction, "install", rpm_transaction_install, 2);
rb_define_method(rpm_cTransaction, "upgrade", rpm_transaction_upgrade, 2);
#ifdef RPMTS_AVAILABLE
rb_define_method(rpm_cTransaction, "available", rpm_transaction_available, 2);
#endif
rb_define_method(rpm_cTransaction, "delete", rpm_transaction_delete, 1);
rb_define_method(rpm_cTransaction, "check", rpm_transaction_check, 0);
rb_define_method(rpm_cTransaction, "order", rpm_transaction_order, 0);
rb_define_method(rpm_cTransaction, "keys", rpm_transaction_keys, 0);
rb_define_method(rpm_cTransaction, "commit", rpm_transaction_commit, -1);
rb_define_method(rpm_cTransaction, "abort", rpm_transaction_abort, 0);
rb_undef_method(rpm_cTransaction, "dup");
rb_undef_method(rpm_cTransaction, "clone");
rpm_sCallbackData = rb_struct_define(NULL, "type", "key", "package",
"amount", "total", NULL);
rb_define_const(rpm_mRPM, "CallbackData", rpm_sCallbackData);
rpm_sProblem = rb_struct_define(NULL, "type", "key", "package",
"description", NULL);
rb_define_const(rpm_mRPM, "Problem", rpm_sProblem);
id_db = rb_intern("db");
id_sf = rb_intern("script_file");
id_keys = rb_intern("keys");
id_commited = rb_intern("commited");
id_aborted = rb_intern("aborted");
id_pl = rb_intern("problist");
id_type = rb_intern("type");
id_key = rb_intern("key");
id_pkg = rb_intern("package");
id_mes = rb_intern("message");
id_amount = rb_intern("amount");
id_total = rb_intern("total");
//id_pkg_cache = rb_intern("package_cache");
id_file = rb_intern("file");
id_fdt = rb_intern("fdt");
}
开发者ID:basecamp,项目名称:ruby-rpm,代码行数:50,代码来源:db.c
示例8: Init_gdk_pixbuf_loader
void
Init_gdk_pixbuf_loader(VALUE mGdk)
{
VALUE gdkPixbufLoader;
/* initialize it */
gdkPixbufLoader = G_DEF_CLASS(GDK_TYPE_PIXBUF_LOADER, "PixbufLoader", mGdk);
/*
* File Loading, Image Data in Memory
*/
rb_define_method(gdkPixbufLoader, "initialize", initialize_loader, -1);
rb_undef_method(gdkPixbufLoader, "dup");
#if RBGDK_PIXBUF_CHECK_VERSION(2,2,0)
rb_define_method(gdkPixbufLoader, "format", loader_get_format, 0);
#endif
rb_define_method(gdkPixbufLoader, "write", loader_write, 1);
rb_define_method(gdkPixbufLoader, "last_write", last_write, 1);
#if RBGDK_PIXBUF_CHECK_VERSION(2,2,0)
rb_define_method(gdkPixbufLoader, "set_size", loader_set_size, 2);
#endif
rb_define_method(gdkPixbufLoader, "close", loader_close, 0);
rb_define_method(gdkPixbufLoader, "pixbuf", get_pixbuf, 0);
rb_define_method(gdkPixbufLoader, "animation", get_animation, 0);
}
开发者ID:benolee,项目名称:ruby-gnome2,代码行数:25,代码来源:rbgdk-pixbuf-loader.c
示例9: Init_gdk_pixbuf_loader
void
Init_gdk_pixbuf_loader(VALUE mGdk)
{
VALUE RG_TARGET_NAMESPACE;
/* initialize it */
RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF_LOADER, "PixbufLoader", mGdk);
/*
* File Loading, Image Data in Memory
*/
RG_DEF_METHOD(initialize, -1);
rb_undef_method(RG_TARGET_NAMESPACE, "dup");
#if RBGDK_PIXBUF_CHECK_VERSION(2,2,0)
RG_DEF_METHOD(format, 0);
#endif
RG_DEF_METHOD(write, 1);
RG_DEF_METHOD(last_write, 1);
#if RBGDK_PIXBUF_CHECK_VERSION(2,2,0)
RG_DEF_METHOD(set_size, 2);
#endif
RG_DEF_METHOD(close, 0);
RG_DEF_METHOD(pixbuf, 0);
RG_DEF_METHOD(animation, 0);
}
开发者ID:Mazwak,项目名称:ruby-gnome2,代码行数:25,代码来源:rbgdk-pixbuf-loader.c
示例10: Init_instruction
void Init_instruction(void)
{
#ifdef RUBY_VM
VALUE rb_cRubyVM;
VALUE rb_cInstruction;
if(!rb_const_defined(rb_cObject, rb_intern("RubyVM")))
{
rb_define_const(
rb_cObject,
"RubyVM",
rb_const_get(rb_cObject, rb_intern("VM")));
}
rb_cRubyVM = rb_define_class("RubyVM", rb_cObject);
rb_cInstruction = rb_define_class_under(rb_cRubyVM, "Instruction", rb_cObject);
rb_define_method(rb_cInstruction, "initialize", instruction_initialize, -1);
rb_define_method(rb_cInstruction, "operands", instruction_operands, 0);
rb_undef_method(rb_cInstruction, "new");
define_instruction_subclasses(rb_cInstruction);
/* Silence compiler warnings about unused static functions */
insn_name(0);
insn_op_type(0, 0);
insn_op_types(0);
#endif
}
开发者ID:shmulim,项目名称:ruby-internal,代码行数:29,代码来源:instruction.c
示例11: LockDownClass
//------------------------------------------------------------------------------
// Function: LockDownClass
//
// Description:
//
// Lock down key methods in a class.
//
// Returns:
//
// Notes:
//
void
LockDownClass(
_In_ VALUE klass)
{
// Prevent scripter from instantiating directly.
//
// 'rb_undef_method' undefs an *instance* method of the given class,
// so for 'new' which is a 'class method', we have to get the
// object's class.
//
rb_undef_method(CLASS_OF(klass), "new");
rb_undef_method(klass, "dup");
rb_undef_method(klass, "clone");
}
开发者ID:alexbudmsft,项目名称:dbgscript,代码行数:27,代码来源:util.cpp
示例12: rb_init_apache_connection
void rb_init_apache_connection()
{
rb_cApacheConnection = rb_define_class_under(rb_mApache, "Connection", rb_cObject);
rb_undef_method(CLASS_OF(rb_cApacheConnection), "new");
rb_define_method(rb_cApacheConnection, "aborted?",
connection_aborted, 0);
rb_define_method(rb_cApacheConnection, "keepalive",
connection_keepalive, 0);
rb_define_method(rb_cApacheConnection, "double_reverse",
connection_double_reverse, 0);
rb_define_method(rb_cApacheConnection, "keepalives",
connection_keepalives, 0);
rb_define_method(rb_cApacheConnection, "remote_ip",
connection_remote_ip, 0);
rb_define_method(rb_cApacheConnection, "remote_host",
connection_remote_host, 0);
rb_define_method(rb_cApacheConnection, "remote_port",
connection_remote_port, 0);
rb_define_method(rb_cApacheConnection, "remote_logname",
connection_remote_logname, 0);
rb_define_method(rb_cApacheConnection, "user", connection_user, 0);
rb_define_method(rb_cApacheConnection, "user=", connection_set_user, 1);
rb_define_method(rb_cApacheConnection, "auth_type",
connection_auth_type, 0);
rb_define_method(rb_cApacheConnection, "auth_type=",
connection_set_auth_type, 1);
rb_define_method(rb_cApacheConnection, "local_ip",
connection_local_ip, 0);
rb_define_method(rb_cApacheConnection, "local_host",
connection_local_host, 0);
rb_define_method(rb_cApacheConnection, "local_port",
connection_local_port, 0);
rb_define_method(rb_cApacheConnection, "notes",
connection_notes, 0);
}
开发者ID:ged,项目名称:mod_ruby,代码行数:35,代码来源:connection.c
示例13: Init_zoom_resultset
void
Init_zoom_resultset (VALUE mZoom)
{
VALUE c;
c = rb_define_class_under (mZoom, "ResultSet", rb_cObject);
rb_undef_method (CLASS_OF (c), "new");
rb_define_method (c, "set_option", rbz_resultset_set_option, 2);
rb_define_method (c, "get_option", rbz_resultset_get_option, 1);
define_zoom_option (c, "start");
define_zoom_option (c, "count");
define_zoom_option (c, "presentChunk");
define_zoom_option (c, "elementSetName");
define_zoom_option (c, "preferredRecordSyntax");
define_zoom_option (c, "schema");
define_zoom_option (c, "setname");
rb_define_method (c, "size", rbz_resultset_size, 0);
rb_define_alias (c, "length", "size");
rb_define_method (c, "records", rbz_resultset_records, 0);
rb_define_method (c, "each_record", rbz_resultset_each_record, 0);
rb_define_method (c, "[]", rbz_resultset_index, -1);
cZoomResultSet = c;
}
开发者ID:Verba,项目名称:ruby-zoom,代码行数:26,代码来源:rbzoomresultset.c
示例14: rbffi_DynamicLibrary_Init
void
rbffi_DynamicLibrary_Init(VALUE moduleFFI)
{
LibraryClass = rb_define_class_under(moduleFFI, "DynamicLibrary", rb_cObject);
rb_global_variable(&LibraryClass);
SymbolClass = rb_define_class_under(LibraryClass, "Symbol", rbffi_PointerClass);
rb_global_variable(&SymbolClass);
rb_define_const(moduleFFI, "NativeLibrary", LibraryClass); // backwards compat library
rb_define_alloc_func(LibraryClass, library_allocate);
rb_define_singleton_method(LibraryClass, "open", library_open, 2);
rb_define_singleton_method(LibraryClass, "last_error", library_dlerror, 0);
rb_define_method(LibraryClass, "initialize", library_initialize, 2);
rb_define_method(LibraryClass, "find_symbol", library_dlsym, 1);
rb_define_method(LibraryClass, "find_function", library_dlsym, 1);
rb_define_method(LibraryClass, "find_variable", library_dlsym, 1);
rb_define_method(LibraryClass, "last_error", library_dlerror, 0);
rb_define_attr(LibraryClass, "name", 1, 0);
rb_define_alloc_func(SymbolClass, symbol_allocate);
rb_undef_method(SymbolClass, "new");
rb_define_method(SymbolClass, "inspect", symbol_inspect, 0);
#define DEF(x) rb_define_const(LibraryClass, "RTLD_" #x, UINT2NUM(RTLD_##x))
DEF(LAZY);
DEF(NOW);
DEF(GLOBAL);
DEF(LOCAL);
}
开发者ID:Flameeyes,项目名称:ffi,代码行数:30,代码来源:DynamicLibrary.c
示例15: Init_basicsocket
/*
* BasicSocket class
*/
void
Init_basicsocket(void)
{
rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO);
rb_undef_method(rb_cBasicSocket, "initialize");
rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup",
bsock_do_not_rev_lookup, 0);
rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup=",
bsock_do_not_rev_lookup_set, 1);
rb_define_singleton_method(rb_cBasicSocket, "for_fd", bsock_s_for_fd, 1);
rb_define_method(rb_cBasicSocket, "close_read", bsock_close_read, 0);
rb_define_method(rb_cBasicSocket, "close_write", bsock_close_write, 0);
rb_define_method(rb_cBasicSocket, "shutdown", bsock_shutdown, -1);
rb_define_method(rb_cBasicSocket, "setsockopt", bsock_setsockopt, -1);
rb_define_method(rb_cBasicSocket, "getsockopt", bsock_getsockopt, 2);
rb_define_method(rb_cBasicSocket, "getsockname", bsock_getsockname, 0);
rb_define_method(rb_cBasicSocket, "getpeername", bsock_getpeername, 0);
rb_define_method(rb_cBasicSocket, "getpeereid", bsock_getpeereid, 0);
rb_define_method(rb_cBasicSocket, "local_address", bsock_local_address, 0);
rb_define_method(rb_cBasicSocket, "remote_address", bsock_remote_address, 0);
rb_define_method(rb_cBasicSocket, "send", rsock_bsock_send, -1);
rb_define_method(rb_cBasicSocket, "recv", bsock_recv, -1);
rb_define_method(rb_cBasicSocket, "recv_nonblock", bsock_recv_nonblock, -1);
rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup", bsock_do_not_reverse_lookup, 0);
rb_define_method(rb_cBasicSocket, "do_not_reverse_lookup=", bsock_do_not_reverse_lookup_set, 1);
}
开发者ID:technohippy,项目名称:oruby,代码行数:31,代码来源:basicsocket.c
示例16: Init_ossl_ssl_session
void Init_ossl_ssl_session(void)
{
#if 0 /* let rdoc know about mOSSL */
mOSSL = rb_define_module("OpenSSL");
mSSL = rb_define_module_under(mOSSL, "SSL");
#endif
cSSLSession = rb_define_class_under(mSSL, "Session", rb_cObject);
eSSLSession = rb_define_class_under(cSSLSession, "SessionError", eOSSLError);
rb_define_alloc_func(cSSLSession, ossl_ssl_session_alloc);
rb_define_method(cSSLSession, "initialize", ossl_ssl_session_initialize, 1);
rb_define_method(cSSLSession, "==", ossl_ssl_session_eq, 1);
rb_define_method(cSSLSession, "time", ossl_ssl_session_get_time, 0);
rb_define_method(cSSLSession, "time=", ossl_ssl_session_set_time, 1);
rb_define_method(cSSLSession, "timeout", ossl_ssl_session_get_timeout, 0);
rb_define_method(cSSLSession, "timeout=", ossl_ssl_session_set_timeout, 1);
#ifdef HAVE_SSL_SESSION_GET_ID
rb_define_method(cSSLSession, "id", ossl_ssl_session_get_id, 0);
#else
rb_undef_method(cSSLSession, "id");
#endif
rb_define_method(cSSLSession, "to_der", ossl_ssl_session_to_der, 0);
rb_define_method(cSSLSession, "to_pem", ossl_ssl_session_to_pem, 0);
rb_define_method(cSSLSession, "to_text", ossl_ssl_session_to_text, 0);
}
开发者ID:2220142,项目名称:ruby,代码行数:28,代码来源:ossl_ssl_session.c
示例17: bdb_init_log
void bdb_init_log()
{
rb_define_method(bdb_cEnv, "log_put", bdb_s_log_put, -1);
rb_define_method(bdb_cEnv, "log_curlsn", bdb_s_log_curlsn, 0);
rb_define_method(bdb_cEnv, "log_checkpoint", bdb_s_log_checkpoint, 1);
rb_define_method(bdb_cEnv, "log_flush", bdb_s_log_flush, -1);
rb_define_method(bdb_cEnv, "log_stat", bdb_env_log_stat, -1);
rb_define_method(bdb_cEnv, "log_archive", bdb_env_log_archive, -1);
#if ! HAVE_ST_DB_ENV_LOG_CURSOR
rb_define_method(bdb_cEnv, "log_get", bdb_env_log_get, 1);
#else
rb_define_method(bdb_cEnv, "log_cursor", bdb_env_log_cursor, 0);
#endif
rb_define_method(bdb_cEnv, "log_each", bdb_env_log_each, 0);
rb_define_method(bdb_cEnv, "log_reverse_each", bdb_env_log_hcae, 0);
rb_define_method(bdb_cCommon, "log_register", bdb_log_register, 1);
rb_define_method(bdb_cCommon, "log_unregister", bdb_log_unregister, 0);
bdb_cLsn = rb_define_class_under(bdb_mDb, "Lsn", rb_cObject);
rb_include_module(bdb_cLsn, rb_mComparable);
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
rb_undef_alloc_func(bdb_cLsn);
#else
rb_undef_method(CLASS_OF(bdb_cLsn), "allocate");
#endif
rb_undef_method(CLASS_OF(bdb_cLsn), "new");
rb_define_method(bdb_cLsn, "env", bdb_lsn_env, 0);
#if HAVE_ST_DB_ENV_LOG_CURSOR
rb_define_method(bdb_cLsn, "log_cursor", bdb_log_cursor, 0);
rb_define_method(bdb_cLsn, "cursor", bdb_log_cursor, 0);
rb_define_method(bdb_cLsn, "log_close", bdb_log_cursor_close, 0);
rb_define_method(bdb_cLsn, "close", bdb_log_cursor_close, 0);
rb_define_method(bdb_cLsn, "log_each", bdb_log_each, 0);
rb_define_method(bdb_cLsn, "each", bdb_log_each, 0);
rb_define_method(bdb_cLsn, "log_reverse_each", bdb_log_hcae, 0);
rb_define_method(bdb_cLsn, "reverse_each", bdb_log_hcae, 0);
#endif
rb_define_method(bdb_cLsn, "log_get", bdb_lsn_log_get, -1);
rb_define_method(bdb_cLsn, "get", bdb_lsn_log_get, -1);
rb_define_method(bdb_cLsn, "log_compare", bdb_lsn_log_compare, 1);
rb_define_method(bdb_cLsn, "compare", bdb_lsn_log_compare, 1);
rb_define_method(bdb_cLsn, "<=>", bdb_lsn_log_compare, 1);
rb_define_method(bdb_cLsn, "log_file", bdb_lsn_log_file, 0);
rb_define_method(bdb_cLsn, "file", bdb_lsn_log_file, 0);
rb_define_method(bdb_cLsn, "log_flush", bdb_lsn_log_flush, 0);
rb_define_method(bdb_cLsn, "flush", bdb_lsn_log_flush, 0);
}
开发者ID:mallowlabs,项目名称:ruby-bdb,代码行数:46,代码来源:log.c
示例18: Init_Result
void
Init_Result (VALUE mXmms)
{
cResult = rb_define_class_under (mXmms, "Result", rb_cObject);
/* ugh, we have to define the "new" method,
* so we can remove it again :(
*/
rb_define_singleton_method (cResult, "new", NULL, 0);
rb_undef_method (rb_singleton_class (cResult), "new");
rb_define_method (cResult, "notifier", c_notifier_set, 0);
rb_define_method (cResult, "wait", c_wait, 0);
rb_define_method (cResult, "value", c_value_get, 0);
rb_define_method (cResult, "error?", c_is_error, 0);
rb_define_method (cResult, "error", c_get_error, 0);
cBroadcastResult = rb_define_class_under (mXmms,
"BroadcastResult",
cResult);
rb_define_method (cBroadcastResult, "disconnect", c_disconnect, 0);
cSignalResult = rb_define_class_under (mXmms, "SignalResult",
cResult);
rb_define_method (cSignalResult, "disconnect", c_disconnect, 0);
eResultError = rb_define_class_under (cResult, "ResultError",
rb_eStandardError);
eValueError = rb_define_class_under (cResult, "ValueError",
eResultError);
cDict = rb_define_class_under (mXmms, "Dict", rb_cObject);
#ifdef HAVE_RB_PROTECT_INSPECT
rb_define_method (cDict, "inspect", c_dict_inspect, 0);
#endif /* HAVE_RB_PROTECT_INSPECT */
rb_define_method (cDict, "size", c_dict_size, 0);
rb_define_method (cDict, "empty?", c_dict_empty, 0);
rb_define_method (cDict, "[]", c_dict_aref, 1);
rb_define_method (cDict, "has_key?", c_dict_has_key, 1);
rb_define_method (cDict, "each", c_dict_each, 0);
rb_define_method (cDict, "each_key", c_dict_each_key, 0);
rb_define_method (cDict, "each_value", c_dict_each_value, 0);
rb_define_alias (cDict, "length", "size");
rb_define_alias (cDict, "include?", "has_key?");
rb_define_alias (cDict, "key?", "has_key?");
rb_define_alias (cDict, "member?", "has_key?");
rb_define_alias (cDict, "each_pair", "each");
rb_include_module (cDict, rb_mEnumerable);
cRawDict = rb_define_class_under (mXmms, "RawDict", cDict);
rb_define_method (cRawDict, "to_propdict", c_raw_dict_to_propdict, -1);
}
开发者ID:vdust,项目名称:xmms2-devel,代码行数:57,代码来源:rb_result.c
示例19: ruby_Init_Continuation_body
void
ruby_Init_Continuation_body(void)
{
rb_cContinuation = rb_define_class("Continuation", rb_cObject);
rb_undef_alloc_func(rb_cContinuation);
rb_undef_method(CLASS_OF(rb_cContinuation), "new");
rb_define_method(rb_cContinuation, "call", rb_cont_call, -1);
rb_define_method(rb_cContinuation, "[]", rb_cont_call, -1);
rb_define_global_function("callcc", rb_callcc, 0);
}
开发者ID:srirammca53,项目名称:update_status,代码行数:10,代码来源:cont.c
示例20: Init_Match
HIDDEN void
Init_Match(VALUE cPatternMatcher)
{
s_cMatch = rb_define_class_under(cPatternMatcher, "Match", rb_cObject);
rb_undef_method(CLASS_OF(s_cMatch), "new");
rb_define_method(s_cMatch, "begin", match_begin, 0);
rb_define_method(s_cMatch, "end", match_end, 0);
rb_define_method(s_cMatch, "inspect", match_inspect, 0);
}
开发者ID:now,项目名称:ned,代码行数:10,代码来源:match.c
注:本文中的rb_undef_method函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论