aboutsummaryrefslogtreecommitdiff
path: root/include/wydawca/wydawca.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-07-24 14:14:47 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-07-24 14:27:11 +0300
commitc047ed856d6d23137ef1df01c1297db36bad3f8c (patch)
tree1999db947cb5e38df8a85d314daa0eef7c7624d0 /include/wydawca/wydawca.h
parent07ea006a31def46ba6ea936dbea366219152d9b6 (diff)
downloadwydawca-c047ed856d6d23137ef1df01c1297db36bad3f8c.tar.gz
wydawca-c047ed856d6d23137ef1df01c1297db36bad3f8c.tar.bz2
Use wordsplit to expand variables in strings.
* NEWS: Raise version number. * configure.ac: Link wydawca.h to include/wydawca Raise version number * doc/wydawca.texi: Document changes. * etc/wydawca.rc: Fix the syntax. * grecs: Upgrace. * include/wydawca/wydawca.h (wy_vlog): New proto. (wy_log, wy_dbg): Format is const char *. (wy_triplet_t): Change typedef. (wy_metadef): Remove struct. (wy_vardef): New struct. (wy_triplet_expand_param) (wy_expand_copy): New protos. * modules/logstat/mod_logstat.c: Update. * modules/mailutils/Makefile.am (AM_CPPFLAGS): Modify, * modules/mailutils/mod_mailutils.c: Update. * src/Makefile.am (wydawca_SOURCES): Remove meta.c * src/dictionary.c: Fix comment. * src/directive.c (directive_get_value): Triplet pointer is const. * src/meta.c: Remove. * src/timer.c: (timer_fill_meta) (timer_free_meta): Remove. * src/triplet.c: Use wordsplit for expansions. * src/wydawca.c (wy_vlog): New function. (wy_stat_expansion): New function. * src/wydawca.h: Remove metadef protos. * tests/etc/notify.rcin: Update variable reference syntax.
Diffstat (limited to 'include/wydawca/wydawca.h')
-rw-r--r--include/wydawca/wydawca.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/include/wydawca/wydawca.h b/include/wydawca/wydawca.h
index 5af2996..a541157 100644
--- a/include/wydawca/wydawca.h
+++ b/include/wydawca/wydawca.h
@@ -40,8 +40,9 @@ extern char *wy_syslog_tag; /* Syslog tag */
# define WY_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg)))
#endif
-void wy_log(int prio, char *fmt, ...) WY_PRINTFLIKE(2, 3);
-void wy_dbg(char *fmt, ...) WY_PRINTFLIKE(1, 2);
+void wy_log(int prio, char const *fmt, ...) WY_PRINTFLIKE(2, 3);
+void wy_vlog(int prio, char const *fmt, va_list ap);
+void wy_dbg(char const *fmt, ...) WY_PRINTFLIKE(1, 2);
#define wy_debug(l,c) do { \
if (wy_debug_level >= (l)) \
wy_dbg c; \
@@ -91,24 +92,21 @@ struct wy_user {
char *fpr;
};
-typedef struct wy_triplet *wy_triplet_t;
+typedef struct wy_triplet wy_triplet_t;
-const char *wy_triplet_project(wy_triplet_t trp);
-struct wy_user *wy_triplet_get_uploaders(wy_triplet_t trp);
-struct wy_user *wy_triplet_get_admins(wy_triplet_t trp);
-struct wy_user *wy_triplet_get_uploader(wy_triplet_t trp);
+const char *wy_triplet_project(wy_triplet_t *trp);
+struct wy_user *wy_triplet_get_uploaders(wy_triplet_t *trp);
+struct wy_user *wy_triplet_get_admins(wy_triplet_t *trp);
+struct wy_user *wy_triplet_get_uploader(wy_triplet_t *trp);
-struct wy_metadef {
- char *kw;
- char *value;
- const char *(*expand) (struct wy_metadef *, void *);
- char *storage;
- void *data;
+struct wy_vardef {
+ char const *name;
+ int (*expand)(char **ret, struct wy_triplet *trp);
};
+char *wy_triplet_expand_param(const char *tmpl, struct wy_triplet *trp,
+ struct wy_vardef *xmeta);
char *wy_expand_stats(const char *tmpl);
-char *wy_triplet_expand_param(const char *tmpl, struct wy_triplet const *trp,
- struct wy_metadef *xmeta);
-
int wy_stat_mask_p(unsigned long mask);
+int wy_expand_copy(char **ret, char const *s);

Return to:

Send suggestions and report system problems to the System administrator.