Mercurial > urweb
comparison src/cjr_print.sml @ 1307:d2ad997ca157
Interface for setting memory limits
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 14 Oct 2010 11:06:26 -0400 |
parents | e665527fce1c |
children | add5ae41969e |
comparison
equal
deleted
inserted
replaced
1306:3a845f2ce9e9 | 1307:d2ad997ca157 |
---|---|
2826 file = "urweb.h"}), | 2826 file = "urweb.h"}), |
2827 string "\"", | 2827 string "\"", |
2828 newline, | 2828 newline, |
2829 newline, | 2829 newline, |
2830 | 2830 |
2831 box [string "static void uw_setup_limits() {", | |
2832 newline, | |
2833 box [p_list_sep (box []) (fn (class, num) => | |
2834 let | |
2835 val num = case class of | |
2836 "page" => Int.max (2048, num) | |
2837 | _ => num | |
2838 in | |
2839 box [string ("uw_" ^ class ^ "_max"), | |
2840 space, | |
2841 string "=", | |
2842 space, | |
2843 string (Int.toString num), | |
2844 string ";", | |
2845 newline] | |
2846 end) (Settings.limits ())], | |
2847 string "}", | |
2848 newline, | |
2849 newline], | |
2850 | |
2831 #code (Settings.currentProtocol ()) (), | 2851 #code (Settings.currentProtocol ()) (), |
2832 | 2852 |
2833 if hasDb then | 2853 if hasDb then |
2834 #init (Settings.currentDbms ()) {dbstring = !dbstring, | 2854 #init (Settings.currentDbms ()) {dbstring = !dbstring, |
2835 prepared = !prepped, | 2855 prepared = !prepped, |
2836 tables = !tables, | 2856 tables = !tables, |
2837 views = !views, | 2857 views = !views, |
2838 sequences = !sequences} | 2858 sequences = !sequences} |
2839 else | 2859 else |
2840 box [string "void uw_client_init(void) { };", | 2860 box [string "static void uw_client_init(void) { };", |
2841 newline, | 2861 newline, |
2842 string "void uw_db_init(uw_context ctx) { };", | 2862 string "static void uw_db_init(uw_context ctx) { };", |
2843 newline, | 2863 newline, |
2844 string "int uw_db_begin(uw_context ctx) { return 0; };", | 2864 string "static int uw_db_begin(uw_context ctx) { return 0; };", |
2845 newline, | 2865 newline, |
2846 string "void uw_db_close(uw_context ctx) { };", | 2866 string "static void uw_db_close(uw_context ctx) { };", |
2847 newline, | 2867 newline, |
2848 string "int uw_db_commit(uw_context ctx) { return 0; };", | 2868 string "static int uw_db_commit(uw_context ctx) { return 0; };", |
2849 newline, | 2869 newline, |
2850 string "int uw_db_rollback(uw_context ctx) { return 0; };"], | 2870 string "static int uw_db_rollback(uw_context ctx) { return 0; };"], |
2851 newline, | 2871 newline, |
2852 newline, | 2872 newline, |
2853 | 2873 |
2854 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\\\">\";", | 2874 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\\\">\";", |
2855 newline, | 2875 newline, |