Skip to Content.
Sympa Menu

freetds - [freetds] Announcement: db-lib update

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Announcement: db-lib update
  • Date: Sat, 31 Jan 2009 14:58:45 -0500

Two changes coming to the db-lib API:

1. Functional prototypes to use "const arg[]" instead of "char *"
wherever applicable.

2. Removal of all unimplemented functions from sybdb.h and libsybdb.

The vendors -- each for their own reasons -- stopped updating db-lib years
ago. Microsoft hasn't produced a new binary since 2000 and no longer
distributes even that.

Meanwhile, the C standard and common practice has changed. const was
added to the language and the C standard library is described in const
terms. Old programs are unaffected, but new programs that adopt modern
practice encounter warnings/errors when passing a const string to a
stone-age function, e.g.:

RETCODE dbrpcinit(DBPROCESS * dbproc,
char *rpcname, DBSMALLINT options);

which is now (in CVS HEAD):

RETCODE dbrpcinit(DBPROCESS * dbproc,
const char rpcname[], DBSMALLINT options);

Not done, but under consideration, is to declare as "const DBPROCESS*"
those functions (e.g. dbconvert) that don't modify the DBPROCESS
structure. That would facilitate C++ wrapper library development. Of
which there are many, I'm sure. ;-)

On the second point, the FreeTDS db-lib declared (and sometimes defined)
78 functions that have no useful implementation. I've never understood
why that was done; I don't see the point in helping something compile that
won't link, or linking something that will only come to tears when it
runs.

Perhaps once upon a time programs linking to FreeTDS might have referenced
some functions that were rarely used, and linking to stub-functions
permitted them to partially run with FreeTDS. Nowadays substantially all
the API has been implemented, and much of what remains has been scheduled
for "never".

Consequently, I moved all such code inside conditional compilation. If
you want it, define DBLIB_UNIMPLEMENTED.

I did this as a favor to developers. If your code fails to compile/link
without DBLIB_UNIMPLEMENTED, you know you're uing non-code and you now
have an opportunity to find it and strike it. Or, you can modify your
Makefile and go on as before.

Feedback welcome of course.

--jkl





  • [freetds] Announcement: db-lib update, James K. Lowden, 01/31/2009

Archive powered by MHonArc 2.6.24.

Top of Page