Add Glulxe.
[gentoo-interactive-fiction.git] / games-engines / glulxe / files / glulxe-0.4.3-gargoyle.patch
blobb089762441772fded3aaeda1ee4353ffc045efea
1 --- glulxe/unixstrt.c~ 2000-02-10 03:43:34.000000000 +0000
2 +++ glulxe/unixstrt.c 2007-12-18 16:02:53.000000000 +0000
3 @@ -7,6 +7,8 @@
4 #include "glulxe.h"
5 #include "glkstart.h" /* This comes with the Glk library. */
7 +#include "string.h"
9 /* The only command-line argument is the filename. */
10 glkunix_argumentlist_t glkunix_arguments[] = {
11 { "", glkunix_arg_ValueFollows, "filename: The game file to load." },
12 @@ -21,8 +23,16 @@
13 unsigned char buf[12];
14 int res;
16 +#ifdef GARGLK
17 + garglk_set_program_name("Glulxe @PV@");
18 + garglk_set_program_info("Glulxe @PV@ by Andrew Plotkin");
19 +#endif
21 if (data->argc <= 1) {
22 init_err = "You must supply the name of a game file.";
23 +#ifdef GARGLK
24 + return TRUE; /* Hack! but I want error message in glk window */
25 +#endif
26 return FALSE;
28 cx = data->argv[1];
29 @@ -34,6 +44,12 @@
30 return TRUE;
33 +#ifdef GARGLK
34 + cx = strrchr(data->argv[1], '/');
35 + if (!cx) cx = strrchr(data->argv[1], '\\');
36 + garglk_set_story_name(cx ? cx + 1 : data->argv[1]);
37 +#endif
39 /* Now we have to check to see if it's a Blorb file. */
41 glk_stream_set_position(gamefile, 0, seekmode_Start);