3e420ec829635a0f80f3790b312ab555d3ff2240 hiram Tue Aug 13 18:03:07 2024 -0700 helper function assemblyListTableName() refs #32897 diff --git src/hg/lib/assemblyList.c src/hg/lib/assemblyList.c index 58dd569..a31a38f 100644 --- src/hg/lib/assemblyList.c +++ src/hg/lib/assemblyList.c @@ -1,27 +1,26 @@ /* assemblyList.c was originally generated by the autoSql program, which also * generated assemblyList.h and assemblyList.sql. This module links the database and * the RAM representation of objects. */ #include "common.h" #include "linefile.h" #include "dystring.h" #include "jksql.h" +#include "hgConfig.h" #include "assemblyList.h" - - char *assemblyListCommaSepFieldNames = "name,priority,commonName,scientificName,taxId,clade,description,browserExists,hubUrl"; void assemblyListStaticLoadWithNull(char **row, struct assemblyList *ret) /* Load a row from assemblyList table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->name = row[0]; if (row[1] != NULL) { ret->priority = needMem(sizeof(*(ret->priority))); *(ret->priority) = sqlUnsigned(row[1]); } else { @@ -318,15 +317,28 @@ fputc(':',f); fprintf(f, "%u", *(el->browserExists)); fputc(',',f); fputc('"',f); fprintf(f,"hubUrl"); fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->hubUrl); fputc('"',f); fputc('}',f); } /* -------------------------------- End autoSql Generated Code -------------------------------- */ +static char *_assemblyListTableName = NULL; + +char *assemblyListTableName() +/* return the assemblyList table name from the environment, + * or hg.conf, or use the default. Cache the result */ +{ +if (_assemblyListTableName == NULL) + _assemblyListTableName = cfgOptionEnvDefault("HGDB_ASSEMBLYLIST_STATUS_TABLE", + assemblyListTableConfVariable, defaultAssemblyListTableName); + +return _assemblyListTableName; +} +