~ubuntu-branches/ubuntu/wily/xmms2/wily

« back to all changes in this revision

Viewing changes to src/clients/lib/ruby/rb_result.c

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2008-07-04 16:23:34 UTC
  • mfrom: (1.1.5 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080704162334-b3esbkcapt8wbrk4
Tags: 0.5DrLecter-2ubuntu1
* Merge from debian unstable (LP: #241098), remaining changes:
  + debian/control:
    + Update Maintainer field
    + add lpia to xmms2-plugin-alsa supported architectures
    + Added liba52-0.7.4-dev to build depends
  + debian/rules: Added patch, patch-stamp and unpatch
  + changed 01_gcc4.3.patch:
    + src/include/xmmsclient/xmmsclient++/helpers.h: Added #include <climits>
* New upstream relase fixes LP: #212566, #222341

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*  XMMS2 - X Music Multiplexer System
2
 
 *  Copyright (C) 2003-2007 XMMS2 Team
 
2
 *  Copyright (C) 2003-2008 XMMS2 Team
3
3
 *
4
4
 *  PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
5
5
 *
223
223
static VALUE
224
224
string_get (RbResult *res)
225
225
{
226
 
        char *s = NULL;
 
226
        const char *s = NULL;
227
227
 
228
228
        if (!xmmsc_result_get_string (res->real, &s))
229
229
                rb_raise (eValueError, "cannot retrieve value");
396
396
c_get_error (VALUE self)
397
397
{
398
398
        RbResult *res;
399
 
        char *error;
 
399
        const char *error;
400
400
 
401
401
        Data_Get_Struct (self, RbResult, res);
402
402
 
413
413
        return self;
414
414
}
415
415
 
 
416
#ifdef HAVE_PROTECT_INSPECT
416
417
static VALUE
417
418
propdict_inspect_cb (VALUE args, VALUE s)
418
419
{
422
423
        key = RARRAY (args)->ptr[1];
423
424
        value = RARRAY (args)->ptr[2];
424
425
 
425
 
        if (RSTRING (s)->len > 1)
 
426
        if (RSTRING_LEN (s) > 1)
426
427
                rb_str_buf_cat2 (s, ", ");
427
428
 
428
429
        rb_str_buf_cat2 (s, "[");
455
456
{
456
457
        return rb_protect_inspect (propdict_inspect, self, 0);
457
458
}
 
459
#endif /* HAVE_PROTECT_INSPECT */
458
460
 
459
461
static VALUE
460
462
c_propdict_aref (VALUE self, VALUE key)
462
464
        RbResult *res = NULL;
463
465
        xmmsc_result_value_type_t type;
464
466
        VALUE tmp;
465
 
        const char *ckey;
 
467
        const char *ckey, *vstr;
466
468
        int32_t vint;
467
469
        uint32_t vuint;
468
 
        char *vstr;
469
470
 
470
471
        Check_Type (key, T_SYMBOL);
471
472
 
588
589
{
589
590
        RbResult *res = NULL;
590
591
        VALUE ary = rb_ary_new ();
591
 
        char **preferences = NULL;
 
592
        const char **preferences = NULL;
592
593
        unsigned int i;
593
594
 
594
595
        Data_Get_Struct (self, RbResult, res);
642
643
        cPropDict = rb_define_class_under (mXmms, "PropDict", rb_cObject);
643
644
 
644
645
        rb_define_method (cPropDict, "initialize", c_propdict_init, 1);
 
646
#ifdef HAVE_PROTECT_INSPECT
645
647
        rb_define_method (cPropDict, "inspect", c_propdict_inspect, 0);
 
648
#endif /* HAVE_PROTECT_INSPECT */
646
649
 
647
650
        rb_define_method (cPropDict, "[]", c_propdict_aref, 1);
648
651
        rb_define_method (cPropDict, "has_key?", c_propdict_has_key, 1);