[comp.sys.mac.programmer] Copyright notices in code resources

jjb@husc4.HARVARD.EDU (Jeremy J. Bornstein) (08/05/88)

I'm writing bunches of XFCNs, and I'd like to include copyright notices
in the resources themselves, near the beginning.  I was using something like:

   goto skipcopyr;

   "Copyright blah blah"

   skipcopyr:

Unfortunately the string constant gets shoved to the end of each resource, so
I tried doing the same thing in assembly (I'm using LSC 2.15) but I can't
figure out how to DC for a string...  Can anyone give me a hand?

Thanks in advance,

-jeremy bornstein
 jjb@husc4.harvard.edu

beloin@batcomputer.tn.cornell.edu (Ron Beloin) (08/05/88)

In article <5073@husc6.harvard.edu> jjb@husc4.UUCP (Jeremy J. Bornstein) writes:
>I'm writing bunches of XFCNs, and I'd like to include copyright notices

One technique I've seen (pretty sure it was Steve Drazga) was to
require the copyright notice to be the first parameter passes to
the XCMD. Yes, it's kludgy and awkward and perhaps annoying, but
anyone using the command can't very well argue that they didn't
know it was a copyrighted work!

Ron Beloin   beloin@tcgould.tn.cornell.edu

carlton@ji.Berkeley.EDU (Mike Carlton) (08/06/88)

In article <5073@husc6.harvard.edu> jjb@husc4.UUCP (Jeremy J. Bornstein) writes:
>I'm writing bunches of XFCNs, and I'd like to include copyright notices
>in the resources themselves, near the beginning.  I was using something like:
...

Try
	goto foo:
	asm {
		dc.l 'Copy'
		dc.l 'righ'
		... you get the picture
	}
	foo: ;

This may not be the prettiest way to do it, but it works.  I'm sure someone 
will let me know if there is a better way. 

regards,
mike

beard@ux1.lbl.gov (Patrick C Beard) (08/06/88)

In article <5073@husc6.harvard.edu> jjb@husc4.UUCP (Jeremy J. Bornstein) writes:
>I'm writing bunches of XFCNs, and I'd like to include copyright notices
>in the resources themselves, near the beginning. 

It would be easy enough to do by just saying:

main(..args for XFCN..)
{

	/* it would probably make sense to put the following into an
		include file like "Copyright.h" and #include it here. */

	goto past_copyright;
	asm {
		dc.b	'C'
		dc.b	'o'
		dc.b	'p'
		dc.b	'y'
		dc.b	'r' 		; etc...
	}
	past_copyright:

	/* code... */
}

I know it's not pretty, but it would do it.  It's true that you probably
won't get this exactly at the beginning of the code resource since LSC
puts glue there.  If you switch to LSC 3.0 you can use a custom code
resource header (see the manual for details) which would allow you to
control everything I believe.

Patrick Beard
Lawrence Berkeley Laboratory
beard@ux1.lbl.gov