diff options
Diffstat (limited to 'src/wydawca.h')
-rw-r--r-- | src/wydawca.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/wydawca.h b/src/wydawca.h index 96fd336..d9933d6 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -83,26 +83,26 @@ #define __cat3__(a,b,c) a ## b ## c #define NITEMS(a) (sizeof(a)/sizeof((a)[0])) -enum access_method_id { - project_uploader_method, /* Retrieves names, gpg-keys, emails and - real names of the project uploaders */ - project_owner_method, /* Retrieves names and emails of the project - owners */ - access_method_count +enum dictionary_id { + project_uploader_dict, /* Contains names, gpg-keys, emails and + real names of the project uploaders */ + project_owner_dict, /* Contains names and emails of the project + owners */ + dictionary_count }; -enum access_method_type +enum dictionary_type { - method_none, /* Undefined or no method */ - method_sql, /* Use SQL database */ - method_builtin, /* Use built-in facilities */ - method_external /* Invoke an external program */ + dictionary_none, /* Undefined or no dictionary */ + dictionary_sql, /* Use SQL database */ + dictionary_builtin, /* Use built-in facilities */ + dictionary_external /* Invoke an external program */ }; -struct access_method +struct dictionary { - enum access_method_id id; - enum access_method_type type; /* Access method type */ + enum dictionary_id id; + enum dictionary_type type; /* Dictionary type */ char *query; /* Query template */ int parmc; /* Number of entries in paramv */ char **parmv; /* Parameters. The semantics differs @@ -230,7 +230,7 @@ struct spool time_t file_sweep_time; /* Remove invalid/unprocessed files after this amount of time */ - struct access_method *access_method[access_method_count]; + struct dictionary *dictionary[dictionary_count]; struct archive_descr archive; /* Archivation data */ struct notification *notification; }; @@ -304,7 +304,7 @@ struct metadef }; char *meta_expand_string (const char *string, struct metadef *def, void *data, - struct access_method *method, void *handle); + struct dictionary *dict, void *handle); void meta_free (struct metadef *def); @@ -395,27 +395,27 @@ void register_file (struct file_info *finfo); void enumerate_triplets (const struct spool *); size_t count_collected_triplets (void); char *triplet_expand_param (const char *tmpl, struct file_triplet *trp); -char *triplet_expand_method_query (struct access_method *method, void *handle, +char *triplet_expand_dictionary_query (struct dictionary *dict, void *handle, struct file_triplet *trp); -/* General-purpose method support */ -struct access_method *method_new (enum access_method_id id, - enum access_method_type type); -int method_init (struct access_method *method); -int method_done (struct access_method *method); -void *method_open (struct access_method *method); -int method_close (struct access_method *method, void *handle); -int method_run (struct access_method *method, void *handle, const char *cmd); -void method_copy_result (struct access_method *method, const char *res, +/* General-purpose dictionary support */ +struct dictionary *dictionary_new (enum dictionary_id id, + enum dictionary_type type); +int dictionary_init (struct dictionary *dict); +int dictionary_done (struct dictionary *dict); +void *dictionary_open (struct dictionary *dict); +int dictionary_close (struct dictionary *dict, void *handle); +int dictionary_lookup (struct dictionary *dict, void *handle, const char *cmd); +void dictionary_copy_result (struct dictionary *dict, const char *res, size_t size); -const char *method_result (struct access_method *method, void *handle, +const char *dictionary_result (struct dictionary *dict, void *handle, unsigned nrow, unsigned ncol); -int method_quote_string (struct access_method *method, void *handle, +int dictionary_quote_string (struct dictionary *dict, void *handle, const char *input, char **poutput, size_t *psize); -unsigned method_num_rows (struct access_method *method); -unsigned method_num_cols (struct access_method *method); +unsigned dictionary_num_rows (struct dictionary *dict); +unsigned dictionary_num_cols (struct dictionary *dict); /* Verification functions */ int verify_directive_file (struct file_triplet *trp, |