Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!news.cs.indiana.edu!msi.umn.edu!noc.MR.NET!gacvx2.gac.edu!hhdist From: postmaster.DUNG_BEETLE@gateway.qm.apple.com (postmaster) Newsgroups: comp.sys.handhelds Subject: Steve Winters :Unknown QM u Message-ID: <9101040921.AA21214@internal.apple.com> Date: 4 Jan 91 09:23:58 GMT Lines: 87 To: handhelds@gac.edu Return-path: To: handhelds@gac.edu Mail*Link#170# Steve Winters :Unknown QM u Received: by gateway.qm.apple.com; 4 Jan 91 01:23:56 Received: from apple.com ([130.43.2.2]) by goofy.apple.com with SMTP (5.61/25-eef) id AA16891; Fri, 4 Jan 91 00:32:43 -0800 for winters Received: from gacvx2.gac.edu by apple.com with SMTP (5.61/25-eef) id AA19251; Sun, 23 Dec 90 11:36:32 -0800 for Steve_Winters.PERIPH_PROJ@gateway.qm.apple.com Date: Sun, 23 Dec 1990 13:30 CST From: handhelds@gac.edu Subject: Re: SAD compilation problems.... Sender: NEWSMGR@gacvx2.gac.edu To: HANDHELDS@gacvx2.gac.edu Errors-To: postmaster@gac.edu Reply-To: handhelds@gac.edu Message-Id: X-Vms-To: IN%"HANDHELDS@GACVX2.GAC.EDU" Comments: Forwarded from COMP.SYS.HANDHELDS by GACVX2.GAC.EDU Relay-Version: VMS News - V6.0-1 14/11/90 VAX/VMS V5.4; site gacvx2.gac.edu Path: gacvx2.gac.edu!noc.MR.NET!uc!tut.cis.ohio-state.edu!snorkelwacker.mit.edu!ai-lab!rice-chex!bson Newsgroups: comp.sys.handhelds Subject: Re: SAD compilation problems.... Message-ID: <12523@life.ai.mit.edu> From: bson@rice-chex.ai.mit.edu (Jan Brittenson) Date: 23 Dec 90 18:36:48 GMT Sender: news@ai.mit.edu References: <1990Dec22.180316.647@zip.eecs.umich.edu> Organization: nil Lines: 55 In article <1990Dec22.180316.647@zip.eecs.umich.edu> kamidon@zip.eecs.umich.edu (Keith Amidon) writes: When porting SAD, make sure that integers are 32 bits or more (shouldn't pose any problems on 68k machines) and that all data types and pointers (except double) are passed on the stack as 32-bit quantities. > ... the one problem I have run into is that SAD expects there to be a > library function called qsort, which doesn't seem to exist in DICE's > libraries. From the SunOS man(1) page: SYNOPSIS qsort(base, nel, width, compar) char *base; int (*compar)(); DESCRIPTION qsort() is an implementation of the quicker-sort algorithm. It sorts a table of data in place. base points to the element at the base of the table. nel is the number of elements in the table. width is the size, in bytes, of each element in the table. compar is the name of the comparison function, which is called with two arguments that point to the elements being compared. As the function must return an integer less than, equal to, or greater than zero, so must the first argument to be considered be less than, equal to, or greater than the second. Note that the description is confusing; compar is not the name (implying name in ascii) of the comparison function, but rather a pointer to it, i.e. (int (*)()) as defined in the synopsis above. I mention this because I've seen attempts to do things like: /* WRONG */ qsort(..., "my_cmp"); /* WRONG */ (Usually by students, but worth mentioning nevertheless.) > [Where can I] find sources for a routine doing the same thing which I > could link into the SAD programs? Check with project GNU's C Standard Library at FTP address prep.ai.mit.edu. qsort should be fairly self-contained and not require much else from the library - send me mail if you need help with this. -- Jan Brittenson bson@ai.mit.edu