On 4/15/05, Rudy Lippan <[EMAIL PROTECTED]> wrote:
> On Fri, 15 Apr 2005, Tim wrote:
> 
> > > #define foobar rows
> > > void
> > > foobar(sth)
> > >     SV* sth
> > >   CODE:
> > > ...
> > >
> > > The above should make subpp happy and should get rid of the dup function
> > > warning.
> >
> > I suspect that won't work, sadly, as xsubpp uses the name to generate
> > some C code. (But feel free to try it.)
> 
> Yup, you are right:
> 
> #define foobar rows
> XS(XS_DBD__mysql__st_foobar)
> {
>     dXSARGS;
>     if (items != 1)
>         Perl_croak(aTHX_ "Usage: DBD::mysql::st::foobar(sth)");
>     {
> 
> Grumble grumble :)  Well, there is always " | grep -v ...", BTA, more time has
> probably been spent on this "warning" than it deserves.

No - warnings are nasty and worry end users.

DBD::Informix doesn't get that warning, so I investigated why - a little.

There are only three routines in Informix.xs - constant(),
driver_init() and FETCH for a $drh.  I'm not even wholly sure why the
FETCH is there...

I have a header file, dbdixmap.h, which includes:

#define dbd_st_rows dbd_ix_st_rows

It also includes:

/*#define dbd_db_do dbd_ix_db_do*/

Once upon a time, DBD::Informix implemented a custom $dbh->do(), but
the vanilla version provided by DBI is adequate.

Finally, in dbdimp.ec (equivalent to dbdimp.c), I have a trivial function:

int
dbd_ix_st_rows(SV *sth, imp_sth_t *imp_sth)
{
    return(imp_sth->n_rows);
} 

I've not seen any warnings...

Based on casual observation, I avoid putting anything in Informix.xs
unless it is necessary.  The overhead of another function call is
minimal, and the code put into  Informix.xsi by DBI etc is
inscrutable, and best left for Tim to worry about.

HTH - not sure whether it will.

-- 
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2005.01 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to