2 ** openurl.library - universal URL display and browser
5 ** AmigaOS4 68k Jump table - Provides jump table for old
8 ** Written by Alexandre Balaban <alexandre@balaban.name>
13 #if !defined(__amigaos4__)
14 # error This file is AmigaOS4 specific and should not be used on other platforms
17 // ABA, DON'T KNOW WHY, BUT SOMETHING SEEMS TO BE MESSED INTO OPENURL.H
18 #define URL_GetPrefs_Default URL_GetPrefs_Mode
20 #include <exec/emulation.h>
21 #include <libraries/openurl.h>
22 #include <interfaces/openurl.h>
24 /* amigaos4 *****************************************************************/
26 STATIC ULONG
stub_OpenPPC(ULONG
*regarray
)
28 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
29 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
30 struct LibraryManagerInterface
*Self
= (struct LibraryManagerInterface
*) ExtLib
->ILibrary
;
32 return (ULONG
)Self
->Open(0);
34 struct EmuTrap stub_Open
= { TRAPINST
, TRAPTYPE
, stub_OpenPPC
};
36 /* amigaos4 *****************************************************************/
38 STATIC ULONG
stub_ClosePPC(ULONG
*regarray
)
40 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
41 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
42 struct LibraryManagerInterface
*Self
= (struct LibraryManagerInterface
*) ExtLib
->ILibrary
;
44 return (ULONG
)Self
->Close();
46 struct EmuTrap stub_Close
= { TRAPINST
, TRAPTYPE
, stub_ClosePPC
};
48 /* amigaos4 *****************************************************************/
50 STATIC ULONG
stub_ExpungePPC(ULONG
*regarray
)
54 struct EmuTrap stub_Expunge
= { TRAPINST
, TRAPTYPE
, stub_ExpungePPC
};
56 /* amigaos4 *****************************************************************/
58 STATIC ULONG
stub_ReservedPPC(ULONG
*regarray
)
62 struct EmuTrap stub_Reserved
= { TRAPINST
, TRAPTYPE
, stub_ReservedPPC
};
64 /* amigaos4 *****************************************************************/
66 static ULONG
stub_URL_OpenAPPC(ULONG
*regarray
)
68 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
69 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
70 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
72 return Self
->URL_OpenA(
73 (STRPTR
)regarray
[REG68K_A0
/4],
74 (struct TagItem
*)regarray
[REG68K_A1
/4]
77 struct EmuTrap stub_URL_OpenA
= { TRAPINST
, TRAPTYPE
, stub_URL_OpenAPPC
};
79 /* amigaos4 *****************************************************************/
81 static struct URL_Prefs
* stub_URL_OldGetPrefsPPC(ULONG
*regarray
)
83 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
84 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
85 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
87 return Self
->URL_GetPrefsA(
91 struct EmuTrap stub_URL_OldGetPrefs
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_URL_OldGetPrefsPPC
};
93 /* amigaos4 *****************************************************************/
95 static void stub_URL_OldFreePrefsPPC(ULONG
*regarray
)
97 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
98 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
99 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
102 (struct URL_Prefs
*)regarray
[REG68K_A0
/4],
106 struct EmuTrap stub_URL_OldFreePrefs
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_URL_OldFreePrefsPPC
};
108 /* amigaos4 *****************************************************************/
110 static ULONG
stub_URL_OldSetPrefsPPC(ULONG
*regarray
)
112 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
113 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
114 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
116 struct TagItem stags
[] = {URL_SetPrefs_Save
,0,TAG_DONE
};
118 stags
[0].ti_Data
= regarray
[REG68K_D0
/4];
120 return Self
->URL_SetPrefsA(
121 (struct URL_Prefs
*)regarray
[REG68K_A0
/4],
125 struct EmuTrap stub_URL_OldSetPrefs
= { TRAPINST
, TRAPTYPE
, stub_URL_OldSetPrefsPPC
};
127 /* amigaos4 *****************************************************************/
129 static struct URL_Prefs
* stub_URL_OldGetDefaultPrefsPPC(ULONG
*regarray
)
131 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
132 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
133 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
135 return Self
->URL_GetPrefs(
136 URL_GetPrefs_Default
,
141 struct EmuTrap stub_URL_OldGetDefaultPrefs
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_URL_OldGetDefaultPrefsPPC
};
143 /* amigaos4 *****************************************************************/
145 static ULONG
stub_URL_OldLaunchPrefsAppPPC(ULONG
*regarray
)
147 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
148 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
149 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
151 return Self
->URL_LaunchPrefsAppA(
155 struct EmuTrap stub_URL_OldLaunchPrefsApp
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_URL_OldLaunchPrefsAppPPC
};
157 /* amigaos4 *****************************************************************/
158 LONG VARARGS68K
OS4_dispatch ( struct OpenURLIFace
* Self
, struct RexxMsg
*msg
, UBYTE
** resPtr
);
160 static LONG
stub_dispatchPPC(ULONG
*regarray
)
162 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
163 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
164 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
167 LONG res
= OS4_dispatch(
169 (struct RexxMsg
*)regarray
[REG68K_A0
/4],
173 regarray
[REG68K_A0
/4] = (ULONG
)pRes
;
177 struct EmuTrap stub_dispatch
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_dispatchPPC
};
179 /* amigaos4 *****************************************************************/
181 static struct URL_Prefs
* stub_URL_GetPrefsAPPC(ULONG
*regarray
)
183 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
184 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
185 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
187 return Self
->URL_GetPrefsA(
188 (struct TagItem
*)regarray
[REG68K_A0
/4]
191 struct EmuTrap stub_URL_GetPrefsA
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_URL_GetPrefsAPPC
};
193 /* amigaos4 *****************************************************************/
195 static void stub_URL_FreePrefsAPPC(ULONG
*regarray
)
197 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
198 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
199 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
201 Self
->URL_FreePrefsA(
202 (struct URL_Prefs
*)regarray
[REG68K_A0
/4],
203 (struct TagItem
*)regarray
[REG68K_A1
/4]
206 struct EmuTrap stub_URL_FreePrefsA
= { TRAPINST
, TRAPTYPE
, (ULONG (*)(ULONG
*))stub_URL_FreePrefsAPPC
};
208 /* amigaos4 *****************************************************************/
210 static ULONG
stub_URL_SetPrefsAPPC(ULONG
*regarray
)
212 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
213 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
214 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
216 return Self
->URL_SetPrefsA(
217 (struct URL_Prefs
*)regarray
[REG68K_A0
/4],
218 (struct TagItem
*)regarray
[REG68K_A1
/4]
221 struct EmuTrap stub_URL_SetPrefsA
= { TRAPINST
, TRAPTYPE
, stub_URL_SetPrefsAPPC
};
223 /* amigaos4 *****************************************************************/
225 static ULONG
stub_URL_LaunchPrefsAppAPPC(ULONG
*regarray
)
227 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
228 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
229 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
231 return Self
->URL_LaunchPrefsAppA(
232 (struct TagItem
*)regarray
[REG68K_A1
/4]
235 struct EmuTrap stub_URL_LaunchPrefsAppA
= { TRAPINST
, TRAPTYPE
, stub_URL_LaunchPrefsAppAPPC
};
237 /* amigaos4 *****************************************************************/
239 static ULONG
stub_URL_GetAttrPPC(ULONG
*regarray
)
241 struct Library
*Base
= (struct Library
*) regarray
[REG68K_A6
/4];
242 struct ExtendedLibrary
*ExtLib
= (struct ExtendedLibrary
*) ((ULONG
)Base
+ Base
->lib_PosSize
);
243 struct OpenURLIFace
*Self
= (struct OpenURLIFace
*) ExtLib
->MainIFace
;
245 return Self
->URL_GetAttr(
246 (ULONG
)regarray
[REG68K_D0
/4],
247 (ULONG
*)regarray
[REG68K_A0
/4]
250 struct EmuTrap stub_URL_GetAttr
= { TRAPINST
, TRAPTYPE
, stub_URL_GetAttrPPC
};
252 /* amigaos4 *****************************************************************/
254 ULONG VecTable68K
[] = {
257 (ULONG
)&stub_Expunge
,
258 (ULONG
)&stub_Reserved
,
260 (ULONG
)&stub_URL_OpenA
,
261 (ULONG
)&stub_URL_OldGetPrefs
,
262 (ULONG
)&stub_URL_OldFreePrefs
,
263 (ULONG
)&stub_URL_OldSetPrefs
,
264 (ULONG
)&stub_URL_OldGetDefaultPrefs
,
265 (ULONG
)&stub_URL_OldLaunchPrefsApp
,
266 (ULONG
)&stub_dispatch
,
267 (ULONG
)&stub_URL_GetPrefsA
,
268 (ULONG
)&stub_URL_FreePrefsA
,
269 (ULONG
)&stub_URL_SetPrefsA
,
270 (ULONG
)&stub_URL_LaunchPrefsAppA
,
271 (ULONG
)&stub_URL_GetAttr
,