diff src/cjr_print.sml @ 116:c5d7ce9ddd57

Basic web server
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Jul 2008 13:38:23 -0400
parents ff13d390ec60
children 94856a3b4752
line wrap: on
line diff
--- a/src/cjr_print.sml	Sun Jul 13 12:56:39 2008 -0400
+++ b/src/cjr_print.sml	Sun Jul 13 13:38:23 2008 -0400
@@ -174,11 +174,15 @@
         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 @@
              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,