search for: data_wrap_struct

Displaying 15 results from an estimated 15 matches for "data_wrap_struct".

2005 May 02
3
where is destructors?
...2 May 2005 11:11:58 -0000 @@ -32,10 +32,16 @@ rb_define_method(rubyClass, "convert_to_image", VALUEFUNC(WxBitmap::ConvertToImage), 0); } +void WxBitmap_free(wxBitmap *bmp) { + if(bmp) { + delete bmp; + }; +}; + VALUE WxBitmap::alloc(VALUE self) { - return Data_Wrap_Struct(self, 0, 0, 0); + return Data_Wrap_Struct(self, 0, WxBitmap_free, 0); } VALUE ================================================================ -- Dmitry mailto:dmiceman@ubiz.ru
2006 Dec 20
0
[789] trunk/wxruby2/swig/classes/Window.i: Make GetChildren work (tho general fix for get_ruby_object still needed)
...bsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE ruby_class = rb_iv_get(mWxruby2, classNameString.mb_str()+2); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturnVal = Data_Wrap_Struct(ruby_class,0,0,obj); </del><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp VALUE ruby_class = rb_iv_get(mWxruby2, classNameString.mb_str()+2); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp returnVal = Data_Wrap_Struct(ruby...
2006 Dec 23
0
[794] trunk/wxruby2: Fix get_ruby_object so it works with SWIG tracking, move find_window_xx
...nbsp&nbsp&nbsp&nbsp&nbsp{ </span><del>-&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp VALUE ruby_class = rb_iv_get(mWxruby2, classNameString.mb_str()+2); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp returnVal = Data_Wrap_Struct(ruby_class,0,0,obj); </del><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp // Check the types match (see SWIG_NewPointerObj) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp VALUE r_swigtype = rb_iv_get(r_obj, "__swigtype__&...
2004 Oct 23
0
win32-ipc, with blocks (code review please)
...or; static char error[MAX_STRING]; static VALUE ipc_init(VALUE self, VALUE obj){ IpcStruct* ptr; Data_Get_Struct(self,IpcStruct,ptr); ptr->handle = (HANDLE)NUM2UINT(obj); return self; } static VALUE ipc_allocate(VALUE klass){ IpcStruct* ptr = malloc(sizeof(IpcStruct)); return Data_Wrap_Struct(klass,0,ipc_free,ptr); } static VALUE wait_for_multiple(VALUE klass,VALUE arr, BOOL fWaitAll,DWORD dwTimeOut) { DWORD dwWait; static HANDLE *handles = NULL; int i,len = RARRAY(arr)->len; if(len==0){ rb_raise(cIpcError,"No objects to wait for"); } REALLOC_N(han...
2013 Dec 27
0
[PATCH] ruby: Fix .new method (RHBZ#1046509).
...if (argc > 1) - rb_raise (rb_eArgError, \"expecting 0 or 1 arguments\"); - - volatile VALUE optargsv = argc == 1 ? argv[0] : rb_hash_new (); - Check_Type (optargsv, T_HASH); + /* Wrap it, and make sure the close function is called when the + * handle goes away. + */ + return Data_Wrap_Struct (c_guestfs, NULL, ruby_guestfs_free, g); +} +static unsigned +parse_flags (int argc, VALUE *argv) +{ + volatile VALUE optargsv; unsigned flags = 0; volatile VALUE v; + + optargsv = argc == 1 ? argv[0] : rb_hash_new (); + Check_Type (optargsv, T_HASH); + v = rb_hash_lookup (optargsv, I...
2007 Jun 28
0
[1092] trunk/wxruby2/swig/classes/App.i: Pass correctly typed Events into filter_event, if defined (bug 10797);
...sp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 1, event_type_id ); &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp + +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE rb_event = Data_Wrap_Struct(event_klass, 0, 0, 0); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspDATA_PTR(rb_event) = &event; + +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE rb_ret_val = rb_funcall(rb_self, filter_event_sym, 1, rb_event); +&nbsp&nbsp&...
2005 May 14
4
Problems with custom service and webrick
Hi all, Windows XP Pro Ruby 1.8.2 I''m having a couple of problems with the following service. The first issue is that the code in service_start doesn''t seem to fire off. The second problem is that any attempt to do ''require "webrick"'' within webrick_daemon.rb causes the service to fail on start. Any ideas? # webrickctl.rb
2003 Oct 27
5
Windows Build - Down to Run Time Errors
I finally got a clean compile and link for wxRuby. Now I''m down to deciphering runtime errors. Once again, I''m going to pick up on this tomorrow, but I thought I''d post my console output tonight to see if anyone has any thoughts before I tackle this tomorrow. I''m running the same app "minimal.rb" E:\Dev\RubyDev\wxruby\samples\minimal>ruby
2006 Dec 07
0
Fwd: win32-service problems with patch
...+ // exceptions, just terminate thread + return 1; } return 0; } static VALUE daemon_allocate(VALUE klass){ - EventHookHash = rb_hash_new(); - - thread_group = rb_class_new_instance(0, 0, - rb_const_get(rb_cObject, rb_intern("ThreadGroup"))); return Data_Wrap_Struct(klass, 0, 0, 0); } +static VALUE +daemon_mainloop_protect(VALUE self) +{ + // Call service_main method + if(rb_respond_to(self,rb_intern("service_main"))){ + rb_funcall(self,rb_intern("service_main"),0); + } + + return self; +} + +static VALUE +daemon_mainloo...
2003 Nov 13
7
modified classes
-- +-[ Kontra, Gergely<kgergely@mcl.hu> PhD student Room IB113 ]---------+ | http://www.mcl.hu/~kgergely "Olyan langesz vagyok, hogy | | Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom" | +-- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+ -------------- next part -------------- A non-text attachment was scrubbed... Name:
2007 May 31
0
[1042] trunk/wxruby2: Overhaul of the event handling WxType->RubyClass mapping to make it
...SSINFO(wxCommandEvent))) - cEvent = cWxCommandEvent.klass; - - else - { - cEvent = cWxEvent.klass; - } - </del><span class="cx"> static VALUE vevent; </span><span class="cx"> vevent = Data_Wrap_Struct(cEvent, 0, 0, 0); </span><span class="cx"> DATA_PTR(vevent) = &event; </span><span class="lines">@@ -500,20 +66,12 @@ </span><span class="cx"> wxRbCallback *cb = (wxRbCallback *)event.m_callbackUserData; </span...
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...RLenNode | RLenValue -> c_params @ [["&len"]] | _ -> c_params in let c_params = List.concat c_params in @@ -3418,6 +3576,7 @@ get_values (VALUE valuesv, size_t *nr_values) pr " return Qnil;\n" | RHive -> pr " return Data_Wrap_Struct (c_hivex, NULL, ruby_hivex_free, r);\n" + | RSize | RNode | RValue | RInt64 -> @@ -3457,6 +3616,14 @@ get_values (VALUE valuesv, size_t *nr_values) pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n"; pr &q...
2008 Jan 14
29
Ebb Web Server
Hello Mongrel Users, I''m writing a web server called Ebb. It''s written in C, makes use of the Mongrel HTTP parser, and uses libev its event loop. The goal is to be small, fast, and language independent server that can host web frameworks. I have written a small Ruby binding which provides a Rack handler - this will allow Ebb to host Rails, Merb, and other Ruby frameworks. In the
2004 Jul 31
3
Bug in new_work_item
Hi all, Windows 2000 Ruby 1.8.2 R7 VC++ 6.0 I noticed that if I try to call new_work_item and give the task a name that already exists, I get a segfault: C:\eclipse\workspace\win32-taskscheduler>ruby test.rb "0.1.0" test.rb:22:in `new_work_item'': NewWorkItem() function failed (Win32::TaskSchedul erError) from test.rb:22 test.rb:22: [BUG] Segmentation fault ruby
2008 Mar 21
26
mongrel garbage collection
Sorry, for the re-post, but I''m new to the mailing list and wanted to bring back up and old topic I saw in the archives. http://rubyforge.org/pipermail/mongrel-users/2008-February/004991.html I think a patch to delay garbage collection and run it later is pretty important for high performance web applications. I do understand the trade-offs of having explicit vs. implicit garbage