Ignore:
Timestamp:
Oct 30, 2008, 9:12:50 PM (11 years ago)
Author:
Pascal Terjan
Message:
  • List drivers as a Hash
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/ruby/caca-display.c

    r2822 r3157  
    2727{
    2828    VALUE obj;
    29     obj = Data_Wrap_Struct(klass, 0, display_free, NULL);   
     29    obj = Data_Wrap_Struct(klass, 0, display_free, NULL);
    3030    return obj;
    3131}
     
    231231    VALUE ary;
    232232    char const* const* list;
    233    
     233
    234234    list = caca_get_display_driver_list();
    235    
    236     ary = rb_ary_new();   
    237     while (*list != NULL)
    238     {
    239         rb_ary_push(ary, rb_str_new2(*list));
    240         list++;
     235
     236    ary = rb_hash_new();
     237    while (*list != NULL && *(list+1) != NULL)
     238    {
     239        rb_hash_aset(ary, rb_str_new2(*list), rb_str_new2(*(list+1)));
     240        list+=2;
    241241    }
    242242
Note: See TracChangeset for help on using the changeset viewer.