From c5e75352f27a02501b3a1a9189f10a581c12e7fb Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 24 Dec 2012 20:10:27 +0100 Subject: block-parser: Add support for custom block functions Similar to replace-table custom functions, this brings an ability to register custom block functions that can be called from templates with variable arguments. The syntax is as follows: ... An optional exclamation mark before the function name reverts the result (negates) the predicate. This allows template flexibility with respect to the currently processed image. --- src/replace-table.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/replace-table.h') diff --git a/src/replace-table.h b/src/replace-table.h index 81365cc..1a1c4ac 100644 --- a/src/replace-table.h +++ b/src/replace-table.h @@ -100,6 +100,13 @@ gchar * extract_token_arg (const gchar *str); */ gboolean token_has_prefix (const gchar *token, const gchar *prefix); +/* + * parse_function: returns name of the function or NULL if token is invalid. Parsed arguments are stored in *args. + * - in case an exclamation mark is present before the function name, the *negation argument is set to TRUE + * + */ +gchar * parse_function (const char *token, gchar ***args, gboolean *negation); + G_END_DECLS -- cgit v1.2.3