+/*
+ * Route searcher - database helper functions
+ */
+/*
+ * This is part of the YARRG website, a tool for assisting
+ * players of Yohoho Puzzle Pirates.
+ *
+ * Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ * are used without permission. This program is not endorsed or
+ * sponsored by Three Rings.
+ */
#include "rscommon.h"
int islandtablesz;
DEBUG_DEFINE_DEBUGF(sql);
+DEBUG_DEFINE_SOME_DEBUGF(sql,debug2f);
static int busy_handler(void *u, int previous) {
debugf("[[DB BUSY %d]]",previous);
void sql_bind(sqlite3_stmt *ss, int index, int value,
const char *ss_what, const char *val_what) {
- debugf("SQL BIND %s #%d = %d = %s\n", ss_what, index, value, val_what);
+ debug2f("SQL BIND %s #%d = %d = %s\n", ss_what, index, value, val_what);
int sqr= sqlite3_bind_int(ss, index, value);
if (sqr) sql_fatal(ss_what, sqr,
masprintf("bind #%d (%s)", index, val_what));
sqr= sqlite3_step((ssh));
switch (sqr) {
case SQLITE_DONE:
- debugf("SQL %s DONE\n",ssh_string);
+ debug2f("SQL %s DONE\n",ssh_string);
return 0;
case SQLITE_ROW:
- if (DEBUGP(sql)) {
+ if (DEBUGP(sql2)) {
int i;
fprintf(debug,"SQL %s R",ssh_string);
for (i=0; i<sqlite3_column_count(ssh); i++) {