aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.h
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-11-15 22:13:30 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-11-15 22:13:30 -0200
commit74dfcce06d39060a4a97c1dd06db9eb55cdbf001 (patch)
tree96356273fa0bb5a6b447f5c2c201acfc65061d0e /src/directives.h
parentf31e60aa815cc38f36fee4ea664efbd631329172 (diff)
downloadblogc-74dfcce06d39060a4a97c1dd06db9eb55cdbf001.tar.gz
blogc-74dfcce06d39060a4a97c1dd06db9eb55cdbf001.tar.bz2
blogc-74dfcce06d39060a4a97c1dd06db9eb55cdbf001.zip
directives: content-parser: added blogc_directive_ctx_t
Diffstat (limited to 'src/directives.h')
-rw-r--r--src/directives.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/directives.h b/src/directives.h
index cbfd213..dd27f03 100644
--- a/src/directives.h
+++ b/src/directives.h
@@ -12,7 +12,14 @@
#include "utils/utils.h"
#include "error.h"
-typedef char* (*blogc_directive_func_t)(const char *argument, b_trie_t *params,
+typedef struct {
+ const char *name;
+ const char *argument;
+ b_trie_t *params;
+ const char *eol;
+} blogc_directive_ctx_t;
+
+typedef char* (*blogc_directive_func_t)(blogc_directive_ctx_t *ctx,
blogc_error_t **err);
typedef struct {
@@ -20,12 +27,10 @@ typedef struct {
blogc_directive_func_t callback;
} blogc_directive_t;
-char* blogc_directive_loader(const char *name, const char *argument,
- b_trie_t *params, blogc_error_t **err);
+char* blogc_directive_loader(blogc_directive_ctx_t *ctx, blogc_error_t **err);
// built-in directives (that are everything we support right now
-char* blogc_directive_youtube(const char *argument, b_trie_t *params,
- blogc_error_t **err);
+char* blogc_directive_youtube(blogc_directive_ctx_t *ctx, blogc_error_t **err);
#endif /* _DIRECTIVES_H */