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

#ifndef SANGREAD_H
#define SANGREAD_H

struct sangRead
/* Information on a Sanger O+O read */
    {
    struct sangRead *next;  /* Next in singly linked list. */
    char id[8];	/* Ascii representation of a number */
    char pq[2];	/* p or q */
    char name[20];	/* Full name of read */
    char dir[16];	/* Directory read stored in */
    };

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

struct sangRead *sangReadLoad(char **row);
/* Load a sangRead from row fetched with select * from sangRead
 * from database.  Dispose of this with sangReadFree(). */

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

void sangReadFree(struct sangRead **pEl);
/* Free a single dynamically allocated sangRead such as created
 * with sangReadLoad(). */

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

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

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

#define sangReadCommaOut(el,f) sangReadOutput(el,f,',',',');
/* Print out sangRead as a comma separated list including final comma. */

#endif /* SANGREAD_H */

