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