Changes to Microsoft SQL Server header files in order to be able to write SQL programs with the C Set/2 compiler

The following are changes to the SQL Server 4.2 include files in order to use SQL Server with the IBM C/Set2 compiler.

In the file sqlfront.h change:

Lines 18-22 from to Lines 30 from to Lines 36-38 from to Lines 60-62 from to In the DBDATEREC structure change all the 'int's to 'INT16's. They are on lines 406-416.
 * 1) define DBUBOOL 	      unsigned int

Lines 422-423 from to In the file sqldb.h change:

Line 54 from to
 * 1) ifndef DBNTWIN32
 * 1) if !defined(DBNTWIN32) && !defined(DBOS2_20)

Line 265 from to
 * 1) ifdef DBMSOS2
 * 1) ifdef DBMSOS2     /* 16 bit os2 */

Copy the DBMSOS2 section (lines 265-441) changing the following in the new section: In the programs you write: LOGINREC * _Seg16 login; #pragma handler(msg_handler) INT16 SQLAPI msg_handler(DBPROCESS * _Seg16 dbproc,                           DBINT msgno,                            INT16 msgstate,                            INT16 severity,                            char * _Seg16 msgtext) {     DBPROCESS  *mydbproc   = dbproc; DBINT      mymsgno    = msgno; INT16      mymsgstate = msgstate; INT16      myseverity = severity; char      *mymsgtext  = msgtext;
 * Define DBOS2_20 ex: #define DBOS2_20
 * All pointers (even those inside structures) which are passed to a 16 bit routine needs to be declared _Seg16.
 * ex: DBPROCESS * _Seg16 dbproc;
 * All other variables passed to a 16 bit routine need a #pragma seg16(variable).
 * ex: #pragma seg16(userid) DBSMALLINT userid; #pragma seg16(name) DBCHAR      name[PLEN+1];
 * For the callbacks to 32 bit code from the 16 bit code, it is best to have a local variable for each parameter passed in from the 16 bit routine. You also need to use a pragma which tells the compiler to install an exception handler in the callback routine.
 * ex:

printf("SQL Server message %ld, state %d, severity %d:\n\t%s\n",            mymsgno, mymsgstate, myseverity, mymsgtext); return(0); }  ex:  dbfcmd(dbproc, "values(%s) \n", (char * _Seg16) cmdbuf);
 * The library routine dbfcmd takes a variable number of parameters. As a result, the compiler doesn't perform the necessary conversions on the optional parms. To correct this, use a cast for all optional parms.