a44421a79fb36cc2036fe116b97ea3bc9590cd0c braney Fri Dec 2 09:34:39 2011 -0800 removed rcsid (#295) diff --git src/hg/lib/traceInfo.c src/hg/lib/traceInfo.c index 232c5e9..3af9b0c 100644 --- src/hg/lib/traceInfo.c +++ src/hg/lib/traceInfo.c @@ -1,108 +1,107 @@ /* traceInfo.c was originally generated by the autoSql program, which also * generated traceInfo.h and traceInfo.sql. This module links the database and * the RAM representation of objects. */ #include "common.h" #include "linefile.h" #include "jksql.h" #include "traceInfo.h" -static char const rcsid[] = "$Id: traceInfo.c,v 1.3 2005/04/13 06:25:58 markd Exp $"; void traceInfoStaticLoad(char **row, struct traceInfo *ret) /* Load a row from traceInfo table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->ti = row[0]; ret->templateId = row[1]; ret->size = sqlUnsigned(row[2]); } struct traceInfo *traceInfoLoad(char **row) /* Load a traceInfo from row fetched with select * from traceInfo * from database. Dispose of this with traceInfoFree(). */ { struct traceInfo *ret; AllocVar(ret); ret->ti = cloneString(row[0]); ret->templateId = cloneString(row[1]); ret->size = sqlUnsigned(row[2]); return ret; } struct traceInfo *traceInfoLoadAll(char *fileName) /* Load all traceInfo from a tab-separated file. * Dispose of this with traceInfoFreeList(). */ { struct traceInfo *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[3]; while (lineFileRow(lf, row)) { el = traceInfoLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; } struct traceInfo *traceInfoCommaIn(char **pS, struct traceInfo *ret) /* Create a traceInfo out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new traceInfo */ { char *s = *pS; if (ret == NULL) AllocVar(ret); ret->ti = sqlStringComma(&s); ret->templateId = sqlStringComma(&s); ret->size = sqlUnsignedComma(&s); *pS = s; return ret; } void traceInfoFree(struct traceInfo **pEl) /* Free a single dynamically allocated traceInfo such as created * with traceInfoLoad(). */ { struct traceInfo *el; if ((el = *pEl) == NULL) return; freeMem(el->ti); freeMem(el->templateId); freez(pEl); } void traceInfoFreeList(struct traceInfo **pList) /* Free a list of dynamically allocated traceInfo's */ { struct traceInfo *el, *next; for (el = *pList; el != NULL; el = next) { next = el->next; traceInfoFree(&el); } *pList = NULL; } void traceInfoOutput(struct traceInfo *el, FILE *f, char sep, char lastSep) /* Print out traceInfo. Separate fields with sep. Follow last field with lastSep. */ { if (sep == ',') fputc('"',f); fprintf(f, "%s", el->ti); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->templateId); if (sep == ',') fputc('"',f); fputc(sep,f); fprintf(f, "%u", el->size); fputc(lastSep,f); }