diff options
Diffstat (limited to 'shared/toxy/scriptlet.c')
-rw-r--r-- | shared/toxy/scriptlet.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/shared/toxy/scriptlet.c b/shared/toxy/scriptlet.c index 2592cee..e2f9883 100644 --- a/shared/toxy/scriptlet.c +++ b/shared/toxy/scriptlet.c @@ -277,6 +277,11 @@ static char *scriptlet_dedot(t_scriptlet *sp, char *ibuf, char *obuf, return (len ? ibuf + len : 0); } +int scriptlet_isempty(t_scriptlet *sp) +{ + return (!(sp->s_tail > sp->s_head && *sp->s_head)); +} + void scriptlet_reset(t_scriptlet *sp) { sp->s_cvstate = SCRIPTLET_CVUNKNOWN; @@ -395,6 +400,20 @@ void scriptlet_qpush(t_scriptlet *sp) } } +/* Non-expanding -- LATER think if this is likely to cause any confusion. + Especially, consider the widget_vis() vs. widget_update() case. */ +void scriptlet_vpush(t_scriptlet *sp, char *varname) +{ + if (scriptlet_ready(sp)) + { + char *tail = sp->s_tail; + strcpy(tail, "}\n"); + sys_vgui("set ::toxy::%s { ", varname); + sys_gui(sp->s_head); + *tail = 0; + } +} + int scriptlet_evaluate(t_scriptlet *insp, t_scriptlet *outsp, int visedonly, int ac, t_atom *av, t_props *argprops) { |