LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-20-2008, 06:50 AM   #1
Ashkan_s
Member
 
Registered: Jul 2008
Distribution: Fedora
Posts: 77

Rep: Reputation: 22
Question Understanding source code


Hi
I want to read the source code of firestarter firewall. I can't understand the meaning and syntax of the below line:

FIRESTARTER_RULES_DIR "/firestarter"

it use in many places in code such as this instruction:

g_spawn_sync (FIRESTARTER_RULES_DIR "/firestarter",
arg, NULL,
G_SPAWN_STDERR_TO_DEV_NULL,
NULL, NULL,
&output,NULL,&retval, &error)

please help me
thanks
 
Old 07-20-2008, 07:12 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Just guessing...
It looks like this:
Quote:
FIRESTARTER_RULES_DIR
is a variable that gets set somewhere, and is perhaps the path. Thus, the expression would decode to--e.g.-- /usr/share/firestarter.

It will help if you know what the function "g_spawn_sync" does.
 
Old 07-20-2008, 07:14 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
In that case, you will probably see a line like this elsewhere:

#define FIRESTARTER_RULES_DIR "/blah/blah/blah"

When the preprocessor runs through the code and sees this:
g_spawn_sync (FIRESTARTER_RULES_DIR "/firestarter",

It will expand the variable FIRESTARTER_RULES_DIR to obtain:
g_spawn_sync ("/blah/blah/blah" "/firestarter",

which is equivalent to:
g_spawn_sync ("/blah/blah/blah/firestarter",

So 'FIRESTARTER_RULES_DIR' is simply a directory path; presumably it holds rules for firestarter.
 
Old 07-20-2008, 08:39 AM   #4
Ashkan_s
Member
 
Registered: Jul 2008
Distribution: Fedora
Posts: 77

Original Poster
Rep: Reputation: 22
thanks for your help
 
  


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
understanding linux source code pankaj99 Programming 10 03-19-2006 04:54 PM
understanding linux source code iqbal Linux - General 2 09-16-2004 11:22 PM
help me in understanding this code???? tuxfood Programming 7 07-24-2004 09:23 AM
understanding linux code shahzadiub Linux - Newbie 1 06-25-2004 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:04 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