Displaying 20 results from an estimated 58 matches for "rb_intern".
2007 Apr 13
0
[961] branches/wxruby2/wxwidgets_282/swig: Move wxDateTime typemap into shared file, map to core Time class instead
...lt;/span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+// Typemaps for converting between wxDateTime and Ruby''s Date and Time classes
+
+%{
+#include <wx/datetime.h>
+%}
+
+%typemap(in) const wxDateTime& {
+ int y = NUM2INT(rb_funcall($input, rb_intern("year"), 0));
+ int rMonth = NUM2INT(rb_funcall($input, rb_intern("month"), 0));
+ int rDay = NUM2INT(rb_funcall($input, rb_intern("mday"), 0));
+ int rHour = NUM2INT(rb_funcall($input, rb_intern("hour"), 0));
+ int rMinute = NUM2INT(rb_funcall($i...
2006 Dec 07
0
Fwd: win32-service problems with patch
...ruby thread to deal with it
+ // this might be over engineering the solution, but I don''t
+ // want to block Service_Ctrl longer than necessary and the
+ // critical section will block it.
+ VALUE EventHookHash = rb_ivar_get(self,
rb_intern("@event_hooks"));
+ if (EventHookHash != Qnil) {
+ VALUE val = rb_hash_aref(EventHookHash,
INT2NUM(waiting_control_code));
+ if(val!=Qnil) {
+ VALUE thread =
rb_thread_create(Service_Event_Dispatch, (void*) val);
+...
2005 Nov 26
1
Another patch of win32-service for nice startup.
...// Create Thread for service main
+ hThread = CreateThread(NULL,0,ThreadProc,0,0,&ThreadId);
+ if(hThread == INVALID_HANDLE_VALUE){
+ strcpy(error,ErrorDescription(GetLastError()));
+ ErrorStopService();
+ rb_raise(cDaemonError,error);
+ }
+
+ if(rb_respond_to(self,rb_intern("service_init"))){
+ rb_funcall(self,rb_intern("service_init"),0);
}
+ SetEvent(hStartEvent);
+
// Call service_main method
if(rb_respond_to(self,rb_intern("service_main"))){
rb_funcall(self,rb_intern("service_main"),0);
========...
2004 Feb 05
1
Service event hooks question
In order to be able to call event hooks as I mentioned previously it
looks like I''ll have to do something like this in Service_Ctrl():
// For example
if(dwCtrlCode == SERVICE_CONTROL_STOP){
rb_funcall(self,rb_intern("send"),rb_intern("on_stop"));
}
There are a few problems. First, I''m not sure I''m calling that
properly. Second, I don''t know how to get "self" into the method - I
making cDaemon global and passing that but it didn''t seem to work...
2007 Jun 25
0
[1072] trunk/wxruby2/swig/shared/datetime.i: Add typemap for DateTime::WeekDay; plug mem leak with wxDateTime arg
...</span><span class="cx"> %}
</span><span class="cx">
</span><del>-%typemap(in) const wxDateTime& {
</del><ins>+%typemap(in) wxDateTime& {
</ins><span class="cx"> int y = NUM2INT(rb_funcall($input, rb_intern("year"), 0));
</span><span class="cx"> int rMonth = NUM2INT(rb_funcall($input, rb_intern("month"), 0));
</span><span class="cx"> int rDay = NUM2INT(rb_funcall($input, rb_intern("mday"), 0));
</span><span clas...
2007 Nov 24
5
Service.start arguments failing or causing segfault
Hi,
Unless I''m mistaken the final arguments to Service.start should be
passed to the Daemon''s service_main method. Correct?
I modified the Service.start method (now in CVS) to look something like
this:
def self.start(service, host=nil, *args)
...
num_args = args.length
if args.empty?
args = nil
else
args.unshift(service) # Necessary?
2011 Dec 08
0
[hivex] [PATCH 2/8] generator: Add new return type to ABI: RLenValue
..."&t"; "&len"]]
+ | RLenValue -> c_params @ [["&len"]]
| _ -> c_params in
let c_params = List.concat c_params in
@@ -3546,6 +3619,11 @@ get_values (VALUE valuesv, size_t *nr_values)
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n";
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"type\")), INT2NUM (t));\n";
pr " return rv;\n"
+ | RLenValue ->
+ pr " VALUE rv = rb_hash_new ();\n";
+ pr " rb_hash_as...
2011 Oct 19
1
[hivex][PATCH 2/8] generator: Add new return type to ABI: RLenValue
..."&t"; "&len"]]
+ | RLenValue -> c_params @ [["&len"]]
| _ -> c_params in
let c_params = List.concat c_params in
@@ -3497,6 +3570,11 @@ get_values (VALUE valuesv, size_t *nr_values)
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n";
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"type\")), INT2NUM (t));\n";
pr " return rv;\n"
+ | RLenValue ->
+ pr " VALUE rv = rb_hash_new ();\n";
+ pr " rb_hash_as...
2005 Oct 06
9
Grid.GetTextExtent
...*font) const {
...
if (swig_get_up()) {
wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font);
return;
}
obj0 = rb_str_new2((const char *)(&string)->mb_str());
obj1 = SWIG_NewPointerObj(x, SWIGTYPE_p_int, 0);
result = rb_funcall(swig_get_self(), rb_intern("get_text_extent"),
2,obj0,obj1);
Wow. That''s just so wrong. It only converts two parameters and the one
it chooses to convert shouldn''t be passed in any case. Any suggestions
on this one?
Roy
2011 Aug 25
4
[PATCH 0/3] ruby: Fix event handler failure
I won't pretend I really understand what's going on here. I've CC'd
this message to Chris since he might have a better idea.
https://bugzilla.redhat.com/show_bug.cgi?id=733297
In this bug, it appears that the event log callback goes out of scope
and is garbage collected. (This is despite the fact we registered it
as a global root). When we invoke the callback later,
2007 May 21
0
[1022] trunk/wxruby2/swig/classes/App.i: Memory mgmt: use Wx::App to mark still-alive Windows, set up Wx::THE_APP const
...amp;nbsp   // so there is no point trying to mark them, and doing so may cause
+        // errors.
+        VALUE the_app = rb_const_get(mWxruby2, rb_intern("THE_APP"));
+        if ( DATA_PTR(the_app) == 0 )
+         {
+          &...
2007 Jul 21
0
[1136] trunk/wxruby2/swig/classes/App.i: Note when the Wx::App is exiting and avoid doing GC if in process of
...amp;nbsp     rb_iv_get(rb_obj, "@__wx_destroyed__") != Qtrue )
</del><ins>+                 ! rb_ivar_defined(rb_obj, rb_intern("@__wx_destroyed__") ) )
</ins><span class="cx">          {
</span><span class="cx">           &...
2005 Nov 11
1
[Fwd: Thanks for win32-service]
Nice. :)
-------------- next part --------------
An embedded message was scrubbed...
From: Jamey Cribbs <cribbsj at oakwood.org>
Subject: Thanks for win32-service
Date: Fri, 11 Nov 2005 11:33:13 -0500
Size: 2505
Url: http://rubyforge.org/pipermail/win32utils-devel/attachments/20051111/5b46cd4f/Thanksforwin32-service.eml
2005 Nov 23
0
Some code change suggestions of thenwin32-service package
...package
>
>
> Hi,
>
> I''d like to suggest some code modifications and tests.
>
> In service.c
> line # 50 : Commet out 1 line
> // SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
>
> line # 260 : Insert 4 lines
> if(rb_respond_to(self,rb_intern("service_init"))){
> rb_funcall(self,rb_intern("service_init"),0);
> }
> SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
>
> In Ruby source
> Insert ''service_init'' method for initialization
>
> I tested with long...
2004 Nov 07
2
Problems with DeviceIoControl()
...nt fn;
USHORT inBuf = COMPRESSION_FORMAT_DEFAULT;
if((rbBool != Qtrue) && (rbBool != Qfalse)){
rb_raise(rb_eTypeError,"Argument must be true or
false");
}
if(rbBool == Qfalse){
inBuf = COMPRESSION_FORMAT_NONE;
}
fn =
NUM2INT(rb_funcall(self,rb_intern("fileno"),0,0));
h = (HANDLE)_get_osfhandle(fn); // Get HANDLE based
on fileno
if(h == INVALID_HANDLE_VALUE){
rb_raise(cFileError,ErrorDescription(GetLastError()));
}
rv = DeviceIoControl(
h,
FSCTL_SET_COMPRESSION,
(LPVOID)inBuf,
sizeof(inBuf...
2006 Aug 24
5
TreeCtrl background?
On my windows build, I just noticed that the background of my TextCtrl''s
is grey by default, and when I try to set the default style I get the error:
TestTextCtrl.rb:15:in `set_default_style'': undefined method `'' for
#<Wxruby2::TextCtrl:0x360a0c4> (NoMethodError)
from TestTextCtrl.rb:15:in `initialize''
from TestTextCtrl.rb:24:in
[1088] trunk/wxruby2/swig/Functions.i: Added a return statement where needed to fix compile on Win32
2007 Jun 27
0
[1088] trunk/wxruby2/swig/Functions.i: Added a return statement where needed to fix compile on Win32
...1088)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">
</span><span class="cx"> static VALUE get_app(VALUE self)
</span><span class="cx"> {
</span><del>- rb_const_get(mWxruby2, rb_intern("THE_APP"));
</del><ins>+ return rb_const_get(mWxruby2, rb_intern("THE_APP"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static VALUE
</span></span></...
2017 Feb 02
3
[nbdkit PATCH 0/2] Ruby bindings for .zero
Similar to python and perl. But MUCH easier (especially considering
that this is the first time I've every tried to run Ruby). I even
had fun making set_error() polymorphic.
Eric Blake (2):
ruby: Expose nbdkit_set_error to ruby script
ruby: Support zero callback
plugins/ruby/example.rb | 11 ++++++++
plugins/ruby/nbdkit-ruby-plugin.pod | 54
2012 Feb 10
3
Installing from source missing -lruby18 in linking.
I am trying to build wxruby from source, but I have encounter an error.
For some reason the ''rake'' command fail when it tries to link lib/wxruby2.so
because it is missing missing -lruby18
resulting in errors like
wx.cpp:(.text+0x1618): undefined reference to `rb_intern''
wx.cpp:(.text+0x165c): undefined reference to `rb_eNotImpError''
wx.cpp:(.text+0x1666): undefined reference to `rb_raise''
wx.cpp:(.text+0x167d): undefined reference to `rb_const_defined''
wx.cpp:(.text+0x1698): undefined reference to `rb_const_get''
coul...
2004 Nov 06
3
Calling CreateFile on an instance of File - possible?
...rying something like this:
static VALUE file_set_compressed(VALUE self, VALUE rbBool){
DWORD dwAttr;
VALUE rbPath;
HANDLE h;
if((rbBool != Qtrue) && (rbBool != Qfalse)){
rb_raise(rb_eTypeError,"Argument must be true or false");
}
rbPath = rb_funcall(self,rb_intern("path"),0,0);
dwAttr = GetFileAttributes(StringValuePtr(rbPath));
h = CreateFile(
(LPCTSTR)StringValuePtr(rbPath),
FILE_ALL_ACCESS,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
dwAttr,
NULL
);
if(h == INVALID_HANDLE_VALUE){
printf(&qu...