summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorJohn Tytgat <joty@netsurf-browser.org>2008-07-26 23:42:24 +0000
committerJohn Tytgat <joty@netsurf-browser.org>2008-07-26 23:42:24 +0000
commit203b3289b8f590d25a2abf6df95bcaff741a7c2e (patch)
treed678df97090f80cb8d8fe54392d8341c509a2a61 /riscos
parent4ea96eac117f0ba74074fb486e2a57f85db8c697 (diff)
downloadnetsurf-203b3289b8f590d25a2abf6df95bcaff741a7c2e.tar.gz
netsurf-203b3289b8f590d25a2abf6df95bcaff741a7c2e.tar.bz2
- Include utils/config.h before each WITH_* test entiry enabling/disabling the object file.
- Add same test in corresponding header file (if there is one) - riscos/uri.c: include riscos/uri.h and have function definitions matching the declarations. - Disable PDF debug logging. svn path=/trunk/netsurf/; revision=4769
Diffstat (limited to 'riscos')
-rw-r--r--riscos/401login.c5
-rw-r--r--riscos/artworks.c5
-rw-r--r--riscos/draw.c5
-rw-r--r--riscos/draw.h5
-rw-r--r--riscos/gui.h2
-rw-r--r--riscos/plugin.c5
-rw-r--r--riscos/plugin.h5
-rw-r--r--riscos/print.c7
-rw-r--r--riscos/print.h5
-rw-r--r--riscos/save_complete.c5
-rw-r--r--riscos/save_complete.h5
-rw-r--r--riscos/save_pdf.c5
-rw-r--r--riscos/save_pdf.h8
-rw-r--r--riscos/search.c13
-rw-r--r--riscos/sprite.c1
-rw-r--r--riscos/sprite.h3
-rw-r--r--riscos/sslcert.c1
-rw-r--r--riscos/uri.c22
-rw-r--r--riscos/uri.h5
-rw-r--r--riscos/url_protocol.c5
-rw-r--r--riscos/url_protocol.h5
21 files changed, 82 insertions, 40 deletions
diff --git a/riscos/401login.c b/riscos/401login.c
index 3cbfcb575..cc75f4ba3 100644
--- a/riscos/401login.c
+++ b/riscos/401login.c
@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "utils/config.h"
+#ifdef WITH_AUTH
+
#include <assert.h>
#include <stdbool.h>
#include <string.h>
@@ -33,8 +36,6 @@
#include "utils/url.h"
#include "utils/utils.h"
-#ifdef WITH_AUTH
-
#define ICON_401LOGIN_LOGIN 0
#define ICON_401LOGIN_CANCEL 1
#define ICON_401LOGIN_HOST 2
diff --git a/riscos/artworks.c b/riscos/artworks.c
index 5dea449c9..f9e8f4b63 100644
--- a/riscos/artworks.c
+++ b/riscos/artworks.c
@@ -22,6 +22,9 @@
* Uses the ArtworksRenderer module
*/
+#include "utils/config.h"
+#ifdef WITH_ARTWORKS
+
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
@@ -37,8 +40,6 @@
#include "utils/messages.h"
#include "utils/log.h"
-#ifdef WITH_ARTWORKS
-
#define AWRender_FileInitAddress 0x46080
#define AWRender_RenderAddress 0x46081
#define AWRender_DocBounds 0x46082
diff --git a/riscos/draw.c b/riscos/draw.c
index 0d1bf51a4..b30e98dfb 100644
--- a/riscos/draw.c
+++ b/riscos/draw.c
@@ -22,6 +22,9 @@
* The DrawFile module is used to plot the DrawFile.
*/
+#include "utils/config.h"
+#ifdef WITH_DRAW
+
#include <string.h>
#include <stdlib.h>
#include "oslib/drawfile.h"
@@ -34,8 +37,6 @@
#include "utils/messages.h"
#include "utils/log.h"
-#ifdef WITH_DRAW
-
/**
* Convert a CONTENT_DRAW for display.
*
diff --git a/riscos/draw.h b/riscos/draw.h
index 81c2a1797..a55058767 100644
--- a/riscos/draw.h
+++ b/riscos/draw.h
@@ -23,6 +23,9 @@
#ifndef _NETSURF_RISCOS_DRAW_H_
#define _NETSURF_RISCOS_DRAW_H_
+#include "utils/config.h"
+#ifdef WITH_DRAW
+
#include <stdbool.h>
struct content;
@@ -38,4 +41,6 @@ bool draw_redraw(struct content *c, int x, int y,
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
float scale, colour background_colour);
+#endif /* WITH_DRAW */
+
#endif
diff --git a/riscos/gui.h b/riscos/gui.h
index f3160c8a6..2d495e948 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -199,9 +199,11 @@ extern os_t sched_time;
void ro_gui_debugwin_open(void);
/* in search.c */
+#ifdef WITH_SEARCH
void ro_gui_search_init(void);
void ro_gui_search_prepare(struct gui_window *g);
bool ro_gui_search_prepare_menu(void);
+#endif
/* in print.c */
void ro_gui_print_init(void);
diff --git a/riscos/plugin.c b/riscos/plugin.c
index 15a37d5f3..dbeb02b14 100644
--- a/riscos/plugin.c
+++ b/riscos/plugin.c
@@ -37,6 +37,9 @@
* Helpers are not supported (system variable detection is #if 0ed out)
*/
+#include "utils/config.h"
+#ifdef WITH_PLUGIN
+
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
@@ -67,8 +70,6 @@
#include "utils/utils.h"
-#ifdef WITH_PLUGIN
-
typedef enum {
PLUGIN_PARAMETER_DATA = 1,
PLUGIN_PARAMETER_URL = 2,
diff --git a/riscos/plugin.h b/riscos/plugin.h
index 5bd7b4abc..ca73fedc2 100644
--- a/riscos/plugin.h
+++ b/riscos/plugin.h
@@ -19,6 +19,9 @@
#ifndef _NETSURF_RISCOS_PLUGIN_H_
#define _NETSURF_RISCOS_PLUGIN_H_
+#include "utils/config.h"
+#ifdef WITH_PLUGIN
+
#include <stdbool.h>
#include "oslib/plugin.h"
#include "oslib/wimp.h"
@@ -73,6 +76,6 @@ void plugin_stream_new(wimp_message *message);
void plugin_stream_written(wimp_message *message);
void plugin_url_access(wimp_message *message);
-
+#endif /* WITH_PLUGIN */
#endif
diff --git a/riscos/print.c b/riscos/print.c
index e75bd1d6a..10296ebf3 100644
--- a/riscos/print.c
+++ b/riscos/print.c
@@ -17,6 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "utils/config.h"
+#ifdef WITH_PRINT
+
#include <assert.h>
#include <string.h>
#include "oslib/font.h"
@@ -68,12 +71,10 @@
* \todo make use of print stylesheets
*/
-struct gui_window *print_current_window = 0;
+struct gui_window *print_current_window = NULL;
bool print_text_black = false;
bool print_active = false;
-#ifdef WITH_PRINT
-
/* 1 millipoint == 1/400 OS unit == 1/800 browser units */
static int print_prev_message = 0;
diff --git a/riscos/print.h b/riscos/print.h
index 4859d305a..566eb79b9 100644
--- a/riscos/print.h
+++ b/riscos/print.h
@@ -19,6 +19,9 @@
#ifndef _NETSURF_RISCOS_PRINT_H_
#define _NETSURF_RISCOS_PRINT_H_
+#include "utils/config.h"
+#ifdef WITH_PRINT
+
#include <stdbool.h>
#include "oslib/wimp.h"
@@ -33,4 +36,6 @@ bool print_ack(wimp_message *m);
void print_dataload_bounce(wimp_message *m);
void print_cleanup(void);
+#endif /* WITH_PRINT */
+
#endif
diff --git a/riscos/save_complete.c b/riscos/save_complete.c
index 25f45409e..e0f4cc6ae 100644
--- a/riscos/save_complete.c
+++ b/riscos/save_complete.c
@@ -21,6 +21,9 @@
* Save HTML document with dependencies (implementation).
*/
+#include "utils/config.h"
+#ifdef WITH_SAVE_COMPLETE
+
#define _GNU_SOURCE /* for strndup */
#include <assert.h>
#include <ctype.h>
@@ -42,8 +45,6 @@
#include "utils/url.h"
#include "utils/utils.h"
-#ifdef WITH_SAVE_COMPLETE
-
regex_t save_complete_import_re;
/** An entry in save_complete_list. */
diff --git a/riscos/save_complete.h b/riscos/save_complete.h
index 63db0e44d..d04c4017a 100644
--- a/riscos/save_complete.h
+++ b/riscos/save_complete.h
@@ -23,10 +23,15 @@
#ifndef _NETSURF_RISCOS_SAVE_COMPLETE_H_
#define _NETSURF_RISCOS_SAVE_COMPLETE_H_
+#include "utils/config.h"
+#ifdef WITH_SAVE_COMPLETE
+
#include <stdbool.h>
struct content;
void save_complete_init(void);
bool save_complete(struct content *c, const char *path);
+#endif /* WITH_SAVE_COMPLETE */
+
#endif
diff --git a/riscos/save_pdf.c b/riscos/save_pdf.c
index a7d0903f4..90420d874 100644
--- a/riscos/save_pdf.c
+++ b/riscos/save_pdf.c
@@ -20,6 +20,9 @@
* Export a content as a PDF file (implementation).
*/
+#include "utils/config.h"
+#ifdef WITH_PDF_EXPORT
+
#include <stdbool.h>
#include "oslib/osfile.h"
#include "content/content.h"
@@ -29,8 +32,6 @@
#include "utils/log.h"
#include "utils/config.h"
-#ifdef WITH_PDF_EXPORT
-
/**
* Export a content as a PDF file.
*
diff --git a/riscos/save_pdf.h b/riscos/save_pdf.h
index ed7bae393..115abb321 100644
--- a/riscos/save_pdf.h
+++ b/riscos/save_pdf.h
@@ -20,10 +20,12 @@
#define _NETSURF_RISCOS_SAVE_PDF_H_
#include "utils/config.h"
-#include "content/content.h"
-
#ifdef WITH_PDF_EXPORT
+
+struct content;
+
bool save_as_pdf(struct content *c, const char *path);
-#endif
+
+#endif /* WITH_PDF_EXPORT */
#endif
diff --git a/riscos/search.c b/riscos/search.c
index 63678828c..ead9876d3 100644
--- a/riscos/search.c
+++ b/riscos/search.c
@@ -21,6 +21,9 @@
* Free text search (implementation)
*/
+#include "utils/config.h"
+#ifdef WITH_SEARCH
+
#include <ctype.h>
#include <string.h>
#include "oslib/hourglass.h"
@@ -40,8 +43,6 @@
#include "utils/messages.h"
#include "utils/utils.h"
-#ifdef WITH_SEARCH
-
#ifndef NOF_ELEMENTS
#define NOF_ELEMENTS(array) (sizeof(array)/sizeof(*(array)))
#endif
@@ -59,13 +60,13 @@ struct list_entry {
struct list_entry *next;
};
-struct gui_window *search_current_window = 0;
+struct gui_window *search_current_window = NULL;
-static char *search_string = 0;
+static char *search_string = NULL;
static struct list_entry search_head = { 0, 0, NULL, NULL, NULL, NULL, NULL };
static struct list_entry *search_found = &search_head;
-static struct list_entry *search_current = 0;
-static struct content *search_content = 0;
+static struct list_entry *search_current = NULL;
+static struct content *search_content = NULL;
static bool search_prev_case_sens = false;
#define RECENT_SEARCHES 8
diff --git a/riscos/sprite.c b/riscos/sprite.c
index 685da088e..32e187087 100644
--- a/riscos/sprite.c
+++ b/riscos/sprite.c
@@ -35,6 +35,7 @@
#include "riscos/gui.h"
#include "riscos/image.h"
#include "riscos/sprite.h"
+#include "utils/config.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"
diff --git a/riscos/sprite.h b/riscos/sprite.h
index 4b3ba8db3..8bfe19b9e 100644
--- a/riscos/sprite.h
+++ b/riscos/sprite.h
@@ -25,7 +25,9 @@
#include <stdbool.h>
#include "oslib/osspriteop.h"
+#include "utils/config.h"
+#ifdef WITH_SPRITE
struct content;
struct content_sprite_data {
@@ -38,6 +40,7 @@ bool sprite_redraw(struct content *c, int x, int y,
int width, int height,
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
float scale, colour background_colour);
+#endif
byte sprite_bpp(const osspriteop_header *s);
diff --git a/riscos/sslcert.c b/riscos/sslcert.c
index 2be320456..51069954c 100644
--- a/riscos/sslcert.c
+++ b/riscos/sslcert.c
@@ -21,7 +21,6 @@
*/
#include "utils/config.h"
-
#ifdef WITH_SSL
#include <assert.h>
diff --git a/riscos/uri.c b/riscos/uri.c
index 9ecd2a378..53167d305 100644
--- a/riscos/uri.c
+++ b/riscos/uri.c
@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "utils/config.h"
+#ifdef WITH_URI
+
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -28,19 +31,14 @@
#include "riscos/theme.h"
#include "desktop/gui.h"
#include "riscos/gui.h"
+#include "riscos/uri.h"
#include "riscos/url_protocol.h"
#include "utils/log.h"
#include "utils/utils.h"
-#ifdef WITH_URI
-
-void ro_uri_message_received(uri_full_message_process*);
-bool ro_uri_launch(char *uri);
-void ro_uri_bounce(uri_full_message_return_result*);
-
-
-void ro_uri_message_received(uri_full_message_process* uri_message)
+void ro_uri_message_received(wimp_message *msg)
{
+ uri_full_message_process *uri_message = (uri_full_message_process *)msg;
uri_h uri_handle;
char* uri_requested;
int uri_length;
@@ -57,7 +55,6 @@ void ro_uri_message_received(uri_full_message_process* uri_message)
xuri_request_uri(0, 0, 0, uri_handle, &uri_length);
uri_requested = calloc((unsigned int)uri_length, sizeof(char));
-
if (uri_requested == NULL)
return;
@@ -85,15 +82,16 @@ bool ro_uri_launch(char *uri)
return true;
}
-void ro_uri_bounce(uri_full_message_return_result *message)
+void ro_uri_bounce(wimp_message *msg)
{
+ uri_full_message_process *message = (uri_full_message_process *)msg;
char uri_buf[512];
os_error *e;
- if ((message->flags & 1) == 0) return;
+ if ((message->flags & 1) == 0)
+ return;
e = xuri_request_uri(0, uri_buf, sizeof uri_buf, message->handle, 0);
-
if (e) {
LOG(("xuri_request_uri: %d: %s", e->errnum, e->errmess));
return;
diff --git a/riscos/uri.h b/riscos/uri.h
index 3f7c9341f..b22d36986 100644
--- a/riscos/uri.h
+++ b/riscos/uri.h
@@ -19,10 +19,15 @@
#ifndef _NETSURF_RISCOS_URI_H_
#define _NETSURF_RISCOS_URI_H_
+#include "utils/config.h"
+#ifdef WITH_URI
+
#include "oslib/wimp.h"
void ro_uri_message_received(wimp_message *message);
bool ro_uri_launch(char *uri);
void ro_uri_bounce(wimp_message *message);
+#endif /* WITH_URI */
+
#endif
diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c
index 68df3c218..7831334b6 100644
--- a/riscos/url_protocol.c
+++ b/riscos/url_protocol.c
@@ -24,6 +24,9 @@
* See http://www.vigay.com/inet/inet_url.html
*/
+#include "utils/config.h"
+#ifdef WITH_URL
+
#define _GNU_SOURCE /* for strndup */
#include <ctype.h>
#include <stdio.h>
@@ -40,8 +43,6 @@
#include "utils/log.h"
#include "utils/utils.h"
-#ifdef WITH_URL
-
/**
* Handle a Message_InetSuiteOpenURL.
*/
diff --git a/riscos/url_protocol.h b/riscos/url_protocol.h
index b0b1cb781..0561d52dc 100644
--- a/riscos/url_protocol.h
+++ b/riscos/url_protocol.h
@@ -23,6 +23,9 @@
#ifndef _NETSURF_RISCOS_URL_H_
#define _NETSURF_RISCOS_URL_H_
+#include "utils/config.h"
+#ifdef WITH_URL
+
#include "oslib/wimp.h"
void ro_url_message_received(wimp_message *message);
@@ -30,4 +33,6 @@ void ro_url_broadcast(const char *url);
void ro_url_load(const char *url);
void ro_url_bounce(wimp_message *message);
+#endif /* WITH_URL */
+
#endif