From: | Dmitry A Jackovlev <hobbut(at)orionet(dot)ru> |
---|---|
To: | pgsql-interfaces(at)postgresql(dot)org |
Subject: | Extrach PGconn* form $dbh (perl) |
Date: | 2006-11-23 08:27:06 |
Message-ID: | 1484180210.20061123112706@orionet.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
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(at)orionet(dot)ru
From | Date | Subject | |
---|---|---|---|
Next Message | Niels Laakmann | 2006-11-23 13:57:27 | Re: ECPG and COPY FROM STDIN |
Previous Message | Eric March | 2006-11-22 11:23:55 | Re: C LIBRARY EXTENSION SEGFAULT |