* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include "c.h"
+#include "nls.h"
+#include "closestream.h"
+
char *timetostr(const time_t time)
{
static char s[29]; /* [Sun Sep 01 00:00:00 1998 PST] */
bpos = strchr(line, '[') - line;
if (bpos < 0) {
- fprintf(stderr, "Extraneous newline in file. Exiting.");
+ fprintf(stderr, _("Extraneous newline in file. Exiting."));
exit(1);
}
line += 1 + bpos;
epos = strchr(line, ']') - line;
if (epos < 0) {
- fprintf(stderr, "Extraneous newline in file. Exiting.");
+ fprintf(stderr, _("Extraneous newline in file. Exiting."));
exit(1);
}
line[epos] = '\0';
void
usage(int result)
{
- printf("Usage: utmpdump [ -frh ] [ filename ]\n");
+ printf(_("Usage: utmpdump [ -frh ] [ filename ]\n"));
exit(result);
}
FILE *fp;
int reverse = 0, forever = 0;
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+ atexit(close_stdout);
+
while ((c = getopt(argc, argv, "froh")) != EOF) {
switch (c) {
case 'r':
}
if (optind < argc) {
- fprintf(stderr, "Utmp %sdump of %s\n", reverse ? "un" : "", argv[optind]);
+ fprintf(stderr, _("Utmp %sdump of %s\n"), reverse ? "un" : "", argv[optind]);
if ((fp = fopen(argv[optind], "r")) == NULL) {
perror("Unable to open file");
exit(1);
}
}
else {
- fprintf(stderr, "Utmp %sdump of stdin\n", reverse ? "un" : "");
+ fprintf(stderr, _("Utmp %sdump of stdin\n"), reverse ? "un" : "");
fp = stdin;
}