1 /* Blerg is (C) 2011 The Dominion of Awesome, and is distributed under a
2 * BSD-style license. Please see the COPYING file for details.
6 #include "canned_responses.h"
9 void respond_simple_data(unsigned const char *data, int len) {
10 printf("Content-length: %d\r\n\r\n", len);
11 fwrite(data, len, 1, stdout);
15 printf("Status: 404 Not Found\r\n");
16 printf("Content-type: text/html\r\n");
17 printf("Content-length: %d\r\n\r\n", strlen(CONTENT_404));
23 printf("Status: 405 Method Not Allowed\r\n");
24 printf("Content-type: text/html\r\n");
25 printf("Content-length: %d\r\n\r\n", strlen(CONTENT_405));
30 void respond_JSON_Failure() {
31 respond_simple_data(JSON_FAILURE, strlen(JSON_FAILURE));
34 void respond_JSON_Success() {
35 respond_simple_data(JSON_SUCCESS, strlen(JSON_SUCCESS));