From 64e772c1125acadad8167fd5fd25b380f333ab86 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 17 May 2015 23:43:31 -0300 Subject: template-parser: convert "if" operator into enum --- src/template-parser.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/template-parser.h') diff --git a/src/template-parser.h b/src/template-parser.h index b9213e2..809e3bc 100644 --- a/src/template-parser.h +++ b/src/template-parser.h @@ -23,11 +23,18 @@ typedef enum { BLOGC_TEMPLATE_CONTENT_STMT, } blogc_template_stmt_type_t; +typedef enum { + BLOGC_TEMPLATE_OP_NOT = 1 << 0, + BLOGC_TEMPLATE_OP_EQ = 1 << 1, + BLOGC_TEMPLATE_OP_LT = 1 << 2, + BLOGC_TEMPLATE_OP_GT = 1 << 3, +} blogc_template_stmt_operator_t; + typedef struct { blogc_template_stmt_type_t type; char *value; char *value2; - char *op; + blogc_template_stmt_operator_t op; } blogc_template_stmt_t; b_slist_t* blogc_template_parse(const char *src, size_t src_len, -- cgit v1.2.3-18-g5258