From owner-freebsd-chat@FreeBSD.ORG Sat Aug 21 01:44:01 2004 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3581A16A4CF for ; Sat, 21 Aug 2004 01:44:01 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD60943D3F for ; Sat, 21 Aug 2004 01:44:00 +0000 (GMT) (envelope-from torstenvl@gmail.com) Received: by mproxy.gmail.com with SMTP id 76so22719rnl for ; Fri, 20 Aug 2004 18:43:52 -0700 (PDT) Received: by 10.38.171.69 with SMTP id t69mr326672rne; Fri, 20 Aug 2004 18:43:52 -0700 (PDT) Received: by 10.38.73.7 with HTTP; Fri, 20 Aug 2004 18:43:52 -0700 (PDT) Message-ID: <126eac48040820184330a9c344@mail.gmail.com> Date: Fri, 20 Aug 2004 21:43:52 -0400 From: =?UTF-8?Q?Josh_=C5=8Cckert?= To: "Jeremy C. Reed" In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: cc: freebsd-chat@freebsd.org Subject: Re: tool for listing C functions used in source code? X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: =?UTF-8?Q?Josh_=C5=8Cckert?= List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2004 01:44:01 -0000 On Fri, 20 Aug 2004 16:41:29 -0700 (PDT), Jeremy C. Reed wrote: > What are some good tools for searching source code that can list all the > standard libc functions used? > > For example, I'd like to point it at some code and have it tell me that it > uses: > > strftime 1 time > isatty 1 > setlocale 1 > getuid 1 > getbsize 5 > strlen 25 > et cetera > > Then I could see what the most used functions are for some research I am > doing. > > Does anyone know of a tool that can do that? > > I am testing cscope, but it doesn't appear to behave like I want. I do > like how it looks at the includes though. I don't want it to be > interactive. I just want a list of all functions used. I can use sort and > uniq to count if needed. > > Next I'll look at cflow. But I am not sure if does what I want either. > > Jeremy C. Reed > > BSD News, BSD tutorials, BSD links > http://www.bsdnewsletter.com/ > > _______________________________________________ > freebsd-chat@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-chat > To unsubscribe, send any mail to "freebsd-chat-unsubscribe@freebsd.org" > I would try something like.... for i in `ls /usr/share/man/man3/ | sed -e '/\\\..*$/d'`; do echo $i; grep -c $i filename.c; done in BASH That's untested, but try it. If you don't understand it, try man sed man grep