[freetds] data and net

James K. Lowden jklowden at schemamania.org
Mon May 5 18:35:47 EDT 2003


On 05 May 2003 23:20:34 +0200, Frediano Ziglio <freddyz77 at tin.it> wrote:
> I think libTDS is grown too much and we should split it a bit...
> My intention is to separate data and net in different modules (data.c
> and net.c). net.c should handle low level connect/read/write operations
> (not packet level, only wire level). 
...
> data.c should handle read/write of data (like tds_get_data,
> tds_put_data, tds_get_data_char and so on).

That sounds reasonable.  I don't see much point in combining read.c and
write.c, though.  

I've been saying for a while that there's a top and a bottom to libtds,
and that we should make that explicit.  

We have:

$ wc -l *.c |sort -n
      41 getmac.c
     102 locale.c
     157 tdsstring.c
     173 challenge.c
     213 vstrbuild.c
     259 threadsafe.c
     274 md4.c
     346 numeric.c
     417 util.c
     465 write.c
     624 des.c
     633 read.c
     696 iconv.c
     871 login.c
    1002 mem.c
    1063 config.c
    1215 query.c
    3041 token.c
    3243 convert.c
   14835 total

Perhaps packet.c?  It would put/get tds packets (by calling lower-level
functions, of course), and be part of the API used by the client
libraries.  I think it would get some functions from the bigger modules,
token.c and convert.c.  

> A note on header. Recent changes bring some internal iconv declaration
> in tds.h but we separated time ago iconv stuff in tdsiconv.h. Should we
> rejoin the two header?

Maybe wait and see?  I'm guessing that iconv stuff will become intricately
entwined in FreeTDS -- hmm, it seems I'm actively making that happen.  It
might be good to keep tdsiconv.h, but just #include it at the top of
tds.h.  

I had to move some things to tds.h, as you know, to support per-column
encoding.  

--jkl



More information about the FreeTDS mailing list