search for: rb_raise

Displaying 20 results from an estimated 41 matches for "rb_raise".

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
2005 Nov 26
1
Another patch of win32-service for nice startup.
...static HANDLE hStartEvent; static HANDLE hStopEvent; static SERVICE_STATUS_HANDLE ssh; static DWORD dwServiceState; @@ -33,6 +34,7 @@ { DWORD bRet; DWORD dwWaitRes; + int i; // Obtain the name of the service. LPTSTR lpszServiceName = lpszArgv[0]; @@ -46,6 +48,15 @@ rb_raise(cDaemonError,"RegisterServiceCtrlHandler failed"); } + // wait for sevice initialization + for(i=1;TRUE;i++) + { + if(WaitForSingleObject(hStartEvent, 1000) == WAIT_OBJECT_0) + break; + + SetTheServiceStatus(SERVICE_START_PENDING, 0, i, 1000); + } + // The...
2011 Aug 18
1
Multiple Errors with RRD and Rake
...cpy'' makes pointer from integer without a cast rubyrrdtool.c:119: warning: passing argument 1 of ''__strdup'' makes pointer from integer without a cast rubyrrdtool.c: In function ''rrdtool_create'': rubyrrdtool.c:325: warning: passing argument 2 of ''rb_raise'' makes pointer from integer without a cast rubyrrdtool.c: In function ''rrdtool_first'': rubyrrdtool.c:419: warning: passing argument 2 of ''rb_raise'' makes pointer from integer without a cast rubyrrdtool.c: In function ''rrdtool_last'': rub...
2004 Nov 21
3
win32-file, overlapped added
Hi all, I''ve got overlapped and offset support in both nread and nwrite. The only thing left before I want to release this (as 0.4.0) is to get NO_BUFFERING to work. Unfortunately, I can''t get it to work. Park, I looked at that site you sent (and borrowed some code from it), but I don''t see anything special happening for NO_BUFFERING. I thought it required
2004 Nov 07
2
Problems with DeviceIoControl()
...to Wayne and Park, I''ve got something like this now: static VALUE file_set_compressed(VALUE self, VALUE rbBool){ HANDLE h; BOOL rv; DWORD dwBytesReturned; int 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_HA...
2004 Jan 22
1
code cleanup suggestion - error classes
Currently, most of the modules define an error class of some sort (e.g. cWin32ServiceError). Within the code, the error is raised like this: rb_raise(cWin32ServiceError,ErrorDescription(GetLastError())); It seems logical that, instead of appending the message every time, that we should simply call ErrorDescription(GetLastError()) simply by raising an error (i.e. within the ''initialize'' method of cWin32ServiceError). In other w...
2006 Dec 07
0
Fwd: win32-service problems with patch
...rorStopService(); void SetTheServiceStatus(DWORD dwCurrentState,DWORD dwWin32ExitCode, DWORD dwCheckPoint, DWORD dwWaitHint); @@ -57,27 +51,27 @@ (LPHANDLER_FUNCTION)Service_Ctrl); if(ssh == (SERVICE_STATUS_HANDLE)0){ - ErrorStopService(); - rb_raise(cDaemonError,"RegisterServiceCtrlHandler failed"); - } - - // wait for sevice initialization - for(i=1;TRUE;i++) - { - if(WaitForSingleObject(hStartEvent, 1000) == WAIT_OBJECT_0) - break; - - SetTheServiceStatus(SERVICE_START_PENDING, 0, i, 1000); + // no serv...
2004 Oct 23
0
win32-ipc, with blocks (code review please)
...){ 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(handles,HANDLE,len); for(i=0; i<len; i++) { handles[i] = (HANDLE)NUM2UINT(RARRAY(arr)->ptr[i]); } dwWait = WaitForMultipleObjects(len,handles,fWaitAll,dwTimeOut); // Yield block if signalled and block is provided...
2007 Jun 26
0
[1085] trunk/wxruby2/swig: Add checks and ruby exceptions for two common Wx::Window mistakes leading to
...nt argument which may be null - but it does +// not inherit from TopLevelWindow - so special typemap for this class. +%typemap(check) wxWindow* parent { + if ( ! rb_const_defined(mWxruby2, rb_intern("THE_APP") ) ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{ rb_raise(rb_eRuntimeError, +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp "Cannot create BusyInfo before App.main_loop has been ca...
2013 Dec 27
0
[PATCH] ruby: Fix .new method (RHBZ#1046509).
...reate here because we need the extra + * parameters, which ruby passes via the initialize method (see next + * function). */ static VALUE -ruby_guestfs_create (int argc, VALUE *argv, VALUE m) +ruby_guestfs_alloc (VALUE klass) { - guestfs_h *g; + guestfs_h *g = NULL; - 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, N...
2005 Dec 19
4
Firefox crash while ajax''ing Google Maps
Hi all, I''m trying to make a simple mapping application that shows to a given point (city, zip etc.) the appropriate map from Google. This is done by updating a div tag via link_to_remote with the Google map code (lot of JavaScript code; see example http://www.google.com/apis/maps/documentation/) Clicking on the ajax''ed link let crash Firefox immediately whereas IE seems
2005 Jan 06
0
Some thoughts on win32-changenotify
...approach. // Get a handle to the directory. hDir = CreateFile( lpPathName, FILE_LIST_DIRECTORY, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); if(hDir == INVALID_HANDLE_VALUE) { rb_raise(cChangeNotifyError,ErrorDescription(GetLastError())); } if(!ReadDirectoryChangesW( hDir, Buf, sizeof(Buf), bWatchSubtree, dwNotifyFilter, &dwBytesReturned, NULL, NULL )){ rb_raise(cChangeNotifyError,ErrorDescription(GetLastError...
2005 Jan 20
1
ChangeNotify help wanted
Hi all, I''ve checked in some code to win32-changenotify. Unfortunately, it doesn''t work right. I need some help. I don''t understand what, exactly, I''m supposed to pass to ReadDirectoryChangesW() for the 2nd argument, nor how to read the data back out. There''s also a WCHAR issue that needs to be worked out with regards to the FileName
2004 Oct 05
0
C extension question
Hi all, I was just refactoring some of the win32_popen code, and I saw this a few times: rb_raise(...); return Qnil; Is there any way it will ever reach the return? Isn''t the rb_raise() going to return? Or is there a good reason for this? Just curious. Dan In the immortal words of Socrates, "I drank what?"
2012 Feb 10
3
Installing from source missing -lruby18 in linking.
...nd 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'' could it be a bad expansion of values in the Config::CONFIG hash ? And if it is, how do I verify that it is the problem? How does the Config...
2007 May 31
0
[1039] trunk/wxruby2/swig/Events.i: Remove some debugging output
...ot;cx"> { </span><del>-&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspputs("Called internal_evt_with_id in Events"); </del><span class="cx"> if (argc != 1) </span><span class="cx"> rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); </span><span class="cx"> </span><span class="lines">@@ -299,7 +297,6 @@ </span><span class="cx"> </span><span class="cx"> int...
2007 May 31
0
[1038] trunk/wxruby2/swig/Events.i: Add missing EVT_COMMAND_TREE constants
...ot;cx"> { </span><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspputs("Called internal_evt_with_id in Events"); </ins><span class="cx"> if (argc != 1) </span><span class="cx"> rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); </span><span class="cx"> </span><span class="lines">@@ -286,7 +310,7 @@ </span><span class="cx"> { </span><span class="cx"> if (argc !...
2004 Nov 06
3
Calling CreateFile on an instance of File - possible?
...;'t know how to get a valid HANDLE to a instance of an already opened file. I''ve been trying 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,...
2007 Jun 28
0
[1092] trunk/wxruby2/swig/classes/App.i: Pass correctly typed Events into filter_event, if defined (bug 10797);
...bsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE rb_ret_val = rb_funcall(rb_self, filter_event_sym, 1, rb_event); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( ! FIXNUM_P(rb_ret_val) ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp { rb_raise(rb_eTypeError, "filter_event must return an integer"); } +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspint ret_val = FIX2INT(rb_ret_val); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( ret_val < -1 || ret_val > 1 ) +&nbs...
2007 May 29
0
[1035] trunk/wxruby2/swig/classes/EvtHandler.i: Removed a heap of redundant stuff that''s been #if 0''d for a while
...tion function = - (wxObjectEventFunction )&wxRbCallback::EventThunker; - (cppSelf)->Connect(firstId, lastId, eventType, function, userData); -} - -static VALUE internal_evt_with_id(int argc, VALUE *argv, VALUE self, - wxEventType eventType) -{ - if (argc != 1) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); - - int id = NUM2INT(argv[0]); - //printf("evt_with_id(%d) %s\n", id, rb_block_given_p() ? "with block" : ""); - - internal_connect(self, id, id, eventType); - return Qnil; -} - -static...