8
static int
reorderO
{
}
char line[MAX_LIRE];
char nev_Iine[KAX_LIBE];
vhile«£gets( line, MAX_LIRE, Input»
!= lULL) {
i£ (£puts( strord( nev_Iine, line,
File~ode),
stdout)
== EOF) {
}
}
Perror( "£puts");
return BAD;
return GOOD;
1*
**************************************************************************
** PerrorO
**
** description:
** set up string vith program name and the £ailed routine name
** display system error message on stderr using perror(3)
**
** assumption:
** perror string be£ore the colon viII not exceed MAX_ERR
**
** global variables:
** Progname: char pointer to the program name
**
** return value:
** no return value
**************************************************************************
*1
1*
VARARGS 1
*1
static void
Perror( rname)
char *rname;
1*
bad routine name
*1
{
char pstr[MAX_ERR];
1*
perror string be£ore the colon
*1
1*
set up perror string
*1
(void) sprint£( pstr, "%s (%s)", Progname, rname);
1*
print the system message or errno
*1
i£ (errno
>
0 tt errno < sys_nerr) {
perror ( pstr);
8-10
Example of Internationalized Software