> João Henrique Freitas writes: > > Some questions; > > - If custom_function(myconn->connection) need more parameters (ex:. > > for the function > > dbi_driver_specific_function(dbi_conn_get_driver(conn), > > "mysql_get_row")) like custom_function(myconn->connection, > > command_sql) is possible too, ok? > > This is supposed to work too. You'll just have to declare the function > pointer appropriately, e.g.like this: > > int (*custom_function)(void*, int); > It's realy works?
If I understand, I can do this: int (*custom_function)(void*, const char*, int); if ((custom_function = dbi_driver_specific_function(dbi_conn_get_driver(mdb->db), "PQputCopyData")) != NULL) { do { res = custom_function(myconn->connection, (const char *)mdb->cmd, (int)len); } while (res == 0 && --count > 0); But have an error like: dbi.c:863: error: invalid conversion from 'void*' to 'int (*)(void*, const char*, int)' If I try: if ((custom_function = (*custom_function)(dbi_driver_specific_function(dbi_conn_get_driver(mdb->db), "PQputCopyData"))) != NULL) { do { res = custom_function(myconn->connection, (const char *)mdb->cmd, (int)len); } while (res == 0 && --count > 0); dbi.c:863: error: too few arguments to function It's possible? Thanks ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users