summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-23 11:44:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:09 +0900
commit0df37da435150bc84ae46e77cb9949e6ca489ada (patch)
treecfdbf7089cbf1d7e2f081d9e0de0947bf9b69b62
parent0e8f890dfbdb188d02857b2bcf64d35089f3a297 (diff)
Evas filters: Fix buffer_push and add support for color classes
Makes sure that buffers don't override already existing globals vars such as 'mask' (a function name). Yeah, it happened to me. CC support is a little bit hackish. Need to find a better way.
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 6b4b8d348e..2352d5d121 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -2297,7 +2297,19 @@ _filter_program_buffers_set(Evas_Filter_Program *pgm)
2297 const char *source; 2297 const char *source;
2298 2298
2299 EINA_ITERATOR_FOREACH(it, source) 2299 EINA_ITERATOR_FOREACH(it, source)
2300 _buffer_add(pgm, source, EINA_FALSE, source, EINA_FALSE); 2300 {
2301 // Cleanup name and avoid overriding existing globals
2302 char name[64];
2303 unsigned i;
2304 snprintf(name, 64, "__source_%s", source);
2305 name[63] = '\0';
2306 for (i = 0; name[i]; i++)
2307 {
2308 if (!isdigit(name[i]) && !isalpha(name[i]))
2309 name[i] = '_';
2310 }
2311 _buffer_add(pgm, name, EINA_FALSE, source, EINA_FALSE);
2312 }
2301 2313
2302 eina_iterator_free(it); 2314 eina_iterator_free(it);
2303 } 2315 }
@@ -2631,10 +2643,22 @@ _filter_program_state_set(Evas_Filter_Program *pgm)
2631 const char *name = tup->key; 2643 const char *name = tup->key;
2632 const char *value = tup->data; 2644 const char *value = tup->data;
2633 if (value) 2645 if (value)
2634 lua_pushstring(L, value); 2646 {
2647 if ((value[0] == '-') && (value[1] == '-') && value[2] == '\n')
2648 {
2649 int i = luaL_dostring(L, value);
2650 ERR("i %d", i);
2651 }
2652 else
2653 {
2654 lua_pushstring(L, value);
2655 lua_setglobal(L, name);
2656 }
2657 }
2635 else 2658 else
2636 lua_pushnil(L); 2659 {
2637 lua_setglobal(L, name); 2660 lua_pushnil(L);
2661 }
2638 } 2662 }
2639 eina_iterator_free(it); 2663 eina_iterator_free(it);
2640 } 2664 }