tartest.c (schily-2021-08-14.tar.bz2) | : | tartest.c (schily-2021-09-18.tar.bz2) | ||
---|---|---|---|---|
/* @(#)tartest.c 1.23 18/06/17 Copyright 2002-2018 J. Schilling */ | /* @(#)tartest.c 1.24 21/08/20 Copyright 2002-2021 J. Schilling */ | |||
#include <schily/mconfig.h> | #include <schily/mconfig.h> | |||
#ifndef lint | #ifndef lint | |||
static UConst char sccsid[] = | static UConst char sccsid[] = | |||
"@(#)tartest.c 1.23 18/06/17 Copyright 2002-2018 J. Schilling"; | "@(#)tartest.c 1.24 21/08/20 Copyright 2002-2021 J. Schilling"; | |||
#endif | #endif | |||
/* | /* | |||
* Copyright (c) 2002-2018 J. Schilling | * Copyright (c) 2002-2021 J. Schilling | |||
*/ | */ | |||
/* | /* | |||
* The contents of this file are subject to the terms of the | * The contents of this file are subject to the terms of the | |||
* Common Development and Distribution License, Version 1.0 only | * Common Development and Distribution License, Version 1.0 only | |||
* (the "License"). You may not use this file except in compliance | * (the "License"). You may not use this file except in compliance | |||
* with the License. | * with the License. | |||
* | * | |||
* See the file CDDL.Schily.txt in this distribution for details. | * See the file CDDL.Schily.txt in this distribution for details. | |||
* A copy of the CDDL is also available via the Internet at | * A copy of the CDDL is also available via the Internet at | |||
* http://www.opensource.org/licenses/cddl1.txt | * http://www.opensource.org/licenses/cddl1.txt | |||
skipping to change at line 37 | skipping to change at line 37 | |||
#include "star.h" | #include "star.h" | |||
#include <schily/standard.h> | #include <schily/standard.h> | |||
#include <schily/string.h> | #include <schily/string.h> | |||
#include <schily/getargs.h> | #include <schily/getargs.h> | |||
#define GT_COMERR /* #define comerr gtcomerr */ | #define GT_COMERR /* #define comerr gtcomerr */ | |||
#define GT_ERROR /* #define error gterror */ | #define GT_ERROR /* #define error gterror */ | |||
#include <schily/schily.h> | #include <schily/schily.h> | |||
#include <schily/fcntl.h> /* O_BINARY */ | #include <schily/fcntl.h> /* O_BINARY */ | |||
#include <schily/io.h> /* for setmode() prototype */ | #include <schily/io.h> /* for setmode() prototype */ | |||
#include <schily/nlsdefs.h> | ||||
LOCAL void usage __PR((int ret)); | LOCAL void usage __PR((int ret)); | |||
EXPORT int main __PR((int ac, char *av[])); | EXPORT int main __PR((int ac, char *av[])); | |||
LOCAL BOOL doit __PR((FILE *f)); | LOCAL BOOL doit __PR((FILE *f)); | |||
LOCAL BOOL checkhdr __PR((TCB *ptb)); | LOCAL BOOL checkhdr __PR((TCB *ptb)); | |||
LOCAL BOOL checkoctal __PR((char *ptr, int len, char *text)); | LOCAL BOOL checkoctal __PR((char *ptr, int len, char *text)); | |||
LOCAL BOOL checktype __PR((TCB *ptb)); | LOCAL BOOL checktype __PR((TCB *ptb)); | |||
LOCAL BOOL checkid __PR((char *ptr, char *text)); | LOCAL BOOL checkid __PR((char *ptr, char *text)); | |||
LOCAL BOOL checkmagic __PR((char *ptr)); | LOCAL BOOL checkmagic __PR((char *ptr)); | |||
LOCAL BOOL checkvers __PR((char *ptr)); | LOCAL BOOL checkvers __PR((char *ptr)); | |||
skipping to change at line 80 | skipping to change at line 81 | |||
main(ac, av) | main(ac, av) | |||
int ac; | int ac; | |||
char *av[]; | char *av[]; | |||
{ | { | |||
int cac = ac; | int cac = ac; | |||
char *const *cav = av; | char *const *cav = av; | |||
BOOL help = FALSE; | BOOL help = FALSE; | |||
BOOL prversion = FALSE; | BOOL prversion = FALSE; | |||
save_args(ac, av); | save_args(ac, av); | |||
(void) setlocale(LC_ALL, ""); | ||||
#ifdef USE_NLS | ||||
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ | ||||
#define TEXT_DOMAIN "tartest" /* Use this only if it weren't */ | ||||
#endif | ||||
{ char *dir; | ||||
dir = searchfileinpath("share/locale", F_OK, | ||||
SIP_ANY_FILE|SIP_NO_PATH, NULL); | ||||
if (dir) | ||||
(void) bindtextdomain(TEXT_DOMAIN, dir); | ||||
else | ||||
#if defined(PROTOTYPES) && defined(INS_BASE) | ||||
(void) bindtextdomain(TEXT_DOMAIN, INS_BASE "/share/locale"); | ||||
#else | ||||
(void) bindtextdomain(TEXT_DOMAIN, "/usr/share/locale"); | ||||
#endif | ||||
(void) textdomain(TEXT_DOMAIN); | ||||
} | ||||
#endif /* USE_NLS */ | ||||
cac--; | cac--; | |||
cav++; | cav++; | |||
if (getallargs(&cac, &cav, "help,h,version,v", &help, &help, | if (getallargs(&cac, &cav, "help,h,version,v", &help, &help, | |||
&prversion, &verbose) < 0) { | &prversion, &verbose) < 0) { | |||
errmsgno(EX_BAD, "Bad Option: '%s'.\n", cav[0]); | errmsgno(EX_BAD, "Bad Option: '%s'.\n", cav[0]); | |||
usage(EX_BAD); | usage(EX_BAD); | |||
} | } | |||
if (help) | if (help) | |||
usage(0); | usage(0); | |||
printf("tartest %s (%s-%s-%s)\n\n", "1.23", | printf("tartest %s (%s-%s-%s)\n\n", "1.24", | |||
HOST_CPU, HOST_VENDOR, HOST_OS); | HOST_CPU, HOST_VENDOR, HOST_OS); | |||
gtprintf("Copyright (C) 2002-2017 Jörg Schilling\n"); | gtprintf("Copyright (C) 2002-2021 %s\n", _("Jörg Schilling")); | |||
gtprintf("This is free software; see the source for copying conditions. There is NO\n"); | gtprintf("This is free software; see the source for copying conditions. There is NO\n"); | |||
gtprintf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU LAR PURPOSE.\n"); | gtprintf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU LAR PURPOSE.\n"); | |||
if (prversion) | if (prversion) | |||
exit(0); | exit(0); | |||
gtprintf("\nTesting for POSIX.1-1990 TAR compliance...\n"); | gtprintf("\nTesting for POSIX.1-1990 TAR compliance...\n"); | |||
setmode(fileno(stdin), O_BINARY); | setmode(fileno(stdin), O_BINARY); | |||
if (!doit(stdin)) { | if (!doit(stdin)) { | |||
End of changes. 7 change blocks. | ||||
5 lines changed or deleted | 27 lines changed or added |