module Xmms

Constants

VERSION

Public Class Methods

decode_url(url) → String click to toggle source

Decodes a url-encoded string url and returns it in UNKNOWN ENCODING. Use with caution.

static VALUE
m_decode_url (VALUE self, VALUE str)
{
        const unsigned char *burl;
        unsigned int blen;
        xmmsv_t *strv, *decoded;
        VALUE url = Qnil;

        strv = xmmsv_new_string (StringValuePtr (str));

        decoded = xmmsv_decode_url (strv);

        if (!decoded)
                goto out;

        if (!xmmsv_get_bin (decoded, &burl, &blen))
                goto out;

        url = rb_str_new ((char *) burl, blen);

out:
        if (decoded)
                xmmsv_unref (decoded);

        xmmsv_unref (strv);

        return url;
}
userconfdir → String click to toggle source

Returns the xmms2 configuration directory for the current user.

static VALUE
m_userconfdir_get (VALUE self)
{
        const char *p;
        char path[XMMS_PATH_MAX];

        p = xmmsc_userconfdir_get (path, XMMS_PATH_MAX);

        return p ? rb_str_new2 (p) : Qnil;
}