Sébastien Helleu
aeeec38d6f
core: fix cast of time_t (to "long long" instead of "long") ( closes #1051 )
2017-08-12 18:36:45 +02:00
Sébastien Helleu
a0f1f3fd68
core: remove unused variable "index" in function eval_hdata_get_value
2017-05-28 08:25:41 +02:00
Sébastien Helleu
925e8b79a8
core: allow index for hdata arrays in evaluation of expressions
2017-05-20 00:05:31 +02:00
Simmo Saan
1329dfb57a
core: add wildcard matching operators to eval ( closes #608 )
2017-04-29 17:04:44 +02:00
Sébastien Helleu
49cdbaab38
core: fix check of condition in ${if:...} (evaluated strings)
2017-04-25 19:41:49 +02:00
Sébastien Helleu
a96d27f236
core: add new cut formats in function comment
2017-04-25 07:19:02 +02:00
Sébastien Helleu
112bebcddf
core: add a way to count the suffix length in max chars displayed in cut of string ("cut:" and "cutscr:") ( closes #963 )
...
The format to use is one of:
- ${cut:+max,suffix,string}
- ${cutscr:+max,suffix,string}
With the "+" before max, WeeChat ensures there are at most "max" chars in
output, including the length of suffix string.
2017-04-24 22:37:49 +02:00
Sébastien Helleu
bb00b6b8fb
core: add ${re:#} to get the index of last group captured in evaluation of expressions
2017-03-30 22:13:14 +02:00
Sébastien Helleu
f99c866f35
core: add cut of string with max chars displayed in evaluation of expressions
...
The syntax is: ${cutscr:max,suffix,string}.
The string is cut after max chars displayed on screen. If the string is cut,
the optional suffix is added after.
2017-03-27 21:14:51 +02:00
Sébastien Helleu
1963191700
core: prevent infinite loop in evaluation of expression with extra_vars_eval
...
When extra variables are evaluated, to prevent infinite loop if the evaluated
variable is calling itself, it is removed from hashtable "extra_vars" before
evaluation.
2017-03-25 14:19:48 +01:00
Sébastien Helleu
9a8ec36cbd
core: add cut of string in evaluation of expressions
...
The syntax is: ${cut:max,suffix,string}.
The string is cut after max chars. If the string is cut, the optional suffix is
added after.
2017-03-25 14:19:48 +01:00
Sébastien Helleu
83117f8d2a
core: add ternary operator (condition) in evaluation of expressions
2017-03-25 14:18:19 +01:00
Sébastien Helleu
705d86e684
core: update copyright dates
2017-01-01 11:32:04 +01:00
Sébastien Helleu
c74c55759a
core: move the extra_vars_eval argument after extra_vars
2016-08-18 21:42:13 +02:00
Sébastien Helleu
c6b3c9d79b
core: fix empty comment
2016-08-18 21:38:04 +02:00
Sébastien Helleu
61bc6b6550
Merge remote-tracking branch 'origin/pr/534'
2016-08-18 21:24:10 +02:00
Sébastien Helleu
3330724574
core: update copyright dates
2016-01-01 11:09:53 +01:00
Simmo Saan
598fbf337e
core: add extra_vars evaluation option to eval_expression
2015-08-18 13:51:37 +03:00
Sébastien Helleu
bd850398e8
core: add missing comments before functions when the result must be freed after use
2015-07-04 08:24:53 +02:00
Sébastien Helleu
9bf40517d3
api: add support of evaluated sub-strings and current date/time in function string_eval_expression() and command /eval
2015-06-30 20:25:35 +02:00
Sébastien Helleu
a79c0fcff3
core: allow pointer as list name in evaluation of hdata ( closes #450 )
2015-06-23 20:55:52 +02:00
Sébastien Helleu
6b2c9d2cb8
api: add support of environment variables in function string_eval_expression() and command /eval (issue #388 )
2015-04-26 11:50:39 +02:00
Sébastien Helleu
d322389e04
core: add support of full color option name in command /eval and API function string_eval_expression()
2015-04-26 10:29:30 +02:00
Sébastien Helleu
a020c28ea6
core: update copyright dates
2015-01-01 09:23:23 +01:00
Sébastien Helleu
ae013b7881
core: fix regex replace in eval_expression when regex or regex_replace is empty
2014-11-23 08:31:29 +01:00
Sébastien Helleu
633a32ccd3
api: add regex replace feature in function string_eval_expression
2014-10-22 21:19:54 +02:00
Sébastien Helleu
f62f759c3d
core: add hide of chars in string in evaluation of expressions
...
The syntax is: ${hide:char,string}.
All chars in string are replaced with char (which can be one or more chars).
2014-10-16 20:46:06 +02:00
Sébastien Helleu
9d849db85a
core: move default prefix/suffix for evaluation in wee-eval.h
2014-10-12 18:22:02 +02:00
Sébastien Helleu
0f363218b6
core: make argument "errors" optional in function string_replace_with_callback
2014-08-13 07:33:49 +02:00
Sébastien Helleu
c5710c6f24
core: fix evaluation of expressions with regex condition ( closes #63 )
...
The regex itself is not evaluated any more (so parentheses are kept).
Before the fix:
>> abcd =~ (?-i)^abc
== [0]
>> (abcd) =~ \(abcd\)
== [0]
After the fix:
>> abcd =~ (?-i)^abc
== [1]
>> (abcd) =~ \(abcd\)
== [1]
2014-07-12 10:10:05 +02:00
Sébastien Helleu
37144535a5
core: fix evaluation of expression with regex when a comparison char is in the regex
2014-04-04 16:52:12 +02:00
Sebastien Helleu
6fbba54bf0
core: fix recursive calls to function eval_expression
2014-03-06 18:23:20 +01:00
Sebastien Helleu
4b57c95494
core: fix memory leak in evaluation of sub-conditions
2014-03-02 17:43:19 +01:00
Sebastien Helleu
ea71121723
api: add support of escaped strings in function string_eval_expression and command /eval
2014-02-28 14:31:40 +01:00
Sebastien Helleu
58c615f33b
core: fix memory leak in regex matching when evaluating expression
2014-01-26 20:04:05 +01:00
Sebastien Helleu
9040dfbf52
core: fix crash in /eval when config option has a NULL value
2014-01-08 09:05:58 +01:00
Sebastien Helleu
846dde00aa
core: fix crash with hdata_update on shared strings, add hdata type "shared_string" (bug #41104 )
2014-01-05 14:37:27 +01:00
Sebastien Helleu
892aa79fb5
core: update copyright dates
2014-01-01 00:14:12 +01:00
Sebastien Helleu
ff62f3edff
api: add support of infos with format ${info:name,arguments} in function string_eval_expression and command /eval
2013-11-09 15:35:54 +01:00
Sebastien Helleu
86e7d95b9c
core: fix evaluation of expressions with parentheses
...
First evaluate sub-expressions between parentheses.
Before the fix:
>> 1 && (0 || 0)
== [1]
After the fix:
>> 1 && (0 || 0)
== [0]
2013-08-25 13:34:51 +02:00
Sebastien Helleu
390443112c
core: optimize creation of hashtable "pointers" in eval_expression if argument is NULL
...
The hashtable is created on first call to eval_expression with pointers == NULL.
On next calls, the hashtable is cleared, then used again.
The hashtable is freed on exit.
2013-08-04 12:42:29 +02:00
Sebastien Helleu
6ea81f4c8c
api: add support of colors with format "${color:xxx}" in function string_eval_expression and command /eval
2013-08-04 10:09:53 +02:00
Sebastien Helleu
dc878c5b69
api: add argument "options" in function string_eval_expression, add option "-c" for command /eval (to evaluate a condition)
2013-08-04 08:56:56 +02:00
Sebastien Helleu
a490195032
core: add secured data with optional encryption in file sec.conf
2013-07-27 12:57:08 +02:00
Sebastien Helleu
50ab62b75d
core: fix priority of logical operators in evaluation of expression
...
The AND ("&&") takes precedence over the OR ("||").
Before the fix:
>> 1 || 1 && 0
== [0]
After the fix:
>> 1 || 1 && 0
== [1]
Since the "&&" has higher priority, expression is evaluated as:
"1 || (1 && 0)".
2013-07-24 08:15:17 +02:00
Sebastien Helleu
3744787ec0
core: fix crash in evaluation of expression when reading a string in hdata with a NULL value (bug #39419 )
2013-07-08 08:28:27 +02:00
Sebastien Helleu
149c77decd
core: fix typos in many comments and some strings
2013-03-17 12:55:20 +01:00
Sebastien Helleu
25eaec3864
core: use size of 32 for hashtables (instead of 4, 8 or 16)
...
A size of 32 will use a little more memory but will reduce collisions in key
hashs, and then length of linked lists inside hash structure (faster search in
hashtable).
2013-01-26 19:26:43 +01:00
Sebastien Helleu
53c6b62ae3
core: fix some copyright dates
2013-01-10 23:14:33 +01:00
Sebastien Helleu
cd37f12059
core: fix memory leak in evaluation of expression when a logical operator ("&&" or "||") is found
2013-01-07 08:24:40 +01:00