aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/c/static.c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-07-15 16:50:55 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-07-15 16:50:55 -0400
commit7f32f0ab54aaa4d4f19ae6943ceafd815547d470 (patch)
tree73aebcfa002bfc332ec3a531fb864869086b390c /src/c/static.c
parente4a29fbb4aca90b241ac13c0ea604f8a9cf594f9 (diff)
Generated pretty-printed HTML for a simple tutorial source file
Diffstat (limited to 'src/c/static.c')
-rw-r--r--src/c/static.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/c/static.c b/src/c/static.c
new file mode 100644
index 00000000..76b04e45
--- /dev/null
+++ b/src/c/static.c
@@ -0,0 +1,56 @@
+#include "config.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "urweb.h"
+
+extern uw_app uw_application;
+
+static void log_debug(void *data, const char *fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+
+ vprintf(fmt, ap);
+}
+
+int main(int argc, char *argv[]) {
+ uw_context ctx;
+ failure_kind fk;
+
+ if (argc != 2) {
+ fprintf(stderr, "Pass exactly one argument: the URI to run\n");
+ return 1;
+ }
+
+ ctx = uw_init(0, NULL, log_debug);
+ uw_set_app(ctx, &uw_application);
+ fk = uw_begin(ctx, argv[1]);
+
+ if (fk == SUCCESS) {
+ uw_print(ctx, 1);
+ puts("");
+ return 0;
+ } else {
+ fprintf(stderr, "Error!\n");
+ return 1;
+ }
+}
+
+void *uw_init_client_data() {
+ return NULL;
+}
+
+void uw_free_client_data(void *data) {
+}
+
+void uw_copy_client_data(void *dst, void *src) {
+}
+
+void uw_do_expunge(uw_context ctx, uw_Basis_client cli, void *data) {
+}
+
+void uw_post_expunge(uw_context ctx, void *data) {
+}
+
+int uw_supports_direct_status = 0;