/* cnpSharpCutoff.h was originally generated by the autoSql program, which also * generated cnpSharpCutoff.c and cnpSharpCutoff.sql. This header links the database and * the RAM representation of objects. */ #ifndef CNPSHARPCUTOFF_H #define CNPSHARPCUTOFF_H #ifndef JKSQL_H #include "jksql.h" #endif #define CNPSHARPCUTOFF_NUM_COLS 3 struct cnpSharpCutoff /* CNP cutoff data from Sharp lab */ { struct cnpSharpCutoff *next; /* Next in singly linked list. */ char *sample; /* Sample name */ unsigned batch; /* Batch number */ float value; /* Data value */ }; void cnpSharpCutoffStaticLoad(char **row, struct cnpSharpCutoff *ret); /* Load a row from cnpSharpCutoff table into ret. The contents of ret will * be replaced at the next call to this function. */ struct cnpSharpCutoff *cnpSharpCutoffLoad(char **row); /* Load a cnpSharpCutoff from row fetched with select * from cnpSharpCutoff * from database. Dispose of this with cnpSharpCutoffFree(). */ struct cnpSharpCutoff *cnpSharpCutoffLoadAll(char *fileName); /* Load all cnpSharpCutoff from whitespace-separated file. * Dispose of this with cnpSharpCutoffFreeList(). */ struct cnpSharpCutoff *cnpSharpCutoffLoadAllByChar(char *fileName, char chopper); /* Load all cnpSharpCutoff from chopper separated file. * Dispose of this with cnpSharpCutoffFreeList(). */ #define cnpSharpCutoffLoadAllByTab(a) cnpSharpCutoffLoadAllByChar(a, '\t'); /* Load all cnpSharpCutoff from tab separated file. * Dispose of this with cnpSharpCutoffFreeList(). */ struct cnpSharpCutoff *cnpSharpCutoffLoadByQuery(struct sqlConnection *conn, char *query); /* Load all cnpSharpCutoff 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 cnpSharpCutoffFreeList(). */ void cnpSharpCutoffSaveToDb(struct sqlConnection *conn, struct cnpSharpCutoff *el, char *tableName, int updateSize); /* Save cnpSharpCutoff 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 cnpSharpCutoffSaveToDbEscaped() */ void cnpSharpCutoffSaveToDbEscaped(struct sqlConnection *conn, struct cnpSharpCutoff *el, char *tableName, int updateSize); /* Save cnpSharpCutoff 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 cnpSharpCutoffSaveToDb(). * For example automatically copies and converts: * "autosql's features include" --> "autosql\'s features include" * before inserting into database. */ struct cnpSharpCutoff *cnpSharpCutoffCommaIn(char **pS, struct cnpSharpCutoff *ret); /* Create a cnpSharpCutoff out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new cnpSharpCutoff */ void cnpSharpCutoffFree(struct cnpSharpCutoff **pEl); /* Free a single dynamically allocated cnpSharpCutoff such as created * with cnpSharpCutoffLoad(). */ void cnpSharpCutoffFreeList(struct cnpSharpCutoff **pList); /* Free a list of dynamically allocated cnpSharpCutoff's */ void cnpSharpCutoffOutput(struct cnpSharpCutoff *el, FILE *f, char sep, char lastSep); /* Print out cnpSharpCutoff. Separate fields with sep. Follow last field with lastSep. */ #define cnpSharpCutoffTabOut(el,f) cnpSharpCutoffOutput(el,f,'\t','\n'); /* Print out cnpSharpCutoff as a line in a tab-separated file. */ #define cnpSharpCutoffCommaOut(el,f) cnpSharpCutoffOutput(el,f,',',','); /* Print out cnpSharpCutoff as a comma separated list including final comma. */ /* -------------------------------- End autoSql Generated Code -------------------------------- */ #endif /* CNPSHARPCUTOFF_H */