Logo Search packages:      
Sourcecode: freetds version File versions

int tds_read_conf_file ( TDSCONNECTINFO *  connect_info,
const char *  server 
)

Read configuration info for given server return 0 on error

Parameters:
connect_info where to store configuration
server section of file configuration that hold configuration for a server

Definition at line 227 of file config.c.

References tds_read_conf_file().

Referenced by tds_read_conf_file(), and tds_read_config_info().

{
      char *path = NULL;
      int found = 0;

      if (interf_file) {
            found = tds_try_conf_file(interf_file, "set programmatically", server, connect_info);
      }

      /* FREETDSCONF env var, pkleef@openlinksw.com 01/21/02 */
      if (!found) {
            path = getenv("FREETDSCONF");
            if (path) {
                  found = tds_try_conf_file(path, "(from $FREETDSCONF)", server, connect_info);
            } else {
                  tdsdump_log(TDS_DBG_INFO2, "%L ...$FREETDSCONF not set.  Trying $HOME.\n");
            }
      }

      if (!found) {
            path = tds_get_home_file(".freetds.conf");
            if (path) {
                  found = tds_try_conf_file(path, "(.freetds.conf)", server, connect_info);
                  free(path);
            } else {
                  tdsdump_log(TDS_DBG_INFO2, "%L ...Error getting ~/.freetds.conf.  Trying %s.\n", FREETDS_SYSCONFFILE);
            }
      }

      if (!found) {
            found = tds_try_conf_file(FREETDS_SYSCONFFILE, "(default)", server, connect_info);
      }

      return found;
}


Generated by  Doxygen 1.6.0   Back to index