From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 4 18:57:10 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F5E216A4CF for ; Mon, 4 Apr 2005 18:57:10 +0000 (GMT) Received: from deliver.epitech.net (deliver.epitech.net [163.5.255.125]) by mx1.FreeBSD.org (Postfix) with SMTP id 399A343D60 for ; Mon, 4 Apr 2005 18:57:09 +0000 (GMT) (envelope-from chehad_g@epita.fr) Received: from epita.fr ([163.5.255.10]) by deliver.epitech.net (SMSSMTP 4.0.0.59) with SMTP id M2005040421000731663 ; Mon, 04 Apr 2005 21:00:07 +0200 Received: from rotten (rotten.epita.fr [10.42.14.1]) by epita.fr id j34Iv1D04476 Mon, 4 Apr 2005 20:57:01 +0200 (CEST) Date: Mon, 4 Apr 2005 20:57:01 +0200 From: gilles chehade To: Matt Message-ID: <20050404185701.GA12867@rotten.epita.fr> References: <42518AC9.5070208@comcast.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42518AC9.5070208@comcast.net> User-Agent: Mutt/1.4i X-Mailman-Approved-At: Tue, 05 Apr 2005 11:50:56 +0000 cc: freebsd-hackers@FreeBSD.ORG cc: misc@openbsd.org Subject: Re: C programming question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 18:57:10 -0000 On Mon, Apr 04, 2005 at 11:43:21AM -0700, Matt wrote: > I need some help understanding some C code. > > int (*if_ioctl) > (struct ifnet *, int, caddr_t); > > int (*if_watchdog) > (int); > > Can someone break down these declarations (if that's what they are)? Is > this a form of typecasting? Thanks for your help. > This is a bit off topic :) int (*if_ioctl)(struct ifnet *, int, caddr_t); pointer to a function that returns an int and that takes a struct ifnet *, an int and a caddr_t as parameters. int (*if_watchdog)(int); pointer to a function that returns an int and takes an int as parameter. -- veins (aka chaton) - Chehade Gilles - chehad_g@epitech.net - promo 2006 (ept4) Astek, assistant crypto, delegue ept4, chercheur en vie meilleure ;-) "..the good guys win primarily because criminals are just so supid." -- bruce schneier