- 论坛徽章:
- 0
|
近日在看GNU coreutils 的代码,有一点疑惑。请看:
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
printf (_("\
Usage: %s NAME [SUFFIX]\n\
or: %s OPTION\n\
"),
program_name, program_name);
fputs (_("\
Print NAME with any leading directory components removed.\n\
If specified, also remove a trailing SUFFIX.\n\
\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
printf (_("\
\n\
Examples:\n\
%s /usr/bin/sort Output \"sort\".\n\
%s include/stdio.h .h Output \"stdio\".\n\
"),
program_name, program_name);
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
}
exit (status);
} |
1. 为什么字符串要用 _( ) 包起来?
2. 为什么这段代码里面有时用 printf 有时却用 fputs ?
望高手解惑,多谢。 |
|