/*  '(C) Copyright 1997 Haage & Partner Computer GmbH'
**	 All Rights Reserved
*/

#include <iostream.h>
#include <clib/exec_protos.h>

// Format dieser Anweisung :
// extern "AmigaLib" <Basisname> {
// Prototype, notfalls mit Registerzuweisungen = offset;
// };
// Offset ist das Negative Offset zur Librarybase, also da wo
// der 680x0 einspringen wuerde. Der PPC Code holt sich dort
// nur seinen JumpPointer. 

extern "AmigaLib" FooBase {
    char * Bar(void) = -0x1e;
 } ;

#ifndef __PPC__
#error "This file must be compiled for the PowerPC CPU."
#endif
extern "C" void EasyRequest(void) {}	// War in der ppcamiga.lib noch nicht drin.

struct Library * FooBase ;		// Unsere Testlibrary

void main(void)
{
    FooBase = OpenLibrary("foo.library", 0);
    if (FooBase) {
        cout << "Foo is open\n";
        cout << "And the message is : " << Bar() << "\n";
        CloseLibrary(FooBase);
    } else {
        cout << "No foo.library\n";
    }
}