From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31228 invoked by alias); 14 Jul 2012 06:34:42 -0000 Received: (qmail 31210 invoked by uid 22791); 14 Jul 2012 06:34:41 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Jul 2012 06:34:27 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M75008000W5WM00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Sat, 14 Jul 2012 09:34:26 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M750086M0XD81B0@a-mtaout20.012.net.il>; Sat, 14 Jul 2012 09:34:26 +0300 (IDT) Date: Sat, 14 Jul 2012 06:34:00 -0000 From: Eli Zaretskii Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb. In-reply-to: To: Doug Evans Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <831ukeam18.fsf@gnu.org> References: <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com> <201207131921.q6DJLf5t002291@greed.delorie.com> <83a9z3a1f5.fsf@gnu.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00195.txt.bz2 > Date: Fri, 13 Jul 2012 14:26:15 -0700 > From: Doug Evans > Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org > > > Sorry if I'm missing something, but why do we need to advertise such a > > function at all? Given that libiberty already provides filename_cmp, > > isn't it trivial to write something like filename_eq whenever someone > > needs to use hashes of file names? > > It's a "matched set" with filename_hash. > The hashtab.c constructors take a hash_f function pointer and an eq_f > function pointer. I understand all that, but why would the eq_f function need to be an external function on its own? E.g., if we were to write a qsort replacement, would we have a suitable string comparison function declared extern, when it is a trivial wrapper around strcmp?