[cs631apue] starting functions in GNU Linux mian()

xxu15 at stevens.edu xxu15 at stevens.edu
Tue Sep 16 23:24:49 EDT 2014


"setprogname can maximum program's portability."  What do you mean by this?
If the program is invoked directly, the process name will be argv[0],  even if not, why necessary to do  set_program_name (argv[0]) ?
why it is necessary to invoke "bindtextdomain (PACKAGE, LOCALEDIR);" and  "textdomain (PACKAGE);" ?




Sincerely,
Xiang Xu (徐祥) 
Student ID: 10388813
tel: +1 (201) 918-0570
      +86 13851478402
qq: 185904095

From: zding4
Date: 2014-09-16 22:40
To: cs631apue
Subject: Re: [cs631apue] starting functions in GNU Linux mian()
setprogname can maximum program's portability.
But GNU use macro to define the program name.

在 09/16/2014 10:30 PM,cpunjabi 写道:
> argv[0] always contains the name of the program. i.e if you run
> welcome.c program, argv[0] contains "welcome". I think setlocale is
> used for internationalization, LC_ALL specifies the locale for all
> purposes and By setting the locale to "", we are implicitly assigning
> the locale to the user's defined locale.
> 
> On 2014-09-16 22:15, xxu15 at stevens.edu wrote:
>> 
>> Hi,
>> I found that in many GNU Linux c files, at the begining of the main()
>> function, there are such functions being invoked as below:
>> 
>> initialize_main (&argc, &argv);
>> set_program_name (argv[0]);
>> setlocale (LC_ALL, "");
>> 
>> bindtextdomain (PACKAGE, LOCALEDIR);
>> 
(PACKAGE);
>> 
>> Has any body figured out what they are used for ?
>> 
>> -------------------------
>> 
>> Sincerely,
>> Xiang Xu (徐祥)
>> Student ID: 10388813
>> tel: +1 (201) 918-0570
>>  +86 13851478402
>> qq: 185904095
>> _______________________________________________
>> cs631apue mailing list
>> cs631apue at lists.stevens.edu
>> https://lists.stevens.edu/mailman/listinfo/cs631apue
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs631apue


_______________________________________________
cs631apue mailing list
cs631apue at lists.stevens.edu
https://lists.stevens.edu/mailman/listinfo/cs631apue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20140916/4931b0b6/attachment.html>


More information about the cs631apue mailing list