#ifndef _INLINE_EXPNAME_H
#define _INLINE_EXPNAME_H

#include <sys/cdefs.h>
#include <inline/stubs.h>

__BEGIN_DECLS

#ifndef BASE_EXT_DECL
#define BASE_EXT_DECL
#define BASE_EXT_DECL0 extern struct Library * ExpnameBase;
#endif
#ifndef BASE_PAR_DECL
#define BASE_PAR_DECL
#define BASE_PAR_DECL0 void
#endif
#ifndef BASE_NAME
#define BASE_NAME ExpnameBase
#endif

BASE_EXT_DECL0

static __inline ULONG
GetExpName (BASE_PAR_DECL STRPTR manufname,STRPTR prodname,struct ConfigDev *configdev,UWORD manufacturer,UBYTE product)
{
  BASE_EXT_DECL
  register APTR _res __asm("d0");
  register struct Library *a6 __asm("a6") = BASE_NAME;
  register STRPTR a0 __asm("a0") = manufname;
  register STRPTR a1 __asm("a1") = prodname;
  register struct ConfigDev *a2 __asm("a2") = configdev;
  register UWORD d0 __asm("d0") = manufacturer;
  register UBYTE d1 __asm("d1") = product;
  __asm __volatile ("jsr a6@(-30)"
  : "=r" (_res)
  : "r" (a6), "r" (d0)
  : "a0","a1","a2","d0","d1", "memory");
  return _res;
}

#undef BASE_EXT_DECL
#undef BASE_EXT_DECL0
#undef BASE_PAR_DECL
#undef BASE_PAR_DECL0
#undef BASE_NAME

__END_DECLS

#endif /* _INLINE_EXPNAME_H */
