English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 04 April 2023, 11:22   #1
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
What does getting interfaces do?

I've been blindly following how to open and init AmiSSL and one of the steps is to have something like

Code:
if (!GETINTERFACE(IAmiSSLMaster, AmiSSLMasterBase)) {
        return RETURN_ERROR;
    }
What does this actually do? I'm pretty new to Amiga system programming but AmiSSL is the only place I've seen interfaces being retrieved.
Nightfox is offline  
Old 04 April 2023, 20:29   #2
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,311
I see you're asking about GCC/68k in another thread. I think Interfaces are a AmigaOS4 thing.
nogginthenog is offline  
Old 05 April 2023, 04:57   #3
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Nightfox!

Indeed, interfaces are for AmigaOS 4, for any v3.x, you don't need to do that

Cheers!
tygre is offline  
Old 05 April 2023, 10:24   #4
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
Ah cheers. I can delete that code from my app then!
Nightfox is offline  
Old 06 April 2023, 04:10   #5
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Yes, it's safe for any v3.x AFAIK

(If you want your program to run in OS v4, it seems mandatory though, but I don't know much more than that, I haven't tried myself...)

Cheers!
tygre is offline  
Old 21 April 2023, 14:54   #6
Futaura
Registered User
 
Futaura's Avatar
 
Join Date: Aug 2018
Location: United Kingdom
Posts: 198
The GETINTERFACE() macro that you probably found in the AmiSSL example sources is a no-op on OS3. We use a macro to save adding #ifdefs everywhere instead, so the code is more readable and easier to manage.

On OS3 library calls are directed to a jump table located in the library base. On OS4 this isn't the case - first you have to get a pointer to the interface and library calls are located in that interface. An OS4 library can also have multiple interfaces.

FYI, this is also why AmiSSL only requires a single library base on OS4. Interfaces are not limited in size, unlike the jump tables in an OS3 library (where AmiSSL requires as second library base due to the jump table not being big enough).
Futaura is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Support for multiport MIDI interfaces garyg request.UAE Wishlist 1 25 May 2011 14:28
Question, about SD2IDE interfaces, (not CF kk ;) ) Vairn support.Hardware 13 27 January 2008 12:28
A1200 Buffered Interfaces r6stu support.Hardware 5 11 November 2007 21:26
A4000 Idefix'97 4-device Interfaces amigakit.com MarketPlace 0 31 October 2006 01:33
Buffered IDe interfaces for A1200 HardStep support.Hardware 5 29 May 2006 01:22

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:43.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.30680 seconds with 15 queries