533112afe2a2005e80cdb1f82904ea65032d4302
braney
  Sat Oct 2 11:37:34 2021 -0700
split hg/lib into two separate libaries, one only used by the cgis

diff --git src/hg/cgilib/contigAcc.c src/hg/cgilib/contigAcc.c
new file mode 100644
index 0000000..8b940cb
--- /dev/null
+++ src/hg/cgilib/contigAcc.c
@@ -0,0 +1,126 @@
+/* contigAcc.c was originally generated by the autoSql program, which also 
+ * generated contigAcc.h and contigAcc.sql.  This module links the database and
+ * the RAM representation of objects. */
+
+/* Copyright (C) 2014 The Regents of the University of California 
+ * See README in this or parent directory for licensing information. */
+
+#include "common.h"
+#include "linefile.h"
+#include "dystring.h"
+#include "jksql.h"
+#include "contigAcc.h"
+
+
+void contigAccStaticLoad(char **row, struct contigAcc *ret)
+/* Load a row from contigAcc table into ret.  The contents of ret will
+ * be replaced at the next call to this function. */
+{
+
+ret->contig = row[0];
+ret->acc = row[1];
+}
+
+struct contigAcc *contigAccLoad(char **row)
+/* Load a contigAcc from row fetched with select * from contigAcc
+ * from database.  Dispose of this with contigAccFree(). */
+{
+struct contigAcc *ret;
+
+AllocVar(ret);
+ret->contig = cloneString(row[0]);
+ret->acc = cloneString(row[1]);
+return ret;
+}
+
+struct contigAcc *contigAccLoadAll(char *fileName) 
+/* Load all contigAcc from a whitespace-separated file.
+ * Dispose of this with contigAccFreeList(). */
+{
+struct contigAcc *list = NULL, *el;
+struct lineFile *lf = lineFileOpen(fileName, TRUE);
+char *row[2];
+
+while (lineFileRow(lf, row))
+    {
+    el = contigAccLoad(row);
+    slAddHead(&list, el);
+    }
+lineFileClose(&lf);
+slReverse(&list);
+return list;
+}
+
+struct contigAcc *contigAccLoadAllByChar(char *fileName, char chopper) 
+/* Load all contigAcc from a chopper separated file.
+ * Dispose of this with contigAccFreeList(). */
+{
+struct contigAcc *list = NULL, *el;
+struct lineFile *lf = lineFileOpen(fileName, TRUE);
+char *row[2];
+
+while (lineFileNextCharRow(lf, chopper, row, ArraySize(row)))
+    {
+    el = contigAccLoad(row);
+    slAddHead(&list, el);
+    }
+lineFileClose(&lf);
+slReverse(&list);
+return list;
+}
+
+struct contigAcc *contigAccCommaIn(char **pS, struct contigAcc *ret)
+/* Create a contigAcc out of a comma separated string. 
+ * This will fill in ret if non-null, otherwise will
+ * return a new contigAcc */
+{
+char *s = *pS;
+
+if (ret == NULL)
+    AllocVar(ret);
+ret->contig = sqlStringComma(&s);
+ret->acc = sqlStringComma(&s);
+*pS = s;
+return ret;
+}
+
+void contigAccFree(struct contigAcc **pEl)
+/* Free a single dynamically allocated contigAcc such as created
+ * with contigAccLoad(). */
+{
+struct contigAcc *el;
+
+if ((el = *pEl) == NULL) return;
+freeMem(el->contig);
+freeMem(el->acc);
+freez(pEl);
+}
+
+void contigAccFreeList(struct contigAcc **pList)
+/* Free a list of dynamically allocated contigAcc's */
+{
+struct contigAcc *el, *next;
+
+for (el = *pList; el != NULL; el = next)
+    {
+    next = el->next;
+    contigAccFree(&el);
+    }
+*pList = NULL;
+}
+
+void contigAccOutput(struct contigAcc *el, FILE *f, char sep, char lastSep) 
+/* Print out contigAcc.  Separate fields with sep. Follow last field with lastSep. */
+{
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->contig);
+if (sep == ',') fputc('"',f);
+fputc(sep,f);
+if (sep == ',') fputc('"',f);
+fprintf(f, "%s", el->acc);
+if (sep == ',') fputc('"',f);
+fputc(lastSep,f);
+}
+
+/* -------------------------------- End autoSql Generated Code -------------------------------- */
+