🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #8111

Re: Help with useing SAS C5.10 to make Libraries

#8111
From: David Jones
Date: Mon, 28 Jan 1991 19:06
52 lines
2193 bytes
>In article <1991Jan9.104606.46575@cc.usu.edu> slmt9@cc.usu.edu writes:
>	First of what does the declaration of the function itself have to look
>like. I read in the source File that it has to be __saveds so my code looks
>like this
>   
>ULONG __saveds Add(a,b)

>If there are any corrections that need to be made here please let me know.

If you want your function to take parameters in registers (most Amiga
library functions do), then you'll need to use __asm and register commands
like this:

ULONG __saveds __asm Add(register __d0 int a, register __d1 int b)

Tips:

The register name must be in lowercase.  It must be prefixed by two
underscores.

You also need the type of each argument.

When you compile, you need to use -ml on the command line.

If your library calls routines which are in its function table (most libraries
do), then don't use #pragmas for functions in your library.  Instead, use
prototypes formatted just like the function definitions.  You may continue
to use pragmas for functions in other libraries.

With reference to a message that Peter Cherna sent to me about a month ago,
do not perform any library initialization in the file "libinit.c"


>	Question number two. What does the .FD file need to look like. When I
>compile I get asked what the name of the library is? When I try to type
>something simple like MyLibrary then it tells me "error -- 'MyLibrary' is not a
>defined symbol" so where deos it get the name and other info from. Does this
>stuff go in the .FD file. Is there a different way to enter it?

Go into your .fd file and check out the name of the base.  If there is no
underscore on the base name, add one.

##base FlowBase		WRONG
##base _FlowBase	BETTER


--



	David Jones	UUCP:	dej@qpoint.amiga.ocunix.on.ca
			Fido:	1:163/109.8
Technical Details
Message-ID: <dej.0386@qpoint.amiga.ocunix.on.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!micor!latour!atronx!qpoint!dej
References: <1991Jan9.104606.46575@cc.usu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!micor!latour!atronx!qpoint!dej
From: dej@qpoint.amiga.ocunix.on.ca (David Jones)
Message-ID: <dej.0386@qpoint.amiga.ocunix.on.ca>
Newsgroups: comp.sys.amiga.tech
Subject: Re: Help with useing SAS C5.10 to make Libraries
Distribution: world
References:  <1991Jan9.104606.46575@cc.usu.edu>
Date: Mon Jan 28 19:06:59 1991