Skip to Content.
Sympa Menu

freetds - FreeTDS under VMS (changes suggestion)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Ruslan R. Laishev" <Laishev AT SMTP.DeltaTel.RU>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Cc: James Cameron <cameron AT stl.dec.com>
  • Subject: FreeTDS under VMS (changes suggestion)
  • Date: Sun, 19 Nov 2000 16:52:03 +0300


Hello All!
I suggest to introduce small changes which will help VMS
programmers/users to use
native input/output routines ($FAO/FAOL). The changes are marked as "-->".

TDS.H:
typedef struct tds_column_info {
TDS_SMALLINT column_type;
TDS_SMALLINT column_xtype;
TDS_SMALLINT column_usertype;
TDS_INT column_size;
TDS_INT column_offset;
--> TDS_TINYINT column_namelen;
TDS_CHAR column_name[256];
TDS_SMALLINT column_bindtype;
TDS_UINT column_bindlen;
TDS_CHAR *column_nullbind;
TDS_CHAR *varaddr;
TDS_CHAR *column_lenbind;
TDS_SMALLINT column_prec;
TDS_SMALLINT column_scale;
TDS_INT column_textsize;
TDS_INT column_textpos;
TDS_CHAR column_textptr[16];
TDS_CHAR column_timestamp[8];
/* Note this is a short term kludge because it will not work with
** row buffering, but should get it working enough to readdress
** it when we understand it a bit better */
TDS_CHAR *column_textvalue;
} TDSCOLINFO;

TOKEN.C:
static int tds_process_col_name(TDSSOCKET *tds)
{
int hdrsize, len=0;
int col,num_cols=0;
int colnamelen;
struct tmp_col_struct {
char *column_name;
struct tmp_col_struct *next;
};
struct tmp_col_struct *head=NULL, *cur=NULL, *prev;
TDSCOLINFO *curcol;
TDSRESULTINFO *info;

hdrsize = tds_get_smallint(tds);

/* this is a little messy...TDS 5.0 gives the number of columns
** upfront, while in TDS 4.2, you're expected to figure it out
** by the size of the message. So, I use a link list to get the
** colum names and then allocate the result structure, copy
** and delete the linked list */
while (len<hdrsize) {
prev = cur;
cur = (struct tmp_col_struct *)
malloc(sizeof (struct tmp_col_struct));
if (prev) prev->next=cur;
if (!head) head = cur;

colnamelen = tds_get_byte(tds);
cur->column_name = (char *) malloc(colnamelen+1);
tds_get_n(tds,cur->column_name, colnamelen);
cur->column_name[colnamelen]='\0';
--> cur->column_namelen = colnamelen;
cur->next=NULL;

len += colnamelen + 1;
num_cols++;
}
...

--
Cheers.
+------------------pure personal opinion-----------------------+
RADIUS Server for OpenVMS project - www.radiusvms.com
www.DLS.net - Connecting with Care!
vms-isps AT dls.net - Forum for ISP running OpenVMS




Archive powered by MHonArc 2.6.24.

Top of Page