Skip to Content.
Sympa Menu

freetds - Re: [freetds] DB connection library and dynamic linking

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Julian Amso" <omegastyle AT gmail.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] DB connection library and dynamic linking
  • Date: Sun, 26 Sep 2010 19:43:30 +0100

Hi James
Thank for the different suggestions. There is bureaucratic situation of not
me having control over the package compilation, installation on the machine
including root access. It looks like a nice solution of the namespace issue.

I wonder what would happen if a recompile the application and staticly link
the FreeTDS application and keep the remaining libraries to be loaded
dynamically. I am planning to test that tomorrow.
I also found an interesting article about direct binding symbol references
using a mapfile.

http://developers.sun.com/solaris/articles/linker_mapfiles.html
http://docs.sun.com/app/docs/doc/817-1984/aehzq?l=en&a=view

/Julian


-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of James K. Lowden
Sent: 26 September 2010 18:50
To: FreeTDS Development Group
Subject: Re: [freetds] DB connection library and dynamic linking

James K. Lowden wrote:
> A systematic solution would be to prefix all the FreeTDS ct-lib names
> throughout the library, and use the preprocessor in ct.c to DTRT.

BTW, the ct.h changes don't have to be elaborate. Something like

$ grep ct_ doc/api_status.txt | awk '/OK/ {print $3}' | perl -ne'chomp;
$old=$_; s/^ct/CT/; printf qq(#define %-20s\t%s\n), $old, $_'
#define ct_bind CT_bind
#define ct_callback CT_callback
#define ct_cancel CT_cancel
#define ct_capability CT_capability
#define ct_close CT_close
#define ct_cmd_alloc CT_cmd_alloc
#define ct_cmd_drop CT_cmd_drop
#define ct_cmd_props CT_cmd_props
#define ct_command CT_command
#define ct_compute_info CT_compute_info
#define ct_con_alloc CT_con_alloc
#define ct_con_drop CT_con_drop
#define ct_con_props CT_con_props
#define ct_config CT_config
#define ct_connect CT_connect
#define ct_cursor CT_cursor
#define ct_data_info CT_data_info
#define ct_describe CT_describe
#define ct_diag CT_diag
#define ct_dynamic CT_dynamic
#define ct_exit CT_exit
#define ct_fetch CT_fetch
#define ct_get_data CT_get_data
#define ct_init CT_init
#define ct_options CT_options
#define ct_param CT_param
#define ct_res_info CT_res_info
#define ct_results CT_results
#define ct_send CT_send
#define ct_send_data CT_send_data
#define ct_setparam CT_setparam

would do the trick with most linkers. It's nice to keep any prefix very
short, for readability.

--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page