#include <string.h>
#endif
+#include <archive.h>
+#include <archive_entry.h>
+
#include "bsdcat.h"
#include "err.h"
static int exit_status = 0;
-void
+static __LA_NORETURN void
usage(FILE *stream, int eval)
{
const char *p;
exit(eval);
}
-static void
+static __LA_NORETURN void
version(void)
{
printf("bsdcat %s - %s \n",
exit(0);
}
-void
+static void
+bsdcat_print_error(void)
+{
+ lafe_warnc(0, "%s: %s",
+ bsdcat_current_path, archive_error_string(a));
+ exit_status = 1;
+}
+
+static void
bsdcat_next(void)
{
if (a != NULL) {
archive_read_support_format_raw(a);
}
-void
-bsdcat_print_error(void)
-{
- lafe_warnc(0, "%s: %s",
- bsdcat_current_path, archive_error_string(a));
- exit_status = 1;
-}
-
-void
+static void
bsdcat_read_to_stdout(const char* filename)
{
int r;
#include "config.h"
#endif
-#include <archive.h>
-#include <archive_entry.h>
-
struct bsdcat {
/* Option parser state */
int getopt_state;
};
int bsdcat_getopt(struct bsdcat *);
-void usage(FILE *stream, int eval);
-void bsdcat_next(void);
-void bsdcat_print_error(void);
-void bsdcat_read_to_stdout(const char* filename);
#endif
static int file_to_archive(struct cpio *, const char *);
static void free_cache(struct name_cache *cache);
static void list_item_verbose(struct cpio *, struct archive_entry *);
-static void long_help(void) __LA_NORETURN;
+static __LA_NORETURN void long_help(void);
static const char *lookup_gname(struct cpio *, gid_t gid);
static int lookup_gname_helper(struct cpio *,
const char **name, id_t gid);
static const char *lookup_uname(struct cpio *, uid_t uid);
static int lookup_uname_helper(struct cpio *,
const char **name, id_t uid);
-static void mode_in(struct cpio *) __LA_NORETURN;
-static void mode_list(struct cpio *) __LA_NORETURN;
+static __LA_NORETURN void mode_in(struct cpio *);
+static __LA_NORETURN void mode_list(struct cpio *);
static void mode_out(struct cpio *);
static void mode_pass(struct cpio *, const char *);
static const char *remove_leading_slash(const char *);
static int restore_time(struct cpio *, struct archive_entry *,
const char *, int fd);
-static void usage(void) __LA_NORETURN;
-static void version(void) __LA_NORETURN;
+static __LA_NORETURN void usage(void);
+static __LA_NORETURN void version(void);
static const char * passphrase_callback(struct archive *, void *);
static void passphrase_free(char *);
return ARCHIVE_FATAL; \
} while (0)
-void __archive_errx(int retvalue, const char *msg) __LA_NORETURN;
+__LA_NORETURN void __archive_errx(int retvalue, const char *msg);
void __archive_ensure_cloexec_flag(int fd);
int __archive_mktemp(const char *tmpdir);
#endif
void lafe_warnc(int code, const char *fmt, ...) __LA_PRINTFLIKE(2, 3);
-void lafe_errc(int eval, int code, const char *fmt, ...) __LA_NORETURN
- __LA_PRINTFLIKE(3, 4);
+__LA_NORETURN void lafe_errc(int eval, int code, const char *fmt, ...) __LA_PRINTFLIKE(3, 4);
const char * lafe_getprogname(void);
void lafe_setprogname(const char *name, const char *defaultname);
}
#endif
-static void long_help(void) __LA_NORETURN;
+static __LA_NORETURN void long_help(void);
static void only_mode(struct bsdtar *, const char *opt,
const char *valid);
static void set_mode(struct bsdtar *, char opt);
-static void version(void) __LA_NORETURN;
+static __LA_NORETURN void version(void);
/* A basic set of security flags to request from libarchive. */
#define SECURITY \
void tar_mode_t(struct bsdtar *bsdtar);
void tar_mode_u(struct bsdtar *bsdtar);
void tar_mode_x(struct bsdtar *bsdtar);
-void usage(void) __LA_NORETURN;
+__LA_NORETURN void usage(void);
int yes(const char *fmt, ...) __LA_PRINTF(1, 2);
#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)