diff --git a/src/badass.h b/src/badass.h index eb4dedc..0b01cb0 100644 --- a/src/badass.h +++ b/src/badass.h @@ -2,6 +2,8 @@ #define ADDR_FILE "badass.addr" #define HTML_FILE "badass.html" #define VALID_REFERER "http://neil.chaosnet.org/" +#define VOTE_TITLE "Which of these professions is the most badass?" +#define VOTE_BACK "http://neil.chaosnet.org/" /* #define VOTES(X) \ X('a', "astronaut"), \ diff --git a/src/movie.h b/src/movie.h index 9d73937..c021760 100644 --- a/src/movie.h +++ b/src/movie.h @@ -2,6 +2,8 @@ #define ADDR_FILE "movie.addr" #define HTML_FILE "movie.html" #define VALID_REFERER "http://neil.chaosnet.org/multiverse/" +#define VOTE_TITLE "Which movie should we watch?" +#define VOTE_BACK "Multiverse" /*#define VOTES(X) \ X('a', "A"), \ diff --git a/src/vote.c b/src/vote.c index 6323437..4ba7824 100644 --- a/src/vote.c +++ b/src/vote.c @@ -3,14 +3,15 @@ @subtitle Vote - These are hard-coded CGI programmes for simple voting. */ + These are hard-coded CGI programmes for simple voting. Compile with different + headers to change the voting scheme. */ #include /* getenv(), atoi() */ #include /* printf(), FILE, f*() */ #include /* strstr() */ #include /* time() */ -static struct vote { +struct vote { const char *name; unsigned vote; const char token; @@ -143,7 +144,7 @@ static char *votes_html(void) { fprintf(htf, "\n" "\n\n" "\n" - "

Which of these professions is the most badass?

" + "

" VOTE_TITLE "

\n\n" "

\nCurrent results:\n

\n\n"); /* write out each name and vote */ for(votep = votes; votep < votes + votes_size; votep++) @@ -155,10 +156,9 @@ static char *votes_html(void) { fprintf(htf, "%s: %u vote%c

", votep->name, votep->vote, (votep->vote == 1) ? ' ' : 's'); } - fprintf(htf, "

Go back to " - "http://neil.chaosnet.org/.

\n"); - fprintf(htf, "\n\n"); - fprintf(htf, "\n"); + fprintf(htf, "

Go back to " VOTE_BACK ".

\n" + "\n\n" + "\n"); fclose(htf); return 0; } @@ -188,7 +188,7 @@ int main(void) { "\n\n" "\n" "

\n%s\n

\n\n" - "

\nGo back to root.\n

\n" + "

Go back to " VOTE_BACK ".\n

\n" "\n\n" "\n", error); return EXIT_FAILURE;