Can't call soup_cookie_parse() through GIR



Hi,

I wanted to parse a cookie with libsoup from Perl via HTTP::Soup and I
can't find a wait to call soup_cookie_parse(). I always get an error.

I tried:
    HTTP::Soup::Cookie->parse($value, undef);
    HTTP::Soup::Cookie->parse($value, HTTP::Soup::URI->new('/'));

and even this out of desperation:
    my $parser = bless {}, 'HTTP::Soup::Cookie';
    my $cookie = $parser->parse($value, HTTP::Soup::URI->new('/'));
    bless $parser, __PACKAGE__;

I always get this error:
    expected a blessed reference at
/usr/local/lib/perl/5.12.4/Glib/Object/Introspection.pm line 58.

libsoup documentation says that soup_cookie_parse is a function and
that the URI parameter can be NULL. I don't understand where the
blessed reference is supposed to go.

Here's a trimmed down dump of my /usr/share/gir-1.0/Soup-2.4.gir

      <function name="parse" c:identifier="soup_cookie_parse" version="2.24">
        <return-value transfer-ownership="full">
          <doc xml:whitespace="preserve">a new #SoupCookie, or %NULL
if it could not be</doc>
          <type name="Cookie" c:type="SoupCookie*"/>
        </return-value>
        <parameters>
          <parameter name="header" transfer-ownership="none">
            <doc xml:whitespace="preserve">a cookie string (eg, the
value of a Set-Cookie header)</doc>
            <type name="utf8" c:type="char*"/>
          </parameter>
          <parameter name="origin" transfer-ownership="none">
            <doc xml:whitespace="preserve">origin of the cookie, or %NULL</doc>
            <type name="URI" c:type="SoupURI*"/>
          </parameter>
        </parameters>
      </function>

I'm probably doing something wrong but I don't see what.

-- 
Emmanuel Rodriguez



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