Re: DB connection library and dynamic linking

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.