[freetds] porting a windows program

James K. Lowden jklowden at freetds.org
Thu Jul 19 15:16:24 EDT 2007


Thomas Stover wrote:
> The first problem is that I don't seem to be including the 
> correct header for the PDBPROCESS structure. I looked around in the 
> FreeTDS headers and saw DBPROCESS all over the place, so I tried a 
> "#define PDBPROCESS DBPROCESS" to no avail. The other big thing is that 
> I'm going from the MS doc's version of what error and message handlers 
> should look like. Clearly that part needs some work. 

Thomas, 

I recommend you add any such Sybase->Microsoft changes to sqldb.h, because
that's what Microsoft calls that file.  For instance, PDBPROCESS is a
pointer to a DBPROCESS, so something like:


#define PDBPROCESS DBPROCESS*

should help.  

If -- and only if -- you have real conflicts, wrap them:

	#ifndef MSDBLIB
		/* the usual */
	#else
		/* one microsoft way */ 
	#endif

I would think the handlers could be defined something like:

typedef INT (DBERRHANDLER)(DBPROCESS*, INT, INT, INT, const char *, const
char *);
typedef INT (DBMSGHANDLER)(DBPROCESS*, DBINT, INT, INT, const char *,
const char *, const char *, DBUSMALLINT);

extern DBERRHANDLER dberrhandle(DBERRHANDLER);
extern DBMSGHANDLER dbmsghandle(DBMSGHANDLER);

HTH.

--jkl


More information about the FreeTDS mailing list