search for: rb_str_new2

Displaying 20 results from an estimated 27 matches for "rb_str_new2".

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
2009 Mar 06
3
Gem update problem
...bxml2 -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/include -c ruby_xml_sax2_handler.c ruby_xml_sax2_handler.c: In function ‘end_element_ns_callback’: ruby_xml_sax2_handler.c:86: warning: pointer targets in passing argument 1 of ‘rb_str_new2’ differ in signedness ruby_xml_sax2_handler.c:88: warning: pointer targets in passing argument 2 of ‘rb_str_cat2’ differ in signedness ruby_xml_sax2_handler.c:92: warning: pointer targets in passing argument 1 of ‘rb_str_new2’ differ in signedness ruby_xml_sax2_handler.c:98: warning: pointer target...
2005 Oct 09
0
[Fwd: Re: [Swig] Re: Object return problem]
...>> } >> >> %typemap(freearg) const wxString& { >> delete $1; >> } >> >> %typemap(freearg) wxString* { >> delete $1; >> } >> */ >> %typemap(directorin) wxString, const wxString &, wxString & "$input = >> rb_str_new2((const char *)$1.mb_str());"; >> >> %typemap(directorin) wxString *, const wxString * "TODO: >> $1_name->mb_str()"; >> >> >> %typemap(out) wxStri...
2008 Nov 10
4
PathFindExtension and wide strings
Hi, What''s happening here? require ''windows/path'' require ''windows/unicode'' include Windows::Path include Windows::Unicode file_a = ''bar.txt'' file_w = multi_to_wide(file_a) p PathFindExtensionA(file_a) # ''.txt'' => OK p PathFindExtensionW(file_w) # ''.'' => WRONG Is Ruby chopping the
2007 Oct 25
2
Using strtok via win32/api
Hi all, I''m having a little trouble with strtok: require ''win32/api'' include Win32 strtok = API.new(''strtok'', ''PP, ''P'', ''msvcrt'') string = "A string\tof ,,tokens\nand some more tokens"; seps = " ,\t\n"; puts "Tokens:" token = strtok.call(string, seps) while token puts
2006 Apr 14
3
[ win32utils-Bugs-4101 ] create hash param
Bugs item #4101, was opened at 2006-04-14 11:27 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=4101&group_id=85 Category: win32-process Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: create hash param Initial Comment: hi, problem with process, when I do pid = Process.create(
2004 Mar 11
5
win32-etc-0.2.2 testing wanted
I''ve commited code for win32-etc 0.2.2, which adds the configure_user and configure_group methods. Testing appreciated. On my home system, I can''t get configure_user to work, but I haven''t any real idea why it fails. The configure_group method seems to work fine, however. Dan _________________________________________________________________ Fast. Reliable. Get
2005 Oct 06
9
Grid.GetTextExtent
...in Grid.cpp: void SwigDirector_wxGrid::GetTextExtent(wxString const &string, int *x, int *y, int *descent, int *externalLeading, wxFont const *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 s...
2006 Oct 10
4
Need help for coding an extension to ferret
..._funcall(rhit, id_doc, 0)); // // HERE I WOUlD LIKE TO LOAD THE DOCUMENTS, ID IS THE GOOD DOC_ID.. // I WOULD LIKE TO GET THIS IN FACT (ruby): // doc_id = INDEX.search(''query'').hits.first // INDEX[doc_id].load <== THAT''S WHAT I WOULD LIKE TO GET ! // } rstr = rb_str_new2(str); free(str); return (argv[0]); } of course, i''ve bound the method to the good object etc... Hope somebody''ll help ! Thank you by advance, Jeremie ''ahFeel'' BORDIER -- Posted via http://www.ruby-forum.com/.
2006 Dec 26
7
Rubygems 0.9.0.8 and Fastthread problem
Heya Folks- This is mainly for Zed and Mentalguy. I have been playing with the new release of rubygems 0.9.0.8 and I have a major problem with the requirement that fastthread needs to be required before thread. Just requiring rubygems and then requiring fastthread right after that will throw the error: ez _blog $ ruby require ''rubygems'' require
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...| RInt _ | RBool _ -> - pr " return INT2NUM (r);\n" + pr " return INT2NUM (r);\n" | RInt64 _ -> - pr " return ULL2NUM (r);\n" + pr " return ULL2NUM (r);\n" | RConstString _ -> - pr " return rb_str_new2 (r);\n"; + pr " return rb_str_new2 (r);\n"; | RConstOptString _ -> - pr " if (r)\n"; - pr " return rb_str_new2 (r);\n"; - pr " else\n"; - pr " return Qnil;\n"; + pr " if (r)\n"; +...
2005 Dec 30
8
WxRuby newbie Mac OS 10.4 install questions
Hi. Forgive me if I am asking questions that have already been answered a million times, but there doesn''t seem to be an easy way to search the wxruby-users archives, so... I tried to install wxruby for the Mac by downloading the latest Mac package installer from rubyforge.org/frs/download.php/1985/wxruby-0.6.0-osx-panther.dmg and tried to run some of the wxruby-0.6.0/samples from the
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?
2007 Aug 31
0
[ win32utils-Bugs-13560 ] Service dependencies has wierd string.
...works fine. static VALUE rb_get_dependencies(LPTSTR lpDependencies){ VALUE v_dependencies = rb_ary_new(); if(lpDependencies){ TCHAR* pszDepend = 0; int i = 0; pszDepend = &lpDependencies[i]; while(*pszDepend != 0){ rb_ary_push(v_dependencies, rb_str_new2(pszDepend)); //i += _tcslen(lpDependencies) + 1; <-- Original code i += _tcslen(&(lpDependencies[i])) + 1; // <-- Modified code pszDepend = &lpDependencies[i]; } } if(RARRAY(v_dependencies)->len == 0) v_dependencies = Qnil;...
2006 Nov 23
2
to_s
...g if this is a good idea or not and if so, is it best to use %extend or put it into something like wxSugar or the ruby parts of wx? My initial implementation is: %extend wxPoint { VALUE to_s() { char buffer[40]; sprintf(buffer, "%d,%d", self->x, self->y); return rb_str_new2(buffer); } } Thoughts? It might even be better to implement an inspect and use that instead (or in addition). Roy
2004 Oct 23
0
win32-ipc, with blocks (code review please)
...ton_method(cIpc,"wait_all",ipc_wait_all,-1); rb_define_method(cIpc,"initialize",ipc_init,1); rb_define_method(cIpc,"wait",ipc_wait,-1); // Constants rb_define_const(cIpc,"INFINITE",UINT2NUM(INFINITE)); rb_define_const(cIpc,"VERSION",rb_str_new2(WIN32_IPC_VERSION)); }
2006 Jan 05
7
[Fwd: [win32utils-help][6822] Eventlog problem]
Dang, I thought we solved this. Any ideas? Dan PS - I realized after reading this I forgot to bump the version number for 0.3.3 - I''ve uploaded a new zip file with the correct version number. -------------- next part -------------- An embedded message was scrubbed... From: alain Fioretti <noreply at rubyforge.org> Subject: [win32utils-help][6822] Eventlog problem Date: Thu, 5
2014 Jan 08
5
hivex: Make node names and value names with embedded null characters accessible
On Windows, there exist at least two APIs for dealing with the Registry: The Win32 API (RegCreateKeyA, RegCreateKeyW, etc.) works with null-terminated ASCII or UTF-16 strings. The native API (ZwCreateKey, etc.), on the other hand works with UTF-16 strings that are stored as buffers+length and may contain null characters. Malware authors have been relying on the Win32 API's inability to
2007 Jun 25
0
[1069] trunk/wxruby2/swig/typemap.i: Fix big memory leak in methods taking wxString as a parameter
...argc > $argnum - 2 ) delete $1;" +%typemap(freearg) wxString* "if ( argc > $argnum - 2 ) delete $1;" </ins><span class="cx"> </span><span class="cx"> %typemap(directorin) wxString, const wxString &, wxString & "$input = rb_str_new2((const char *)$1.mb_str());"; </span><span class="cx"> </span></span></pre> </div> </div> </body> </html>
2011 Jan 05
0
Fwd: Review of libguestfs ruby bindings
...peek() 5) The way that hash lookups are done are a little complicated. For instance, ruby_guestfs_add_drive_opts() uses: VALUE v; v = rb_hash_lookup (optargsv, ID2SYM (rb_intern ("readonly"))); to get at the hash symbol. In ruby-libvirt I tend to do: v = rb_hash_aref(optsargv, rb_str_new2("readonly")); That being said, your way may actually be faster since you aren't allocating a new object. Minor in any case, they both work. 6) In ruby_guestfs_download() and elsewhere, there is code like: Check_Type (remotefilenamev, T_STRING); const char *remotefilename = St...