show-url-info page through "search engine plugins".
-const char cgi_rcs[] = "$Id: cgi.c,v 1.106 2008/05/21 15:24:38 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.107 2008/05/26 16:23:19 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
* Functions declared include:
*
*
- * Copyright : Written by and Copyright (C) 2001-2004, 2006-2007
+ * Copyright : Written by and Copyright (C) 2001-2004, 2006-2008
* the SourceForge Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.107 2008/05/26 16:23:19 fabiankeil
+ * - Fix spelling in template-not-found message.
+ * - Declare referrer_is_safe()'s alternative_prefix[] static.
+ *
* Revision 1.106 2008/05/21 15:24:38 fabiankeil
* Mark csp as immutable for a bunch of functions.
*
{ "t",
cgi_transparent_image,
NULL, TRUE /* Send a transparent image (short name) */ },
+ { "url-info-osd.xml",
+ cgi_send_url_info_osd,
+ NULL, TRUE /* Send templates/url-info-osd.xml */ },
{ "user-manual",
cgi_send_user_manual,
NULL, TRUE /* Send user-manual */ },
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.83 2008/05/12 14:51:30 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.84 2008/05/26 16:16:55 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
*
* Revisions :
* $Log: cgisimple.c,v $
+ * Revision 1.84 2008/05/26 16:16:55 fabiankeil
+ * Spell error correctly.
+ *
* Revision 1.83 2008/05/12 14:51:30 fabiankeil
* Don't complain about an invalid URL if show-url-info is requested
* without parameters. Regression introduced in 1.81 by yours truly.
return JB_ERR_OK;
}
+
+
+/*********************************************************************
+ *
+ * Function : cgi_send_url_info_osd
+ *
+ * Description : CGI function that sends the OpenSearch Description
+ * template for the show-url-info page. It allows to
+ * access the page through "search engine plugins".
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ * 2 : rsp = http_response data structure for output
+ * 3 : parameters = map of cgi parameters
+ *
+ * CGI Parameters : None
+ *
+ * Returns : JB_ERR_OK on success
+ * JB_ERR_MEMORY on out-of-memory error.
+ *
+ *********************************************************************/
+jb_err cgi_send_url_info_osd(struct client_state *csp,
+ struct http_response *rsp,
+ const struct map *parameters)
+{
+ jb_err err = JB_ERR_MEMORY;
+ struct map *exports = default_exports(csp, NULL);
+
+ if (NULL != exports)
+ {
+ err = template_fill_for_cgi(csp, "url-info-osd.xml", exports, rsp);
+ if (JB_ERR_OK == err)
+ {
+ err = enlist(rsp->headers,
+ "Content-Type: application/opensearchdescription+xml");
+ }
+ }
+
+ return err;
+
+}
+
+
/*********************************************************************
*
* Function : cgi_send_user_manual
#ifndef CGISIMPLE_H_INCLUDED
#define CGISIMPLE_H_INCLUDED
-#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.14 2006/09/06 18:45:03 fabiankeil Exp $"
+#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.15 2007/01/23 15:51:17 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.h,v $
*
* Revisions :
* $Log: cgisimple.h,v $
+ * Revision 1.15 2007/01/23 15:51:17 fabiankeil
+ * Add favicon delivery functions.
+ *
* Revision 1.14 2006/09/06 18:45:03 fabiankeil
* Incorporate modified version of Roland Rosenfeld's patch to
* optionally access the user-manual via Privoxy. Closes patch 679075.
extern jb_err cgi_send_stylesheet(struct client_state *csp,
struct http_response *rsp,
const struct map *parameters);
+extern jb_err cgi_send_url_info_osd(struct client_state *csp,
+ struct http_response *rsp,
+ const struct map *parameters);
extern jb_err cgi_send_user_manual(struct client_state *csp,
struct http_response *rsp,
const struct map *parameters);
#
# Revisions :
# $Log: show-url-info,v $
+# Revision 1.26 2008/05/05 10:03:06 fabiankeil
+# If the provided URL isn't valid, don't show the
+# cgi-editor-is-disabled and filters-might-be-ineffective
+# sections.
+#
# Revision 1.25 2008/04/26 10:34:18 fabiankeil
# If zlib support is unavailable and there are content filters active
# but the prevent-compression action is disabled, include a warning
<meta name="robots" content="noindex,nofollow">
<link rel="stylesheet" type="text/css" href="@default-cgi@send-stylesheet">
<link rel="shortcut icon" href="@default-cgi@favicon.ico" type="image/x-icon">
+ <link rel="search" type="application/opensearchdescription+xml" title="Privoxy URL Info" href="/url-info-osd.xml">
</head>
<body>
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+ <ShortName>Privoxy URL Info</ShortName>
+ <Description>
+ Enter a URL to see which Privoxy actions apply.
+ Only works while the browser is configured to use Privoxy.
+ </Description>
+ <InputEncoding>ISO-8859-1</InputEncoding>
+ <OutputEncoding>ISO-8859-1</OutputEncoding>
+ <Developer>Privoxy Team</Developer>
+ <Contact>ijbswa-developers@lists.sourceforge.net</Contact>
+ <Image width="16" height="16" type="image/x-icon">@default-cgi@favicon.ico</Image>
+ <Url type="text/html" method="GET" template="@default-cgi@show-url-info?url={searchTerms}"/>
+</OpenSearchDescription>