/* cdsSpec.h was originally generated by the autoSql program, which also 
 * generated cdsSpec.c and cdsSpec.sql.  This header links the database and
 * the RAM representation of objects. */

/* Copyright (C) 2008 The Regents of the University of California 
 * See README in this or parent directory for licensing information. */

#ifndef CDSSPEC_H
#define CDSSPEC_H

#define CDSSPEC_NUM_COLS 2

struct cdsSpec
/* GenBank-style CDS specification, indexed by sequence id */
    {
    struct cdsSpec *next;  /* Next in singly linked list. */
    char *id;	/* unique sequence id */
    char *cds;	/* CDS specification, in NCBI format. */
    };

void cdsSpecStaticLoad(char **row, struct cdsSpec *ret);
/* Load a row from cdsSpec table into ret.  The contents of ret will
 * be replaced at the next call to this function. */

struct cdsSpec *cdsSpecLoad(char **row);
/* Load a cdsSpec from row fetched with select * from cdsSpec
 * from database.  Dispose of this with cdsSpecFree(). */

struct cdsSpec *cdsSpecLoadAll(char *fileName);
/* Load all cdsSpec from whitespace-separated file.
 * Dispose of this with cdsSpecFreeList(). */

struct cdsSpec *cdsSpecLoadAllByChar(char *fileName, char chopper);
/* Load all cdsSpec from chopper separated file.
 * Dispose of this with cdsSpecFreeList(). */

#define cdsSpecLoadAllByTab(a) cdsSpecLoadAllByChar(a, '\t');
/* Load all cdsSpec from tab separated file.
 * Dispose of this with cdsSpecFreeList(). */

struct cdsSpec *cdsSpecCommaIn(char **pS, struct cdsSpec *ret);
/* Create a cdsSpec out of a comma separated string. 
 * This will fill in ret if non-null, otherwise will
 * return a new cdsSpec */

void cdsSpecFree(struct cdsSpec **pEl);
/* Free a single dynamically allocated cdsSpec such as created
 * with cdsSpecLoad(). */

void cdsSpecFreeList(struct cdsSpec **pList);
/* Free a list of dynamically allocated cdsSpec's */

void cdsSpecOutput(struct cdsSpec *el, FILE *f, char sep, char lastSep);
/* Print out cdsSpec.  Separate fields with sep. Follow last field with lastSep. */

#define cdsSpecTabOut(el,f) cdsSpecOutput(el,f,'\t','\n');
/* Print out cdsSpec as a line in a tab-separated file. */

#define cdsSpecCommaOut(el,f) cdsSpecOutput(el,f,',',',');
/* Print out cdsSpec as a comma separated list including final comma. */

/* -------------------------------- End autoSql Generated Code -------------------------------- */

#endif /* CDSSPEC_H */

