Just a couple of script bindings. The single parameter atan function and a substring function to flesh the string library out a bit. I wasn't sure if it should finish with an error or finish with what it's already made if it reached the end of the string while in the copy section.<br>
diff --git a/src/plugins/splash/script/script-lib-math.c b/src/plugins/splash/script/script-lib-math.c<br>index 383fe46..f614b18 100644<br>--- a/src/plugins/splash/script/script-lib-math.c<br>+++ b/src/plugins/splash/script/script-lib-math.c<br>
@@ -85,6 +85,12 @@ script_lib_math_data_t *script_lib_math_setup (script_state_t *state)<br> "value",<br> NULL);<br> script_add_native_function (math_hash,<br>
+ "ATan",<br>+ script_lib_math_double_from_double_function,<br>+ atan,<br>+ "value",<br>
+ NULL);<br>+ script_add_native_function (math_hash,<br> "ATan2",<br> script_lib_math_double_from_double_double_function,<br>
atan2,<br>diff --git a/src/plugins/splash/script/script-lib-string.c b/src/plugins/splash/script/script-lib-string.c<br>index 833a377..90c463b 100644<br>--- a/src/plugins/splash/script/script-lib-string.c<br>
+++ b/src/plugins/splash/script/script-lib-string.c<br>@@ -62,6 +62,41 @@ static script_return_t script_lib_string_char_at (script_state_t *state,<br> return script_return_obj(script_obj_new_string (charstring));<br> }<br>
<br>+static script_return_t script_lib_string_substring (script_state_t *state,<br>+ void *user_data)<br>+{<br>+ char *text = script_obj_as_string (state->this);<br>
+ int start = script_obj_hash_get_number (state->local, "start");<br>+ int end = script_obj_hash_get_number (state->local, "end");<br>+ int text_count, substring_count;<br>+ char substring [end-start+1];<br>
+ <br>+ if (!text || start < 0 || end < start)<br>+ {<br>+ free (text);<br>+ return script_return_obj_null ();<br>+ }<br>+ for (text_count = 0; text_count < start; text_count++)<br>+ {<br>+ if (text[text_count] == '\0')<br>
+ {<br>+ free (text);<br>+ return script_return_obj(script_obj_new_string (""));<br>+ }<br>+ }<br>+ for (text_count = start, substring_count = 0; text_count < end; text_count++, substring_count++)<br>
+ {<br>+ if (text[text_count] == '\0')<br>+ {<br>+ break;<br>+ }<br>