comparison src/c/static.c @ 1493:9cb923efea4d

Generated pretty-printed HTML for a simple tutorial source file
author Adam Chlipala <adam@chlipala.net>
date Fri, 15 Jul 2011 16:50:55 -0400
parents
children 8c32c7191bf0
comparison
equal deleted inserted replaced
1492:175b6d52252d 1493:9cb923efea4d
1 #include "config.h"
2
3 #include <stdio.h>
4 #include <stdarg.h>
5
6 #include "urweb.h"
7
8 extern uw_app uw_application;
9
10 static void log_debug(void *data, const char *fmt, ...) {
11 va_list ap;
12 va_start(ap, fmt);
13
14 vprintf(fmt, ap);
15 }
16
17 int main(int argc, char *argv[]) {
18 uw_context ctx;
19 failure_kind fk;
20
21 if (argc != 2) {
22 fprintf(stderr, "Pass exactly one argument: the URI to run\n");
23 return 1;
24 }
25
26 ctx = uw_init(0, NULL, log_debug);
27 uw_set_app(ctx, &uw_application);
28 fk = uw_begin(ctx, argv[1]);
29
30 if (fk == SUCCESS) {
31 uw_print(ctx, 1);
32 puts("");
33 return 0;
34 } else {
35 fprintf(stderr, "Error!\n");
36 return 1;
37 }
38 }
39
40 void *uw_init_client_data() {
41 return NULL;
42 }
43
44 void uw_free_client_data(void *data) {
45 }
46
47 void uw_copy_client_data(void *dst, void *src) {
48 }
49
50 void uw_do_expunge(uw_context ctx, uw_Basis_client cli, void *data) {
51 }
52
53 void uw_post_expunge(uw_context ctx, void *data) {
54 }
55
56 int uw_supports_direct_status = 0;