diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-03-12 15:03:59 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-03-12 15:22:13 +0200 |
commit | 1ba8cf95a5f536d4aa6293f9848271a7285bc092 (patch) | |
tree | dede8a4bccb1daad8b67530d87845e7fe05749e6 /src/diskio.c | |
parent | 293108d7806aa3c0c5e706237b3788b261779e66 (diff) | |
download | wydawca-1ba8cf95a5f536d4aa6293f9848271a7285bc092.tar.gz wydawca-1ba8cf95a5f536d4aa6293f9848271a7285bc092.tar.bz2 |
Namespace normalization (2). Provide installable headers.
* Makefile.am (SUBDIRS): Add include.
* configure.ac: Build include/*/Makefile
Set-up grecs as a shared convenience library. Install
its headers.
* include/Makefile.am: New file.
* include/wydawca/Makefile.am: New file.
* include/wydawca/cfg.h: New file.
* include/wydawca/wydawca.h: New file.
* modules/mailutils/Makefile.am (AM_CPPFLAGS): Add include/
* src/Makefile.am (LDADD): Use @GRECS_LDADD@
(AM_CPPFLAGS): Add include/.
* tests/Makefile.am: Likewise.
* src/wydawca.h: Include wydawca/wydawca.h.
(__cat2__, __cat3__): Move to installable header and rename.
(struct wy_user): Move to installable header.
(struct file_triplet): Rename to wy_triplet. All uses changed.
(enum notification_event): Rename to wy_event and move to
installable header.
(struct metadef): Rename to wy_metadef and move to
installable header.
(dry_run_mode): Rename to wy_dry_run and move to
installable header.
(wydawca_gpg_homedir): Rename to wy_gpg_homedir and move to
installable header.
(wy_version, wy_debug_level, wy_log_to_stderr)
(wy_log_facility, wy_syslog_tag)
(wy_log,wy_dbg): Move to installable header.
* modules/mailutils/mod_mailutils.c: Update.
* src/cmdline.opt
* src/config.c
* src/directive.c
* src/diskio.c
* src/event.c
* src/gpg.c
* src/job.c
* src/meta.c
* src/module.c
* src/null.c
* src/timer.c
* src/triplet.c
* src/verify.c
* src/vtab.c
* src/watcher.c
* src/wydawca.c
Diffstat (limited to 'src/diskio.c')
-rw-r--r-- | src/diskio.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/diskio.c b/src/diskio.c index 99d3b54..d083d2a 100644 --- a/src/diskio.c +++ b/src/diskio.c @@ -102,14 +102,14 @@ create_hierarchy(char *dir, size_t baselen) /* Create a directory BASE/NAME (with eventual intermediate directories in NAME). - Do nothing if dry_run_mode is set. */ + Do nothing if wy_dry_run is set. */ char * create_directory(const char *base, const char *name) { size_t baselen; char *dir = concat_dir(base, name, &baselen); - if (!dry_run_mode) { + if (!wy_dry_run) { if (create_hierarchy(dir, baselen)) { free(dir); dir = NULL; @@ -225,14 +225,14 @@ do_move_file(const char *file, const char *dst_file) } /* Append the FILE to the tar ARCHIVE. - Do nothing if dry_run_mode is set. */ + Do nothing if wy_dry_run is set. */ int tar_append_file(const char *archive, const char *file) { const char *argv[6]; wy_debug(1, (_("tarring %s to %s"), file, archive)); - if (dry_run_mode) { + if (wy_dry_run) { UPDATE_STATS(STAT_ARCHIVES); return 0; } @@ -266,7 +266,7 @@ tar_append_file(const char *archive, const char *file) ARCHIVE - Archive descriptor. RELDIR - Directory part of FILE - Do nothing if dry_run_mode is set. */ + Do nothing if wy_dry_run is set. */ int backup_file(const char *dst_file, const char *dst_dir, const char *file, const struct archive_descr *archive, const char *reldir) @@ -288,7 +288,7 @@ backup_file(const char *dst_file, const char *dst_dir, const char *file, wy_debug(1, (_("removing previous archive " "file `%s'"), file_name)); - if (!dry_run_mode && unlink(file_name)) { + if (!wy_dry_run && unlink(file_name)) { wy_log(LOG_ERR, _("cannot unlink previous archive " "file `%s': %s"), @@ -304,7 +304,7 @@ backup_file(const char *dst_file, const char *dst_dir, const char *file, wy_debug(1, (_("backing up previous archive " "file `%s' to `%s'"), file_name, archive_file_name)); - if (!dry_run_mode) { + if (!wy_dry_run) { rc = do_move_file(file_name, archive_file_name); if (rc) { @@ -323,7 +323,7 @@ backup_file(const char *dst_file, const char *dst_dir, const char *file, } wy_debug(1, (_("archiving `%s' to `%s'"), dst_file, file_name)); - if (!dry_run_mode) { + if (!wy_dry_run) { rc = do_move_file(dst_file, file_name); if (rc) wy_log(LOG_ERR, _("archiving `%s' as `%s' failed: %s"), @@ -357,7 +357,7 @@ do_archive_file(const char *dst_file, const char *dst_dir, const char *file, break; } - if (!dry_run_mode && unlink(dst_file) && errno != ENOENT) { + if (!wy_dry_run && unlink(dst_file) && errno != ENOENT) { wy_log(LOG_ERR, _("canot unlink file `%s': %s"), dst_file, strerror(errno)); return 1; @@ -366,7 +366,7 @@ do_archive_file(const char *dst_file, const char *dst_dir, const char *file, } static int -replace_allowed_p(struct file_triplet *trp) +replace_allowed_p(struct wy_triplet *trp) { const char *val; @@ -388,9 +388,9 @@ dir_get_path(struct spool *sp) TRP->SPOOL. TRP->RELATIVE_DIR gives relative directory (i.e. the directory part of the file name) for backup purposes. - Do nothing if dry_run_mode is set. */ + Do nothing if wy_dry_run is set. */ int -dir_move_file(struct file_triplet *trp, enum file_type file_id) +dir_move_file(struct wy_triplet *trp, enum file_type file_id) { char *dst_file; int rc = 0; @@ -421,7 +421,7 @@ dir_move_file(struct file_triplet *trp, enum file_type file_id) } } - if (!dry_run_mode && rc == 0) + if (!wy_dry_run && rc == 0) rc = do_move_file(trp->file[file_id].name, dst_file); free(dst_file); @@ -433,10 +433,10 @@ dir_move_file(struct file_triplet *trp, enum file_type file_id) /* Archive the file FILE_NAME, located in DPAIR->dest_dir, and remove the file. Get user IDs from the triplet TRP. - Do nothing if dry_run_mode is set. + Do nothing if wy_dry_run is set. */ int -archive_single_file(struct file_triplet *trp, const char *file_name, +archive_single_file(struct wy_triplet *trp, const char *file_name, int noentok) { char *dst_file; @@ -495,10 +495,10 @@ make_signame(const char *file_name) /* Archive the file FILE_NAME, located in DPAIR->dest_dir, and remove the file. Get user IDs from the triplet TRP. Unless FILE_NAME ends in ".sig", do the same with FILE_NAME.sig, if such a file exists. - Do nothing if dry_run_mode is set. + Do nothing if wy_dry_run is set. */ int -dir_archive_file(struct file_triplet *trp, const char *file_name) +dir_archive_file(struct wy_triplet *trp, const char *file_name) { int rc; char *signame; @@ -515,9 +515,9 @@ dir_archive_file(struct file_triplet *trp, const char *file_name) /* Create a symbolic link from WANTED_SRC to WANTED_DST in the subdirectory TRP->relative_dir of SPOOL->dest_dir. - Do nothing if dry_run_mode is set. */ + Do nothing if wy_dry_run is set. */ int -dir_symlink_file(struct file_triplet *trp, +dir_symlink_file(struct wy_triplet *trp, const char *wanted_src, const char *wanted_dst) { int rc = 0; @@ -550,7 +550,7 @@ dir_symlink_file(struct file_triplet *trp, wy_debug(1, (_("symlinking %s to %s in directory %s"), src, dst, dst_dir)); - if (!dry_run_mode) { + if (!wy_dry_run) { char *p = strrchr(dst, '/'); if (p > dst) { char *dir; @@ -639,7 +639,7 @@ do_rmsymlink_file(const char *dst_file, int noentok) return 1; } } - if (!dry_run_mode && unlink(dst_file)) { + if (!wy_dry_run && unlink(dst_file)) { wy_log(LOG_ERR, _("cannot unlink %s: %s"), dst_file, strerror(errno)); return 1; @@ -650,9 +650,9 @@ do_rmsymlink_file(const char *dst_file, int noentok) /* Remove the symbolic link TRP->spool->dest_dir/TRP->relative_dir/FILE_NAME - Do nothing if dry_run_mode is set. */ + Do nothing if wy_dry_run is set. */ int -dir_rmsymlink_file(struct file_triplet *trp, const char *file_name) +dir_rmsymlink_file(struct wy_triplet *trp, const char *file_name) { char *dst_file; int rc = 0; |