diff options
Diffstat (limited to 'content/fetchers/about/about.c')
-rw-r--r-- | content/fetchers/about/about.c | 104 |
1 files changed, 2 insertions, 102 deletions
diff --git a/content/fetchers/about/about.c b/content/fetchers/about/about.c index 2ef470bc2..117bd6689 100644 --- a/content/fetchers/about/about.c +++ b/content/fetchers/about/about.c @@ -35,7 +35,6 @@ #include "netsurf/plot_style.h" #include "utils/log.h" -#include "testament.h" #include "utils/corestrings.h" #include "utils/nscolour.h" #include "utils/nsoption.h" @@ -52,6 +51,7 @@ #include "blank.h" #include "certificate.h" #include "imagecache.h" +#include "atestament.h" #include "about.h" typedef bool (*fetch_about_handler)(struct fetch_about_context *); @@ -216,6 +216,7 @@ nsurl *fetch_about_get_url(struct fetch_about_context *ctx) return ctx->url; } + /** * Generate a 500 server error respnse * @@ -243,8 +244,6 @@ static bool fetch_about_srverror(struct fetch_about_context *ctx) } - - /** * Handler to generate about scheme credits page. * @@ -289,9 +288,6 @@ static bool fetch_about_licence_handler(struct fetch_about_context *ctx) } - - - /** * Handler to generate about scheme config page * @@ -502,102 +498,6 @@ fetch_about_choices_handler_aborted: } -typedef struct { - const char *leaf; - const char *modtype; -} modification_t; - -/** - * Generate the text of an svn testament which represents the current - * build-tree status - * - * \param ctx The fetcher context. - * \return true if handled false if aborted. - */ -static bool fetch_about_testament_handler(struct fetch_about_context *ctx) -{ - nserror res; - static modification_t modifications[] = WT_MODIFICATIONS; - int modidx; /* midification index */ - - /* content is going to return ok */ - fetch_set_http_code(ctx->fetchh, 200); - - /* content type */ - if (fetch_about_send_header(ctx, "Content-Type: text/plain")) - goto fetch_about_testament_handler_aborted; - - res = fetch_about_ssenddataf(ctx, - "# Automatically generated by NetSurf build system\n\n"); - if (res != NSERROR_OK) { - goto fetch_about_testament_handler_aborted; - } - - res = fetch_about_ssenddataf(ctx, -#if defined(WT_BRANCHISTRUNK) || defined(WT_BRANCHISMASTER) - "# This is a *DEVELOPMENT* build from the main line.\n\n" -#elif defined(WT_BRANCHISTAG) && (WT_MODIFIED == 0) - "# This is a tagged build of NetSurf\n" -#ifdef WT_TAGIS - "# The tag used was '" WT_TAGIS "'\n\n" -#else - "\n" -#endif -#elif defined(WT_NO_SVN) || defined(WT_NO_GIT) - "# This NetSurf was built outside of our revision " - "control environment.\n" - "# This testament is therefore not very useful.\n\n" -#else - "# This NetSurf was built from a branch (" WT_BRANCHPATH ").\n\n" -#endif -#if defined(CI_BUILD) - "# This build carries the CI build number '" CI_BUILD "'\n\n" -#endif - ); - if (res != NSERROR_OK) { - goto fetch_about_testament_handler_aborted; - } - - res = fetch_about_ssenddataf(ctx, - "Built by %s (%s) from %s at revision %s on %s\n\n", - GECOS, USERNAME, WT_BRANCHPATH, WT_REVID, WT_COMPILEDATE); - if (res != NSERROR_OK) { - goto fetch_about_testament_handler_aborted; - } - - res = fetch_about_ssenddataf(ctx, "Built on %s in %s\n\n", WT_HOSTNAME, WT_ROOT); - if (res != NSERROR_OK) { - goto fetch_about_testament_handler_aborted; - } - - if (WT_MODIFIED > 0) { - res = fetch_about_ssenddataf(ctx, - "Working tree has %d modification%s\n\n", - WT_MODIFIED, WT_MODIFIED == 1 ? "" : "s"); - } else { - res = fetch_about_ssenddataf(ctx, "Working tree is not modified.\n"); - } - if (res != NSERROR_OK) { - goto fetch_about_testament_handler_aborted; - } - - for (modidx = 0; modidx < WT_MODIFIED; ++modidx) { - res = fetch_about_ssenddataf(ctx, - " %s %s\n", - modifications[modidx].modtype, - modifications[modidx].leaf); - if (res != NSERROR_OK) { - goto fetch_about_testament_handler_aborted; - } - } - - fetch_about_send_finished(ctx); - - return true; - -fetch_about_testament_handler_aborted: - return false; -} /** |