summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/content.c42
-rw-r--r--content/content.h35
-rw-r--r--content/fetchcache.c22
-rw-r--r--content/fetchcache.h15
-rw-r--r--content/url_store.c2
5 files changed, 62 insertions, 54 deletions
diff --git a/content/content.c b/content/content.c
index a8b34a6e7..1d6e32a8b 100644
--- a/content/content.c
+++ b/content/content.c
@@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf.sourceforge.net/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
- * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
+ * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
*/
/** \file
@@ -13,6 +13,7 @@
*/
#include <assert.h>
+#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -363,9 +364,9 @@ bool content_set_type(struct content *c, content_type type,
{
union content_msg_data msg_data;
struct content *clone;
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data);
- void *p1, *p2;
+ void (*callback)(content_msg msg, struct content *c, intptr_t p1,
+ intptr_t p2, union content_msg_data data);
+ intptr_t p1, p2;
assert(c != 0);
assert(c->status == CONTENT_STATUS_TYPE_UNKNOWN);
@@ -772,13 +773,14 @@ bool content_redraw(struct content *c, int x, int y,
*/
bool content_add_user(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2)
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2)
{
struct content_user *user;
- LOG(("content %s, user %p %p %p", c->url, callback, p1, p2));
+ LOG(("content %s, user %p 0x%" PRIxPTR " 0x%" PRIxPTR,
+ c->url, callback, p1, p2));
user = talloc(c, struct content_user);
if (!user)
return false;
@@ -800,9 +802,9 @@ bool content_add_user(struct content *c,
*/
struct content_user * content_find_user(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2)
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2)
{
struct content_user *user;
@@ -824,12 +826,13 @@ struct content_user * content_find_user(struct content *c,
*/
void content_remove_user(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2)
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2)
{
struct content_user *user, *next;
- LOG(("content %s, user %p %p %p", c->url, callback, p1, p2));
+ LOG(("content %s, user %p 0x%" PRIxPTR " 0x%" PRIxPTR,
+ c->url, callback, p1, p2));
/* user_list starts with a sentinel */
for (user = c->user_list; user->next != 0 &&
@@ -873,9 +876,9 @@ void content_broadcast(struct content *c, content_msg msg,
*/
void content_stop(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2)
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2)
{
struct content_user *user;
@@ -888,7 +891,8 @@ void content_stop(struct content *c,
return;
}
- LOG(("%p %s: stop user %p %p %p", c, c->url, callback, p1, p2));
+ LOG(("%p %s: stop user %p 0x%" PRIxPTR " 0x%" PRIxPTR,
+ c, c->url, callback, p1, p2));
user->stop = true;
}
diff --git a/content/content.h b/content/content.h
index 4bda90dfd..edb9fe0d7 100644
--- a/content/content.h
+++ b/content/content.h
@@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf.sourceforge.net/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
- * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
+ * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
* Copyright 2003 Philip Pemberton <philpem@users.sourceforge.net>
*/
@@ -101,6 +101,7 @@
#ifndef _NETSURF_DESKTOP_CONTENT_H_
#define _NETSURF_DESKTOP_CONTENT_H_
+#include <stdint.h>
#include "netsurf/utils/config.h"
#include "netsurf/content/content_type.h"
#include "netsurf/css/css.h"
@@ -172,10 +173,10 @@ union content_msg_data {
/** Linked list of users of a content. */
struct content_user
{
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data);
- void *p1;
- void *p2;
+ void (*callback)(content_msg msg, struct content *c, intptr_t p1,
+ intptr_t p2, union content_msg_data data);
+ intptr_t p1;
+ intptr_t p2;
bool stop;
struct content_user *next;
};
@@ -286,23 +287,23 @@ bool content_redraw(struct content *c, int x, int y,
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
float scale, unsigned long background_colour);
bool content_add_user(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2);
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2);
struct content_user * content_find_user(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2);
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2);
void content_remove_user(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2);
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2);
void content_broadcast(struct content *c, content_msg msg,
union content_msg_data data);
void content_stop(struct content *c,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2);
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2);
void content_open(struct content *c, struct browser_window *bw,
struct content *page, struct box *box,
struct object_params *params);
diff --git a/content/fetchcache.c b/content/fetchcache.c
index e188fea54..f7e6706cf 100644
--- a/content/fetchcache.c
+++ b/content/fetchcache.c
@@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf.sourceforge.net/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
- * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
+ * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
*/
/** \file
@@ -46,8 +46,8 @@ static void fetchcache_error_page(struct content *c, const char *error);
* \param url address to fetch
* \param callback function to call when anything interesting happens to
* the new content
- * \param p1 user parameter for callback
- * \param p2 user parameter for callback
+ * \param p1 user parameter for callback (may be a pointer or integer)
+ * \param p2 user parameter for callback (may be a pointer or integer)
* \param width available space
* \param height available space
* \param no_error_pages if an error occurs, send CONTENT_MSG_ERROR instead
@@ -62,9 +62,9 @@ static void fetchcache_error_page(struct content *c, const char *error);
*/
struct content * fetchcache(const char *url,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2,
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2,
int width, int height,
bool no_error_pages,
char *post_urlenc,
@@ -122,8 +122,8 @@ struct content * fetchcache(const char *url,
* \param referer referring URL, or 0
* \param callback function to call when anything interesting happens to
* the new content
- * \param p1 user parameter for callback
- * \param p2 user parameter for callback
+ * \param p1 user parameter for callback
+ * \param p2 user parameter for callback
* \param width available space
* \param height available space
* \param post_urlenc url encoded post data, or 0 if none
@@ -134,9 +134,9 @@ struct content * fetchcache(const char *url,
*/
void fetchcache_go(struct content *content, char *referer,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2,
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2,
int width, int height,
char *post_urlenc,
struct form_successful_control *post_multipart,
diff --git a/content/fetchcache.h b/content/fetchcache.h
index 5a1794901..7d8b3c341 100644
--- a/content/fetchcache.h
+++ b/content/fetchcache.h
@@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf.sourceforge.net/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
- * Copyright 2004 James Bursa <bursa@users.sourceforge.net>
+ * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
*/
/** \file
@@ -16,15 +16,16 @@
#define _NETSURF_DESKTOP_FETCHCACHE_H_
#include <stdbool.h>
+#include <stdint.h>
#include "netsurf/content/content.h"
struct form_successful_control;
void fetchcache_init(void);
struct content * fetchcache(const char *url,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2,
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2,
int width, int height,
bool no_error_pages,
char *post_urlenc,
@@ -32,9 +33,9 @@ struct content * fetchcache(const char *url,
bool cookies,
bool download);
void fetchcache_go(struct content *content, char *referer,
- void (*callback)(content_msg msg, struct content *c, void *p1,
- void *p2, union content_msg_data data),
- void *p1, void *p2,
+ void (*callback)(content_msg msg, struct content *c,
+ intptr_t p1, intptr_t p2, union content_msg_data data),
+ intptr_t p1, intptr_t p2,
int width, int height,
char *post_urlenc,
struct form_successful_control *post_multipart,
diff --git a/content/url_store.c b/content/url_store.c
index 61dd29afd..1c1900d7f 100644
--- a/content/url_store.c
+++ b/content/url_store.c
@@ -519,7 +519,9 @@ void url_store_save(const char *file) {
const char *thumb_file = "";
int thumb_size = 0;
FILE *fp;
+#ifdef riscos
struct bitmap *bitmap;
+#endif
fp = fopen(file, "w");
if (!fp) {