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

#ifndef LIFTSPEC_H
#define LIFTSPEC_H

struct liftSpec
/* Info on how to change coordinates from lower to higher level */
    {
    struct liftSpec *next;  /* Next in singly linked list. */
    int offset;	/* Offset to add. */
    char *oldName;	/* Name of old sequence. */
    int oldSize;	/* Size of old sequence. */
    char *newName;	/* Name of new sequence. */
    int size;	/* Size of new sequence. */
    };

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

struct liftSpec *liftSpecLoad(char **row);
/* Load a liftSpec from row fetched with select * from liftSpec
 * from database.  Dispose of this with liftSpecFree(). */

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

void liftSpecFree(struct liftSpec **pEl);
/* Free a single dynamically allocated liftSpec such as created
 * with liftSpecLoad(). */

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

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

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

#define liftSpecCommaOut(el,f) liftSpecOutput(el,f,',',',');
/* Print out liftSpec as a comma separated list including final comma. */

#endif /* LIFTSPEC_H */

