static struct sqlConnection *ccdsSqlConn(char *ccdsDb) /* open ccds database, handle profile.db syntax */ { char buf[256]; safecpy(buf, sizeof(buf), ccdsDb); char *sep = strchr(buf, ':'); char *profile, *db; if (sep == NULL) { profile = "db"; db = ccdsDb; } else { profile = buf; *sep = '\0'; db = sep+1; } return sqlConnectProfile(profile, db); }
struct sqlConnection *edwConnectReadWrite() /* Returns read/write connection to database. */ { return sqlConnectProfile("encodeDataWarehouse", edwDatabase); }