*BSD News Article 40606


Return to BSD News archive

Xref: sserve comp.unix.bsd:15870 comp.lang.c:90005 comp.unix.sys5.r3:2372
Newsgroups: comp.unix.bsd,comp.lang.c,comp.unix.sys5.r3
Path: sserve!newshost.anu.edu.au!munnari.oz.au!goanna.cs.rmit.edu.au!aggedor.rmit.EDU.AU!harbinger.cc.monash.edu.au!msunews!uwm.edu!news.alpha.net!news.mathworks.com!zombie.ncsc.mil!admii!lhc!rubenst
From: rubenst%occs.nlm.nih.gov (Mike Rubenstein Phoenix Contract)
Subject: Re: how to completely get rid of bcopy, bzero, bcmp?
Message-ID: <1995Jan7.223112.3561@nlm.nih.gov>
Followup-To: comp.unix.bsd,comp.lang.c,comp.unix.sys5.r3
Sender: news@nlm.nih.gov
Organization: National Library of Medicine
X-Newsreader: TIN [version 1.1 PL8]
References: <id.X38G1.148@nmti.com>
Date: Sat, 7 Jan 95 22:31:12 GMT
Lines: 15

Peter da Silva (peter@nmti.com) wrote:
> Ideally you should use M4, if you have it. M4 was designed for just this
> sort of task:

> m4 -D'bcopy=memcpy($2,$1,$3)' \
>    -D'bzero=memset($1,0,$2)' \
>    -D'bcmp=memcmp($1,$2,$3)' file.bsd > file.posix

which should be very exciting if your code contains something like:

	typedef struct { int a; } rm;
	void syscmd(rm *);

--
Mike Rubenstein