src/hg/inc/makeItemsItem.h 1.1

1.1 2010/04/09 17:44:20 kent
Adding makeItemsItem autoSql object.
Index: src/hg/inc/makeItemsItem.h
===================================================================
RCS file: src/hg/inc/makeItemsItem.h
diff -N src/hg/inc/makeItemsItem.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/hg/inc/makeItemsItem.h	9 Apr 2010 17:44:20 -0000	1.1
@@ -0,0 +1,95 @@
+/* makeItemsItem.h was originally generated by the autoSql program, which also 
+ * generated makeItemsItem.c and makeItemsItem.sql.  This header links the database and
+ * the RAM representation of objects. */
+
+#ifndef MAKEITEMSITEM_H
+#define MAKEITEMSITEM_H
+
+#include "jksql.h"
+#define MAKEITEMS_NUM_COLS 9
+
+struct makeItems
+/* Browser extensible data */
+    {
+    struct makeItems *next;  /* Next in singly linked list. */
+    unsigned bin;	/* Bin for range index */
+    char *chrom;	/* Reference sequence chromosome or scaffold */
+    unsigned chromStart;	/* Start position in chromosome */
+    unsigned chromEnd;	/* End position in chromosome */
+    char *name;	/* Name of item - up to 16 chars */
+    char strand[2];	/* + or - for strand */
+    unsigned score;	/* 0-1000.  Higher numbers are darker. */
+    char *color;	/* Comma separated list of RGB components.  IE 255,0,0 for red */
+    char *description;	/* Longer item description */
+    };
+
+void makeItemsStaticLoad(char **row, struct makeItems *ret);
+/* Load a row from makeItems table into ret.  The contents of ret will
+ * be replaced at the next call to this function. */
+
+struct makeItems *makeItemsLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all makeItems 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 makeItemsFreeList(). */
+
+void makeItemsSaveToDb(struct sqlConnection *conn, struct makeItems *el, char *tableName, int updateSize);
+/* Save makeItems 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. Note that strings must be escaped to allow insertion into the database.
+ * For example "autosql's features include" --> "autosql\'s features include" 
+ * If worried about this use makeItemsSaveToDbEscaped() */
+
+void makeItemsSaveToDbEscaped(struct sqlConnection *conn, struct makeItems *el, char *tableName, int updateSize);
+/* Save makeItems 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. Automatically 
+ * escapes all simple strings (not arrays of string) but may be slower than makeItemsSaveToDb().
+ * For example automatically copies and converts: 
+ * "autosql's features include" --> "autosql\'s features include" 
+ * before inserting into database. */ 
+
+struct makeItems *makeItemsLoad(char **row);
+/* Load a makeItems from row fetched with select * from makeItems
+ * from database.  Dispose of this with makeItemsFree(). */
+
+struct makeItems *makeItemsLoadAll(char *fileName);
+/* Load all makeItems from whitespace-separated file.
+ * Dispose of this with makeItemsFreeList(). */
+
+struct makeItems *makeItemsLoadAllByChar(char *fileName, char chopper);
+/* Load all makeItems from chopper separated file.
+ * Dispose of this with makeItemsFreeList(). */
+
+#define makeItemsLoadAllByTab(a) makeItemsLoadAllByChar(a, '\t');
+/* Load all makeItems from tab separated file.
+ * Dispose of this with makeItemsFreeList(). */
+
+struct makeItems *makeItemsCommaIn(char **pS, struct makeItems *ret);
+/* Create a makeItems out of a comma separated string. 
+ * This will fill in ret if non-null, otherwise will
+ * return a new makeItems */
+
+void makeItemsFree(struct makeItems **pEl);
+/* Free a single dynamically allocated makeItems such as created
+ * with makeItemsLoad(). */
+
+void makeItemsFreeList(struct makeItems **pList);
+/* Free a list of dynamically allocated makeItems's */
+
+void makeItemsOutput(struct makeItems *el, FILE *f, char sep, char lastSep);
+/* Print out makeItems.  Separate fields with sep. Follow last field with lastSep. */
+
+#define makeItemsTabOut(el,f) makeItemsOutput(el,f,'\t','\n');
+/* Print out makeItems as a line in a tab-separated file. */
+
+#define makeItemsCommaOut(el,f) makeItemsOutput(el,f,',',',');
+/* Print out makeItems as a comma separated list including final comma. */
+
+/* -------------------------------- End autoSql Generated Code -------------------------------- */
+
+#endif /* MAKEITEMSITEM_H */
+