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

#ifndef BARCHARTSAMPLE_H
#define BARCHARTSAMPLE_H

#include "jksql.h"
#define BARCHARTSAMPLE_NUM_COLS 2

extern char *barChartSampleCommaSepFieldNames;

struct barChartSample
/* barChart sample description */
    {
    struct barChartSample *next;  /* Next in singly linked list. */
    char *sample;	/* Sample identifier */
    char *category;	/* Category identifier (e.g. tissue) */
    };

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

struct barChartSample *barChartSampleLoadByQuery(struct sqlConnection *conn, char *query);
/* Load all barChartSample from table that satisfy the query given.  
 * Where query is of the form 'select * from example where something=something'
 * or 'select example.* from example, anotherTable where example.something = 
 * anotherTable.something'.
 * Dispose of this with barChartSampleFreeList(). */

void barChartSampleSaveToDb(struct sqlConnection *conn, struct barChartSample *el, char *tableName, int updateSize);
/* Save barChartSample as a row to the table specified by tableName. 
 * As blob fields may be arbitrary size updateSize specifies the approx size
 * of a string that would contain the entire query. Arrays of native types are
 * converted to comma separated strings and loaded as such, User defined types are
 * inserted as NULL. This function automatically escapes quoted strings for mysql. */

struct barChartSample *barChartSampleLoad(char **row);
/* Load a barChartSample from row fetched with select * from barChartSample
 * from database.  Dispose of this with barChartSampleFree(). */

struct barChartSample *barChartSampleLoadAll(char *fileName);
/* Load all barChartSample from whitespace-separated file.
 * Dispose of this with barChartSampleFreeList(). */

struct barChartSample *barChartSampleLoadAllByChar(char *fileName, char chopper);
/* Load all barChartSample from chopper separated file.
 * Dispose of this with barChartSampleFreeList(). */

#define barChartSampleLoadAllByTab(a) barChartSampleLoadAllByChar(a, '\t');
/* Load all barChartSample from tab separated file.
 * Dispose of this with barChartSampleFreeList(). */

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

void barChartSampleFree(struct barChartSample **pEl);
/* Free a single dynamically allocated barChartSample such as created
 * with barChartSampleLoad(). */

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

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

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

#define barChartSampleCommaOut(el,f) barChartSampleOutput(el,f,',',',');
/* Print out barChartSample as a comma separated list including final comma. */

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

#endif /* BARCHARTSAMPLE_H */

