comparison src/c/static.c @ 2206:c1a62ce47083

Merge.
author Ziv Scully <ziv@mit.edu>
date Tue, 27 May 2014 21:38:01 -0400
parents c93fbd139732
children 8ecbd1100227
comparison
equal deleted inserted replaced
2205:cdea39473c78 2206:c1a62ce47083
5 5
6 #include "urweb.h" 6 #include "urweb.h"
7 7
8 extern uw_app uw_application; 8 extern uw_app uw_application;
9 9
10 static void log_debug(void *data, const char *fmt, ...) { 10 static void log_(void *data, const char *fmt, ...) {
11 va_list ap; 11 va_list ap;
12 va_start(ap, fmt); 12 va_start(ap, fmt);
13 13
14 vprintf(fmt, ap); 14 vprintf(fmt, ap);
15 } 15 }
16
17 static uw_loggers loggers = {NULL, log_, log_};
16 18
17 int main(int argc, char *argv[]) { 19 int main(int argc, char *argv[]) {
18 uw_context ctx; 20 uw_context ctx;
19 failure_kind fk; 21 failure_kind fk;
20 22
21 if (argc != 2) { 23 if (argc != 2) {
22 fprintf(stderr, "Pass exactly one argument: the URI to run\n"); 24 fprintf(stderr, "Pass exactly one argument: the URI to run\n");
23 return 1; 25 return 1;
24 } 26 }
25 27
26 ctx = uw_init(0, NULL, log_debug); 28 ctx = uw_init(0, &loggers);
27 uw_set_app(ctx, &uw_application); 29 uw_set_app(ctx, &uw_application);
28 uw_initialize(ctx); 30 uw_initialize(ctx);
29 31
30 while (1) { 32 while (1) {
31 fk = uw_begin(ctx, argv[1]); 33 fk = uw_begin(ctx, argv[1]);