From efb3ff51bf8ee99f94b26529b5162a91c4fa94a0 Mon Sep 17 00:00:00 2001 From: mazze Date: Sun, 2 Dec 2007 00:50:46 +0000 Subject: [PATCH] First attempt of AROS port of openurl.library. git-svn-id: https://svn.aros.org:8080/svn/aros/trunk/AROS@27344 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/openurl/Cmd/SmartReadArgs.c | 8 +- workbench/libs/openurl/Cmd/debug.h | 13 +- workbench/libs/openurl/Cmd/mmakefile.src | 19 +++ workbench/libs/openurl/LEGAL | 1 + workbench/libs/openurl/include/aros/macros.h | 88 ++++++++++++ workbench/libs/openurl/library/api.c | 185 ++++++++++++++++++++++++-- workbench/libs/openurl/library/base.h | 4 + workbench/libs/openurl/library/init.c | 2 + workbench/libs/openurl/library/lib.h | 6 +- workbench/libs/openurl/library/lib_protos.h | 8 +- workbench/libs/openurl/library/libinit-aros.c | 62 +++++++++ workbench/libs/openurl/library/mmakefile.src | 38 ++++++ workbench/libs/openurl/library/openurl.conf | 30 +++++ workbench/libs/openurl/library/utils.c | 2 +- 14 files changed, 448 insertions(+), 18 deletions(-) create mode 100644 workbench/libs/openurl/Cmd/mmakefile.src create mode 100644 workbench/libs/openurl/LEGAL create mode 100644 workbench/libs/openurl/include/aros/macros.h create mode 100644 workbench/libs/openurl/library/libinit-aros.c create mode 100644 workbench/libs/openurl/library/mmakefile.src create mode 100644 workbench/libs/openurl/library/openurl.conf diff --git a/workbench/libs/openurl/Cmd/SmartReadArgs.c b/workbench/libs/openurl/Cmd/SmartReadArgs.c index e3fce4ace..3ddeb1d3c 100755 --- a/workbench/libs/openurl/Cmd/SmartReadArgs.c +++ b/workbench/libs/openurl/Cmd/SmartReadArgs.c @@ -93,9 +93,13 @@ /* --------------------------- library bases ------------------------------ */ extern struct Library *IconBase; +#ifdef __AROS__ +extern struct UtilityBase *UtilityBase; +#else extern struct Library *UtilityBase; +#endif -#if defined(__GNUC__) && !defined(__amigaos4__) +#if defined(__GNUC__) && !defined(__amigaos4__) && !defined(__AROS__) extern struct WBStartup *_WBenchMsg; #endif @@ -265,7 +269,7 @@ int main(int argc, STRPTR argv[]) /* Obtain WBStartup; depends on your compiler environment */ struct WBStartup *wb_startup = NULL; -#if defined(__GNUC__) && !defined(__amigaos4__) +#if defined(__GNUC__) && !defined(__amigaos4__) && !defined(__AROS__) wb_startup = _WBenchMsg; #else if (argc == 0) diff --git a/workbench/libs/openurl/Cmd/debug.h b/workbench/libs/openurl/Cmd/debug.h index b17ccec20..ea953572b 100755 --- a/workbench/libs/openurl/Cmd/debug.h +++ b/workbench/libs/openurl/Cmd/debug.h @@ -1,5 +1,16 @@ /* Debuggin defines used by SmartReadArgs */ +#ifdef __AROS__ + +#ifdef DEBUG_CODE +#define DEBUG 1 +#endif /* DEBUG_CODE */ + +#define DEBUG 1 +#include + +#else /* __AROS__ */ + #ifdef __GNUC__ /* Debug output goes to stdout for GCC as debug.lib doesn't seem to be * included in Geek Gadgets' distribution */ @@ -18,4 +29,4 @@ extern void kprintf(char *fmt,...); #define D(x) #endif - +#endif /* __AROS__ */ diff --git a/workbench/libs/openurl/Cmd/mmakefile.src b/workbench/libs/openurl/Cmd/mmakefile.src new file mode 100644 index 000000000..db5ff89aa --- /dev/null +++ b/workbench/libs/openurl/Cmd/mmakefile.src @@ -0,0 +1,19 @@ +# $Id$ +# +# Makefile for the OpenURL command of openurl.library + +include $(TOP)/config/make.cfg + +#MM- workbench-libs-openurl : workbench-libs-openurl-cmd + +#MM workbench-libs-openurl-cmd : includes linklibs workbench-libs-openurl-lib + +EXE := OpenURL +EXEDIR := $(AROS_C) +FILES := OpenURL SmartReadArgs + +%build_prog mmake=workbench-libs-openurl-cmd \ + progname=$(EXE) files=$(FILES) \ + targetdir=$(EXEDIR) uselibs="amiga openurl" + +%common diff --git a/workbench/libs/openurl/LEGAL b/workbench/libs/openurl/LEGAL new file mode 100644 index 000000000..1d9572b9e --- /dev/null +++ b/workbench/libs/openurl/LEGAL @@ -0,0 +1 @@ +openurl is released as "Public Domain" \ No newline at end of file diff --git a/workbench/libs/openurl/include/aros/macros.h b/workbench/libs/openurl/include/aros/macros.h new file mode 100644 index 000000000..10f642c01 --- /dev/null +++ b/workbench/libs/openurl/include/aros/macros.h @@ -0,0 +1,88 @@ + +#ifndef _MACROS_H +#define _MACROS_H + +/****************************************************************************/ + +#define SAVEDS +#define ASM +#define REGARGS +#define STDARGS +#define INLINE inline +#define VARARGS68k __stackparm +//#define REG(x,p) p +//#define LIBCALL + +#define M_DISP(n) static ULONG _##n(void) +#define M_DISPSTART \ + struct IClass *cl = (struct IClass *)REG_A0; \ + Object *obj = (Object *)REG_A2; \ + Msg msg = (Msg)REG_A1; +#define M_DISPEND(n) static struct EmulLibEntry n = {TRAP_LIB,0,(void *)_##n}; +#define DISP(n) ((APTR)&n) + +#undef NODE +#define NODE(a) ((struct Node *)(a)) + +#undef MINNODE +#define MINNODE(a) ((struct MinNode *)(a)) + +#undef LIST +#define LIST(a) ((struct List *)(a)) + +#undef MINLIST +#define MINLIST(a) ((struct MinList *)(a)) + +#undef MESSAGE +#define MESSAGE(m) ((struct Message *)(m)) + +#undef NEWLIST +#define NEWLIST(l) (LIST(l)->lh_Head = NODE(&LIST(l)->lh_Tail), \ + LIST(l)->lh_Tail = NULL, \ + LIST(l)->lh_TailPred = NODE(&LIST(l)->lh_Head)) + +#undef QUICKNEWLIST +#define QUICKNEWLIST(l) (LIST(l)->lh_Head = NODE(&LIST(l)->lh_Tail), \ + LIST(l)->lh_TailPred = NODE(&LIST(l)->lh_Head)) + +#undef ADDTAIL +#define ADDTAIL(l,n) AddTail(LIST(l),NODE(n)) + +#undef PORT +#define PORT(p) ((struct MsgPort *)(p)) + +#undef INITPORT +#define INITPORT(p,s) (PORT(p)->mp_Flags = PA_SIGNAL, \ + PORT(p)->mp_SigBit = (UBYTE)(s), \ + PORT(p)->mp_SigTask = FindTask(NULL), \ + NEWLIST(&(PORT(p)->mp_MsgList))) + +#undef QUICKINITPORT +#define QUICKINITPORT(p,s,t) (PORT(p)->mp_Flags = PA_SIGNAL, \ + PORT(p)->mp_SigBit = (UBYTE)(s), \ + PORT(p)->mp_SigTask = (t), \ + QUICKNEWLIST(&(PORT(p)->mp_MsgList))) + +#undef INITMESSAGE +#define INITMESSAGE(m,p,l) (MESSAGE(m)->mn_Node.ln_Type = NT_MESSAGE, \ + MESSAGE(m)->mn_ReplyPort = PORT(p), \ + MESSAGE(m)->mn_Length = ((UWORD)l)) + +#undef MAKE_ID +#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) + +#undef MIN +#define MIN(a,b) ((ab) ? (a) : (b)) + +#undef ABS +#define ABS(a) (((a)>0) ? (a) : -(a)) + +#undef BOOLSAME +#define BOOLSAME(a,b) (((a) ? TRUE : FALSE)==((b) ? TRUE : FALSE)) + +/****************************************************************************/ + +#endif /* _MACROS_H */ diff --git a/workbench/libs/openurl/library/api.c b/workbench/libs/openurl/library/api.c index 16f0d425e..4a37c17d1 100755 --- a/workbench/libs/openurl/library/api.c +++ b/workbench/libs/openurl/library/api.c @@ -16,11 +16,27 @@ #include "openurl.library_rev.h" #include +#ifdef __AROS__ +// MAXRMARG doesn't exist in AROS's headers +// The value 15 comes from the AOS3.9 SDK +#define MAXRMARG (15) +#endif + /**************************************************************************/ +#ifdef __AROS__ +AROS_LH2(ULONG, URL_OpenA, + AROS_LHA(STRPTR, URL, A0), + AROS_LHA(struct TagItem *, attrs, A1), + struct Library *, library, 5, Openurl +) +{ + AROS_LIBFUNC_INIT +#else ULONG LIBCALL URL_OpenA(REG(a0,UBYTE *URL),REG(a1,struct TagItem *attrs)) { +#endif struct List portList; UBYTE buf[256], *fullURL = NULL, *pubScreenName; ULONG res, show, toFront, newWindow, launch, httpPrepend = FALSE; @@ -93,13 +109,26 @@ done: if (httpPrepend && fullURL && fullURL!=buf) freeVecPooled(fullURL); return res; + +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH1(struct URL_Prefs *, URL_GetPrefsA, + AROS_LHA(struct TagItem *, attrs, A0), + struct Library *, library, 12, Openurl +) +{ + AROS_LIBFUNC_INIT +#else struct URL_Prefs * LIBCALL URL_GetPrefsA(REG(a0,struct TagItem *attrs)) { +#endif struct URL_Prefs *p; ULONG mode; @@ -144,21 +173,45 @@ URL_GetPrefsA(REG(a0,struct TagItem *attrs)) ReleaseSemaphore(&lib_prefsSem); return p; +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH0(struct URL_Prefs *, URL_OldGetPrefs, + struct Library *, library, 6, Openurl +) +{ + AROS_LIBFUNC_INIT +#else struct URL_Prefs * LIBCALL URL_OldGetPrefs(void) { +#endif return URL_GetPrefsA(NULL); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH2(VOID, URL_FreePrefsA, + AROS_LHA(struct URL_Prefs *, p, A0), + AROS_LHA(struct TagItem *, attrs, A1), + struct Library *, library, 13, Openurl +) +{ + AROS_LIBFUNC_INIT +#else void LIBCALL URL_FreePrefsA(REG(a0,struct URL_Prefs *p),REG(a1,struct TagItem *attrs)) { +#endif if (p) { freeList((struct List *)&p->up_BrowserList,sizeof(struct URL_BrowserNode)); @@ -166,21 +219,46 @@ URL_FreePrefsA(REG(a0,struct URL_Prefs *p),REG(a1,struct TagItem *attrs)) freeList((struct List *)&p->up_FTPList,sizeof(struct URL_FTPNode)); freePooled(p,sizeof(*p)); } +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH1(VOID, URL_OldFreePrefs, + AROS_LHA(struct URL_Prefs *, p, A0), + struct Library *, library, 7, Openurl +) +{ + AROS_LIBFUNC_INIT +#else void LIBCALL URL_OldFreePrefs(REG(a0,struct URL_Prefs *p)) { +#endif URL_FreePrefsA(p,NULL); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH2(ULONG, URL_SetPrefsA, + AROS_LHA(struct URL_Prefs *, p, A0), + AROS_LHA(struct TagItem *, attrs, A1), + struct Library *, library, 14, Openurl +) +{ + AROS_LIBFUNC_INIT +#else ULONG LIBCALL URL_SetPrefsA(REG(a0,struct URL_Prefs *p),REG(a1,struct TagItem *attrs)) { +#endif ULONG res = FALSE; if (p->up_Version==PREFS_VERSION) @@ -189,7 +267,7 @@ URL_SetPrefsA(REG(a0,struct URL_Prefs *p),REG(a1,struct TagItem *attrs)) ObtainSemaphore(&lib_prefsSem); - if (newp = copyPrefs(p)) + if ((newp = copyPrefs(p))) { newp->up_Version = PREFS_VERSION; newp->up_Flags &= ~UPF_ISDEFAULTS; @@ -197,7 +275,7 @@ URL_SetPrefsA(REG(a0,struct URL_Prefs *p),REG(a1,struct TagItem *attrs)) URL_FreePrefsA(lib_prefs,NULL); lib_prefs = newp; - if (res = savePrefs(DEF_ENV,lib_prefs)) + if ((res = savePrefs(DEF_ENV,lib_prefs))) { if (GetTagData(URL_SetPrefs_Save,FALSE,attrs)) { @@ -210,52 +288,88 @@ URL_SetPrefsA(REG(a0,struct URL_Prefs *p),REG(a1,struct TagItem *attrs)) } return res; +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH2(ULONG, URL_OldSetPrefs, + AROS_LHA(struct URL_Prefs *, p, A0), + AROS_LHA(BOOL, save, D0), + struct Library *, library, 8, Openurl +) +{ + AROS_LIBFUNC_INIT +#else ULONG LIBCALL URL_OldSetPrefs(REG(a0,struct URL_Prefs *p),REG(d0,ULONG save)) { - struct TagItem stags[] = {URL_SetPrefs_Save,0,TAG_DONE}; +#endif + struct TagItem stags[] = { {URL_SetPrefs_Save,0} , {TAG_DONE} }; stags[0].ti_Data = save; return URL_SetPrefsA(p,stags); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH0(struct URL_Prefs *, URL_OldGetDefaultPrefs, + struct Library *, library, 9, Openurl +) +{ + AROS_LIBFUNC_INIT +#else struct URL_Prefs * LIBCALL URL_OldGetDefaultPrefs(void) { - struct TagItem gtags[] = {URL_GetPrefs_Mode,URL_GetPrefs_Mode_Default,TAG_DONE}; +#endif + struct TagItem gtags[] = { {URL_GetPrefs_Mode,URL_GetPrefs_Mode_Default} , {TAG_DONE} }; return URL_GetPrefsA(gtags); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH1(ULONG, URL_LaunchPrefsAppA, + AROS_LHA(struct TagItem *, tags, A0), + struct Library *, library, 15, Openurl +) +{ + AROS_LIBFUNC_INIT +#else ULONG LIBCALL URL_LaunchPrefsAppA(REG(a0,struct TagItem *attrs)) { +#endif BPTR in; - if (in = Open("NIL:",MODE_OLDFILE)) + if ((in = Open("NIL:",MODE_OLDFILE))) { BPTR out; - if (out = Open("NIL:",MODE_OLDFILE)) + if ((out = Open("NIL:",MODE_OLDFILE))) { UBYTE name[256]; - struct TagItem stags[] = {SYS_Input, 0, - SYS_Output, 0, - NP_StackSize, 16000, - SYS_Asynch, TRUE, + struct TagItem stags[] = {{SYS_Input, 0}, + {SYS_Output, 0}, + {NP_StackSize, 16000}, + {SYS_Asynch, TRUE}, #ifdef __MORPHOS__ - NP_PPCStackSize, 32000, + {NP_PPCStackSize, 32000}, #endif - TAG_DONE}; + {TAG_DONE}}; if (GetVar("OpenURL_Prefs_Path",name,sizeof(name),GVF_GLOBAL_ONLY)<=0) strcpy(name,"Sys:Prefs/OpenURL"); @@ -271,21 +385,45 @@ URL_LaunchPrefsAppA(REG(a0,struct TagItem *attrs)) } return FALSE; +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH0(ULONG, URL_OldLaunchPrefsApp, + struct Library *, library, 10, Openurl +) +{ + AROS_LIBFUNC_INIT +#else ULONG LIBCALL URL_OldLaunchPrefsApp(void) { +#endif return URL_LaunchPrefsAppA(NULL); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ +#ifdef __AROS__ +AROS_LH2(ULONG, URL_GetAttr, + AROS_LHA(ULONG, attr, D0), + AROS_LHA(ULONG *, storage, A0), + struct Library *, library, 16, Openurl +) +{ + AROS_LIBFUNC_INIT +#else ULONG LIBCALL URL_GetAttr(REG(d0,ULONG attr),REG(a0,ULONG *storage)) { +#endif switch (attr) { case URL_GetAttr_Version: *storage = VERSION; return TRUE; @@ -300,6 +438,9 @@ URL_GetAttr(REG(d0,ULONG attr),REG(a0,ULONG *storage)) default: return FALSE; } +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif } /**************************************************************************/ @@ -308,6 +449,11 @@ URL_GetAttr(REG(d0,ULONG attr),REG(a0,ULONG *storage)) LONG dispatch(void) { struct RexxMsg *msg = (struct RexxMsg *)REG_A0; +#elif defined(__AROS__) +// FIXME: implement me correctly +LONG dispatch(void) +{ + struct RexxMsg *msg = 0; #else LONG ASM SAVEDS dispatch(REG(a0,struct RexxMsg *msg),REG(a1,UBYTE **resPtr)) { @@ -364,6 +510,8 @@ LONG ASM SAVEDS dispatch(REG(a0,struct RexxMsg *msg),REG(a1,UBYTE **resPtr)) #ifdef __MORPHOS__ return (REG_A0 = (ULONG)CreateArgstring(res ? "1" : "0",1)) ? 0 : 3; +#elif defined(__AROS__) + return 0; // FIXME: implement me correctly #else return (*resPtr = CreateArgstring(res ? "1" : "0",1)) ? 0 : 3; #endif @@ -371,3 +519,16 @@ LONG ASM SAVEDS dispatch(REG(a0,struct RexxMsg *msg),REG(a1,UBYTE **resPtr)) /**************************************************************************/ +#ifdef __AROS__ +AROS_LH1(VOID, DoFunction, + AROS_LHA(STRPTR, rxmsg, A0), + struct Library *, library, 11, Openurl +) +{ + AROS_LIBFUNC_INIT +// FIXME: implement my correctly + AROS_LIBFUNC_EXIT +} +#endif + +/**************************************************************************/ diff --git a/workbench/libs/openurl/library/base.h b/workbench/libs/openurl/library/base.h index fc523382d..bb0746694 100755 --- a/workbench/libs/openurl/library/base.h +++ b/workbench/libs/openurl/library/base.h @@ -39,7 +39,11 @@ extern ULONG lib_revision; extern struct ExecBase *SysBase; extern struct DosLibrary *DOSBase; +#ifdef __AROS__ +extern struct UtilityBase *UtilityBase; +#else extern struct Library *UtilityBase; +#endif extern struct Library *IFFParseBase; extern struct RxsLib *RexxSysBase; diff --git a/workbench/libs/openurl/library/init.c b/workbench/libs/openurl/library/init.c index f51093952..3f244856f 100755 --- a/workbench/libs/openurl/library/init.c +++ b/workbench/libs/openurl/library/init.c @@ -65,11 +65,13 @@ freeBase(void) UtilityBase = NULL; } +#if defined(__amigaos4__) if( IDOS ) { DropInterface( (struct Interface*)IDOS ); IDOS = NULL; } +#endif if (DOSBase) { diff --git a/workbench/libs/openurl/library/lib.h b/workbench/libs/openurl/library/lib.h index 52c182270..a9be727c3 100755 --- a/workbench/libs/openurl/library/lib.h +++ b/workbench/libs/openurl/library/lib.h @@ -12,9 +12,10 @@ ** Ported to OS4 by Alexandre Balaban */ - +#ifndef __AROS__ #define __NOLIBBASE__ #define __USE_SYSBASE +#endif #include #include @@ -24,7 +25,9 @@ #include #include +#ifndef __AROS__ #include +#endif #include @@ -33,6 +36,7 @@ #include #include "base.h" + #include /**************************************************************************/ diff --git a/workbench/libs/openurl/library/lib_protos.h b/workbench/libs/openurl/library/lib_protos.h index 242cf4c01..94110dbfb 100755 --- a/workbench/libs/openurl/library/lib_protos.h +++ b/workbench/libs/openurl/library/lib_protos.h @@ -18,6 +18,9 @@ void freeBase ( void ); ULONG initBase ( void ); /* api.c */ +#ifdef __AROS__ +#include +#else /* __AROS__ */ ULONG LIBCALL URL_OpenA ( REG (a0 ,UBYTE *URL ), REG (a1 ,struct TagItem *attrs )); struct URL_Prefs *LIBCALL URL_GetPrefsA ( REG (a0 ,struct TagItem *attrs )); struct URL_Prefs *LIBCALL URL_OldGetPrefs ( void ); @@ -34,6 +37,7 @@ LONG dispatch ( void ); #else LONG LIBCALL dispatch ( REG (a0 , struct RexxMsg *msg ) , REG (a1 , UBYTE **resPtr )); #endif +#endif /* __AROS__ */ #ifdef __MORPHOS__ /* morphos.c */ @@ -71,7 +75,7 @@ LONG VARARGS68K OS4_dispatch ( struct OpenURLIFace * Self, struct #endif /* handler.c */ -#ifdef __MORPHOS__ +#if defined(__MORPHOS__) || defined(__AROS__) void handler ( void ); #else void SAVEDS handler ( void ); @@ -100,6 +104,8 @@ void freeVecPooled ( APTR mem ); #define msprintf(to, fmt, ...) ({ ULONG _tags[] = { __VA_ARGS__ }; RawDoFmt(fmt, _tags, (void (*)(void)) 0, to); }) #elif defined(__amigaos4__) void VARARGS68K msprintf ( UBYTE *to , UBYTE *fmt , ...); +#elif defined(__AROS__) +#define msprintf __sprintf #else void STDARGS msprintf ( UBYTE *to , UBYTE *fmt , ...); #endif diff --git a/workbench/libs/openurl/library/libinit-aros.c b/workbench/libs/openurl/library/libinit-aros.c new file mode 100644 index 000000000..a71e7b9c6 --- /dev/null +++ b/workbench/libs/openurl/library/libinit-aros.c @@ -0,0 +1,62 @@ +#include "lib.h" +#include + +struct Library * OpenURLBase; + +struct RxsLib *RexxSysBase = NULL; +struct SignalSemaphore lib_sem; +struct SignalSemaphore lib_prefsSem; +struct SignalSemaphore lib_memSem; + +APTR lib_pool = NULL; +ULONG lib_use = 0; +ULONG lib_flags = 0; +struct URL_Prefs *lib_prefs = NULL; + +/****************************************************************************/ + +int LibInit(struct Library *base) +{ + BOOL success = FALSE; + + // Init global library base + OpenURLBase = base; + + InitSemaphore(&lib_sem); + InitSemaphore(&lib_prefsSem); + InitSemaphore(&lib_memSem); + + // protect access to initBase() + ObtainSemaphore(&lib_sem); + + success = initBase(); + + // unprotect initBase() + ReleaseSemaphore(&lib_sem); + + return success; +} + +/****************************************************************************/ + +int LibExpunge(struct Library *base) +{ + // free all our private data and stuff. + ObtainSemaphore(&lib_sem); + + freeBase(); + + // unprotect + ReleaseSemaphore(&lib_sem); + + OpenURLBase = NULL; + + return TRUE; +} + +/****************************************************************************/ + +ADD2INITLIB(LibInit, 0); +ADD2EXPUNGELIB(LibExpunge, 0); + +/***********************************************************************/ diff --git a/workbench/libs/openurl/library/mmakefile.src b/workbench/libs/openurl/library/mmakefile.src new file mode 100644 index 000000000..b49deb2b9 --- /dev/null +++ b/workbench/libs/openurl/library/mmakefile.src @@ -0,0 +1,38 @@ +# $Id$ + +# AROS metamakefile for openurl + +include $(TOP)/config/make.cfg + +FILES := \ + libinit-aros \ + init \ + api \ + handler \ + prefs \ + utils + +USER_INCLUDES := -I../include/aros + +#MM- workbench-libs-openurl : workbench-libs-openurl-lib + +#MM- workbench-libs-openurl-lib : linklibs + +#MM workbench-libs-openurl-lib-includes : \ +#MM kernel-exec-includes \ +#MM kernel-dos-includes \ +#MM kernel-utility-includes \ +#MM includes-copy + +%build_module mmake=workbench-libs-openurl-lib \ + modname=openurl modtype=library \ + files=$(FILES) \ + uselibs="amiga rom" + +#MM workbench-libs-openurl-clean : workbench-libs-openurl-lib-clean + +#MM +workbench-libs-openurl-clean : + $(RM) $(GENDIR)/workbench/libs/openurl + +%common diff --git a/workbench/libs/openurl/library/openurl.conf b/workbench/libs/openurl/library/openurl.conf new file mode 100644 index 000000000..9ebde734f --- /dev/null +++ b/workbench/libs/openurl/library/openurl.conf @@ -0,0 +1,30 @@ +##begin config +libbase OpenURLBase +version 7.2 +date 01.12.2005 +##end config + +##begin cdef +#include + +ULONG URL_Open(STRPTR, ...); +//struct URL_Prefs *URL_GetPrefs(...); +VOID URL_FreePrefs(struct URL_Prefs *,...); +ULONG URL_SetPrefs(struct URL_Prefs *,...); +//ULONG URL_LaunchPrefsApp(...); +##end cdef + +##begin functionlist +ULONG URL_OpenA(STRPTR URL, struct TagItem *attrs) (A0,A1) +struct URL_Prefs * URL_OldGetPrefs( ) ( ) +VOID URL_OldFreePrefs(struct URL_Prefs * p) (A0) +ULONG URL_OldSetPrefs(struct URL_Prefs * p, BOOL save) (A0,D0) +struct URL_Prefs * URL_OldGetDefaultPrefs() () +ULONG URL_OldLaunchPrefsApp() () +VOID DoFunction(STRPTR rxmsg) (A0) +struct URL_Prefs * URL_GetPrefsA(struct TagItem * attrs) (A0) +VOID URL_FreePrefsA(struct URL_Prefs * p, struct TagItem * attrs) (A0,A1) +ULONG URL_SetPrefsA(struct URL_Prefs * p, struct TagItem * attrs) (A0,A1) +ULONG URL_LaunchPrefsAppA(struct TagItem * tags) (A0) +ULONG URL_GetAttr(ULONG attr, ULONG * storage) (D0,A0) +##end functionlist diff --git a/workbench/libs/openurl/library/utils.c b/workbench/libs/openurl/library/utils.c index a0f35e0df..513d4540c 100755 --- a/workbench/libs/openurl/library/utils.c +++ b/workbench/libs/openurl/library/utils.c @@ -857,7 +857,7 @@ isdigits(UBYTE *str) /**************************************************************************/ -#if !defined(__MORPHOS__) && !defined(__amigaos4__) +#if !defined(__MORPHOS__) && !defined(__amigaos4__) && !defined(__AROS__) static UWORD fmtfunc[] = { 0x16c0, 0x4e75 }; void STDARGS msprintf(UBYTE *buf,UBYTE *fmt,...) -- 2.11.4.GIT