LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-23-2011, 08:47 PM   #1
bhismnarayan
Member
 
Registered: Jul 2010
Location: Jalgaon,India
Distribution: Ubuntu 10.04
Posts: 36

Rep: Reputation: 0
what is the function of these


hello
whichever source code I go through I find these three lines of code written what do they actually mean and what is their function?
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
textdomain(PACKAGE_NAME);
 
Old 02-24-2011, 01:31 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Could you explain a bit more?

- Is this LFS related,
- Which files are you looking at,
- What are you trying to do.
 
Old 02-24-2011, 01:16 PM   #3
bhismnarayan
Member
 
Registered: Jul 2010
Location: Jalgaon,India
Distribution: Ubuntu 10.04
Posts: 36

Original Poster
Rep: Reputation: 0
hello,
I am looking at the source code of all the packages that are attached with operating system.I have got the job of simulating linux command.files such as passwd.c ,shadow.c ,etc all those which are there in the src folder
 
Old 02-24-2011, 01:22 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I think I have a rough idea why this is so, but I'm definitely not sure.....

As this is not LFS related I will ask a moderator to move this to an appropriate sub-forum (Programming sound correct), this way it will get the proper attention.
 
Old 02-24-2011, 01:46 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,745

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 02-24-2011, 02:46 PM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Those are the lines needed to initialize the use of gettext in the code -that's why you see them (nearly) everywhere.
 
Old 02-24-2011, 11:15 PM   #7
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Also, if you see a function call in source code that you do not understand, you can check if there is a man page for it. For example:
Code:
man setlocale
man bindtextdomain
man textdomain
All three functions had manual pages on my system describing what the function does and what the arguments are supposed to be.

However, there are some times where a function does not have a man page. It could be that you need to install another package to get the documentation, or maybe the function just doesn't have any documentation available.
 
  


Reply

Tags
gettext



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
[SOLVED] How can a friend function access a public function from a base class? lesca Programming 1 11-17-2010 01:56 PM
Passing data from interrupt handler function to tasklet function in kernel programmin double-out Programming 2 05-18-2010 10:10 PM
[SOLVED] Threaded function cannot call a function with extern "C" but nonthreaded function can morty346 Programming 16 01-12-2010 05:00 PM
how to print function names & parmaters each time control enters the function? tanniru Linux - Networking 1 09-11-2008 01:21 AM
Compilation issue when Function is parameter in function call on LINUX sa20358 Linux - Software 2 07-24-2008 10:19 PM

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

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