aboutsummaryrefslogtreecommitdiff
path: root/src/wydawca.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-01-03 11:44:34 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-01-03 11:49:20 +0200
commitc2cbf4e863a8f3a5081357d4b48f54cec2cd5d69 (patch)
tree93711f398c585fcc8ac0b19bbcfe15b79f4c6b73 /src/wydawca.h
parenta2489ce17e9c9a03b649d5b63183d4f830c639a1 (diff)
downloadwydawca-c2cbf4e863a8f3a5081357d4b48f54cec2cd5d69.tar.gz
wydawca-c2cbf4e863a8f3a5081357d4b48f54cec2cd5d69.tar.bz2
Do not pass spool as a separate parameter, register it early in the triplet.
* src/directive.c (process_directives): Remove spool parameter. * src/gpg.c (verify_directive_signature) (verify_detached_signature): Remove spool parameter. * src/process.c (scan_spool_unlocked): Update call to register_file. * src/triplet.c (register_file): Take spool ptr as second argument. (triplet_processor): Ignore proc_data. (enumerate_triplets): Pass NULL as proc_data. * src/verify.c (verify_directive_file): Remove spool parameter. * src/wydawca.h (ASGN_SPOOL): New macro. (register_file, verify_directive_file) (verify_directive_signature, verify_detached_signature) (process_directives): Remove spool parameter. * src/getopt.m4 (print_help): Minor fix.
Diffstat (limited to 'src/wydawca.h')
-rw-r--r--src/wydawca.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/wydawca.h b/src/wydawca.h
index 54ecf00..b44b5d7 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -238,6 +238,20 @@ struct spool
char *check_script;
};
+#define ASGN_SPOOL(spool, trp, faction) \
+ do \
+ { \
+ spool = (trp)->spool; \
+ if (!spool) \
+ { \
+ logmsg (LOG_CRIT, \
+ _("INTERNAL ERROR at %s:%d: spool not defined for %s"),\
+ __FILE__, __LINE__, (trp)->name); \
+ faction; \
+ } \
+ } \
+ while (0)
+
enum wydawca_stat
{
@@ -401,7 +415,7 @@ void spool_create_timers (void);
void register_spool (struct spool *spool);
struct spool *wydawca_find_spool (const char *name);
-void register_file (struct file_info *finfo);
+void register_file (struct file_info *finfo, const struct spool *spool);
void enumerate_triplets (const struct spool *);
size_t count_collected_triplets (void);
char *triplet_expand_param (const char *tmpl, struct file_triplet *trp);
@@ -428,12 +442,9 @@ unsigned dictionary_num_rows (struct dictionary *dict);
unsigned dictionary_num_cols (struct dictionary *dict);
/* Verification functions */
-int verify_directive_file (struct file_triplet *trp,
- const struct spool *spool);
-int verify_directive_signature (struct file_triplet *trp,
- const struct spool *spool);
-int verify_detached_signature (struct file_triplet *trp,
- const struct spool *spool);
+int verify_directive_file (struct file_triplet *trp);
+int verify_directive_signature (struct file_triplet *trp);
+int verify_detached_signature (struct file_triplet *trp);
int fill_project_name (struct file_triplet *trp);
struct uploader_info *uploader_find_frp (struct uploader_info *list,
const char *frp);
@@ -450,8 +461,7 @@ int directive_first (struct file_triplet *trp,
const char **pkey, const char **pval);
int directive_next (struct file_triplet *trp, int n,
const char **pkey, const char **pval);
-int process_directives (struct file_triplet *trp,
- const struct spool *spool);
+int process_directives (struct file_triplet *trp);
int enabled_spool_p (const struct spool *spool);
int selected_spools (void);

Return to:

Send suggestions and report system problems to the System administrator.