diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-29 19:53:24 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-29 19:53:24 +0200 |
commit | a7278cd9133596c3adbad2fc03571ce8bea18272 (patch) | |
tree | 52bf5bfb1e7c79cbf27427e45ed95902147ce2fe | |
parent | 03d27824f4cdb403de79e9ecc82037df037723db (diff) | |
download | wydawca-a7278cd9133596c3adbad2fc03571ce8bea18272.tar.gz wydawca-a7278cd9133596c3adbad2fc03571ce8bea18272.tar.bz2 |
Remove unnecessary virtual function.
The source_dir of a spool always refers to a directory on a file system,
so the get_path method is unnecessary and is removed.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/vtab.c | 14 | ||||
-rw-r--r-- | src/watcher.c | 2 | ||||
-rw-r--r-- | src/wydawca.h | 3 |
4 files changed, 6 insertions, 16 deletions
@@ -14,7 +14,8 @@ Version 2.1.90 (Git) * When available, use inotify(7) to watch the input spools. The use of inotify allows wydawca to act immediately upon finished -uploads without the need of external notifications. +uploads without the need of external notifications. This makes the +TCP-based notification unnecessary on GNU/Linux systems. Version 2.1 "KMB", 2010-01-06 @@ -24,13 +24,13 @@ struct virt_tab_reg static struct virt_tab_reg reg[] = { { "file", - { dir_get_path, dir_test_url, dir_move_file, dir_archive_file, + { dir_test_url, dir_move_file, dir_archive_file, dir_symlink_file, dir_rmsymlink_file } }, { "dir", - { dir_get_path, dir_test_url, dir_move_file, dir_archive_file, + { dir_test_url, dir_move_file, dir_archive_file, dir_symlink_file, dir_rmsymlink_file } }, { "null", - { NULL, NULL, null_move_file, null_archive_file, null_symlink_file, + { NULL, null_move_file, null_archive_file, null_symlink_file, null_rmsymlink_file } }, { NULL } }; @@ -53,14 +53,6 @@ url_to_vtab (mu_url_t url, struct virt_tab *vtab) } -const char * -get_path (struct spool *sp) -{ - if (!sp->vtab.get_path) - return NULL; - return sp->vtab.get_path (sp); -} - int move_file (struct file_triplet *trp, enum file_type file_id) { diff --git a/src/watcher.c b/src/watcher.c index 1c67294..f6245db 100644 --- a/src/watcher.c +++ b/src/watcher.c @@ -79,7 +79,7 @@ create_watcher (struct spool *sp, void *data) int ifd = *(int*)data; struct dirwatcher *dwp; int wd; - const char *path = get_path (sp); + const char *path = sp->source_dir; if (!sp) return 0; diff --git a/src/wydawca.h b/src/wydawca.h index 4021a56..25153c2 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -206,7 +206,6 @@ struct file_triplet struct virt_tab { - const char *(*get_path) (struct spool *sp); int (*test_url) (mu_url_t url, grecs_locus_t *loc); int (*move_file) (struct file_triplet *trp, enum file_type file_id); int (*archive_file) (struct file_triplet *trp, const char *file_name); @@ -508,7 +507,6 @@ int assert_string_arg (grecs_locus_t *, enum grecs_callback_command, /* vtab.c */ int url_to_vtab (mu_url_t url, struct virt_tab *vtab); -const char *get_path (struct spool *sp); int move_file (struct file_triplet *trp, enum file_type file_id); int archive_file (struct file_triplet *trp, const char *file_name); int symlink_file (struct file_triplet *trp, @@ -520,7 +518,6 @@ int rmsymlink_file (struct file_triplet *trp, const char *file_name); char *concat_dir (const char *base, const char *name, size_t *pbaselen); int copy_file (const char *file, const char *dst_file); -const char *dir_get_path (struct spool *sp); int dir_test_url (mu_url_t url, grecs_locus_t *locus); int dir_move_file (struct file_triplet *trp, enum file_type file_id); int dir_archive_file (struct file_triplet *trp, const char *reldir); |