comparison src/cjr_print.sml @ 764:7f653298dd66

C FFI compiler options
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Apr 2009 17:15:14 -0400
parents 67cd8326f743
children a28982de5645
comparison
equal deleted inserted replaced
763:af41ec2f302a 764:7f653298dd66
1247 | _ => (ErrorMsg.errorAt loc "Unable to choose a URL encoding function"; 1247 | _ => (ErrorMsg.errorAt loc "Unable to choose a URL encoding function";
1248 space) 1248 space)
1249 in 1249 in
1250 urlify' IS.empty 0 t 1250 urlify' IS.empty 0 t
1251 end 1251 end
1252
1253 val timeout = ref 0
1254 1252
1255 fun p_exp' par env (e, loc) = 1253 fun p_exp' par env (e, loc) =
1256 case e of 1254 case e of
1257 EPrim p => Prim.p_t_GCC p 1255 EPrim p => Prim.p_t_GCC p
1258 | ERel n => p_rel env n 1256 | ERel n => p_rel env n
2830 newline, 2828 newline,
2831 string "uw_set_script_header(ctx, \"", 2829 string "uw_set_script_header(ctx, \"",
2832 string (case side of 2830 string (case side of
2833 ServerOnly => "" 2831 ServerOnly => ""
2834 | _ => "<script src=\\\"" 2832 | _ => "<script src=\\\""
2835 ^ OS.Path.joinDirFile {dir = !Monoize.urlPrefix, 2833 ^ OS.Path.joinDirFile {dir = Settings.getUrlPrefix (),
2836 file = "app.js"} 2834 file = "app.js"}
2837 ^ "\\\"></script>\\n"), 2835 ^ "\\\"></script>\\n"),
2838 string "\");", 2836 string "\");",
2839 newline, 2837 newline,
2840 string "uw_set_needs_push(ctx, ", 2838 string "uw_set_needs_push(ctx, ",
2842 ServerAndPullAndPush => "1" 2840 ServerAndPullAndPush => "1"
2843 | _ => "0"), 2841 | _ => "0"),
2844 string ");", 2842 string ");",
2845 newline, 2843 newline,
2846 string "uw_set_url_prefix(ctx, \"", 2844 string "uw_set_url_prefix(ctx, \"",
2847 string (!Monoize.urlPrefix), 2845 string (Settings.getUrlPrefix ()),
2848 string "\");", 2846 string "\");",
2849 newline]), 2847 newline]),
2850 string "uw_set_needs_sig(ctx, ", 2848 string "uw_set_needs_sig(ctx, ",
2851 string (if couldWrite ek then 2849 string (if couldWrite ek then
2852 "1" 2850 "1"
3183 box [string "#include <postgresql/libpq-fe.h>", 3181 box [string "#include <postgresql/libpq-fe.h>",
3184 newline] 3182 newline]
3185 else 3183 else
3186 box [], 3184 box [],
3187 newline, 3185 newline,
3186 p_list_sep (box []) (fn s => box [string "#include \"",
3187 string s,
3188 string "\"",
3189 newline]) (Settings.getHeaders ()),
3188 string "#include \"", 3190 string "#include \"",
3189 string (OS.Path.joinDirFile {dir = Config.includ, 3191 string (OS.Path.joinDirFile {dir = Config.includ,
3190 file = "urweb.h"}), 3192 file = "urweb.h"}),
3191 string "\"", 3193 string "\"",
3192 newline, 3194 newline,
3196 string "int uw_inputs_len = ", 3198 string "int uw_inputs_len = ",
3197 string (Int.toString (SM.foldl Int.max 0 fnums + 1)), 3199 string (Int.toString (SM.foldl Int.max 0 fnums + 1)),
3198 string ";", 3200 string ";",
3199 newline, 3201 newline,
3200 string "int uw_timeout = ", 3202 string "int uw_timeout = ",
3201 string (Int.toString (!timeout)), 3203 string (Int.toString (Settings.getTimeout ())),
3202 string ";", 3204 string ";",
3203 newline, 3205 newline,
3204 newline, 3206 newline,
3205 string "int uw_input_num(char *name) {", 3207 string "int uw_input_num(char *name) {",
3206 newline, 3208 newline,