129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
-
+
|
done:
sqlite3_finalize(st);
return id;
}
unsigned char*read_lump_or_userstate(int sol,int lvl,long*sz,char us) {
// Returns a pointer to the data; must be freed using free().
// If there is no data, returns null and sets *sz and *us to zero.
// If there is no data, returns null and sets *sz to zero.
// Third argument is a pointer to a variable to store the data size (must be not null).
// Fourth argument is 1 for user state or 0 for lump data.
unsigned char*buf=0;
sqlite3_reset(readusercachest);
sqlite3_bind_int64(readusercachest,1,sol?solutionuc:leveluc);
sqlite3_bind_int(readusercachest,2,lvl);
sqlite3_bind_int(readusercachest,3,us);
|