LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2005, 07:06 AM   #1
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Rep: Reputation: 30
how function with argumets called without argumets?


Hello,

In kernel source i found a statement

#ifdef CONFIG_PROC_FS
tb->tb_get_info = fn_hash_get_info;
#endif
which is called from struct fib_table * fib_hash_init(int id)

and all these are in fib_hash.c in /usr/src/linux-2.4.24/net/ipv4

What i want to know is simple thing about how fn_hash_get_info gets called? that mean i found its calling without any arguments whereas i found same function written in same file with
static int fn_hash_get_info(struct fib_table *tb, char *buffer, int first, int count)

How then function gets its parameters???

regards,
cranium
 
Old 03-15-2005, 08:32 AM   #2
zeropash
Member
 
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
tb->tb_get_info = fn_hash_get_info;
is not calling the function fn_hash_get_info.
it is just saving the address in the tb_get_info.
remeber that the function name is same as the address where its code lies.

somewhere later he would make the actual call using
(*tb->tb_get_info)(PARAMETERLISTHERE)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Driver Probe function not being called xtom Fedora 1 11-10-2018 12:05 PM
howto know whether a function is called in signal handler snowing Programming 1 11-07-2005 09:55 PM
what are the Hexadecimal function and ASCII function in Perl Bassam Programming 1 06-03-2004 01:44 AM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM
Perl exec function in linux (and system-function) nazula Programming 1 04-19-2004 12:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration