Re: [PATCH v2 13/44] ruby: bind setup_git_directory()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 29, 2013 at 12:11 AM, Ramkumar Ramachandra
<artagnon@xxxxxxxxx> wrote:
> Felipe Contreras wrote:
>> +static inline VALUE cstr_to_str(const char *str)
>> +{
>> +       if (str == NULL)
>> +               return Qnil;
>> +       return rb_str_new2(str);
>> +}
>> +
>> +static VALUE git_rb_setup_git_directory(VALUE self)
>> +{
>> +       int nongit_ok;
>> +       const char *prefix;
>> +       prefix = setup_git_directory_gently(&nongit_ok);
>> +       return rb_ary_new3(2, cstr_to_str(prefix), INT2FIX(nongit_ok));
>> +}
>
> Most excellent. Goes to show how well ruby.h is written.

Indeed. I find it easier than using GLib.

> I'm not very familiar with the interface, and am referring to
> http://www.ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html -- let
> me know if there are some other sources.

That one is really good and got me almost as far as I am.

Others might give a bit more information, but nothing too critical.

http://stackoverflow.com/tags/ruby-c-api/info

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]