comparison src/cjr_print.sml @ 1956:ac1be85e91ad

Add 'html5' .urp directive
author Adam Chlipala <adam@chlipala.net>
date Thu, 09 Jan 2014 17:27:24 -0500
parents 94f9570671f0
children ced78ef1c82f 01c8aceac480
comparison
equal deleted inserted replaced
1955:469e02eea43a 1956:ac1be85e91ad
3081 newline, 3081 newline,
3082 case side of 3082 case side of
3083 ServerOnly => box [] 3083 ServerOnly => box []
3084 | _ => box [string "uw_write_header(ctx, \"Content-script-type: text/javascript\\r\\n\");", 3084 | _ => box [string "uw_write_header(ctx, \"Content-script-type: text/javascript\\r\\n\");",
3085 newline], 3085 newline],
3086 string "uw_write(ctx, begin_xhtml);", 3086 string ("uw_write(ctx, uw_begin_" ^
3087 (if Settings.getIsHtml5 () then
3088 "html5"
3089 else
3090 "xhtml") ^ ");"),
3087 newline, 3091 newline,
3088 string "uw_mayReturnIndirectly(ctx);", 3092 string "uw_mayReturnIndirectly(ctx);",
3089 newline, 3093 newline,
3090 string "uw_set_script_header(ctx, \"", 3094 string "uw_set_script_header(ctx, \"",
3091 let 3095 let
3372 newline, 3376 newline,
3373 string "static int uw_db_rollback(uw_context ctx) { return 0; };"], 3377 string "static int uw_db_rollback(uw_context ctx) { return 0; };"],
3374 newline, 3378 newline,
3375 newline, 3379 newline,
3376 3380
3377 string "static const char begin_xhtml[] = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\\n<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" xml:lang=\\\"en\\\" lang=\\\"en\\\">\";",
3378 newline,
3379 newline,
3380 3381
3381 p_list_sep newline (fn x => x) pds, 3382 p_list_sep newline (fn x => x) pds,
3382 newline, 3383 newline,
3383 newline, 3384 newline,
3384 string "static int uw_input_num(const char *name) {", 3385 string "static int uw_input_num(const char *name) {",
3586 "uw_client_init", "uw_initializer", "uw_expunger", 3587 "uw_client_init", "uw_initializer", "uw_expunger",
3587 "uw_db_init", "uw_db_begin", "uw_db_commit", "uw_db_rollback", "uw_db_close", 3588 "uw_db_init", "uw_db_begin", "uw_db_commit", "uw_db_rollback", "uw_db_close",
3588 "uw_handle", 3589 "uw_handle",
3589 "uw_input_num", "uw_cookie_sig", "uw_check_url", "uw_check_mime", "uw_check_requestHeader", "uw_check_responseHeader", "uw_check_envVar", 3590 "uw_input_num", "uw_cookie_sig", "uw_check_url", "uw_check_mime", "uw_check_requestHeader", "uw_check_responseHeader", "uw_check_envVar",
3590 case onError of NONE => "NULL" | SOME _ => "uw_onError", "my_periodics", 3591 case onError of NONE => "NULL" | SOME _ => "uw_onError", "my_periodics",
3591 "\"" ^ Prim.toCString (Settings.getTimeFormat ()) ^ "\""], 3592 "\"" ^ Prim.toCString (Settings.getTimeFormat ()) ^ "\"",
3593 if Settings.getIsHtml5 () then "1" else "0"],
3592 string "};", 3594 string "};",
3593 newline] 3595 newline]
3594 end 3596 end
3595 3597
3596 fun p_sql env (ds, _) = 3598 fun p_sql env (ds, _) =