Retabify about.c since I had previously moosed it

svn path=/trunk/netsurf/; revision=12091
This commit is contained in:
Daniel Silverstone 2011-03-17 12:12:55 +00:00
parent 4de9349fb8
commit 293c2b026b
1 changed files with 39 additions and 39 deletions

View File

@ -294,12 +294,12 @@ fetch_about_choices_handler_aborted:
typedef struct { const char *leaf; const char modtype; } modification_t; typedef struct { const char *leaf; const char modtype; } modification_t;
static bool fetch_about_testament_handler(struct fetch_about_context *ctx) static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
{ {
static modification_t modifications[] = WT_MODIFICATIONS; static modification_t modifications[] = WT_MODIFICATIONS;
char buffer[1024]; char buffer[1024];
int code = 200; int code = 200;
int slen; int slen;
int i; int i;
/* content is going to return ok */ /* content is going to return ok */
fetch_set_http_code(ctx->fetchh, code); fetch_set_http_code(ctx->fetchh, code);
@ -315,63 +315,63 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx)
FETCH_ERROR_NO_ERROR)) FETCH_ERROR_NO_ERROR))
goto fetch_about_testament_handler_aborted; goto fetch_about_testament_handler_aborted;
slen = snprintf(buffer, sizeof buffer, slen = snprintf(buffer, sizeof buffer,
#if defined(WT_BRANCHISTRUNK) #if defined(WT_BRANCHISTRUNK)
"# This is a *DEVELOPMENT* build from the trunk.\n\n" "# This is a *DEVELOPMENT* build from the trunk.\n\n"
#elif defined(WT_BRANCHISRELEASE) #elif defined(WT_BRANCHISRELEASE)
"# This is a release build of NetSurf\n\n" "# This is a release build of NetSurf\n\n"
#elif defined(WT_NO_SVN) #elif defined(WT_NO_SVN)
"# This NetSurf was built outside of our revision control environment.\n# This testament is therefore very useful.\n\n" "# This NetSurf was built outside of our revision control environment.\n# This testament is therefore very useful.\n\n"
#else #else
"# This NetSurf was built from a branch.\n\n" "# This NetSurf was built from a branch.\n\n"
#endif #endif
); );
if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen,
FETCH_ERROR_NO_ERROR)) FETCH_ERROR_NO_ERROR))
goto fetch_about_testament_handler_aborted; goto fetch_about_testament_handler_aborted;
slen = snprintf(buffer, sizeof buffer, slen = snprintf(buffer, sizeof buffer,
"Built by %s (%s) from %s at revision %s\n\n", "Built by %s (%s) from %s at revision %s\n\n",
GECOS, USERNAME, WT_BRANCHPATH, WT_REVID); GECOS, USERNAME, WT_BRANCHPATH, WT_REVID);
if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen,
FETCH_ERROR_NO_ERROR)) FETCH_ERROR_NO_ERROR))
goto fetch_about_testament_handler_aborted; goto fetch_about_testament_handler_aborted;
slen = snprintf(buffer, sizeof buffer, slen = snprintf(buffer, sizeof buffer,
"Built on %s in %s\n\n", "Built on %s in %s\n\n",
WT_HOSTNAME, WT_ROOT); WT_HOSTNAME, WT_ROOT);
if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen,
FETCH_ERROR_NO_ERROR)) FETCH_ERROR_NO_ERROR))
goto fetch_about_testament_handler_aborted; goto fetch_about_testament_handler_aborted;
if (WT_MODIFIED > 0) { if (WT_MODIFIED > 0) {
slen = snprintf(buffer, sizeof buffer, slen = snprintf(buffer, sizeof buffer,
"Working tree has %d modification%s\n\n", "Working tree has %d modification%s\n\n",
WT_MODIFIED, WT_MODIFIED == 1 ? "" : "s"); WT_MODIFIED, WT_MODIFIED == 1 ? "" : "s");
} else { } else {
slen = snprintf(buffer, sizeof buffer, slen = snprintf(buffer, sizeof buffer,
"Working tree is not modified.\n"); "Working tree is not modified.\n");
} }
if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen,
FETCH_ERROR_NO_ERROR)) FETCH_ERROR_NO_ERROR))
goto fetch_about_testament_handler_aborted; goto fetch_about_testament_handler_aborted;
for (i = 0; i < WT_MODIFIED; ++i) { for (i = 0; i < WT_MODIFIED; ++i) {
slen = snprintf(buffer, sizeof buffer, slen = snprintf(buffer, sizeof buffer,
" %c %s\n", " %c %s\n",
modifications[i].modtype, modifications[i].modtype,
modifications[i].leaf); modifications[i].leaf);
if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen,
FETCH_ERROR_NO_ERROR)) FETCH_ERROR_NO_ERROR))
goto fetch_about_testament_handler_aborted; goto fetch_about_testament_handler_aborted;
} }
fetch_about_send_callback(FETCH_FINISHED, ctx, 0, 0, fetch_about_send_callback(FETCH_FINISHED, ctx, 0, 0,
FETCH_ERROR_NO_ERROR); FETCH_ERROR_NO_ERROR);
@ -396,8 +396,8 @@ struct about_handlers about_handler_list[] = {
{ "license", fetch_about_license_handler, true }, { "license", fetch_about_license_handler, true },
{ "config", fetch_about_config_handler, false }, { "config", fetch_about_config_handler, false },
{ "Choices", fetch_about_choices_handler, false }, { "Choices", fetch_about_choices_handler, false },
{ "testament", fetch_about_testament_handler, false }, { "testament", fetch_about_testament_handler, false },
{ "about", fetch_about_about_handler, false }, { "about", fetch_about_about_handler, false },
{ "blank", fetch_about_blank_handler, false } /* The default */ { "blank", fetch_about_blank_handler, false } /* The default */
}; };