summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 13:38:23 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 13:38:23 -0400
commit0eb51a6e21e5f435d37afd885ae316a0575c7208 (patch)
treeb8d8a99e6a1a518ae6c45ebffff6877985f8537f /src/cjr_print.sml
parent3c2cf28f8c508355be291a3ce2ecc9bb571f97dd (diff)
Basic web server
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index f3beb023..19df046f 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -174,11 +174,15 @@ fun p_decl env ((d, _) : decl) =
end
fun p_page env (s, n) =
- box [string "/* ",
- string s,
- string " */ ",
+ box [string "if (!strcmp(request, \"",
+ string (String.toString s),
+ string "\")) {",
+ newline,
p_enamed env n,
- string "(lw_unit_v);"]
+ string "(lw_unit_v);",
+ newline,
+ string "}",
+ newline]
fun p_file env (ds, ps) =
let
@@ -193,7 +197,7 @@ fun p_file env (ds, ps) =
newline,
p_list_sep newline (fn x => x) pds,
newline,
- string "void lw_handle(void) {",
+ string "void lw_handle(char *request) {",
newline,
p_list_sep newline (fn x => x) pds',
newline,