# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the MonetDB Database System.
#
# The Initial Developer of the Original Code is CWI.
# Portions created by CWI are Copyright (C) 1997-2006 CWI.
# All Rights Reserved.

# Author: Steffen Goeldner <sgoeldner@cpan.org>

TYPEMAP

MonetDB::CLI::MapiXS::Cxn O_OBJECT
MonetDB::CLI::MapiXS::Req O_OBJECT
const char*               T_PV

OUTPUT

O_OBJECT
        sv_setref_pv( $arg, \"${ntype}\", (void*)$var );

INPUT

O_OBJECT
        if ( sv_isobject( $arg ) && ( SvTYPE( SvRV( $arg ) ) == SVt_PVMG ) ) {
                $var = ( $type)SvIV( (SV*)SvRV( $arg ) );
        }
        else {
                warn(\"${Package}::$func_name() -- $var is not a blessed SV reference\");
                XSRETURN_UNDEF;
        }
