Skip to Content.
Sympa Menu

freetds - CVS diffs for SYBVARBINARY and vxWorks

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Dennis Nicklaus <nicklaus AT crusher.fnal.gov>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: CVS diffs for SYBVARBINARY and vxWorks
  • Date: Tue, 3 Oct 2000 15:23:13 -0500 (CDT)


I recently checked out the latest version of the freetds
source and made a few modifications so that it would
1) Work correctly with SYBVARBINARY data. There were 2 mistakes
in the code that I corrected in tds/token.c and dblib/dblib.c.

and

2) Be compatible with vxWorks, specifically cross-compiling for
vxWorks for PowerPCs (Moto 2400 series), or 68020/040s.

Attached below is the output of "cvs diff" for the files I changed.
The vxWorks changes are mostly cosmetic kinds of things, e.g.
vxWorks std. include files already #define a STATUS and BOOL,
so you can't redefine them in sybdb.h.
In tds/read.c, there was a macro named READ that I renamed to
READ_MACRO because vxworks already has a READ defined.

Also, I had to change // comments to /* */. Please only use /* */
in the C source code.

Here is the cvs diff output. If someone can please merge it into the
cvs repository, I would appreciate it. Or, if you can make me a
developer with write access somehow, I'd be happy to give the CVS
update commands myself.

Dennis Nicklaus nicklaus AT fnal.gov




Index: sybdb.h
===================================================================
RCS file: /Repository/freetds/include/sybdb.h,v
retrieving revision 1.26
diff -r1.26 sybdb.h
72a73,75
> #ifndef __INCvxWorksh
> /* VxWorks already defines STATUS and BOOL. Compiler gets mad if you
> redefine them. */
> /* __INCvxWorksh will get #defined by std. include files included from
> tds.h */
73a77
> #endif
75a80
> #ifndef __INCvxWorksh /* vxWorks doesn't have a sys/time.h */
76a82
> #endif
Index: tds.h
===================================================================
RCS file: /Repository/freetds/include/tds.h,v
retrieving revision 1.57
diff -r1.57 tds.h
32a33
> #ifndef __INCvxWorksh
33a35,37
> #else
> #include <signal.h>
> #endif
Index: tdsutil.h
===================================================================
RCS file: /Repository/freetds/include/tdsutil.h,v
retrieving revision 1.9
diff -r1.9 tdsutil.h
25c25,26
< #include <time.h> // Jeff's hack
---
> #include <time.h> /* Jeff's hack */
> #ifndef __INCvxWorksh /* vxWorks doesn't have a sys/time.h */
26a28
> #endif
Index: login.c
===================================================================
RCS file: /Repository/freetds/src/tds/login.c,v
retrieving revision 1.24
diff -r1.24 login.c
21a22,27
> #ifdef __INCvxWorksh
> /* This will get #defined from std. include files included in tds.h
> if we are building for a VxWorks system. vxWorks requires ioLib.h
> to pick up FIONBIO */
> #include <ioLib.h>
> #endif
Index: mem.c
===================================================================
RCS file: /Repository/freetds/src/tds/mem.c,v
retrieving revision 1.20
diff -r1.20 mem.c
233c233
< tds_socket->timeout = 0; // Jeff's hack, init to no
timeout
---
> tds_socket->timeout = 0; /* Jeff's hack, init to no
> timeout*/
Index: read.c
===================================================================
RCS file: /Repository/freetds/src/tds/read.c,v
retrieving revision 1.17
diff -r1.17 read.c
22c22
< #include <malloc.h>
---
> #include <stdlib.h>
23a24
> #ifndef __INCvxWorksh /* vxWorks doesn't have a sys/time.h */
24a26
> #endif
28c30
< #define READ(a,b,c) recv (a, b, c, 0L);
---
> #define READ_MACRO(a,b,c) recv (a, b, c, 0L);
31c33
< #define READ(a,b,c) read (a, b, c);
---
> #define READ_MACRO(a,b,c) read (a, b, c);
78c80
< len = READ(tds->s, buf+got, buflen);
---
> len = READ_MACRO(tds->s, buf+got, buflen);
95c97
< got = READ(tds->s, buf, buflen);
---
> got = READ_MACRO(tds->s, buf, buflen);

Index: token.c
===================================================================
RCS file: /Repository/freetds/src/tds/token.c,v
retrieving revision 1.64
diff -r1.64 token.c
857a858,864
> /* It is important to re-zero out the whole
> column_size varbin array here because the
> result
> of the query ("colsize") may be any
> number of
> bytes <= column_size (because the result
> will be truncated if the rest of the data
> in the column would be all zeros). */
>
> memset(varbin->array,'\0',curcol->column_size);

Index: dblib.c
===================================================================
RCS file: /Repository/freetds/src/dblib/dblib.c,v
retrieving revision 1.63
diff -r1.63 dblib.c
987a988
> TDS_VARBINARY *varbin;
999a1001,1005
> if (colinfo->column_type == SYBVARBINARY) {
> varbin = (TDS_VARBINARY *)
> &(resinfo->current_row[colinfo->column_offset]);
> return varbin->array;
> }
>
1000a1007
>




Archive powered by MHonArc 2.6.24.

Top of Page