Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion avcall, callback, trampoline, vacall, etc
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gnuist...@hotmail.com  
View profile  
 More options Oct 26 2012, 1:16 pm
Newsgroups: comp.lang.c, comp.lang.c++, comp.unix.programmer, comp.lang.javascript, comp.lang.lisp
From: gnuist...@hotmail.com
Date: Fri, 26 Oct 2012 10:16:30 -0700 (PDT)
Local: Fri, Oct 26 2012 1:16 pm
Subject: Re: avcall, callback, trampoline, vacall, etc
On Oct 26, 5:27 am, Les Cargill <lcargil...@comcast.com> wrote:

> gnuist...@hotmail.com wrote:
> > Dear Programming Gurus,

> > These concepts are rather well talked about .. over the internet and
> > usenet, however, I cant find any clear explanation.

> > avcall, callback, trampoline, vacall, etc

> > I looked in a book of C programming, ie k&r and also the rationale for
> > C, an old copy and could not find any explanation.

> > I know that javascript books talk a lot about callbacks and there is
> > the style of programming involving writing callbacks and registering
> > them. Unfortunately, in the age when I took my C class, there was no
> > discussion along these lines.

> > Can anyone give clear definition, example, benefits, variations,
> > origin or citation to a paper where it originated and explained first,
> > as well as some modern text that does the better than most job of
> > illustrating it and its applications.

> "Callbacks" are a method of storing pointers to functions
> and exploiting them.

> I'm answering from comp.lang.c so one thing I would start with is to
> learn the concept of an ioctl(). It's one of the oldest ways to
> do this sort of thing. Just google for "device driver programming in
> linux" and follow some of the simpler examples. ioctl() is a pattern
> that occurs quite frequently, in and out of kernel/driver
> development.

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.

there are books on defice driver programming. I need the part that you
can make into a small paper. Give me a reference to read that you have
read yourself and appreciate, maybe a citeseer link to paper etc.

> After that, just do plain old callbacks in 'C' - declare...

> //a typedef

> typedef void (*cbtype)(char *);

> // an array of them

> cbtype cbtab[3];

> // an initializer

> void set_cb(cbtype a,int idx)
> {
> ...

> }

> // and reference the callbacks

> void thing(char *s)
> {
> ...

> }

> ...

>    set_cb(thing,2);
>    cbtab[2]("Calling Elvis");

> --
> Les Cargill


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.