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

#ifndef CTGPOS_H
#define CTGPOS_H

struct ctgPos
/* Where a contig is inside of a chromosome. */
    {
    struct ctgPos *next;  /* Next in singly linked list. */
    char *contig;	/* Name of contig */
    unsigned size;	/* Size of contig */
    char *chrom;	/* Chromosome name */
    unsigned chromStart;	/* Start in chromosome */
    unsigned chromEnd;	/* End in chromosome */
    };

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

struct ctgPos *ctgPosLoad(char **row);
/* Load a ctgPos from row fetched with select * from ctgPos
 * from database.  Dispose of this with ctgPosFree(). */

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

void ctgPosFree(struct ctgPos **pEl);
/* Free a single dynamically allocated ctgPos such as created
 * with ctgPosLoad(). */

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

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

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

#define ctgPosCommaOut(el,f) ctgPosOutput(el,f,',',',');
/* Print out ctgPos as a comma separated list including final comma. */

#endif /* CTGPOS_H */

