Skip to Content.
Sympa Menu

freetds - [freetds] tdsdump functions

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: [freetds] tdsdump functions
  • Date: Tue, 27 Jul 2004 16:44:45 +0200

Considering

$ grep -r tdsdump_log `find -name \*.c` | grep '%L' | sed 's,"%L,,g' |
grep '%L'
./src/tds/read.c: tdsdump_log(TDS_DBG_NETWORK, "Received header @
%L\n%D\n", header, sizeof(header));
./src/tds/read.c: tdsdump_log(TDS_DBG_NETWORK, "Received packet @
%L\n%D\n", tds->in_buf, tds->in_len);
./src/tds/write.c: tdsdump_log(TDS_DBG_NETWORK, "Sending packet @
%L\n%D\n", tds->out_buf, tds->out_pos);

$ grep -r tdsdump_log `find -name \*.c` | grep '%D'
./src/tds/read.c: tdsdump_log(TDS_DBG_NETWORK, "Received header @
%L\n%D\n", header, sizeof(header));
./src/tds/read.c: tdsdump_log(TDS_DBG_NETWORK, "Received packet @
%L\n%D\n", tds->in_buf, tds->in_len);
./src/tds/read.c:
tdsdump_log(TDS_DBG_NETWORK, "\tTroublesome bytes:\n\t%D\n", bufp,
bufleft);
./src/tds/write.c:
tdsdump_log(TDS_DBG_NETWORK, "\tTroublesome bytes:\n\t%D\n", s, (int)
inbytesleft);
./src/tds/write.c: tdsdump_log(TDS_DBG_NETWORK, "Sending packet @
%L\n%D\n", tds->out_buf, tds->out_pos);

I think it would be better to implement tdsdump_log using vfprintf
(prefixing date/time) and add a message parameter to tdsdump_dump_buf.
So we can use all printf formatting (like %*s or whatever) and gain gcc
check on parameters.

freddy77



  • [freetds] tdsdump functions, ZIGLIO, Frediano, VF-IT, 07/27/2004

Archive powered by MHonArc 2.6.24.

Top of Page