summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-11 00:14:54 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-11 00:14:54 +0000
commit87f85c2034dba9ca2ff95fb0da55cfdfdf412f51 (patch)
tree869ceab1c26f8b3d57317dbb38d609bc5013ec14
parent5416059602bd7a9477a1d869e12e1766f332fba5 (diff)
parentae012398b0f0a7320ed1d80bf6c370971033b2b9 (diff)
downloadnetsurf-87f85c2034dba9ca2ff95fb0da55cfdfdf412f51.tar.gz
netsurf-87f85c2034dba9ca2ff95fb0da55cfdfdf412f51.tar.bz2
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
-rw-r--r--amiga/agclass/amigaguide_class.c55
-rw-r--r--amiga/arexx.c6
-rw-r--r--amiga/bitmap.c10
-rw-r--r--amiga/clipboard.c9
-rw-r--r--amiga/context_menu.c7
-rwxr-xr-xamiga/context_menu.h4
-rw-r--r--amiga/download.c2
-rw-r--r--amiga/drag.c46
-rw-r--r--amiga/drag.h7
-rw-r--r--amiga/dt_anim.c13
-rw-r--r--amiga/dt_picture.c3
-rw-r--r--amiga/dt_sound.c2
-rw-r--r--amiga/file.c2
-rw-r--r--amiga/filetype.c7
-rwxr-xr-xamiga/font_scan.h2
-rwxr-xr-xamiga/misc.c13
-rw-r--r--amiga/misc.h1
-rw-r--r--amiga/os3support.c12
-rw-r--r--amiga/os3support.h24
19 files changed, 168 insertions, 57 deletions
diff --git a/amiga/agclass/amigaguide_class.c b/amiga/agclass/amigaguide_class.c
index 8d8160dcc..e0f6600ef 100644
--- a/amiga/agclass/amigaguide_class.c
+++ b/amiga/agclass/amigaguide_class.c
@@ -4,8 +4,7 @@
* by Daniel "Trixie" Jedlicka
*/
-#undef __USE_INLINE__
-
+#include "amiga/os3support.h"
#include "amigaguide_class.h"
@@ -46,18 +45,22 @@ Class *initAGClass(void)
// Open amigaguide.library and its interface.
- if ( (AmigaGuideBase = IExec->OpenLibrary("amigaguide.library", 52)) )
+ if ( (AmigaGuideBase = OpenLibrary("amigaguide.library", 52)) )
{
- if ( (IAmigaGuide = (struct AmigaGuideIFace *)IExec->GetInterface(AmigaGuideBase, "main", 1L, NULL)) )
+#ifdef __amigaos4__
+ if ( (IAmigaGuide = (struct AmigaGuideIFace *)GetInterface(AmigaGuideBase, "main", 1L, NULL)) )
{
- if ( (cl = IIntuition->MakeClass(NULL, "rootclass", NULL, sizeof(struct localObjectData), 0)) )
+#endif
+ if ( (cl = MakeClass(NULL, "rootclass", NULL, sizeof(struct localObjectData), 0)) )
{
cl->cl_Dispatcher.h_Entry = (HOOKFUNC)dispatchAGClass;
- IIntuition->AddClass(cl);
+ AddClass(cl);
}
else freeAGClass(NULL);
+#ifdef __amigaos4__
}
else freeAGClass(NULL);
+#endif
}
return cl;
@@ -72,9 +75,11 @@ BOOL freeAGClass(Class *cl)
// Close amigaguide.library and free the class.
- if (IAmigaGuide) IExec->DropInterface((struct Interface *)IAmigaGuide);
- if (AmigaGuideBase) IExec->CloseLibrary(AmigaGuideBase);
- if (cl) retVal = IIntuition->FreeClass(cl);
+#ifdef __amigaos4__
+ if (IAmigaGuide) DropInterface((struct Interface *)IAmigaGuide);
+#endif
+ if (AmigaGuideBase) CloseLibrary(AmigaGuideBase);
+ if (cl) retVal = FreeClass(cl);
return retVal;
}
@@ -112,7 +117,7 @@ static uint32 dispatchAGClass(Class *cl, Object *o, Msg msg)
return agm_process(cl, o, msg);
default:
- return IIntuition->IDoSuperMethodA(cl, o, msg);
+ return IDoSuperMethodA(cl, o, msg);
}
}
@@ -126,7 +131,7 @@ uint32 om_new(Class *cl, Object *o, struct opSet *msg)
uint32 retVal = 0L;
- if ( (retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg)) )
+ if ( (retVal = IDoSuperMethodA(cl, o, (Msg)msg)) )
{
// Obtain pointer to our object's local instance data.
if ( (lod = (struct localObjectData *)INST_DATA(cl, retVal)) )
@@ -161,7 +166,7 @@ uint32 om_dispose(Class *cl, Object *o, Msg msg)
agm_close(cl, o, msg);
// Let superclass dispose of the object.
- return IIntuition->IDoSuperMethodA(cl, o, msg);
+ return IDoSuperMethodA(cl, o, msg);
}
@@ -176,7 +181,7 @@ uint32 om_set(Class *cl, Object *o, struct opSet *msg)
uint32 retVal = 0L;
- while ((ti = IUtility->NextTagItem (&tags)))
+ while ((ti = NextTagItem (&tags)))
{
switch (ti->ti_Tag)
{
@@ -267,7 +272,7 @@ uint32 om_get(Class *cl, Object *o, struct opGet *msg)
break;
default:
- retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg);
+ retVal = IDoSuperMethodA(cl, o, (Msg)msg);
}
return retVal;
@@ -289,15 +294,15 @@ uint32 agm_open(Class *cl, Object *o, Msg msg)
if ( lod->agHandle ) agm_close(cl, o, msg);
// (Re)establish the AmigaGuide context and open the database asynchronously.
- if ( (lod->agHandle = IAmigaGuide->OpenAmigaGuideAsync(&(lod->nag), NULL)) )
+ if ( (lod->agHandle = OpenAmigaGuideAsync(&(lod->nag), NULL)) )
{
- if ( (lod->agSignal = IAmigaGuide->AmigaGuideSignal(lod->agHandle)) )
+ if ( (lod->agSignal = AmigaGuideSignal(lod->agHandle)) )
{
// Wait until the database is displayed and ready.
- IExec->Wait(lod->agSignal);
+ Wait(lod->agSignal);
while ( agActive == FALSE )
{
- while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) )
+ while ( (lod->agm = GetAmigaGuideMsg(lod->agHandle)) )
{
// The AmigaGuide process started OK.
if ( lod->agm->agm_Type == ActiveToolID ) agActive = TRUE;
@@ -305,19 +310,19 @@ uint32 agm_open(Class *cl, Object *o, Msg msg)
// Opening the guide file failed for some reason, continue as usual.
if ( lod->agm->agm_Type == ToolStatusID && lod->agm->agm_Pri_Ret ) agActive = TRUE;
- IAmigaGuide->ReplyAmigaGuideMsg(lod->agm);
+ ReplyAmigaGuideMsg(lod->agm);
}
}
if ( lod->nag.nag_Context )
{
// A context node array is provided = open the current context node.
- IAmigaGuide->SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL);
- retVal = IAmigaGuide->SendAmigaGuideContext(lod->agHandle, NULL);
+ SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL);
+ retVal = SendAmigaGuideContext(lod->agHandle, NULL);
}
else
{
// No context array is provided = open the main node.
- retVal = IAmigaGuide->SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE);
+ retVal = SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE);
}
}
}
@@ -338,7 +343,7 @@ uint32 agm_close(Class *cl, Object *o, Msg msg)
if ( lod->agHandle )
{
- IAmigaGuide->CloseAmigaGuide(lod->agHandle);
+ CloseAmigaGuide(lod->agHandle);
lod->agHandle = NULL;
lod->agSignal = 0;
retVal = 1L;
@@ -361,7 +366,7 @@ uint32 agm_process(Class *cl, Object *o, Msg msg)
if (lod->agHandle)
{
- while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) )
+ while ( (lod->agm = GetAmigaGuideMsg(lod->agHandle)) )
{
switch (lod->agm->agm_Type)
{
@@ -374,7 +379,7 @@ uint32 agm_process(Class *cl, Object *o, Msg msg)
//printf("%d\n", lod->agm->agm_Type);
break;
}
- IAmigaGuide->ReplyAmigaGuideMsg(lod->agm);
+ ReplyAmigaGuideMsg(lod->agm);
}
}
diff --git a/amiga/arexx.c b/amiga/arexx.c
index 35cdfb028..eb2a6c10a 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -16,7 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+#include <stdlib.h>
#include <string.h>
#include <math.h>
@@ -32,11 +34,11 @@
#include "desktop/gui_window.h"
#include "desktop/version.h"
-#include "amiga/os3support.h"
#include "amiga/arexx.h"
#include "amiga/download.h"
#include "amiga/gui.h"
#include "amiga/hotlist.h"
+#include "amiga/misc.h"
#include "amiga/theme.h"
extern const char * const verarexx;
@@ -238,7 +240,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
{
if(!gw) return;
- dln = AllocVecTags(sizeof(struct dlnode), AVT_ClearWithValue, 0, TAG_DONE);
+ dln = ami_misc_allocvec_clear(sizeof(struct dlnode), 0);
dln->filename = strdup((char *)cmd->ac_ArgList[3]);
dln->node.ln_Name = strdup((char *)cmd->ac_ArgList[0]);
dln->node.ln_Type = NT_USER;
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 90f89e9d3..e7bd72ce4 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -40,6 +40,7 @@
#include "amiga/gui.h"
#include "amiga/bitmap.h"
#include "amiga/download.h"
+#include "amiga/misc.h"
/**
* Create a bitmap.
@@ -54,13 +55,10 @@ void *bitmap_create(int width, int height, unsigned int state)
{
struct bitmap *bitmap;
- bitmap = AllocVecTags(sizeof(struct bitmap), AVT_ClearWithValue, 0, TAG_DONE);
+ bitmap = ami_misc_allocvec_clear(sizeof(struct bitmap), 0);
if(bitmap)
{
- bitmap->pixdata = AllocVecTags(width*height*4,
- AVT_Type,MEMF_PRIVATE,
- AVT_ClearWithValue,0xff,
- TAG_DONE);
+ bitmap->pixdata = ami_misc_allocvec_clear(width*height*4, 0xff);
bitmap->width = width;
bitmap->height = height;
@@ -378,7 +376,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
bm_format, bitmap_get_rowstride(bm), 0, 0,
bmh->bmh_Width, bmh->bmh_Height);
#ifndef __amigaos4__
- ami_bitmap_argb_to_rgba(bitmap);
+ ami_bitmap_argb_to_rgba(bm);
#endif
bitmap_set_opaque(bm, bitmap_test_opaque(bm));
}
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index a14a7b7ad..c95a9a3a6 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -42,6 +42,7 @@
#include "amiga/iff_cset.h"
#include "amiga/iff_dr2d.h"
#include "amiga/menu.h"
+#include "amiga/misc.h"
#include "amiga/utf8.h"
#define ID_UTF8 MAKE_ID('U','T','F','8')
@@ -110,10 +111,10 @@ static char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codese
case 0:
if(ci_new) {
- ci_next->ci_Next = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE);
+ ci_next->ci_Next = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0);
ci_next = ci_next->ci_Next;
} else {
- ci_new = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE);
+ ci_new = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0);
ci_next = ci_new;
}
@@ -124,10 +125,10 @@ static char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codese
default:
if(ci_new) {
- ci_next->ci_Next = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE);
+ ci_next->ci_Next = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0);
ci_next = ci_next->ci_Next;
} else {
- ci_new = AllocVecTags(sizeof(struct CollectionItem), AVT_ClearWithValue, 0, TAG_DONE);
+ ci_new = ami_misc_allocvec_clear(sizeof(struct CollectionItem), 0);
ci_next = ci_new;
}
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 500f1895a..b74affb11 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -1313,6 +1313,9 @@ void gui_create_form_select_menu(struct gui_window *g,
#else
+#include <proto/dos.h>
+#include "amiga/context_menu.h"
+
void ami_context_menu_init(void)
{
}
@@ -1330,8 +1333,8 @@ void ami_context_menu_show(struct gui_window_2 *gwin, int x, int y)
{
}
-void gui_create_form_select_menu(struct gui_window *g,
- struct form_control *control)
+void gui_create_form_select_menu(struct gui_window *g, struct form_control *control)
{
}
#endif
+
diff --git a/amiga/context_menu.h b/amiga/context_menu.h
index e3d66edef..5697b5611 100755
--- a/amiga/context_menu.h
+++ b/amiga/context_menu.h
@@ -20,6 +20,9 @@
#define AMIGA_CONTEXT_MENU_H
struct tree;
+struct gui_window;
+struct gui_window_2;
+struct form_control;
void ami_context_menu_init(void);
void ami_context_menu_free(void);
@@ -29,3 +32,4 @@ void ami_context_menu_show(struct gui_window_2 *gwin, int x, int y);
void gui_create_form_select_menu(struct gui_window *g, struct form_control *control);
#endif
+
diff --git a/amiga/download.c b/amiga/download.c
index 1c49629e7..e9d1a71f2 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -98,7 +98,7 @@ static struct gui_download_window *gui_download_window_create(download_context *
char *dl_filename = ami_utf8_easy(download_context_get_filename(ctx));
APTR va[3];
- dw = AllocVecTags(sizeof(struct gui_download_window), AVT_ClearWithValue, 0, TAG_DONE);
+ dw = ami_misc_allocvec_clear(sizeof(struct gui_download_window), 0);
if(gui && (!IsListEmpty(&gui->dllist)) && (dw->dln = (struct dlnode *)FindName(&gui->dllist,url)))
{
diff --git a/amiga/drag.c b/amiga/drag.c
index b40bbd65c..924deed4f 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+#ifdef __amigaos4__
#include <string.h>
#include <proto/wb.h>
@@ -26,9 +26,7 @@
#include <proto/icon.h>
#include <proto/layers.h>
-#ifdef __amigaos4__
#include <graphics/blitattr.h>
-#endif
#include <workbench/icon.h>
#include "utils/errors.h"
@@ -36,10 +34,8 @@
#include "utils/messages.h"
#include "utils/utils.h"
#include "utils/nsoption.h"
-#include "desktop/browser.h"
#include "content/hlcache.h"
#include "desktop/mouse.h"
-#include "desktop/gui_window.h"
#include "amiga/bitmap.h"
#include "amiga/clipboard.h"
@@ -315,3 +311,43 @@ void *ami_window_at_pointer(int type)
if(layer) return ami_find_gwin_by_id(layer->Window, type);
else return NULL;
}
+
+#else
+#include "amiga/drag.h"
+
+void gui_drag_save_object(struct gui_window *g, struct hlcache_handle *c,
+ gui_save_type type)
+{
+}
+
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
+{
+}
+
+void ami_drag_save(struct Window *win)
+{
+}
+
+void ami_drag_icon_show(struct Window *win, const char *type)
+{
+}
+
+void ami_drag_icon_close(struct Window *win)
+{
+}
+
+void ami_drag_icon_move(void)
+{
+}
+
+BOOL ami_drag_in_progress(void)
+{
+ return FALSE;
+}
+
+void *ami_window_at_pointer(int type)
+{
+ return NULL;
+}
+#endif
+
diff --git a/amiga/drag.h b/amiga/drag.h
index 35f2754ee..59a1a8467 100644
--- a/amiga/drag.h
+++ b/amiga/drag.h
@@ -18,9 +18,15 @@
#ifndef AMIGA_DRAG_H
#define AMIGA_DRAG_H
+#include <exec/types.h>
+#include "desktop/browser.h"
+#include "desktop/gui_window.h"
#define AMI_DRAG_THRESHOLD 10
+struct hlcache_handle;
+struct Window;
+
int drag_save;
void *drag_save_data;
struct gui_window *drag_save_gui;
@@ -36,3 +42,4 @@ BOOL ami_drag_in_progress(void);
void *ami_window_at_pointer(int type);
#endif
+
diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c
index a76966dc9..f69af31b9 100644
--- a/amiga/dt_anim.c
+++ b/amiga/dt_anim.c
@@ -21,8 +21,11 @@
*/
#ifdef WITH_AMIGA_DATATYPES
+#include "amiga/os3support.h"
+
#include "amiga/filetype.h"
#include "amiga/datatypes.h"
+#include "amiga/misc.h"
#include "amiga/plotters.h"
#include "content/content_protected.h"
#include "desktop/plotters.h"
@@ -36,7 +39,9 @@
#include <proto/intuition.h>
#include <datatypes/animationclass.h>
#include <datatypes/pictureclass.h>
+#ifdef __amigaos4__
#include <graphics/blitattr.h>
+#endif
#include <intuition/classusr.h>
typedef struct amiga_dt_anim_content {
@@ -192,7 +197,7 @@ bool amiga_dt_anim_convert(struct content *c)
IDoMethodA(plugin->dto, (Msg)&adt_frame);
clut = ami_colormap_to_clut(adt_frame.alf_CMap);
-
+#ifdef __amigaos4__
BltBitMapTags(
BLITA_Width, width,
BLITA_Height, height,
@@ -203,7 +208,9 @@ bool amiga_dt_anim_convert(struct content *c)
BLITA_DestBytesPerRow, width,
BLITA_CLUT, clut,
TAG_DONE);
-
+#else
+#warning FIXME: Need to use a different blitter function for OS3!
+#endif
FreeVec(clut);
adt_frame.MethodID = ADTM_UNLOADFRAME;
@@ -332,7 +339,7 @@ content_type amiga_dt_anim_content_type(void)
APTR ami_colormap_to_clut(struct ColorMap *cmap)
{
int i;
- UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */
+ UBYTE *clut = ami_misc_allocvec_clear(256 * 4, 0); /* NB: Was not MEMF_PRIVATE */
ULONG colr[256 * 4];
if(!clut) return NULL;
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 38bb46311..a31c3501c 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -21,6 +21,9 @@
*/
#ifdef WITH_AMIGA_DATATYPES
+#include "amiga/os3support.h"
+
+#include "amiga/bitmap.h"
#include "amiga/filetype.h"
#include "amiga/datatypes.h"
#include "content/content_protected.h"
diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c
index 93933bce5..2823178e2 100644
--- a/amiga/dt_sound.c
+++ b/amiga/dt_sound.c
@@ -21,6 +21,8 @@
*/
#ifdef WITH_AMIGA_DATATYPES
+#include "amiga/os3support.h"
+
#include "amiga/filetype.h"
#include "amiga/datatypes.h"
#include "content/content_protected.h"
diff --git a/amiga/file.c b/amiga/file.c
index 80e5d84b1..e191ae190 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -217,7 +217,7 @@ void ami_file_save(int type, char *fname, struct Window *win,
void ami_file_save_req(int type, struct gui_window_2 *gwin,
struct hlcache_handle *object)
{
- char *fname = AllocVecTags(1024, NULL);
+ char *fname = AllocVecTagList(1024, NULL);
char *initial_fname = NULL;
if(object) {
diff --git a/amiga/filetype.c b/amiga/filetype.c
index 67b60ab07..b37ebe58d 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -16,9 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <stdlib.h>
#include <string.h>
#include "amiga/filetype.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "content/fetch.h"
#include "content/content.h"
@@ -201,7 +204,7 @@ nserror ami_mime_init(const char *mimefile)
if(ReadArgs(template, rarray, rargs))
{
node = AddObject(ami_mime_list, AMINS_MIME);
- mimeentry = AllocVecTags(sizeof(struct ami_mime_entry), AVT_ClearWithValue, 0, TAG_DONE);
+ mimeentry = ami_misc_allocvec_clear(sizeof(struct ami_mime_entry), 0);
node->objstruct = mimeentry;
if(rarray[AMI_MIME_MIMETYPE])
@@ -351,7 +354,7 @@ static APTR ami_mime_guess_add_datatype(struct DataType *dt, lwc_string **lwc_mi
char *p;
node = AddObject(ami_mime_list, AMINS_MIME);
- mimeentry = AllocVecTags(sizeof(struct ami_mime_entry), AVT_ClearWithValue, 0, TAG_DONE);
+ mimeentry = ami_misc_allocvec_clear(sizeof(struct ami_mime_entry), 0);
node->objstruct = mimeentry;
lerror = lwc_intern_string(dth->dth_Name, strlen(dth->dth_Name), &mimeentry->datatype);
diff --git a/amiga/font_scan.h b/amiga/font_scan.h
index d29469742..69361557f 100755
--- a/amiga/font_scan.h
+++ b/amiga/font_scan.h
@@ -18,7 +18,7 @@
#ifndef AMIGA_FONT_SCAN_H
#define AMIGA_FONT_SCAN_H
-
+#include "amiga/os3support.h"
#include <libwapcaplet/libwapcaplet.h>
void ami_font_scan_init(const char *filename, bool force_scan, bool save,
diff --git a/amiga/misc.c b/amiga/misc.c
index 2f2f93eb8..0cd3baedd 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -34,6 +34,19 @@
#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_CLEAR);
+ if (mem && (value != 0)) {
+ memset(mem, value, size);
+ }
+ return mem;
+#endif
+}
+
static LONG ami_misc_req(const char *message, uint32 type)
{
LONG ret = 0;
diff --git a/amiga/misc.h b/amiga/misc.h
index 33313036f..66a6f1d11 100644
--- a/amiga/misc.h
+++ b/amiga/misc.h
@@ -23,6 +23,7 @@
extern struct gui_file_table *amiga_file_table;
struct Window;
+void *ami_misc_allocvec_clear(int size, UBYTE value);
char *translate_escape_chars(const char *s);
void ami_misc_fatal_error(const char *message);
int32 ami_warn_user_multi(const char *body,
diff --git a/amiga/os3support.c b/amiga/os3support.c
index e020d0420..613701cc5 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -160,4 +160,16 @@ char *ASPrintf(const char *fmt, ...)
return rbuf;
}
+/* C */
+char *strlwr(char *str)
+{
+ size_t i;
+ size_t len = strlen(str);
+
+ for(i=0; i<len; i++)
+ str[i] = tolower((unsigned char)str[i]);
+
+ return str;
+}
#endif
+
diff --git a/amiga/os3support.h b/amiga/os3support.h
index b2b09c0df..9a25197e9 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -36,6 +36,9 @@
#include <exec/memory.h>
#endif
+/* Macros */
+#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
+
/* Define extra memory type flags */
#define MEMF_PRIVATE MEMF_ANY
#define MEMF_SHARED MEMF_ANY
@@ -43,25 +46,33 @@
/* Ignore tags that aren't supported */
#define PDTA_PromoteMask TAG_IGNORE
+/* Renamed structures */
+#define AnchorPathOld AnchorPath
+
/* Easy compat macros */
/* application */
#define Notify(...) (void)0;
/* Exec */
/* AllocVecTagList with no tags */
-#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY);
-#define GetSucc(N) (N)->ln_Succ;
+#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY)
+#define GetSucc(N) (N)->ln_Succ
/* diskfont */
/* Only used in one place we haven't ifdeffed, where it returns the charset name */
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
/* DOS */
-#define FOpen(A,B,C) Open(A,B);
-#define FClose(A) Close(A);
+#define FOpen(A,B,C) Open(A,B)
+#define FClose(A) Close(A)
/* Intuition */
#define IDoMethod DoMethod
+#define IDoMethodA DoMethodA
+#define IDoSuperMethodA DoSuperMethodA
+#define RefreshSetGadgetAttrs SetGadgetAttrs /*\todo This isn't quite right */
+/* Utility */
+#define SetMem memset
/* Integral type definitions */
typedef int8_t int8;
@@ -115,6 +126,9 @@ struct Node *GetHead(struct List *list);
/* Utility */
char *ASPrintf(const char *fmt, ...);
-#endif
+/* C */
+char *strlwr(char *str);
+#endif
#endif
+