From owner-freebsd-questions@FreeBSD.ORG Mon Jun 1 01:23:02 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15AEC106564A for ; Mon, 1 Jun 2009 01:23:02 +0000 (UTC) (envelope-from till.plewe@gmail.com) Received: from mail-px0-f106.google.com (mail-px0-f106.google.com [209.85.216.106]) by mx1.freebsd.org (Postfix) with ESMTP id DEE378FC12 for ; Mon, 1 Jun 2009 01:23:01 +0000 (UTC) (envelope-from till.plewe@gmail.com) Received: by pxi4 with SMTP id 4so6219669pxi.3 for ; Sun, 31 May 2009 18:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U9jB1e3UU4jiUkZIfPA/uDAT21ro+AbKfqbIf31Q/DU=; b=xN5mGOJbV2JIrU8C0DidyhyeO3ZSorxbeqI2XHBguyhY9VBKpYsDlRe7vwxzGIfQQX qJ8LC3uXE9ylZ7fQJXEU0Lw5KfUDZXCMuRnE6JeCIwwagKIE+eFAhaKe3r2z/ZENohZ0 9JCZNFstCaZXWp2zYelQed7K94Mo5Yu6RQsuo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=H5H1B1lYotFM6V7eAEuoAZqXKUYMQYbLtcotpzHwLXDdHIsnJ8ljUtZEN22YAbqdto ygwDfElS4ZjY5KwryH5uWXG+1RujLX87JfPcN5w3l+0V1oMfb98Ejrndn2GF/+xQ5xFv bo7Euk7VX4pojGG6cgliLPpnloV/zc6G5VI/8= MIME-Version: 1.0 Received: by 10.143.35.4 with SMTP id n4mr1613760wfj.73.1243819381376; Sun, 31 May 2009 18:23:01 -0700 (PDT) In-Reply-To: <20090601010602.GA9692@thought.org> References: <20090601010602.GA9692@thought.org> Date: Mon, 1 Jun 2009 10:23:01 +0900 Message-ID: <8be8566f0905311823y7871c5a3q1b8d57a4d9f520c@mail.gmail.com> From: till plewe To: Gary Kline Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: is there a macro that prints the incoming param list? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 01:23:02 -0000 On Mon, Jun 1, 2009 at 10:06 AM, Gary Kline wrote: > > is there any marco that printfs the incoming list, or am i asking too much of the > compiler at runtime? > > example: > > main (int argc, char *argv) > > with this macro might print: > > "2", "testinput" > > and baz(char *file, int count) > > similarly might print, > > "testinput", "47" > > i'm probably asking the impossible, but this is certainly the place to > ask. > > thanks, > > gary > > > ps: i'm looking to create a DEBUG header. > > > > -- > Gary Kline kline@thought.org http://www.thought.org Public Service Unix > http://jottings.thought.org http://transfinite.thought.org > The 4.91a release of Jottings: http://jottings.thought.org/index.php > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > How is the macro supposed to know how to print the arguments? There may be user defined types. The simplest way would be to add a printf statement after each function definition. You could write scripts which generate the format strings for you from your header files and then use a (variadic) macro which expects that you have generated a table which contains for each function name the corresponding format string and argument list.