aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-12-29 19:53:24 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-12-29 19:53:24 +0200
commita7278cd9133596c3adbad2fc03571ce8bea18272 (patch)
tree52bf5bfb1e7c79cbf27427e45ed95902147ce2fe
parent03d27824f4cdb403de79e9ecc82037df037723db (diff)
downloadwydawca-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--NEWS3
-rw-r--r--src/vtab.c14
-rw-r--r--src/watcher.c2
-rw-r--r--src/wydawca.h3
4 files changed, 6 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 804a61e..f28ec2a 100644
--- a/NEWS
+++ b/NEWS
@@ -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
16The use of inotify allows wydawca to act immediately upon finished 16The use of inotify allows wydawca to act immediately upon finished
17uploads without the need of external notifications. 17uploads without the need of external notifications. This makes the
18TCP-based notification unnecessary on GNU/Linux systems.
18 19
19 20
20Version 2.1 "KMB", 2010-01-06 21Version 2.1 "KMB", 2010-01-06
diff --git a/src/vtab.c b/src/vtab.c
index cec6fc0..e05b964 100644
--- a/src/vtab.c
+++ b/src/vtab.c
@@ -24,13 +24,13 @@ struct virt_tab_reg
24 24
25static struct virt_tab_reg reg[] = { 25static 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
56const char *
57get_path (struct spool *sp)
58{
59 if (!sp->vtab.get_path)
60 return NULL;
61 return sp->vtab.get_path (sp);
62}
63
64int 56int
65move_file (struct file_triplet *trp, enum file_type file_id) 57move_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
207struct virt_tab 207struct 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 */
509int url_to_vtab (mu_url_t url, struct virt_tab *vtab); 508int url_to_vtab (mu_url_t url, struct virt_tab *vtab);
510 509
511const char *get_path (struct spool *sp);
512int move_file (struct file_triplet *trp, enum file_type file_id); 510int move_file (struct file_triplet *trp, enum file_type file_id);
513int archive_file (struct file_triplet *trp, const char *file_name); 511int archive_file (struct file_triplet *trp, const char *file_name);
514int symlink_file (struct file_triplet *trp, 512int symlink_file (struct file_triplet *trp,
@@ -520,7 +518,6 @@ int rmsymlink_file (struct file_triplet *trp, const char *file_name);
520char *concat_dir (const char *base, const char *name, size_t *pbaselen); 518char *concat_dir (const char *base, const char *name, size_t *pbaselen);
521int copy_file (const char *file, const char *dst_file); 519int copy_file (const char *file, const char *dst_file);
522 520
523const char *dir_get_path (struct spool *sp);
524int dir_test_url (mu_url_t url, grecs_locus_t *locus); 521int dir_test_url (mu_url_t url, grecs_locus_t *locus);
525int dir_move_file (struct file_triplet *trp, enum file_type file_id); 522int dir_move_file (struct file_triplet *trp, enum file_type file_id);
526int dir_archive_file (struct file_triplet *trp, const char *reldir); 523int dir_archive_file (struct file_triplet *trp, const char *reldir);

Return to:

Send suggestions and report system problems to the System administrator.