Lines 7-12
Link Here
|
7 |
#include "glulxe.h" |
7 |
#include "glulxe.h" |
8 |
#include "glkstart.h" /* This comes with the Glk library. */ |
8 |
#include "glkstart.h" /* This comes with the Glk library. */ |
9 |
|
9 |
|
|
|
10 |
#include "string.h" |
11 |
|
10 |
/* The only command-line argument is the filename. */ |
12 |
/* The only command-line argument is the filename. */ |
11 |
glkunix_argumentlist_t glkunix_arguments[] = { |
13 |
glkunix_argumentlist_t glkunix_arguments[] = { |
12 |
{ "", glkunix_arg_ValueFollows, "filename: The game file to load." }, |
14 |
{ "", glkunix_arg_ValueFollows, "filename: The game file to load." }, |
Lines 21-28
Link Here
|
21 |
unsigned char buf[12]; |
23 |
unsigned char buf[12]; |
22 |
int res; |
24 |
int res; |
23 |
|
25 |
|
|
|
26 |
#ifdef GARGLK |
27 |
garglk_set_program_name("Glulxe @PV@"); |
28 |
garglk_set_program_info("Glulxe @PV@ by Andrew Plotkin"); |
29 |
#endif |
30 |
|
24 |
if (data->argc <= 1) { |
31 |
if (data->argc <= 1) { |
25 |
init_err = "You must supply the name of a game file."; |
32 |
init_err = "You must supply the name of a game file."; |
|
|
33 |
#ifdef GARGLK |
34 |
return TRUE; /* Hack! but I want error message in glk window */ |
35 |
#endif |
26 |
return FALSE; |
36 |
return FALSE; |
27 |
} |
37 |
} |
28 |
cx = data->argv[1]; |
38 |
cx = data->argv[1]; |
Lines 34-39
Link Here
|
34 |
return TRUE; |
44 |
return TRUE; |
35 |
} |
45 |
} |
36 |
|
46 |
|
|
|
47 |
#ifdef GARGLK |
48 |
cx = strrchr(data->argv[1], '/'); |
49 |
if (!cx) cx = strrchr(data->argv[1], '\\'); |
50 |
garglk_set_story_name(cx ? cx + 1 : data->argv[1]); |
51 |
#endif |
52 |
|
37 |
/* Now we have to check to see if it's a Blorb file. */ |
53 |
/* Now we have to check to see if it's a Blorb file. */ |
38 |
|
54 |
|
39 |
glk_stream_set_position(gamefile, 0, seekmode_Start); |
55 |
glk_stream_set_position(gamefile, 0, seekmode_Start); |