projects
/
projects
/
chimara
/
chimara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Port date/time functions to GDateTime
[projects/chimara/chimara.git]
/
interpreters
/
glulxe
/
unixstrt.c
diff --git
a/interpreters/glulxe/unixstrt.c
b/interpreters/glulxe/unixstrt.c
index 4e629055f097e6379d6a6fd0dbc92e12d848187c..f4fa2057990fb35aa8eb5fe237d21e70ea990026 100644
(file)
--- a/
interpreters/glulxe/unixstrt.c
+++ b/
interpreters/glulxe/unixstrt.c
@@
-6,6
+6,7
@@
#include "glk.h"
#include "glulxe.h"
#include "glkstart.h" /* This comes with the Glk library. */
#include "glk.h"
#include "glulxe.h"
#include "glkstart.h" /* This comes with the Glk library. */
+#include <string.h>
/* The only command-line argument is the filename. */
glkunix_argumentlist_t glkunix_arguments[] = {
/* The only command-line argument is the filename. */
glkunix_argumentlist_t glkunix_arguments[] = {
@@
-21,9
+22,17
@@
int glkunix_startup_code(glkunix_startup_t *data)
unsigned char buf[12];
int res;
unsigned char buf[12];
int res;
+#ifdef GARGLK
+ garglk_set_program_name("Glulxe 0.4.7");
+ garglk_set_program_info("Glulxe 0.4.7 by Andrew Plotkin");
+#endif
+
if (data->argc <= 1) {
init_err = "You must supply the name of a game file.";
if (data->argc <= 1) {
init_err = "You must supply the name of a game file.";
- return FALSE;
+#ifdef GARGLK
+ return TRUE; /* Hack! but I want error message in glk window */
+#endif
+ return FALSE;
}
cx = data->argv[1];
}
cx = data->argv[1];
@@
-34,6
+43,12
@@
int glkunix_startup_code(glkunix_startup_t *data)
return TRUE;
}
return TRUE;
}
+#ifdef GARGLK
+ cx = strrchr(data->argv[1], '/');
+ if (!cx) cx = strrchr(data->argv[1], '\\');
+ garglk_set_story_name(cx ? cx + 1 : data->argv[1]);
+#endif
+
/* Now we have to check to see if it's a Blorb file. */
glk_stream_set_position(gamefile, 0, seekmode_Start);
/* Now we have to check to see if it's a Blorb file. */
glk_stream_set_position(gamefile, 0, seekmode_Start);