summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
Diffstat (limited to 'frontends')
-rw-r--r--frontends/amiga/Makefile2
-rw-r--r--frontends/amiga/arexx.c1
-rw-r--r--frontends/amiga/bitmap.c1
-rw-r--r--frontends/amiga/clipboard.c2
-rw-r--r--frontends/amiga/download.c1
-rw-r--r--frontends/amiga/dt_anim.c2
-rw-r--r--frontends/amiga/file.c1
-rw-r--r--frontends/amiga/filetype.c2
-rw-r--r--frontends/amiga/font_bullet.c1
-rw-r--r--frontends/amiga/gui.c1
-rwxr-xr-xfrontends/amiga/gui_options.c2
-rwxr-xr-xfrontends/amiga/history_local.c1
-rw-r--r--frontends/amiga/icon.c2
-rw-r--r--frontends/amiga/iff_dr2d.c2
-rwxr-xr-xfrontends/amiga/login.c2
-rwxr-xr-xfrontends/amiga/memory.c79
-rw-r--r--frontends/amiga/memory.h33
-rw-r--r--frontends/amiga/menu.c1
-rwxr-xr-xfrontends/amiga/misc.c52
-rw-r--r--frontends/amiga/misc.h9
-rwxr-xr-xfrontends/amiga/object.c2
-rw-r--r--frontends/amiga/os3support.c2
-rw-r--r--frontends/amiga/plotters.c1
-rw-r--r--frontends/amiga/print.c1
-rw-r--r--frontends/amiga/schedule.c2
-rwxr-xr-xfrontends/amiga/search.c2
-rw-r--r--frontends/amiga/theme.c2
-rw-r--r--frontends/amiga/tree.c1
28 files changed, 135 insertions, 75 deletions
diff --git a/frontends/amiga/Makefile b/frontends/amiga/Makefile
index a2c1b13d5..ea6e8fe67 100644
--- a/frontends/amiga/Makefile
+++ b/frontends/amiga/Makefile
@@ -37,7 +37,7 @@ MESSAGES_FILTER=ami
# sources purely for the Amiga build
S_FRONTEND := gui.c tree.c history.c hotlist.c schedule.c file.c \
- misc.c bitmap.c font.c filetype.c utf8.c login.c \
+ misc.c bitmap.c font.c filetype.c utf8.c login.c memory.c \
plotters.c object.c menu.c save_pdf.c arexx.c version.c \
cookies.c ctxmenu.c clipboard.c help.c font_scan.c \
launch.c search.c history_local.c download.c iff_dr2d.c \
diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c
index 062f00b3f..ad2d23713 100644
--- a/frontends/amiga/arexx.c
+++ b/frontends/amiga/arexx.c
@@ -42,6 +42,7 @@
#include "amiga/hotlist.h"
#include "amiga/tree.h"
#include "amiga/libs.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/theme.h"
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 8c691eded..7609d9451 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -54,6 +54,7 @@
#include "amiga/gui.h"
#include "amiga/bitmap.h"
#include "amiga/plotters.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/rtg.h"
diff --git a/frontends/amiga/clipboard.c b/frontends/amiga/clipboard.c
index 2dce06845..4933f59e7 100644
--- a/frontends/amiga/clipboard.c
+++ b/frontends/amiga/clipboard.c
@@ -45,7 +45,7 @@
#include "amiga/iff_cset.h"
#include "amiga/iff_dr2d.h"
#include "amiga/menu.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/utf8.h"
#define ID_UTF8 MAKE_ID('U','T','F','8')
diff --git a/frontends/amiga/download.c b/frontends/amiga/download.c
index 93536f494..0750e5e83 100644
--- a/frontends/amiga/download.c
+++ b/frontends/amiga/download.c
@@ -64,6 +64,7 @@
#include "amiga/file.h"
#include "amiga/iff_dr2d.h"
#include "amiga/libs.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"
diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c
index 19467882a..3175cf13b 100644
--- a/frontends/amiga/dt_anim.c
+++ b/frontends/amiga/dt_anim.c
@@ -46,7 +46,7 @@
#include "amiga/bitmap.h"
#include "amiga/filetype.h"
#include "amiga/datatypes.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/plotters.h"
typedef struct amiga_dt_anim_content {
diff --git a/frontends/amiga/file.c b/frontends/amiga/file.c
index 1bba30eb3..db0e7162b 100644
--- a/frontends/amiga/file.c
+++ b/frontends/amiga/file.c
@@ -40,6 +40,7 @@
#include "amiga/filetype.h"
#include "amiga/icon.h"
#include "amiga/iff_dr2d.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/save_pdf.h"
#include "amiga/theme.h"
diff --git a/frontends/amiga/filetype.c b/frontends/amiga/filetype.c
index 61e4929c5..8c658ee81 100644
--- a/frontends/amiga/filetype.c
+++ b/frontends/amiga/filetype.c
@@ -31,7 +31,7 @@
#include "utils/utils.h"
#include "amiga/filetype.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/object.h"
/**
diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c
index 48e49f345..bb0adb5d0 100644
--- a/frontends/amiga/font_bullet.c
+++ b/frontends/amiga/font_bullet.c
@@ -41,6 +41,7 @@
#include "utils/utf8.h"
#include "utils/utils.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/font.h"
#include "amiga/font_bullet.h"
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 459e768e1..df03756f3 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -141,6 +141,7 @@
#include "amiga/libs.h"
#include "amiga/login.h"
#include "amiga/menu.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/nsoption.h"
#include "amiga/plotters.h"
diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c
index 2b1b7c944..a890a9126 100755
--- a/frontends/amiga/gui_options.c
+++ b/frontends/amiga/gui_options.c
@@ -73,7 +73,7 @@
#include "amiga/gui_options.h"
#include "amiga/help.h"
#include "amiga/libs.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/nsoption.h"
#include "amiga/object.h"
#include "amiga/selectmenu.h"
diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c
index c87b56385..fa5c249b9 100755
--- a/frontends/amiga/history_local.c
+++ b/frontends/amiga/history_local.c
@@ -51,6 +51,7 @@
#include "graphics/rpattr.h"
#include "amiga/libs.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/plotters.h"
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c
index 7b73360d0..bd79a5502 100644
--- a/frontends/amiga/icon.c
+++ b/frontends/amiga/icon.c
@@ -49,7 +49,7 @@
#include "amiga/os3support.h"
#include "amiga/bitmap.h"
#include "amiga/icon.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */
#define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */
diff --git a/frontends/amiga/iff_dr2d.c b/frontends/amiga/iff_dr2d.c
index aea7738d3..1c8d7db2c 100644
--- a/frontends/amiga/iff_dr2d.c
+++ b/frontends/amiga/iff_dr2d.c
@@ -30,7 +30,7 @@
#include "netsurf/content.h"
#include "amiga/os3support.h"
#include "amiga/iff_dr2d.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#else
#include "os3support.h"
#include "iff_dr2d.h"
diff --git a/frontends/amiga/login.c b/frontends/amiga/login.c
index 3b338bfe5..e1d2891c5 100755
--- a/frontends/amiga/login.c
+++ b/frontends/amiga/login.c
@@ -46,7 +46,7 @@
#include "amiga/gui.h"
#include "amiga/libs.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/object.h"
#include "amiga/login.h"
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c
new file mode 100755
index 000000000..874f8521e
--- /dev/null
+++ b/frontends/amiga/memory.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2016 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+#include <proto/exec.h>
+
+#include "amiga/memory.h"
+
+#ifndef __amigaos4__
+ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
+#endif
+
+void *ami_misc_allocvec_clear(int size, UBYTE value)
+{
+#ifdef __amigaos4__
+ return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
+#else
+ void *mem = AllocVec(size, MEMF_ANY);
+ if (mem) memset(mem, value, size);
+ return mem;
+#endif
+}
+
+APTR ami_misc_itempool_create(int size)
+{
+#ifdef __amigaos4__
+ return AllocSysObjectTags(ASOT_ITEMPOOL,
+ ASOITEM_MFlags, MEMF_PRIVATE,
+ ASOITEM_ItemSize, size,
+ ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT,
+ ASOITEM_GCParameter, 100,
+ TAG_DONE);
+#else
+ return CreatePool(MEMF_ANY, 20 * size, size);
+#endif
+}
+
+void ami_misc_itempool_delete(APTR pool)
+{
+#ifdef __amigaos4__
+ FreeSysObject(ASOT_ITEMPOOL, pool);
+#else
+ DeletePool(pool);
+#endif
+}
+
+APTR ami_misc_itempool_alloc(APTR pool, int size)
+{
+#ifdef __amigaos4__
+ return ItemPoolAlloc(pool);
+#else
+ return AllocPooled(pool, size);
+#endif
+}
+
+void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
+{
+#ifdef __amigaos4__
+ ItemPoolFree(pool, item);
+#else
+ FreePooled(pool, item, size);
+#endif
+}
+
diff --git a/frontends/amiga/memory.h b/frontends/amiga/memory.h
new file mode 100644
index 000000000..1c51f3081
--- /dev/null
+++ b/frontends/amiga/memory.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef AMIGA_MEMORY_H
+#define AMIGA_MEMORY_H
+
+#include <exec/types.h>
+
+/* Standard memory allocation */
+void *ami_misc_allocvec_clear(int size, UBYTE value);
+
+/* Itempool cross-compatibility */
+APTR ami_misc_itempool_create(int size);
+void ami_misc_itempool_delete(APTR pool);
+APTR ami_misc_itempool_alloc(APTR pool, int size);
+void ami_misc_itempool_free(APTR pool, APTR item, int size);
+#endif
+
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 0fd730ed8..feb5c2979 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -68,6 +68,7 @@
#include "amiga/hotlist.h"
#include "amiga/libs.h"
#include "amiga/menu.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/nsoption.h"
#include "amiga/print.h"
diff --git a/frontends/amiga/misc.c b/frontends/amiga/misc.c
index c09b28308..5ca4f906a 100755
--- a/frontends/amiga/misc.c
+++ b/frontends/amiga/misc.c
@@ -42,58 +42,6 @@
#include "amiga/misc.h"
#include "amiga/utf8.h"
-void *ami_misc_allocvec_clear(int size, UBYTE value)
-{
-#ifdef __amigaos4__
- return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
-#else
- void *mem = AllocVec(size, MEMF_ANY);
- if (mem) memset(mem, value, size);
- return mem;
-#endif
-}
-
-APTR ami_misc_itempool_create(int size)
-{
-#ifdef __amigaos4__
- return AllocSysObjectTags(ASOT_ITEMPOOL,
- ASOITEM_MFlags, MEMF_PRIVATE,
- ASOITEM_ItemSize, size,
- ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT,
- ASOITEM_GCParameter, 100,
- TAG_DONE);
-#else
- return CreatePool(MEMF_ANY, 20 * size, size);
-#endif
-}
-
-void ami_misc_itempool_delete(APTR pool)
-{
-#ifdef __amigaos4__
- FreeSysObject(ASOT_ITEMPOOL, pool);
-#else
- DeletePool(pool);
-#endif
-}
-
-APTR ami_misc_itempool_alloc(APTR pool, int size)
-{
-#ifdef __amigaos4__
- return ItemPoolAlloc(pool);
-#else
- return AllocPooled(pool, size);
-#endif
-}
-
-void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
-{
-#ifdef __amigaos4__
- ItemPoolFree(pool, item);
-#else
- FreePooled(pool, item, size);
-#endif
-}
-
static LONG ami_misc_req(const char *message, uint32 type)
{
LONG ret = 0;
diff --git a/frontends/amiga/misc.h b/frontends/amiga/misc.h
index c7ae5af78..a74979451 100644
--- a/frontends/amiga/misc.h
+++ b/frontends/amiga/misc.h
@@ -35,15 +35,6 @@ struct Window;
* faliure displaying the message to the user.
*/
nserror amiga_warn_user(const char *warning, const char *detail);
-
-void *ami_misc_allocvec_clear(int size, UBYTE value);
-
-/* Itempool cross-compatibility */
-APTR ami_misc_itempool_create(int size);
-void ami_misc_itempool_delete(APTR pool);
-APTR ami_misc_itempool_alloc(APTR pool, int size);
-void ami_misc_itempool_free(APTR pool, APTR item, int size);
-
char *translate_escape_chars(const char *s);
void ami_misc_fatal_error(const char *message);
int32 amiga_warn_user_multi(const char *body,
diff --git a/frontends/amiga/object.c b/frontends/amiga/object.c
index 6459d63c0..074ad9277 100755
--- a/frontends/amiga/object.c
+++ b/frontends/amiga/object.c
@@ -26,7 +26,7 @@
#include <exec/lists.h>
#include <exec/nodes.h>
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/object.h"
#ifdef __amigaos4__
diff --git a/frontends/amiga/os3support.c b/frontends/amiga/os3support.c
index 6722ca83c..bdf633316 100644
--- a/frontends/amiga/os3support.c
+++ b/frontends/amiga/os3support.c
@@ -46,8 +46,6 @@
#define FAILURE (FALSE)
#define NO !
-ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
-
/* Diskfont */
struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG flags)
{
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index 19171716c..073a95f3c 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -45,6 +45,7 @@
#include "amiga/bitmap.h"
#include "amiga/font.h"
#include "amiga/gui.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/rtg.h"
#include "amiga/utf8.h"
diff --git a/frontends/amiga/print.c b/frontends/amiga/print.c
index 6926647c3..7c0dfd963 100644
--- a/frontends/amiga/print.c
+++ b/frontends/amiga/print.c
@@ -62,6 +62,7 @@
#include "amiga/font.h"
#include "amiga/gui.h"
#include "amiga/libs.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/print.h"
#include "amiga/utf8.h"
diff --git a/frontends/amiga/schedule.c b/frontends/amiga/schedule.c
index 707d7bbfa..bfafe9c88 100644
--- a/frontends/amiga/schedule.c
+++ b/frontends/amiga/schedule.c
@@ -30,7 +30,7 @@
#include "utils/errors.h"
#include "utils/log.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/schedule.h"
struct nscallback
diff --git a/frontends/amiga/search.c b/frontends/amiga/search.c
index 429545e4f..7a49919be 100755
--- a/frontends/amiga/search.c
+++ b/frontends/amiga/search.c
@@ -56,7 +56,7 @@
#include "amiga/libs.h"
#include "amiga/gui.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
#include "amiga/search.h"
#include "amiga/object.h"
#include "amiga/theme.h"
diff --git a/frontends/amiga/theme.c b/frontends/amiga/theme.c
index 4042d1dd0..5f44a9bab 100644
--- a/frontends/amiga/theme.c
+++ b/frontends/amiga/theme.c
@@ -49,7 +49,7 @@
#include "amiga/bitmap.h"
#include "amiga/schedule.h"
#include "amiga/theme.h"
-#include "amiga/misc.h"
+#include "amiga/memory.h"
static struct BitMap *throbber = NULL;
static struct bitmap *throbber_nsbm = NULL;
diff --git a/frontends/amiga/tree.c b/frontends/amiga/tree.c
index 8328194ac..eea64ffea 100644
--- a/frontends/amiga/tree.c
+++ b/frontends/amiga/tree.c
@@ -66,6 +66,7 @@
#include "amiga/tree.h"
#include "amiga/file.h"
#include "amiga/libs.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/utf8.h"
#include "amiga/sslcert.h"