/* vgPrbMap.h was originally generated by the autoSql program, which also * generated vgPrbMap.c and vgPrbMap.sql. This header links the database and * the RAM representation of objects. */ #ifndef VGPRBMAP_H #define VGPRBMAP_H #ifndef JKSQL_H #include "jksql.h" #endif #define VGPRBMAP_NUM_COLS 2 struct vgPrbMap /* Map probe table to vgPrb Permanent Probes */ { struct vgPrbMap *next; /* Next in singly linked list. */ int probe; /* ID of probe */ int vgPrb; /* ID of vgPrb */ }; void vgPrbMapStaticLoad(char **row, struct vgPrbMap *ret); /* Load a row from vgPrbMap table into ret. The contents of ret will * be replaced at the next call to this function. */ struct vgPrbMap *vgPrbMapLoad(char **row); /* Load a vgPrbMap from row fetched with select * from vgPrbMap * from database. Dispose of this with vgPrbMapFree(). */ struct vgPrbMap *vgPrbMapLoadAll(char *fileName); /* Load all vgPrbMap from whitespace-separated file. * Dispose of this with vgPrbMapFreeList(). */ struct vgPrbMap *vgPrbMapLoadAllByChar(char *fileName, char chopper); /* Load all vgPrbMap from chopper separated file. * Dispose of this with vgPrbMapFreeList(). */ #define vgPrbMapLoadAllByTab(a) vgPrbMapLoadAllByChar(a, '\t'); /* Load all vgPrbMap from tab separated file. * Dispose of this with vgPrbMapFreeList(). */ struct vgPrbMap *vgPrbMapLoadByQuery(struct sqlConnection *conn, char *query); /* Load all vgPrbMap 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 vgPrbMapFreeList(). */ void vgPrbMapSaveToDb(struct sqlConnection *conn, struct vgPrbMap *el, char *tableName, int updateSize); /* Save vgPrbMap 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 vgPrbMapSaveToDbEscaped() */ void vgPrbMapSaveToDbEscaped(struct sqlConnection *conn, struct vgPrbMap *el, char *tableName, int updateSize); /* Save vgPrbMap 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 vgPrbMapSaveToDb(). * For example automatically copies and converts: * "autosql's features include" --> "autosql\'s features include" * before inserting into database. */ struct vgPrbMap *vgPrbMapCommaIn(char **pS, struct vgPrbMap *ret); /* Create a vgPrbMap out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new vgPrbMap */ void vgPrbMapFree(struct vgPrbMap **pEl); /* Free a single dynamically allocated vgPrbMap such as created * with vgPrbMapLoad(). */ void vgPrbMapFreeList(struct vgPrbMap **pList); /* Free a list of dynamically allocated vgPrbMap's */ void vgPrbMapOutput(struct vgPrbMap *el, FILE *f, char sep, char lastSep); /* Print out vgPrbMap. Separate fields with sep. Follow last field with lastSep. */ #define vgPrbMapTabOut(el,f) vgPrbMapOutput(el,f,'\t','\n'); /* Print out vgPrbMap as a line in a tab-separated file. */ #define vgPrbMapCommaOut(el,f) vgPrbMapOutput(el,f,',',','); /* Print out vgPrbMap as a comma separated list including final comma. */ /* -------------------------------- End autoSql Generated Code -------------------------------- */ #endif /* VGPRBMAP_H */