/*
* Hic Est Leo -- MapCSS Stylesheets
*
- * (c) 2014 Martin Mares <mj@ucw.cz>
+ * (c) 2014--2015 Martin Mares <mj@ucw.cz>
*/
#ifndef _LEO_CSS_H
struct mempool *pool;
clist rules;
char *filename;
+
+ /* For parsing for single properties by css_parse_prop */
+ int pushed_token;
+ struct style_prop *parsed_prop;
};
struct css_rule {
osm_val_t val;
};
+enum css_action_type {
+ CSS_ACTION_SET,
+ CSS_ACTION_EXPR,
+};
+
struct css_action {
cnode n;
- struct style_prop prop;
+ enum css_action_type type;
+ struct style_prop prop; // for CSS_ACTION_SET
};
/* css-parse.y */
extern struct css_sheet *css_this;
struct css_sheet *css_load(char *filename);
+struct style_prop *css_parse_prop(struct mempool *mp, char *objname, const char *key_str, const char *value_str);
/* css-lex.c */
-void css_error(char *err, ...);
+void css_error(const char *err, ...);
int css_lex(void);
void css_lex_open(void);
void css_lex_close(void);
+void css_lex_string(const char *str);
color_t css_rgb_to_color(const char *rgb);