On Mon, Oct 20, 2003 at 07:15:11PM -0700, Dean Arnold wrote:
> Coupla points:
> 
> 1. After (painful) experimentation with Inline::Struct, I've determined
> it's got some significant short comings at this time <heavy sigh>
> 
> 2. Howver, for my purposes, with Inline::C and some clever editting
> (thank you TextPad!) I can emulate most of Inline::Struct
> and probably do so in a more code optimal fashion.
> 
> 3. As for Perl vs. C code, I abstain, as I haven't visited this
> particular soil in some time. My only perspective is
> from hacking DBD::ODBC some 3 years ago for
> array binding, and it was kinda painful for a newbie then.
> 
> 4. That being said, if your API is based on simple C
> primitives, Inline::C might be an attractive solution...but
> beware of array or non-primitive inputs!

Here's the interface between Driver.xst and your code. Just implement
(most of) these functions:

void    dbd_init _((dbistate_t *dbistate));
int      dbd_db_login  _((SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char 
*pwd));
int      dbd_db_login6 _((SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char 
*pwd, SV *attr));
int      dbd_db_do _((SV *sv, char *statement));
int      dbd_db_commit     _((SV *dbh, imp_dbh_t *imp_dbh));
int      dbd_db_rollback   _((SV *dbh, imp_dbh_t *imp_dbh));
int      dbd_db_disconnect _((SV *dbh, imp_dbh_t *imp_dbh));
void     dbd_db_destroy    _((SV *dbh, imp_dbh_t *imp_dbh));
int      dbd_db_STORE_attrib _((SV *dbh, imp_dbh_t *imp_dbh, SV *keysv, SV *valuesv));
SV      *dbd_db_FETCH_attrib _((SV *dbh, imp_dbh_t *imp_dbh, SV *keysv));
int      dbd_st_prepare _((SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs));
int      dbd_st_rows    _((SV *sth, imp_sth_t *imp_sth));
int      dbd_st_execute _((SV *sth, imp_sth_t *imp_sth));
int      dbd_st_cancel  _((SV *sth, imp_sth_t *imp_sth));
AV      *dbd_st_fetch   _((SV *sth, imp_sth_t *imp_sth));
int      dbd_st_finish  _((SV *sth, imp_sth_t *imp_sth));
void     dbd_st_destroy _((SV *sth, imp_sth_t *imp_sth));
int      dbd_st_STORE_attrib _((SV *sth, imp_sth_t *imp_sth, SV *keysv, SV *valuesv));
SV      *dbd_st_FETCH_attrib _((SV *sth, imp_sth_t *imp_sth, SV *keysv));
int      dbd_bind_ph  _((SV *sth, imp_sth_t *imp_sth,
                SV *param, SV *value, IV sql_type, SV *attribs, int is_inout, IV 
maxlen));

See perldoc DBI::DBD for more info.

Tim.

Reply via email to