Received: from localhost (pluto.hub.org [200.46.204.4]) by postgresql.org (Postfix) with ESMTP id 881759FA0B7 for ; Thu, 23 Nov 2006 04:34:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024) with ESMTP id 18143-03 for ; Thu, 23 Nov 2006 04:34:45 -0400 (AST) X-Greylist: delayed 00:07:31.689256 by SQLgrey-1.7.4 Received: from mail.orionet.ru (mail.orionet.ru [213.59.74.53]) by postgresql.org (Postfix) with ESMTP id 556C89FA098 for ; Thu, 23 Nov 2006 04:34:47 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.orionet.ru (Postfix) with ESMTP id DB793B8E5 for ; Thu, 23 Nov 2006 11:27:55 +0300 (MSK) X-Virus-Scanned: amavisd-new at mail.orionet.ru Received: from mail.orionet.ru ([127.0.0.1]) by localhost (mail.orionet.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cqIUCV5mLFUW for ; Thu, 23 Nov 2006 11:27:55 +0300 (MSK) Received: by mail.orionet.ru (Postfix, from userid 58) id C27EAB8E4; Thu, 23 Nov 2006 11:27:55 +0300 (MSK) Received: from hobbut (hobbut [80.240.211.39]) (Authenticated sender: hobbut@orionet.ru) by mail.orionet.ru (Postfix) with ESMTP id B2B33B8ED for ; Thu, 23 Nov 2006 11:27:50 +0300 (MSK) Date: Thu, 23 Nov 2006 11:27:06 +0300 From: Dmitry A Jackovlev X-Mailer: The Bat! (v3.85.03) Professional Reply-To: hobbut@orionet.ru X-Priority: 3 (Normal) Message-ID: <1484180210.20061123112706@orionet.ru> To: pgsql-interfaces@postgresql.org Subject: Extrach PGconn* form $dbh (perl) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50 X-Spam-Level: X-Archive-Number: 200611/9 X-Sequence-Number: 6324 Hello. Sorry for my bad English. I need to extract PGconn*-type variable from perl $dbh (e.g. magicfunction(dbh)) to use it in my XS-function, but I can't understand how to get PGconn from my function using DBH (I send dbh to my function and need to get PGconn variable as returned value from my function). Please help me to write PGconn *magicfunction(SV*) function. for example: parser.pl: ... my $dbh= DBI->connect("dbi:Pg:dbname=some_db","user","pass"); my $h=myfunction($dbh, "filename"); ... myfunction.xs: HV * myfunction( DBH, filename ) SV *DBH char *filename CODE: HV *hash=newHV(); // some hash PGconn *myconnection=magicfunction( DBH ); processfile ( hash, filename ); //fill hash from file. writehash ( hash, myconnection ); RETVAL=hash; OUTPUT: RETVAL -- WBR, Dmitry mailto:hobbut@orionet.ru