|
| 1 | +/* mainTest.h was originally generated by the autoSql program, which also |
| 2 | + * generated mainTest.c and mainTest.sql. This header links the database and |
| 3 | + * the RAM representation of objects. */ |
| 4 | + |
| 5 | +#ifndef MAINTEST_H |
| 6 | +#define MAINTEST_H |
| 7 | + |
| 8 | +#define PT_NUM_COLS 2 |
| 9 | + |
| 10 | +extern char *ptCommaSepFieldNames; |
| 11 | + |
| 12 | +struct pt |
| 13 | +/* Two dimensional point */ |
| 14 | + { |
| 15 | + int x; /* x coor */ |
| 16 | + int y; /* y coor */ |
| 17 | + }; |
| 18 | + |
| 19 | +struct pt *ptLoad(char **row); |
| 20 | +/* Load a pt from row fetched with select * from pt |
| 21 | + * from database. Dispose of this with ptFree(). */ |
| 22 | + |
| 23 | +struct pt *ptLoadAll(char *fileName); |
| 24 | +/* Load all pt from whitespace-separated file. |
| 25 | + * Dispose of this with ptFreeList(). */ |
| 26 | + |
| 27 | +struct pt *ptLoadAllByChar(char *fileName, char chopper); |
| 28 | +/* Load all pt from chopper separated file. |
| 29 | + * Dispose of this with ptFreeList(). */ |
| 30 | + |
| 31 | +#define ptLoadAllByTab(a) ptLoadAllByChar(a, '\t'); |
| 32 | +/* Load all pt from tab separated file. |
| 33 | + * Dispose of this with ptFreeList(). */ |
| 34 | + |
| 35 | +struct pt *ptCommaIn(char **pS, struct pt *ret); |
| 36 | +/* Create a pt out of a comma separated string. |
| 37 | + * This will fill in ret if non-null, otherwise will |
| 38 | + * return a new pt */ |
| 39 | + |
| 40 | +void ptOutput(struct pt *el, FILE *f, char sep, char lastSep); |
| 41 | +/* Print out pt. Separate fields with sep. Follow last field with lastSep. */ |
| 42 | + |
| 43 | +#define ptTabOut(el,f) ptOutput(el,f,'\t','\n'); |
| 44 | +/* Print out pt as a line in a tab-separated file. */ |
| 45 | + |
| 46 | +#define ptCommaOut(el,f) ptOutput(el,f,',',','); |
| 47 | +/* Print out pt as a comma separated list including final comma. */ |
| 48 | + |
| 49 | +#define POINT_NUM_COLS 5 |
| 50 | + |
| 51 | +extern char *pointCommaSepFieldNames; |
| 52 | + |
| 53 | +struct point |
| 54 | +/* Three dimensional point */ |
| 55 | + { |
| 56 | + struct point *next; /* Next in singly linked list. */ |
| 57 | + char acc[13]; /* GenBank Accession sequence */ |
| 58 | + int x; /* x coor */ |
| 59 | + int y; /* y coor */ |
| 60 | + int z; /* z coor */ |
| 61 | + struct pt pt; /* Transformed point. */ |
| 62 | + }; |
| 63 | + |
| 64 | +struct point *pointLoad(char **row); |
| 65 | +/* Load a point from row fetched with select * from point |
| 66 | + * from database. Dispose of this with pointFree(). */ |
| 67 | + |
| 68 | +struct point *pointLoadAll(char *fileName); |
| 69 | +/* Load all point from whitespace-separated file. |
| 70 | + * Dispose of this with pointFreeList(). */ |
| 71 | + |
| 72 | +struct point *pointLoadAllByChar(char *fileName, char chopper); |
| 73 | +/* Load all point from chopper separated file. |
| 74 | + * Dispose of this with pointFreeList(). */ |
| 75 | + |
| 76 | +#define pointLoadAllByTab(a) pointLoadAllByChar(a, '\t'); |
| 77 | +/* Load all point from tab separated file. |
| 78 | + * Dispose of this with pointFreeList(). */ |
| 79 | + |
| 80 | +struct point *pointCommaIn(char **pS, struct point *ret); |
| 81 | +/* Create a point out of a comma separated string. |
| 82 | + * This will fill in ret if non-null, otherwise will |
| 83 | + * return a new point */ |
| 84 | + |
| 85 | +void pointFree(struct point **pEl); |
| 86 | +/* Free a single dynamically allocated point such as created |
| 87 | + * with pointLoad(). */ |
| 88 | + |
| 89 | +void pointFreeList(struct point **pList); |
| 90 | +/* Free a list of dynamically allocated point's */ |
| 91 | + |
| 92 | +void pointOutput(struct point *el, FILE *f, char sep, char lastSep); |
| 93 | +/* Print out point. Separate fields with sep. Follow last field with lastSep. */ |
| 94 | + |
| 95 | +#define pointTabOut(el,f) pointOutput(el,f,'\t','\n'); |
| 96 | +/* Print out point as a line in a tab-separated file. */ |
| 97 | + |
| 98 | +#define pointCommaOut(el,f) pointOutput(el,f,',',','); |
| 99 | +/* Print out point as a comma separated list including final comma. */ |
| 100 | + |
| 101 | +#define POLYGON_NUM_COLS 4 |
| 102 | + |
| 103 | +extern char *polygonCommaSepFieldNames; |
| 104 | + |
| 105 | +struct polygon |
| 106 | +/* A face */ |
| 107 | + { |
| 108 | + struct polygon *next; /* Next in singly linked list. */ |
| 109 | + unsigned id; /* Unique ID */ |
| 110 | + int pointCount; /* point count */ |
| 111 | + struct point *points; /* Points list */ |
| 112 | + struct pt *persp; /* Points after perspective transformation */ |
| 113 | + }; |
| 114 | + |
| 115 | +struct polygon *polygonLoad(char **row); |
| 116 | +/* Load a polygon from row fetched with select * from polygon |
| 117 | + * from database. Dispose of this with polygonFree(). */ |
| 118 | + |
| 119 | +struct polygon *polygonLoadAll(char *fileName); |
| 120 | +/* Load all polygon from whitespace-separated file. |
| 121 | + * Dispose of this with polygonFreeList(). */ |
| 122 | + |
| 123 | +struct polygon *polygonLoadAllByChar(char *fileName, char chopper); |
| 124 | +/* Load all polygon from chopper separated file. |
| 125 | + * Dispose of this with polygonFreeList(). */ |
| 126 | + |
| 127 | +#define polygonLoadAllByTab(a) polygonLoadAllByChar(a, '\t'); |
| 128 | +/* Load all polygon from tab separated file. |
| 129 | + * Dispose of this with polygonFreeList(). */ |
| 130 | + |
| 131 | +struct polygon *polygonCommaIn(char **pS, struct polygon *ret); |
| 132 | +/* Create a polygon out of a comma separated string. |
| 133 | + * This will fill in ret if non-null, otherwise will |
| 134 | + * return a new polygon */ |
| 135 | + |
| 136 | +void polygonFree(struct polygon **pEl); |
| 137 | +/* Free a single dynamically allocated polygon such as created |
| 138 | + * with polygonLoad(). */ |
| 139 | + |
| 140 | +void polygonFreeList(struct polygon **pList); |
| 141 | +/* Free a list of dynamically allocated polygon's */ |
| 142 | + |
| 143 | +void polygonOutput(struct polygon *el, FILE *f, char sep, char lastSep); |
| 144 | +/* Print out polygon. Separate fields with sep. Follow last field with lastSep. */ |
| 145 | + |
| 146 | +#define polygonTabOut(el,f) polygonOutput(el,f,'\t','\n'); |
| 147 | +/* Print out polygon as a line in a tab-separated file. */ |
| 148 | + |
| 149 | +#define polygonCommaOut(el,f) polygonOutput(el,f,',',','); |
| 150 | +/* Print out polygon as a comma separated list including final comma. */ |
| 151 | + |
| 152 | +#define POLYHEDRON_NUM_COLS 5 |
| 153 | + |
| 154 | +extern char *polyhedronCommaSepFieldNames; |
| 155 | + |
| 156 | +struct polyhedron |
| 157 | +/* A 3-d object */ |
| 158 | + { |
| 159 | + struct polyhedron *next; /* Next in singly linked list. */ |
| 160 | + unsigned id; /* Unique ID */ |
| 161 | + char *names[2]; /* Name of this figure */ |
| 162 | + int polygonCount; /* Polygon count */ |
| 163 | + struct polygon *polygons; /* Polygons */ |
| 164 | + struct pt screenBox[2]; /* Bounding box in screen coordinates */ |
| 165 | + }; |
| 166 | + |
| 167 | +struct polyhedron *polyhedronLoad(char **row); |
| 168 | +/* Load a polyhedron from row fetched with select * from polyhedron |
| 169 | + * from database. Dispose of this with polyhedronFree(). */ |
| 170 | + |
| 171 | +struct polyhedron *polyhedronLoadAll(char *fileName); |
| 172 | +/* Load all polyhedron from whitespace-separated file. |
| 173 | + * Dispose of this with polyhedronFreeList(). */ |
| 174 | + |
| 175 | +struct polyhedron *polyhedronLoadAllByChar(char *fileName, char chopper); |
| 176 | +/* Load all polyhedron from chopper separated file. |
| 177 | + * Dispose of this with polyhedronFreeList(). */ |
| 178 | + |
| 179 | +#define polyhedronLoadAllByTab(a) polyhedronLoadAllByChar(a, '\t'); |
| 180 | +/* Load all polyhedron from tab separated file. |
| 181 | + * Dispose of this with polyhedronFreeList(). */ |
| 182 | + |
| 183 | +struct polyhedron *polyhedronCommaIn(char **pS, struct polyhedron *ret); |
| 184 | +/* Create a polyhedron out of a comma separated string. |
| 185 | + * This will fill in ret if non-null, otherwise will |
| 186 | + * return a new polyhedron */ |
| 187 | + |
| 188 | +void polyhedronFree(struct polyhedron **pEl); |
| 189 | +/* Free a single dynamically allocated polyhedron such as created |
| 190 | + * with polyhedronLoad(). */ |
| 191 | + |
| 192 | +void polyhedronFreeList(struct polyhedron **pList); |
| 193 | +/* Free a list of dynamically allocated polyhedron's */ |
| 194 | + |
| 195 | +void polyhedronOutput(struct polyhedron *el, FILE *f, char sep, char lastSep); |
| 196 | +/* Print out polyhedron. Separate fields with sep. Follow last field with lastSep. */ |
| 197 | + |
| 198 | +#define polyhedronTabOut(el,f) polyhedronOutput(el,f,'\t','\n'); |
| 199 | +/* Print out polyhedron as a line in a tab-separated file. */ |
| 200 | + |
| 201 | +#define polyhedronCommaOut(el,f) polyhedronOutput(el,f,',',','); |
| 202 | +/* Print out polyhedron as a comma separated list including final comma. */ |
| 203 | + |
| 204 | +#define TWOPOINT_NUM_COLS 4 |
| 205 | + |
| 206 | +extern char *twoPointCommaSepFieldNames; |
| 207 | + |
| 208 | +struct twoPoint |
| 209 | +/* Two points back to back */ |
| 210 | + { |
| 211 | + char name[13]; /* name of points */ |
| 212 | + struct pt a; /* point a */ |
| 213 | + struct pt b; /* point b */ |
| 214 | + struct pt points[2]; /* points as array */ |
| 215 | + }; |
| 216 | + |
| 217 | +struct twoPoint *twoPointLoad(char **row); |
| 218 | +/* Load a twoPoint from row fetched with select * from twoPoint |
| 219 | + * from database. Dispose of this with twoPointFree(). */ |
| 220 | + |
| 221 | +struct twoPoint *twoPointLoadAll(char *fileName); |
| 222 | +/* Load all twoPoint from whitespace-separated file. |
| 223 | + * Dispose of this with twoPointFreeList(). */ |
| 224 | + |
| 225 | +struct twoPoint *twoPointLoadAllByChar(char *fileName, char chopper); |
| 226 | +/* Load all twoPoint from chopper separated file. |
| 227 | + * Dispose of this with twoPointFreeList(). */ |
| 228 | + |
| 229 | +#define twoPointLoadAllByTab(a) twoPointLoadAllByChar(a, '\t'); |
| 230 | +/* Load all twoPoint from tab separated file. |
| 231 | + * Dispose of this with twoPointFreeList(). */ |
| 232 | + |
| 233 | +struct twoPoint *twoPointCommaIn(char **pS, struct twoPoint *ret); |
| 234 | +/* Create a twoPoint out of a comma separated string. |
| 235 | + * This will fill in ret if non-null, otherwise will |
| 236 | + * return a new twoPoint */ |
| 237 | + |
| 238 | +void twoPointOutput(struct twoPoint *el, FILE *f, char sep, char lastSep); |
| 239 | +/* Print out twoPoint. Separate fields with sep. Follow last field with lastSep. */ |
| 240 | + |
| 241 | +#define twoPointTabOut(el,f) twoPointOutput(el,f,'\t','\n'); |
| 242 | +/* Print out twoPoint as a line in a tab-separated file. */ |
| 243 | + |
| 244 | +#define twoPointCommaOut(el,f) twoPointOutput(el,f,',',','); |
| 245 | +/* Print out twoPoint as a comma separated list including final comma. */ |
| 246 | + |
| 247 | +#define STRINGARRAY_NUM_COLS 2 |
| 248 | + |
| 249 | +extern char *stringArrayCommaSepFieldNames; |
| 250 | + |
| 251 | +struct stringArray |
| 252 | +/* An array of strings */ |
| 253 | + { |
| 254 | + struct stringArray *next; /* Next in singly linked list. */ |
| 255 | + short numNames; /* Number of names */ |
| 256 | + char **names; /* Array of names */ |
| 257 | + }; |
| 258 | + |
| 259 | +struct stringArray *stringArrayLoad(char **row); |
| 260 | +/* Load a stringArray from row fetched with select * from stringArray |
| 261 | + * from database. Dispose of this with stringArrayFree(). */ |
| 262 | + |
| 263 | +struct stringArray *stringArrayLoadAll(char *fileName); |
| 264 | +/* Load all stringArray from whitespace-separated file. |
| 265 | + * Dispose of this with stringArrayFreeList(). */ |
| 266 | + |
| 267 | +struct stringArray *stringArrayLoadAllByChar(char *fileName, char chopper); |
| 268 | +/* Load all stringArray from chopper separated file. |
| 269 | + * Dispose of this with stringArrayFreeList(). */ |
| 270 | + |
| 271 | +#define stringArrayLoadAllByTab(a) stringArrayLoadAllByChar(a, '\t'); |
| 272 | +/* Load all stringArray from tab separated file. |
| 273 | + * Dispose of this with stringArrayFreeList(). */ |
| 274 | + |
| 275 | +struct stringArray *stringArrayCommaIn(char **pS, struct stringArray *ret); |
| 276 | +/* Create a stringArray out of a comma separated string. |
| 277 | + * This will fill in ret if non-null, otherwise will |
| 278 | + * return a new stringArray */ |
| 279 | + |
| 280 | +void stringArrayFree(struct stringArray **pEl); |
| 281 | +/* Free a single dynamically allocated stringArray such as created |
| 282 | + * with stringArrayLoad(). */ |
| 283 | + |
| 284 | +void stringArrayFreeList(struct stringArray **pList); |
| 285 | +/* Free a list of dynamically allocated stringArray's */ |
| 286 | + |
| 287 | +void stringArrayOutput(struct stringArray *el, FILE *f, char sep, char lastSep); |
| 288 | +/* Print out stringArray. Separate fields with sep. Follow last field with lastSep. */ |
| 289 | + |
| 290 | +#define stringArrayTabOut(el,f) stringArrayOutput(el,f,'\t','\n'); |
| 291 | +/* Print out stringArray as a line in a tab-separated file. */ |
| 292 | + |
| 293 | +#define stringArrayCommaOut(el,f) stringArrayOutput(el,f,',',','); |
| 294 | +/* Print out stringArray as a comma separated list including final comma. */ |
| 295 | + |
| 296 | +/* -------------------------------- End autoSql Generated Code -------------------------------- */ |
| 297 | + |
| 298 | +#endif /* MAINTEST_H */ |
| 299 | + |
0 commit comments