tofu_rep_t *handler(tofu_req_t *req, void *argp) { tofu_rep_t *rep = tofu_rep_init(); tofu_status(rep, 418); return rep; }
tofu_rep_t *status_simple(tofu_req_t *req, void *argp) { tofu_rep_t *rep = tofu_rep_init(); tofu_status(rep, 418); return rep; }
tofu_rep_t *error_418(tofu_req_t *req) { tofu_rep_t *rep = tofu_rep_init(); tofu_status(rep, 418); tofu_head(rep, "Content-Type", "text/html"); tofu_write(rep, "<!DOCTYPE html>\n<head><title>I'm a teapot</title></head><body><h1>418 - Sorry, I'm just a teapot!</h1></body>\n"); return rep; }
tofu_rep_t *handler_root(tofu_req_t *req) { tofu_rep_t *rep = tofu_rep_init(); tofu_head(rep, "Content-Type", "text/html"); /* some random error occurred here */ tofu_status(rep, 500); return rep; }