6 #define DEBUG_FLAG_LIST \
14 #define DEBUG_DEV "/dev/stdout"
19 #define SQL_MUST( call ) ({ \
20 /* `call' is an expression returning result, using const char *sqe; \
21 * chk1 and chk2 are blocks using sqe and int sqr; */ \
22 const char *sql_must_call_string= #call; \
24 if (DEBUGP(sql2)) fprintf(stderr,"SQL %s", sql_must_call_string); \
26 if (DEBUGP(sql2)) fprintf(stderr," = %d\n", sqr); \
27 if (sqr) sql_fatal("(unknown)", sqr, sql_must_call_string); \
30 void sql_fatal(const char *stmt_what, int sqr, const char *act_what) NORET;
32 #define SQL_STEP(ssh) (sql_step_wrap((ssh), #ssh, __FILE__, __LINE__))
33 int sql_step_wrap(sqlite3_stmt *ssh, const char *ssh_string,
34 const char *file, int line);
36 int sql_single_int(const char *stmt);
38 #define SQL_PREPARE(ss,stmt) ((ss)= sql_prepare((stmt),#ss))
39 sqlite3_stmt *sql_prepare(const char *stmt, const char *what);
41 #define SQL_BIND(ss,index,value) (sql_bind((ss),(index),(value),#ss,#value))
42 void sql_bind(sqlite3_stmt *ss, int index, int value,
43 const char *ss_what, const char *val_what);
45 #define MAX_ROUTELEN 20
50 double value_route(int nislands, const int *islands);
51 void setup_value(void);
52 void setup_search(void);
53 void search(int start_isle);
55 extern double max_mass, max_volu, max_capi;
56 extern double distance_loss_factor_per_league;
59 #define LOSS_FACTOR_PER_DELAY_SLOT (1-1e-8)
61 extern int islandtablesz;