renamed warning() to notice()

This commit is contained in:
anon 2025-01-24 23:33:08 +01:00
parent 11062cfff2
commit 9448bd3b7e
4 changed files with 11 additions and 10 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ vimdir_test_file.vimdir
vimdir
object/*
vimdir.tar
*.out

View File

@ -11,11 +11,11 @@ void verror(const char * fmt, va_list argv) {
fdictate(stderr, "$0");
}
void warning(const char * fmt, ...) {
void notice(const char * fmt, ...) {
va_list argv;
va_start(argv, fmt);
fdictatef(stderr, "$yvimdir: warning: ");
fdictatef(stderr, "$yvimdir: notice: ");
vafdictatef(stderr, fmt, argv);
fdictate(stderr, "$0");

View File

@ -17,7 +17,7 @@ enum {
};
extern void errorn(int n, ...);
extern void warning(const char * fmt, ...);
extern void notice(const char * fmt, ...);
#define CHECK_OPEN(f, n, E) \
if (!f) { \

View File

@ -149,44 +149,44 @@ mode_t str_to_mode(const char *permissions) {
// --- Dry implementations
static
int dry_touch(const char * filename) {
warning("touch '%s' (subsequent stats will fail)", filename);
notice("touch '%s' (subsequent stats will fail)", filename);
return 0;
}
static
int dry_delete(const char * filename) {
warning("delete '%s'", filename);
notice("delete '%s'", filename);
return 0;
}
static
int dry_chmod(const char * filename, mode_t mode) {
char buf[11];
warning("chmod '%s' (%s)", filename, mode_to_str(mode, buf));
notice("chmod '%s' (%s)", filename, mode_to_str(mode, buf));
return 0;
}
static
int dry_chown(const char * filename, const char * owner, const char * group) {
warning("chown '%s' (%s:%s)", filename, owner, group);
notice("chown '%s' (%s:%s)", filename, owner, group);
return 0;
}
static
int dry_move(const char * filename, const char * newname) {
warning("rename '%s' (-> '%s')", filename, newname);
notice("rename '%s' (-> '%s')", filename, newname);
return 0;
}
static
int dry_copy(const char * filename, const char * newname) {
warning("copy '%s' (as '%s')", filename, newname);
notice("copy '%s' (as '%s')", filename, newname);
return 0;
}
static
move_data_t dry_mytempmove(const char * filename, const char * newname) {
warning("swap detected in a dry-run ('%s' <-> '%s'); the following logs will be inaccurate", filename, newname);
notice("swap detected in a dry-run ('%s' <-> '%s'); the following logs will be inaccurate", filename, newname);
return (move_data_t) {
.orig_name = strdup(filename),
.curt_name = strdup(filename),