summaryrefslogtreecommitdiffstats
path: root/dimension/realize.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-02-09 21:03:10 -0500
committerTavian Barnes <tavianator@gmail.com>2010-02-09 21:03:10 -0500
commit7d3a45468b07356d6ca2863b59163b165a83a0f0 (patch)
tree45e75628a775c41384f138b4b43d833db587afc9 /dimension/realize.c
parent06b653e922cd36006f0c86b7e015109e5c0b8923 (diff)
downloaddimension-7d3a45468b07356d6ca2863b59163b165a83a0f0.tar.xz
Get rid of fmemopen() hack.
Diffstat (limited to 'dimension/realize.c')
-rw-r--r--dimension/realize.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/dimension/realize.c b/dimension/realize.c
index 31fb021..810d86e 100644
--- a/dimension/realize.c
+++ b/dimension/realize.c
@@ -17,8 +17,6 @@
* 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"
@@ -754,18 +752,14 @@ dmnsn_realize_string(const char *str, dmnsn_symbol_table *symtable)
if (!symtable) {
symtable = dmnsn_new_symbol_table();
}
- if (!dmnsn_find_symbol(symtable, "__file__")) {
- dmnsn_declare_symbol(symtable, "__file__",
- dmnsn_new_ast_string("<string>"));
- }
- FILE *file = fmemopen((void *)str, strlen(str), "r");
- if (!file) {
+ dmnsn_astree *astree = dmnsn_parse_string(str, symtable);
+ if (!astree) {
return NULL;
}
- dmnsn_scene *scene = dmnsn_realize(file, symtable);
+ dmnsn_scene *scene = dmnsn_realize_astree(astree);
- fclose(file);
+ dmnsn_delete_astree(astree);
return scene;
}