diff options
Diffstat (limited to 'dimension/realize.c')
-rw-r--r-- | dimension/realize.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dimension/realize.c b/dimension/realize.c index 7ca3ae2..bbbe4e7 100644 --- a/dimension/realize.c +++ b/dimension/realize.c @@ -17,10 +17,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *************************************************************************/ +#define _GNU_SOURCE /* For fmemopen */ + #include "realize.h" #include "parse.h" #include "utility.h" #include <math.h> +#include <stdio.h> static double dmnsn_realize_float(dmnsn_astnode astnode) @@ -617,3 +620,13 @@ dmnsn_realize(FILE *file, const char *filename) } return dmnsn_realize_astree(astree); } + +dmnsn_scene * +dmnsn_realize_string(const char *str) +{ + FILE *file = fmemopen((void *)str, strlen(str), "r"); + if (!file) { + return NULL; + } + return dmnsn_realize(file, "<string>"); +} |