6 #define DEBUG_FLAG_LIST \
13 #define DEBUG_DEV "/dev/stdout"
18 #define SQL_MUST( call ) ({ \
19 /* `call' is an expression returning result, using const char *sqe; \
20 * chk1 and chk2 are blocks using sqe and int sqr; */ \
21 const char *sql_must_call_string= #call; \
23 if (DEBUGP(sql2)) fprintf(stderr,"SQL %s", sql_must_call_string); \
25 if (DEBUGP(sql2)) fprintf(stderr," = %d\n", sqr); \
26 if (sqr) sql_fatal("(unknown)", sqr, sql_must_call_string); \
29 void sql_fatal(const char *stmt_what, int sqr, const char *act_what) NORET;
31 #define SQL_STEP(ssh) (sql_step_wrap((ssh), #ssh, __FILE__, __LINE__))
32 int sql_step_wrap(sqlite3_stmt *ssh, const char *ssh_string,
33 const char *file, int line);
35 int sql_single_int(const char *stmt);
37 #define SQL_PREPARE(ss,stmt) ((ss)= sql_prepare((stmt),#ss))
38 sqlite3_stmt *sql_prepare(const char *stmt, const char *what);
40 #define SQL_BIND(ss,index,value) (sql_bind((ss),(index),(value),#ss,#value))
41 void sql_bind(sqlite3_stmt *ss, int index, int value,
42 const char *ss_what, const char *val_what);
44 #define MAX_ROUTELEN 20
49 double value_route(int nislands, const int *islands);
50 void setup_value(void);
51 void setup_search(void);
52 void search(int start_isle);
54 extern double max_mass, max_volu, max_capi;
55 extern double distance_loss_factor_per_league;
58 #define LOSS_FACTOR_PER_DELAY_SLOT (1-1e-8)
60 extern int islandtablesz;