mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Updated to use the proper OS4 build environment.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15004 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.os4,v 1.1 2005-07-04 10:25:33 obarthel Exp $
|
||||
# $Id: GNUmakefile.os4,v 1.2 2005-07-04 11:06:20 obarthel Exp $
|
||||
#
|
||||
# :ts=4
|
||||
#
|
||||
@ -43,12 +43,12 @@ DEBUG = -ggdb
|
||||
|
||||
###############################################################################
|
||||
|
||||
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) -I. -I/V/include
|
||||
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) -I/V/include -I. -Iinclude
|
||||
|
||||
###############################################################################
|
||||
|
||||
OBJS = \
|
||||
lib_base.o lib_user.o usergroup_68k.o
|
||||
lib_base.o lib_user.o skeleton_68k.o
|
||||
|
||||
###############################################################################
|
||||
|
||||
@ -56,7 +56,9 @@ LIBS = -lc -lamiga
|
||||
|
||||
###############################################################################
|
||||
|
||||
all: skeleton.library
|
||||
all: skeleton_68k.c skeleton.library
|
||||
|
||||
###############################################################################
|
||||
|
||||
skeleton.library: $(OBJS)
|
||||
$(CC) -o $@.debug $(OBJS) $(CFLAGS) -Wl,--cref,-M,-Map=$@.map \
|
||||
@ -65,5 +67,12 @@ skeleton.library: $(OBJS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
# This will rebuild the library header files and stub code when necessary
|
||||
skeleton_68k.c : skeleton_lib.sfd skeleton.xml
|
||||
idltool --proto --interface --inline skeleton.xml
|
||||
fdtrans --c68k skeleton_lib.sfd
|
||||
|
||||
###############################################################################
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.debug *.map skeleton.library
|
||||
|
||||
26
library/skeleton_library/include/inline4/skeleton.h
Normal file
26
library/skeleton_library/include/inline4/skeleton.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef INLINE4_SKELETON_H
|
||||
#define INLINE4_SKELETON_H
|
||||
|
||||
/*
|
||||
** This file was auto generated by idltool 51.6.
|
||||
**
|
||||
** It provides compatibility to OS3 style library
|
||||
** calls by substituting functions.
|
||||
**
|
||||
** Do not edit manually.
|
||||
*/
|
||||
|
||||
#ifndef EXEC_TYPES_H
|
||||
#include <exec/types.h>
|
||||
#endif
|
||||
#ifndef EXEC_EXEC_H
|
||||
#include <exec/exec.h>
|
||||
#endif
|
||||
#ifndef EXEC_INTERFACES_H
|
||||
#include <exec/interfaces.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Inline macros for Interface "main" */
|
||||
|
||||
#endif /* INLINE4_SKELETON_H */
|
||||
30
library/skeleton_library/include/interfaces/skeleton.h
Normal file
30
library/skeleton_library/include/interfaces/skeleton.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef SKELETON_INTERFACE_DEF_H
|
||||
#define SKELETON_INTERFACE_DEF_H
|
||||
|
||||
/*
|
||||
** This file was machine generated by idltool 51.6.
|
||||
** Do not edit
|
||||
*/
|
||||
|
||||
#ifndef EXEC_TYPES_H
|
||||
#include <exec/types.h>
|
||||
#endif
|
||||
#ifndef EXEC_EXEC_H
|
||||
#include <exec/exec.h>
|
||||
#endif
|
||||
#ifndef EXEC_INTERFACES_H
|
||||
#include <exec/interfaces.h>
|
||||
#endif
|
||||
|
||||
|
||||
struct SkeletonIFace
|
||||
{
|
||||
struct InterfaceData Data;
|
||||
|
||||
ULONG APICALL (*Obtain)(struct SkeletonIFace *Self);
|
||||
ULONG APICALL (*Release)(struct SkeletonIFace *Self);
|
||||
void APICALL (*Expunge)(struct SkeletonIFace *Self);
|
||||
struct Interface * APICALL (*Clone)(struct SkeletonIFace *Self);
|
||||
};
|
||||
|
||||
#endif /* SKELETON_INTERFACE_DEF_H */
|
||||
83
library/skeleton_library/include/proto/skeleton.h
Executable file
83
library/skeleton_library/include/proto/skeleton.h
Executable file
@ -0,0 +1,83 @@
|
||||
#ifndef PROTO_SKELETON_H
|
||||
#define PROTO_SKELETON_H
|
||||
|
||||
/*
|
||||
** $Id: skeleton.h,v 1.1 2005-07-04 11:06:23 obarthel Exp $
|
||||
**
|
||||
** Prototype/inline/pragma header file combo
|
||||
** Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
** All rights reserved.
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions
|
||||
** are met:
|
||||
**
|
||||
** - Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
**
|
||||
** - Neither the name of Olaf Barthel nor the names of contributors
|
||||
** may be used to endorse or promote products derived from this
|
||||
** software without specific prior written permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
** POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef EXEC_TYPES_H
|
||||
#include <exec/types.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef __NOLIBBASE__
|
||||
#ifndef __USE_BASETYPE__
|
||||
extern struct Library * SkeletonBase;
|
||||
#else
|
||||
extern struct Library * SkeletonBase;
|
||||
#endif /* __USE_BASETYPE__ */
|
||||
#endif /* __NOLIBBASE__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __amigaos4__
|
||||
#include <interfaces/skeleton.h>
|
||||
#ifdef __USE_INLINE__
|
||||
#include <inline4/skeleton.h>
|
||||
#endif /* __USE_INLINE__ */
|
||||
#ifndef CLIB_SKELETON_PROTOS_H
|
||||
#define CLIB_SKELETON_PROTOS_H 1
|
||||
#endif /* CLIB_SKELETON_PROTOS_H */
|
||||
#ifndef __NOGLOBALIFACE__
|
||||
extern struct SkeletonIFace *ISkeleton;
|
||||
#endif /* __NOGLOBALIFACE__ */
|
||||
#else /* __amigaos4__ */
|
||||
#ifndef CLIB_SKELETON_PROTOS_H
|
||||
#include <clib/skeleton_protos.h>
|
||||
#endif /* CLIB_SKELETON_PROTOS_H */
|
||||
#if defined(__GNUC__)
|
||||
#ifndef __PPC__
|
||||
#include <inline/skeleton.h>
|
||||
#else
|
||||
#include <ppcinline/skeleton.h>
|
||||
#endif /* __PPC__ */
|
||||
#elif defined(__VBCC__)
|
||||
#ifndef __PPC__
|
||||
#include <inline/skeleton_protos.h>
|
||||
#endif /* __PPC__ */
|
||||
#else
|
||||
#include <pragmas/skeleton_pragmas.h>
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* PROTO_SKELETON_H */
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: lib_base.c,v 1.2 2005-07-04 10:25:33 obarthel Exp $
|
||||
* $Id: lib_base.c,v 1.3 2005-07-04 11:06:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -41,9 +41,17 @@
|
||||
/****************************************************************************/
|
||||
|
||||
#define __NOLIBBASE__
|
||||
#define __NOGLOBALIFACE__
|
||||
#define __USE_INLINE__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <proto/exec.h>
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
#include <proto/skeleton.h>
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include "lib_base.h"
|
||||
@ -166,7 +174,7 @@ lib_init(
|
||||
goto out;
|
||||
|
||||
/* Now try the user-supplied library initialization function. */
|
||||
if(UserLibInit(SysBase,sb->sb_UserData) == FALSE)
|
||||
if(UserLibInit(SysBase,sb,sb->sb_UserData) == FALSE)
|
||||
goto out;
|
||||
|
||||
result = sb;
|
||||
@ -456,11 +464,11 @@ STATIC CONST UBYTE version_string[] = "$VER: " VSTRING;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
CONST struct Resident LibTag[] =
|
||||
CONST struct Resident LibTag =
|
||||
{
|
||||
RTC_MATCHWORD,
|
||||
(struct Resident *)&LibTag[0],
|
||||
(struct Resident *)&LibTag[1],
|
||||
(struct Resident *)&LibTag,
|
||||
(struct Resident *)&LibTag+1,
|
||||
RTF_AUTOINIT|RTF_NATIVE,
|
||||
VERSION,
|
||||
NT_LIBRARY,
|
||||
@ -529,11 +537,11 @@ STATIC CONST struct LibraryInitTable lib_init_table =
|
||||
/* The library loader looks for this marker in the memory
|
||||
the library code and data will occupy. It is responsible
|
||||
setting up the Library base data structure. */
|
||||
struct Resident LibTag[] =
|
||||
struct Resident LibTag =
|
||||
{
|
||||
RTC_MATCHWORD, /* Marker value. */
|
||||
(struct Resident *)&LibTag[0], /* This points back to itself. */
|
||||
(struct Resident *)&LibTag[1], /* This points behind this marker. */
|
||||
(struct Resident *)&LibTag, /* This points back to itself. */
|
||||
(struct Resident *)&LibTag+1, /* This points behind this marker. */
|
||||
RTF_AUTOINIT, /* The Library should be set up according to the given table. */
|
||||
VERSION, /* The version of this Library. */
|
||||
NT_LIBRARY, /* This defines this module as a Library. */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: lib_user.c,v 1.2 2005-07-04 10:25:33 obarthel Exp $
|
||||
* $Id: lib_user.c,v 1.3 2005-07-04 11:06:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,10 @@
|
||||
By the time this function is invoked the library base has already been
|
||||
initialized. It has to return TRUE for success and FALSE otherwise. */
|
||||
BOOL
|
||||
UserLibInit(struct Library * SysBase,struct UserData * ud)
|
||||
UserLibInit(
|
||||
struct Library * SysBase,
|
||||
struct SkeletonBase * sb,
|
||||
struct UserData * ud)
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
@ -65,6 +68,12 @@ UserLibInit(struct Library * SysBase,struct UserData * ud)
|
||||
}
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
/* The library base pointer may come in handy if library
|
||||
functions are to call other library functions. These
|
||||
calls should go through the normal library calling
|
||||
mechanism rather than invoke these functions directly. */
|
||||
ud->ud_SkeletonBase = sb;
|
||||
|
||||
result = TRUE;
|
||||
|
||||
return(result);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: lib_user.h,v 1.2 2005-07-04 10:25:33 obarthel Exp $
|
||||
* $Id: lib_user.h,v 1.3 2005-07-04 11:06:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,20 +46,26 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct SkeletonBase;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct UserData
|
||||
{
|
||||
struct Library * ud_SysBase;
|
||||
struct Library * ud_SysBase;
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
struct ExecIFace * ud_IExec;
|
||||
struct ExecIFace * ud_IExec;
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
ULONG ud_UseCount;
|
||||
struct SkeletonBase * ud_SkeletonBase;
|
||||
|
||||
ULONG ud_UseCount;
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
BOOL UserLibInit(struct Library *SysBase,struct UserData *ud);
|
||||
BOOL UserLibInit(struct Library *SysBase,struct SkeletonBase *sb,struct UserData *ud);
|
||||
BOOL UserLibOpen(struct UserData *ud);
|
||||
VOID UserLibClose(struct UserData *ud);
|
||||
VOID UserLibExpunge(struct UserData *ud);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE library SYSTEM "library.dtd">
|
||||
<!-- autogenerated by fdtrans v51.16 -->
|
||||
<library name="skeleton" basename="SkeletonBase" openname="skeleton.library">
|
||||
<include>exec/types.h</include>
|
||||
<interface name="main" version="1.0" struct="SkeletonIFace" prefix="_Skeleton_" asmprefix="ISkeleton" global="ISkeleton">
|
||||
|
||||
65
library/skeleton_library/skeleton_68k.c
Normal file
65
library/skeleton_library/skeleton_68k.c
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
** This file was automatically generated by fdtrans 51.16.
|
||||
** Do not edit it by hand. Instead, edit the sfd file
|
||||
** that was used to generate this file
|
||||
*/
|
||||
|
||||
#ifdef __USE_INLINE__
|
||||
#undef __USE_INLINE__
|
||||
#endif
|
||||
#ifndef __NOGLOBALIFACE__
|
||||
#define __NOGLOBALIFACE__
|
||||
#endif
|
||||
|
||||
#include <exec/interfaces.h>
|
||||
#include <exec/libraries.h>
|
||||
#include <exec/emulation.h>
|
||||
#include <interfaces/exec.h>
|
||||
#include <interfaces/skeleton.h>
|
||||
#include <proto/skeleton.h>
|
||||
|
||||
|
||||
static inline int8 convert_int8 (uint32 x) { return x; }
|
||||
static inline int16 convert_int16(uint32 x) { return x; }
|
||||
|
||||
|
||||
STATIC struct Library * stub_OpenPPC(ULONG *regarray)
|
||||
{
|
||||
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
|
||||
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize);
|
||||
struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary;
|
||||
|
||||
return Self->Open(0);
|
||||
}
|
||||
STATIC CONST struct EmuTrap stub_Open = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_OpenPPC };
|
||||
|
||||
STATIC APTR stub_ClosePPC(ULONG *regarray)
|
||||
{
|
||||
struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
|
||||
struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize);
|
||||
struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary;
|
||||
|
||||
return Self->Close();
|
||||
}
|
||||
STATIC CONST struct EmuTrap stub_Close = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ClosePPC };
|
||||
|
||||
STATIC APTR stub_ExpungePPC(ULONG *regarray __attribute__((unused)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
STATIC CONST struct EmuTrap stub_Expunge = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ExpungePPC };
|
||||
|
||||
STATIC ULONG stub_ReservedPPC(ULONG *regarray __attribute__((unused)))
|
||||
{
|
||||
return 0UL;
|
||||
}
|
||||
STATIC CONST struct EmuTrap stub_Reserved = { TRAPINST, TRAPTYPE, stub_ReservedPPC };
|
||||
|
||||
CONST CONST_APTR VecTable68K[] =
|
||||
{
|
||||
&stub_Open,
|
||||
&stub_Close,
|
||||
&stub_Expunge,
|
||||
&stub_Reserved,
|
||||
(CONST_APTR)-1
|
||||
};
|
||||
Reference in New Issue
Block a user