Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: James Kuyper Newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.javascript,comp.lang.lisp Subject: Re: avcall, callback, trampoline, vacall, etc Date: Fri, 26 Oct 2012 14:08:39 -0400 Organization: A noiseless patient Spider Lines: 22 Message-ID: <508AD1A7.5060700@verizon.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="d8fef572ea43a1acd556896aa70d63af"; logging-data="28588"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WpN9b4JeHDoqLQqMm4BXlJ5BDbgihjYM=" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: Cancel-Lock: sha1:D0zw9Yis/gxNJYYe0AGl6aau5JE= Xref: csiph.com comp.lang.c:27733 comp.lang.c++:19262 comp.unix.programmer:3669 comp.lang.javascript:16904 comp.lang.lisp:11766 On 10/26/2012 01:16 PM, gnuist007@hotmail.com wrote: ... > For starters, I always start with google and wikipedia. I could not > find any examples. > > I am asking here so that you guys can give me whetted and good > examples for a newbie. I pointed out that qsort() and bsearch() are good simple examples of how callbacks are used, and I recommended searching Wikipedia. has two completely filled out toy examples of code using callback functions. Joe Pfeiffer pointed you at a tutorial for FUSE, which is a more complicated system making use of callbacks. Les Cargill gave you a basic template for implementing callbacks in C. Callback are a relatively simple concept. Everything that makes a callback be a callback is present in both Wikipedia's examples and in Les Cargill's template. If there's something more that you need, that wasn't provided by those examples, then you're looking for something more than just a callback. Perhaps you could explain in more detail what you're looking for that was missing from these examples?