diff options
author | Joshua Judson Rosen | 2017-03-19 15:40:45 -0400 |
---|---|---|
committer | Joshua Judson Rosen | 2017-03-28 22:07:50 -0400 |
commit | 3f67b9fe5713bd19d314500316be387ff7843c30 (patch) | |
tree | e2d15a740aa3ea12b3778a36000274ad20649fd0 /src | |
parent | robot-move: prevent crash on zero-length moves (diff) | |
download | gnurobots-3f67b9fe5713bd19d314500316be387ff7843c30.tar.gz |
api: accept symbols (as well as strings)
This seems a lot more natural for scheme code.
Diffstat (limited to 'src')
-rw-r--r-- | src/api.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -51,6 +51,9 @@ api_robot_smell (SCM s_th) gboolean ret; gchar *str; + if (scm_symbol_p (s_th) == SCM_BOOL_T) { + s_th = scm_symbol_to_string (s_th); + } str = scm_to_locale_string (s_th); ret = g_robot_smell (robot, str); @@ -63,6 +66,9 @@ api_robot_feel (SCM s_th) gboolean ret; gchar *str; + if (scm_symbol_p (s_th) == SCM_BOOL_T) { + s_th = scm_symbol_to_string (s_th); + } str = scm_to_locale_string (s_th); ret = g_robot_feel (robot, str); @@ -75,6 +81,9 @@ api_robot_look (SCM s_th) gboolean ret; gchar *str; + if (scm_symbol_p (s_th) == SCM_BOOL_T) { + s_th = scm_symbol_to_string (s_th); + } str = scm_to_locale_string (s_th); ret = g_robot_look (robot, str); |