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) | |||
14 | * When available, use inotify(7) to watch the input spools. | 14 | * When available, use inotify(7) to watch the input spools. |
15 | 15 | ||
16 | The use of inotify allows wydawca to act immediately upon finished | 16 | The use of inotify allows wydawca to act immediately upon finished |
17 | uploads without the need of external notifications. | 17 | uploads without the need of external notifications. This makes the |
18 | TCP-based notification unnecessary on GNU/Linux systems. | ||
18 | 19 | ||
19 | 20 | ||
20 | Version 2.1 "KMB", 2010-01-06 | 21 | Version 2.1 "KMB", 2010-01-06 |
@@ -24,13 +24,13 @@ struct virt_tab_reg | |||
24 | 24 | ||
25 | static struct virt_tab_reg reg[] = { | 25 | static struct virt_tab_reg reg[] = { |
26 | { "file", | 26 | { "file", |
27 | { dir_get_path, dir_test_url, dir_move_file, dir_archive_file, | 27 | { dir_test_url, dir_move_file, dir_archive_file, |
28 | dir_symlink_file, dir_rmsymlink_file } }, | 28 | dir_symlink_file, dir_rmsymlink_file } }, |
29 | { "dir", | 29 | { "dir", |
30 | { dir_get_path, dir_test_url, dir_move_file, dir_archive_file, | 30 | { dir_test_url, dir_move_file, dir_archive_file, |
31 | dir_symlink_file, dir_rmsymlink_file } }, | 31 | dir_symlink_file, dir_rmsymlink_file } }, |
32 | { "null", | 32 | { "null", |
33 | { NULL, NULL, null_move_file, null_archive_file, null_symlink_file, | 33 | { NULL, null_move_file, null_archive_file, null_symlink_file, |
34 | null_rmsymlink_file } }, | 34 | null_rmsymlink_file } }, |
35 | { NULL } | 35 | { NULL } |
36 | }; | 36 | }; |
@@ -53,14 +53,6 @@ url_to_vtab (mu_url_t url, struct virt_tab *vtab) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | 55 | ||
56 | const char * | ||
57 | get_path (struct spool *sp) | ||
58 | { | ||
59 | if (!sp->vtab.get_path) | ||
60 | return NULL; | ||
61 | return sp->vtab.get_path (sp); | ||
62 | } | ||
63 | |||
64 | int | 56 | int |
65 | move_file (struct file_triplet *trp, enum file_type file_id) | 57 | move_file (struct file_triplet *trp, enum file_type file_id) |
66 | { | 58 | { |
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) | |||
79 | int ifd = *(int*)data; | 79 | int ifd = *(int*)data; |
80 | struct dirwatcher *dwp; | 80 | struct dirwatcher *dwp; |
81 | int wd; | 81 | int wd; |
82 | const char *path = get_path (sp); | 82 | const char *path = sp->source_dir; |
83 | 83 | ||
84 | if (!sp) | 84 | if (!sp) |
85 | return 0; | 85 | 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 | |||
206 | 206 | ||
207 | struct virt_tab | 207 | struct virt_tab |
208 | { | 208 | { |
209 | const char *(*get_path) (struct spool *sp); | ||
210 | int (*test_url) (mu_url_t url, grecs_locus_t *loc); | 209 | int (*test_url) (mu_url_t url, grecs_locus_t *loc); |
211 | int (*move_file) (struct file_triplet *trp, enum file_type file_id); | 210 | int (*move_file) (struct file_triplet *trp, enum file_type file_id); |
212 | int (*archive_file) (struct file_triplet *trp, const char *file_name); | 211 | 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, | |||
508 | /* vtab.c */ | 507 | /* vtab.c */ |
509 | int url_to_vtab (mu_url_t url, struct virt_tab *vtab); | 508 | int url_to_vtab (mu_url_t url, struct virt_tab *vtab); |
510 | 509 | ||
511 | const char *get_path (struct spool *sp); | ||
512 | int move_file (struct file_triplet *trp, enum file_type file_id); | 510 | int move_file (struct file_triplet *trp, enum file_type file_id); |
513 | int archive_file (struct file_triplet *trp, const char *file_name); | 511 | int archive_file (struct file_triplet *trp, const char *file_name); |
514 | int symlink_file (struct file_triplet *trp, | 512 | int symlink_file (struct file_triplet *trp, |
@@ -520,7 +518,6 @@ int rmsymlink_file (struct file_triplet *trp, const char *file_name); | |||
520 | char *concat_dir (const char *base, const char *name, size_t *pbaselen); | 518 | char *concat_dir (const char *base, const char *name, size_t *pbaselen); |
521 | int copy_file (const char *file, const char *dst_file); | 519 | int copy_file (const char *file, const char *dst_file); |
522 | 520 | ||
523 | const char *dir_get_path (struct spool *sp); | ||
524 | int dir_test_url (mu_url_t url, grecs_locus_t *locus); | 521 | int dir_test_url (mu_url_t url, grecs_locus_t *locus); |
525 | int dir_move_file (struct file_triplet *trp, enum file_type file_id); | 522 | int dir_move_file (struct file_triplet *trp, enum file_type file_id); |
526 | int dir_archive_file (struct file_triplet *trp, const char *reldir); | 523 | int dir_archive_file (struct file_triplet *trp, const char *reldir); |