Message 93

Re: tupleCmp

X-Added: With Flames (bblib $Revision: 1.4 $)
Return-path: <nburns@andrew.cmu.edu>
X-Andrew-Authenticated-as: 0;andrew.cmu.edu;Network-Mail
Received: from po0.andrew.cmu.edu via trymail for bb+academic.cs.15-721@andrew.cmu.edu
          ID </afs/andrew.cmu.edu/usr0/bb/Mailbox/cvot1XO00UdY0yTU9B>;
          Sun, 21 Oct 2001 23:20:03 -0400 (EDT)
Received: from mx2.andrew.cmu.edu (MX2.ANDREW.CMU.EDU [128.2.10.112])
        by po0.andrew.cmu.edu (8.9.3/8.9.3) with ESMTP id XAA15990;
        Sun, 21 Oct 2001 23:20:02 -0400 (EDT)
Received: from surreal (pool-141-158-70-172.pitt.east.verizon.net [141.158.70.172])
        by mx2.andrew.cmu.edu (8.12.0.Beta16/8.12.0.Beta16) with ESMTP id f9M3Jxtx025805;
        Sun, 21 Oct 2001 23:20:00 -0400
Received: from surreal ([127.0.0.1] ident=nburns)
        by surreal with smtp (Exim 3.32 #1 (Debian))
        id 15vVd5-0000he-00; Sun, 21 Oct 2001 23:19:55 -0400
Date: Sun, 21 Oct 2001 23:19:55 -0400 (EDT)
From: Neal Burns <nburns@andrew.cmu.edu>
X-Sender: nburns@surreal
Reply-To: Neal Burns <nburns@andrew.cmu.edu>
To: Leejay Wu <lw2j+@andrew.cmu.edu>
cc: post+academic.cs.15-721@andrew.cmu.edu
Subject: Re: tupleCmp
In-Reply-To: <ovo_7Pi00UjLB71nQn@andrew.cmu.edu>
Message-ID: <Pine.LNX.3.96L.1011021231440.1246C-100000@surreal>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Sorry to belabor this point, but where does tupleCmp get the sort order
and key size? Are they globals set by the test code? Is it safe to just
ignore this function and write our own?

Neal

On Fri, 19 Oct 2001, Leejay Wu wrote:

> Excerpts from academic.cs.15-721: 19-Oct-101 Re: tupleCmp by Jia-Yu
> Pan@andrew.cmu.ed 
> > Does tupleCmp() know which attribute of the input tuples are the
> > attribute we want to compare?
> 
> Not by itself.  Here's the code:
> 
> 
> int tupleCmp (const void* t1, const void* t2)
> {
> 
>       if (s_order == Ascending)
>          return strncmp((char*)t1,(char*)t2,key_size);
>       else
>          return strncmp((char*)t2,(char*)t1,key_size);
> }
> 
> -- 
> |   lw2j@cs.cmu.edu        | #include <0.0648g NaCl>     |              
> |--------------------------|-----------------------------|  
> |   #include <stddiscl.h>  | Spam returned to postmaster |
> 
>     
> 
>