summaryrefslogtreecommitdiff
path: root/meme/stl.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2014-09-13 00:23:44 (GMT)
committerWerner Almesberger <werner@almesberger.net>2014-09-13 00:23:44 (GMT)
commit6cea3edc58b963ad06ee226d6fbceef3a9640c6a (patch)
tree23c3377e7f3e1e78e7e56422796f8ac2613a17f7 /meme/stl.c
parentae1f29befcb2f500128598f79101bcbd177ce2f2 (diff)
downloadmisc-6cea3edc58b963ad06ee226d6fbceef3a9640c6a.zip
misc-6cea3edc58b963ad06ee226d6fbceef3a9640c6a.tar.gz
misc-6cea3edc58b963ad06ee226d6fbceef3a9640c6a.tar.bz2
meme/stl.h, stl.c (stl_load): rename to stl_load_file; new stl_load loads by file name
Diffstat (limited to 'meme/stl.c')
-rw-r--r--meme/stl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/meme/stl.c b/meme/stl.c
index 084cac5..6e1f80e 100644
--- a/meme/stl.c
+++ b/meme/stl.c
@@ -34,7 +34,7 @@ enum state {
};
-void stl_load(FILE *file)
+void stl_load_file(FILE *file)
{
char buf[MAX_LINE+1];
enum state state = s_init;
@@ -104,3 +104,17 @@ void stl_load(FILE *file)
exit(1);
}
+
+
+void stl_load(const char *name)
+{
+ FILE *file;
+
+ file = fopen(name, "r");
+ if (!file) {
+ perror(name);
+ exit(1);
+ }
+ stl_load_file(file);
+ fclose(file);
+}