aboutsummaryrefslogtreecommitdiff
path: root/src/wydawca.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wydawca.h')
-rw-r--r--src/wydawca.h83
1 files changed, 59 insertions, 24 deletions
diff --git a/src/wydawca.h b/src/wydawca.h
index 3f28919..8a716e4 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -34,3 +34,10 @@
#include <sys/stat.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/un.h>
+#include <sys/wait.h>
+#include <netdb.h>
+#include <arpa/inet.h>
#include <fcntl.h>
+#include <time.h>
@@ -49,2 +56,3 @@
#include "gconf.h"
+#include "gl_list.h"
#include "argcv.h"
@@ -158,3 +166,3 @@ struct file_triplet
struct file_info file[FILE_TYPE_COUNT]; /* Components */
- struct spool *spool; /* Owning spool */
+ const struct spool *spool; /* Owning spool */
char **directive; /* Decoded directive pairs (key: value\0) */
@@ -181,3 +189,3 @@ struct virt_tab
int (*move_file) (struct file_triplet *trp,
- struct spool *spool,
+ const struct spool *spool,
enum file_type file_id,
@@ -185,3 +193,3 @@ struct virt_tab
int (*archive_file) (struct file_triplet *trp,
- struct spool *spool,
+ const struct spool *spool,
const char *reldir,
@@ -189,3 +197,3 @@ struct virt_tab
int (*symlink_file) (struct file_triplet *trp,
- struct spool *spool,
+ const struct spool *spool,
const char *reldir,
@@ -194,3 +202,3 @@ struct virt_tab
int (*rmsymlink_file)(struct file_triplet *trp,
- struct spool *spool,
+ const struct spool *spool,
const char *reldir,
@@ -203,2 +211,4 @@ struct spool
{
+ char *tag;
+ gl_list_t aliases;
char *url; /* Download URL */
@@ -308,2 +318,11 @@ extern char *admin_stat_message;
+extern char *pidfile;
+extern int force_startup;
+
+extern int daemon_mode;
+extern time_t wakeup_interval;
+extern int foreground;
+extern int single_process;
+extern struct gconf_sockaddr listen_sockaddr;
+
#define UPDATE_STATS(what) \
@@ -343,6 +362,9 @@ enum exec_result wydawca_exec (int argc, const char **argv, int *retcode);
/* Directory scanning and registering */
-void scan_directories (void);
+void scan_spool (const struct spool *spool, int uc, uid_t *uv);
+void scan_directories (int, uid_t *);
+
void register_spool (struct spool *spool);
+struct spool *wydawca_find_spool (const char *name);
void register_file (struct file_info *finfo);
-void enumerate_triplets (struct spool *);
+void enumerate_triplets (const struct spool *);
size_t count_collected_triplets (void);
@@ -371,8 +393,8 @@ unsigned method_num_cols (struct access_method *method);
int verify_directive_file (struct file_triplet *trp,
- struct spool *spool);
+ const struct spool *spool);
int verify_directive_signature (struct file_triplet *trp,
- struct spool *spool,
+ const struct spool *spool,
const char *pubkey);
int verify_detached_signature (struct file_triplet *trp,
- struct spool *spool);
+ const struct spool *spool);
int fill_project_name (struct file_triplet *trp);
@@ -392,5 +414,4 @@ int directive_next (struct file_triplet *trp, int n,
int process_directives (struct file_triplet *trp,
- struct spool *spool);
+ const struct spool *spool);
-int match_uid_p (uid_t uid);
int enabled_spool_p (const struct spool *spool);
@@ -412,9 +433,9 @@ int url_to_vtab (mu_url_t url, struct virt_tab *vtab);
int
-move_file (struct file_triplet *trp, struct spool *spool,
+move_file (struct file_triplet *trp, const struct spool *spool,
enum file_type file_id, const char *reldir);
int
-archive_file (struct file_triplet *trp, struct spool *spool,
+archive_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir, const char *file_name);
int
-symlink_file (struct file_triplet *trp, struct spool *spool,
+symlink_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir,
@@ -422,3 +443,3 @@ symlink_file (struct file_triplet *trp, struct spool *spool,
int
-rmsymlink_file (struct file_triplet *trp, struct spool *spool,
+rmsymlink_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir, const char *file_name);
@@ -429,10 +450,10 @@ rmsymlink_file (struct file_triplet *trp, struct spool *spool,
int dir_test_url (mu_url_t url, gconf_locus_t *locus);
-int dir_move_file (struct file_triplet *trp, struct spool *spool,
+int dir_move_file (struct file_triplet *trp, const struct spool *spool,
enum file_type file_id, const char *reldir);
-int dir_archive_file (struct file_triplet *trp, struct spool *spool,
+int dir_archive_file (struct file_triplet *trp, const struct spool *spool,
const char *file_name, const char *reldir);
-int dir_symlink_file (struct file_triplet *trp, struct spool *spool,
+int dir_symlink_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir,
const char *wanted_src, const char *wanted_dst);
-int dir_rmsymlink_file (struct file_triplet *trp, struct spool *spool,
+int dir_rmsymlink_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir, const char *file_name);
@@ -440,10 +461,10 @@ int dir_rmsymlink_file (struct file_triplet *trp, struct spool *spool,
/* null.c */
-int null_move_file (struct file_triplet *trp, struct spool *spool,
+int null_move_file (struct file_triplet *trp, const struct spool *spool,
enum file_type file_id, const char *reldir);
-int null_archive_file (struct file_triplet *trp, struct spool *spool,
+int null_archive_file (struct file_triplet *trp, const struct spool *spool,
const char *file_name, const char *reldir);
-int null_symlink_file (struct file_triplet *trp, struct spool *spool,
+int null_symlink_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir,
const char *wanted_src, const char *wanted_dst);
-int null_rmsymlink_file (struct file_triplet *trp, struct spool *spool,
+int null_rmsymlink_file (struct file_triplet *trp, const struct spool *spool,
const char *reldir, const char *file_name);
@@ -471 +492,15 @@ void report_finish (void);
extern char *report_string;
+
+
+/* job.c */
+int schedule_job (const struct spool *spool, uid_t uid);
+void job_init (void);
+void job_queue_runner (void);
+
+
+/* profile.c */
+void check_pidfile (void);
+
+
+/* net.c */
+void wydawca_listener (void);

Return to:

Send suggestions and report system problems to the System administrator.