Revbump glkloader for Glk 0.7.4 support
[gentoo-interactive-fiction.git] / dev-games / glkloader / files / glkloader-0.3.2-glk-0.7.4.patch
blob3dd09fc15ecebb505d4335c177fabfa5cf9ed312
1 Source: dleverton
2 Upstream: previous version submitted
3 Reason: update to Glk 0.7.4
5 --- glkloader-0.3.2/glk.h~ 2001-03-14 03:07:59.000000000 +0000
6 +++ glkloader-0.3.2/glk.h 2012-01-30 04:00:03.000000000 +0000
7 @@ -1,11 +1,11 @@
8 #ifndef GLK_H
9 #define GLK_H
11 -/* glk.h: Header file for Glk API, version 0.6.1.
12 +/* glk.h: Header file for Glk API, version 0.7.4.
13 Designed by Andrew Plotkin <erkyrath@eblong.com>
14 - http://www.eblong.com/zarf/glk/index.html
15 + http://eblong.com/zarf/glk/
17 - This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
18 + This file is copyright 1998-2012 by Andrew Plotkin. You may copy,
19 distribute, and incorporate it into your own programs, by any means
20 and under any conditions, as long as you do not modify it. You may
21 also modify this file, incorporate it into your own programs,
22 @@ -14,17 +14,28 @@
23 shown above.
26 -/* You may have to edit the definition of glui32 to make sure it's really a
27 - 32-bit unsigned integer type, and glsi32 to make sure it's really a
28 - 32-bit signed integer type. If they're not, horrible things will happen. */
29 -typedef unsigned long glui32;
30 -typedef signed long glsi32;
31 +/* If your system does not have <stdint.h>, you'll have to remove this
32 + include line. Then edit the definition of glui32 to make sure it's
33 + really a 32-bit unsigned integer type, and glsi32 to make sure
34 + it's really a 32-bit signed integer type. If they're not, horrible
35 + things will happen. */
36 +#include <stdint.h>
37 +typedef uint32_t glui32;
38 +typedef int32_t glsi32;
40 /* These are the compile-time conditionals that reveal various Glk optional
41 - modules. */
42 + modules. Note that if GLK_MODULE_SOUND2 is defined, GLK_MODULE_SOUND
43 + must be also. */
44 +#define GLK_MODULE_LINE_ECHO
45 +#define GLK_MODULE_LINE_TERMINATORS
46 +#define GLK_MODULE_UNICODE
47 +#define GLK_MODULE_UNICODE_NORM
48 #define GLK_MODULE_IMAGE
49 #define GLK_MODULE_SOUND
50 +#define GLK_MODULE_SOUND2
51 #define GLK_MODULE_HYPERLINKS
52 +#define GLK_MODULE_DATETIME
53 +#define GLK_MODULE_RESOURCE_STREAM
55 /* These types are opaque object identifiers. They're pointers to opaque
56 C structures, which are defined differently by each library. */
57 @@ -51,6 +62,14 @@
58 #define gestalt_HyperlinkInput (12)
59 #define gestalt_SoundMusic (13)
60 #define gestalt_GraphicsTransparency (14)
61 +#define gestalt_Unicode (15)
62 +#define gestalt_UnicodeNorm (16)
63 +#define gestalt_LineInputEcho (17)
64 +#define gestalt_LineTerminators (18)
65 +#define gestalt_LineTerminatorKey (19)
66 +#define gestalt_DateTime (20)
67 +#define gestalt_Sound2 (21)
68 +#define gestalt_ResourceStream (22)
70 #define evtype_None (0)
71 #define evtype_Timer (1)
72 @@ -61,6 +80,7 @@
73 #define evtype_Redraw (6)
74 #define evtype_SoundNotify (7)
75 #define evtype_Hyperlink (8)
76 +#define evtype_VolumeNotify (9)
78 typedef struct event_struct {
79 glui32 type;
80 @@ -131,6 +151,10 @@
81 #define winmethod_Proportional (0x20)
82 #define winmethod_DivisionMask (0xf0)
84 +#define winmethod_Border (0x000)
85 +#define winmethod_NoBorder (0x100)
86 +#define winmethod_BorderMask (0x100)
88 #define fileusage_Data (0x00)
89 #define fileusage_SavedGame (0x01)
90 #define fileusage_Transcript (0x02)
91 @@ -263,6 +287,55 @@
92 extern void glk_cancel_char_event(winid_t win);
93 extern void glk_cancel_mouse_event(winid_t win);
95 +#ifdef GLK_MODULE_LINE_ECHO
96 +extern void glk_set_echo_line_event(winid_t win, glui32 val);
97 +#endif /* GLK_MODULE_LINE_ECHO */
99 +#ifdef GLK_MODULE_LINE_TERMINATORS
100 +extern void glk_set_terminators_line_event(winid_t win, glui32 *keycodes,
101 + glui32 count);
102 +#endif /* GLK_MODULE_LINE_TERMINATORS */
104 +#ifdef GLK_MODULE_UNICODE
106 +extern glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len,
107 + glui32 numchars);
108 +extern glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len,
109 + glui32 numchars);
110 +extern glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len,
111 + glui32 numchars, glui32 lowerrest);
113 +extern void glk_put_char_uni(glui32 ch);
114 +extern void glk_put_string_uni(glui32 *s);
115 +extern void glk_put_buffer_uni(glui32 *buf, glui32 len);
116 +extern void glk_put_char_stream_uni(strid_t str, glui32 ch);
117 +extern void glk_put_string_stream_uni(strid_t str, glui32 *s);
118 +extern void glk_put_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len);
120 +extern glsi32 glk_get_char_stream_uni(strid_t str);
121 +extern glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len);
122 +extern glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len);
124 +extern strid_t glk_stream_open_file_uni(frefid_t fileref, glui32 fmode,
125 + glui32 rock);
126 +extern strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen,
127 + glui32 fmode, glui32 rock);
129 +extern void glk_request_char_event_uni(winid_t win);
130 +extern void glk_request_line_event_uni(winid_t win, glui32 *buf,
131 + glui32 maxlen, glui32 initlen);
133 +#endif /* GLK_MODULE_UNICODE */
135 +#ifdef GLK_MODULE_UNICODE_NORM
137 +extern glui32 glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len,
138 + glui32 numchars);
139 +extern glui32 glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len,
140 + glui32 numchars);
142 +#endif /* GLK_MODULE_UNICODE_NORM */
144 #ifdef GLK_MODULE_IMAGE
146 #define imagealign_InlineUp (0x01)
147 @@ -301,6 +374,19 @@
149 extern void glk_sound_load_hint(glui32 snd, glui32 flag);
151 +#ifdef GLK_MODULE_SOUND2
152 +/* Note that this section is nested inside the #ifdef GLK_MODULE_SOUND.
153 + GLK_MODULE_SOUND must be defined if GLK_MODULE_SOUND2 is. */
155 +extern schanid_t glk_schannel_create_ext(glui32 rock, glui32 volume);
156 +extern glui32 glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount,
157 + glui32 *sndarray, glui32 soundcount, glui32 notify);
158 +extern void glk_schannel_pause(schanid_t chan);
159 +extern void glk_schannel_unpause(schanid_t chan);
160 +extern void glk_schannel_set_volume_ext(schanid_t chan, glui32 vol,
161 + glui32 duration, glui32 notify);
163 +#endif /* GLK_MODULE_SOUND2 */
164 #endif /* GLK_MODULE_SOUND */
166 #ifdef GLK_MODULE_HYPERLINKS
167 @@ -312,4 +398,45 @@
169 #endif /* GLK_MODULE_HYPERLINKS */
171 +#ifdef GLK_MODULE_DATETIME
173 +typedef struct glktimeval_struct {
174 + glsi32 high_sec;
175 + glui32 low_sec;
176 + glsi32 microsec;
177 +} glktimeval_t;
179 +typedef struct glkdate_struct {
180 + glsi32 year; /* full (four-digit) year */
181 + glsi32 month; /* 1-12, 1 is January */
182 + glsi32 day; /* 1-31 */
183 + glsi32 weekday; /* 0-6, 0 is Sunday */
184 + glsi32 hour; /* 0-23 */
185 + glsi32 minute; /* 0-59 */
186 + glsi32 second; /* 0-59, maybe 60 during a leap second */
187 + glsi32 microsec; /* 0-999999 */
188 +} glkdate_t;
190 +extern void glk_current_time(glktimeval_t *time);
191 +extern glsi32 glk_current_simple_time(glui32 factor);
192 +extern void glk_time_to_date_utc(glktimeval_t *time, glkdate_t *date);
193 +extern void glk_time_to_date_local(glktimeval_t *time, glkdate_t *date);
194 +extern void glk_simple_time_to_date_utc(glsi32 time, glui32 factor,
195 + glkdate_t *date);
196 +extern void glk_simple_time_to_date_local(glsi32 time, glui32 factor,
197 + glkdate_t *date);
198 +extern void glk_date_to_time_utc(glkdate_t *date, glktimeval_t *time);
199 +extern void glk_date_to_time_local(glkdate_t *date, glktimeval_t *time);
200 +extern glsi32 glk_date_to_simple_time_utc(glkdate_t *date, glui32 factor);
201 +extern glsi32 glk_date_to_simple_time_local(glkdate_t *date, glui32 factor);
203 +#endif /* GLK_MODULE_DATETIME */
205 +#ifdef GLK_MODULE_RESOURCE_STREAM
207 +extern strid_t glk_stream_open_resource(glui32 filenum, glui32 rock);
208 +extern strid_t glk_stream_open_resource_uni(glui32 filenum, glui32 rock);
210 +#endif /* GLK_MODULE_RESOURCE_STREAM */
212 #endif /* GLK_H */
213 --- glkloader-0.3.2/gi_blorb.c~ 2001-03-14 03:07:59.000000000 +0000
214 +++ glkloader-0.3.2/gi_blorb.c 2012-01-30 03:56:26.000000000 +0000
215 @@ -1,9 +1,9 @@
216 /* gi_blorb.c: Blorb library layer for Glk API.
217 - gi_blorb version 1.4.
218 + gi_blorb version 1.5.
219 Designed by Andrew Plotkin <erkyrath@eblong.com>
220 - http://www.eblong.com/zarf/glk/index.html
221 + http://eblong.com/zarf/glk/
223 - This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
224 + This file is copyright 1998-2010 by Andrew Plotkin. You may copy,
225 distribute, and incorporate it into your own programs, by any means
226 and under any conditions, as long as you do not modify it. You may
227 also modify this file, incorporate it into your own programs,
228 @@ -227,7 +227,6 @@
229 giblorb_err_t err;
230 char *ptr;
231 glui32 len;
232 - glui32 val;
233 glui32 numres;
234 int gotindex = FALSE;
236 @@ -396,7 +395,6 @@
238 case giblorb_method_Memory:
239 if (!chu->ptr) {
240 - giblorb_err_t err;
241 glui32 readlen;
242 void *dat = giblorb_malloc(chu->len);
244 @@ -515,7 +513,7 @@
246 static void giblorb_qsort(giblorb_resdesc_t **list, int len)
248 - int ix, jx, res, val;
249 + int ix, jx, res;
250 giblorb_resdesc_t *tmpptr, *pivot;
252 if (len < 6) {
253 --- glkloader-0.3.2/gi_blorb.h~ 2001-03-14 03:07:59.000000000 +0000
254 +++ glkloader-0.3.2/gi_blorb.h 2012-01-30 03:56:26.000000000 +0000
255 @@ -2,11 +2,11 @@
256 #define _GI_BLORB_H
258 /* gi_blorb.h: Blorb library layer for Glk API.
259 - gi_blorb version 1.4.
260 + gi_blorb version 1.5.
261 Designed by Andrew Plotkin <erkyrath@eblong.com>
262 - http://www.eblong.com/zarf/glk/index.html
263 + http://eblong.com/zarf/glk/
265 - This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
266 + This file is copyright 1998-2012 by Andrew Plotkin. You may copy,
267 distribute, and incorporate it into your own programs, by any means
268 and under any conditions, as long as you do not modify it. You may
269 also modify this file, incorporate it into your own programs,
270 @@ -35,12 +35,15 @@
271 #define giblorb_make_id(c1, c2, c3, c4) \
272 (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
274 -#define giblorb_ID_Snd (giblorb_make_id('S', 'n', 'd', ' '))
275 #define giblorb_ID_Exec (giblorb_make_id('E', 'x', 'e', 'c'))
276 +#define giblorb_ID_Snd (giblorb_make_id('S', 'n', 'd', ' '))
277 #define giblorb_ID_Pict (giblorb_make_id('P', 'i', 'c', 't'))
278 +#define giblorb_ID_Data (giblorb_make_id('D', 'a', 't', 'a'))
279 #define giblorb_ID_Copyright (giblorb_make_id('(', 'c', ')', ' '))
280 #define giblorb_ID_AUTH (giblorb_make_id('A', 'U', 'T', 'H'))
281 #define giblorb_ID_ANNO (giblorb_make_id('A', 'N', 'N', 'O'))
282 +#define giblorb_ID_TEXT (giblorb_make_id('T', 'E', 'X', 'T'))
283 +#define giblorb_ID_BINA (giblorb_make_id('B', 'I', 'N', 'A'))
285 /* giblorb_map_t: Holds the complete description of an open Blorb
286 file. This type is opaque for normal interpreter use. */
287 --- glkloader-0.3.2/gi_dispa.c~ 2001-03-14 03:07:59.000000000 +0000
288 +++ glkloader-0.3.2/gi_dispa.c 2012-01-30 03:56:25.000000000 +0000
289 @@ -1,8 +1,8 @@
290 -/* gi_dispa.c: Dispatch layer for Glk API, version 0.6.1.
291 +/* gi_dispa.c: Dispatch layer for Glk API, version 0.7.4.
292 Designed by Andrew Plotkin <erkyrath@eblong.com>
293 - http://www.eblong.com/zarf/glk/index.html
294 + http://eblong.com/zarf/glk/
296 - This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
297 + This file is copyright 1998-2012 by Andrew Plotkin. You may copy,
298 distribute, and incorporate it into your own programs, by any means
299 and under any conditions, as long as you do not modify it. You may
300 also modify this file, incorporate it into your own programs,
301 @@ -21,6 +21,9 @@
302 #define NULL 0
303 #endif
305 +#define NUMCLASSES \
306 + (sizeof(class_table) / sizeof(gidispatch_intconst_t))
308 #define NUMINTCONSTANTS \
309 (sizeof(intconstant_table) / sizeof(gidispatch_intconst_t))
311 @@ -28,6 +31,14 @@
312 (sizeof(function_table) / sizeof(gidispatch_function_t))
314 /* The constants in this table must be ordered alphabetically. */
315 +static gidispatch_intconst_t class_table[] = {
316 + { "fileref", (2) }, /* "Qc" */
317 + { "schannel", (3) }, /* "Qd" */
318 + { "stream", (1) }, /* "Qb" */
319 + { "window", (0) }, /* "Qa" */
322 +/* The constants in this table must be ordered alphabetically. */
323 static gidispatch_intconst_t intconstant_table[] = {
324 { "evtype_Arrange", (5) },
325 { "evtype_CharInput", (2) },
326 @@ -38,6 +49,8 @@
327 { "evtype_Redraw", (6) },
328 { "evtype_SoundNotify", (7) },
329 { "evtype_Timer", (1) },
330 + { "evtype_VolumeNotify", (9) },
332 { "filemode_Read", (0x02) },
333 { "filemode_ReadWrite", (0x03) },
334 { "filemode_Write", (0x01) },
335 @@ -54,26 +69,34 @@
336 { "gestalt_CharOutput_ApproxPrint", (1) },
337 { "gestalt_CharOutput_CannotPrint", (0) },
338 { "gestalt_CharOutput_ExactPrint", (2) },
339 + { "gestalt_DateTime", (20) },
340 { "gestalt_DrawImage", (7) },
341 { "gestalt_Graphics", (6) },
342 { "gestalt_GraphicsTransparency", (14) },
343 { "gestalt_HyperlinkInput", (12) },
344 { "gestalt_Hyperlinks", (11) },
345 { "gestalt_LineInput", (2) },
346 + { "gestalt_LineInputEcho", (17) },
347 + { "gestalt_LineTerminatorKey", (19) },
348 + { "gestalt_LineTerminators", (18) },
349 { "gestalt_MouseInput", (4) },
350 + { "gestalt_ResourceStream", (22) },
351 { "gestalt_Sound", (8) },
352 + { "gestalt_Sound2", (21) },
353 { "gestalt_SoundMusic", (13) },
354 { "gestalt_SoundNotify", (10) },
355 { "gestalt_SoundVolume", (9) },
356 { "gestalt_Timer", (5) },
357 + { "gestalt_Unicode", (15) },
358 + { "gestalt_UnicodeNorm", (16) },
359 { "gestalt_Version", (0) },
360 -#ifdef GLK_MODULE_IMAGE
362 { "imagealign_InlineCenter", (0x03) },
363 { "imagealign_InlineDown", (0x02) },
364 { "imagealign_MarginLeft", (0x04) },
365 { "imagealign_MarginRight", (0x05) },
366 { "imagealign_InlineUp", (0x01) },
367 -#endif /* GLK_MODULE_IMAGE */
369 { "keycode_Delete", (0xfffffff9) },
370 { "keycode_Down", (0xfffffffb) },
371 { "keycode_End", (0xfffffff3) },
372 @@ -130,14 +155,19 @@
373 { "stylehint_just_LeftFlush", (0) },
374 { "stylehint_just_LeftRight", (1) },
375 { "stylehint_just_RightFlush", (3) },
377 { "winmethod_Above", (0x02) },
378 { "winmethod_Below", (0x03) },
379 + { "winmethod_Border", (0x000) },
380 + { "winmethod_BorderMask", (0x100) },
381 { "winmethod_DirMask", (0x0f) },
382 { "winmethod_DivisionMask", (0xf0) },
383 { "winmethod_Fixed", (0x10) },
384 { "winmethod_Left", (0x00) },
385 + { "winmethod_NoBorder", (0x100) },
386 { "winmethod_Proportional", (0x20) },
387 { "winmethod_Right", (0x01) },
389 { "wintype_AllTypes", (0) },
390 { "wintype_Blank", (2) },
391 { "wintype_Graphics", (5) },
392 @@ -233,6 +263,13 @@
393 { 0x00FA, glk_schannel_stop, "schannel_stop" },
394 { 0x00FB, glk_schannel_set_volume, "schannel_set_volume" },
395 { 0x00FC, glk_sound_load_hint, "sound_load_hint" },
396 +#ifdef GLK_MODULE_SOUND2
397 + { 0x00F4, glk_schannel_create_ext, "schannel_create_ext" },
398 + { 0x00F7, glk_schannel_play_multi, "schannel_play_multi" },
399 + { 0x00FD, glk_schannel_set_volume_ext, "schannel_set_volume_ext" },
400 + { 0x00FE, glk_schannel_pause, "schannel_pause" },
401 + { 0x00FF, glk_schannel_unpause, "schannel_unpause" },
402 +#endif /* GLK_MODULE_SOUND2 */
403 #endif /* GLK_MODULE_SOUND */
404 #ifdef GLK_MODULE_HYPERLINKS
405 { 0x0100, glk_set_hyperlink, "set_hyperlink" },
406 @@ -240,11 +277,62 @@
407 { 0x0102, glk_request_hyperlink_event, "request_hyperlink_event" },
408 { 0x0103, glk_cancel_hyperlink_event, "cancel_hyperlink_event" },
409 #endif /* GLK_MODULE_HYPERLINKS */
410 +#ifdef GLK_MODULE_UNICODE
411 + { 0x0120, glk_buffer_to_lower_case_uni, "buffer_to_lower_case_uni" },
412 + { 0x0121, glk_buffer_to_upper_case_uni, "buffer_to_upper_case_uni" },
413 + { 0x0122, glk_buffer_to_title_case_uni, "buffer_to_title_case_uni" },
414 + { 0x0128, glk_put_char_uni, "put_char_uni" },
415 + { 0x0129, glk_put_string_uni, "put_string_uni" },
416 + { 0x012A, glk_put_buffer_uni, "put_buffer_uni" },
417 + { 0x012B, glk_put_char_stream_uni, "put_char_stream_uni" },
418 + { 0x012C, glk_put_string_stream_uni, "put_string_stream_uni" },
419 + { 0x012D, glk_put_buffer_stream_uni, "put_buffer_stream_uni" },
420 + { 0x0130, glk_get_char_stream_uni, "get_char_stream_uni" },
421 + { 0x0131, glk_get_buffer_stream_uni, "get_buffer_stream_uni" },
422 + { 0x0132, glk_get_line_stream_uni, "get_line_stream_uni" },
423 + { 0x0138, glk_stream_open_file_uni, "stream_open_file_uni" },
424 + { 0x0139, glk_stream_open_memory_uni, "stream_open_memory_uni" },
425 + { 0x0140, glk_request_char_event_uni, "request_char_event_uni" },
426 + { 0x0141, glk_request_line_event_uni, "request_line_event_uni" },
427 +#endif /* GLK_MODULE_UNICODE */
428 +#ifdef GLK_MODULE_UNICODE_NORM
429 + { 0x0123, glk_buffer_canon_decompose_uni, "buffer_canon_decompose_uni" },
430 + { 0x0124, glk_buffer_canon_normalize_uni, "buffer_canon_normalize_uni" },
431 +#endif /* GLK_MODULE_UNICODE_NORM */
432 +#ifdef GLK_MODULE_LINE_ECHO
433 + { 0x0150, glk_set_echo_line_event, "set_echo_line_event" },
434 +#endif /* GLK_MODULE_LINE_ECHO */
435 +#ifdef GLK_MODULE_LINE_TERMINATORS
436 + { 0x0151, glk_set_terminators_line_event, "set_terminators_line_event" },
437 +#endif /* GLK_MODULE_LINE_TERMINATORS */
438 +#ifdef GLK_MODULE_DATETIME
439 + { 0x0160, glk_current_time, "current_time" },
440 + { 0x0161, glk_current_simple_time, "current_simple_time" },
441 + { 0x0168, glk_time_to_date_utc, "time_to_date_utc" },
442 + { 0x0169, glk_time_to_date_local, "time_to_date_local" },
443 + { 0x016A, glk_simple_time_to_date_utc, "simple_time_to_date_utc" },
444 + { 0x016B, glk_simple_time_to_date_local, "simple_time_to_date_local" },
445 + { 0x016C, glk_date_to_time_utc, "date_to_time_utc" },
446 + { 0x016D, glk_date_to_time_local, "date_to_time_local" },
447 + { 0x016E, glk_date_to_simple_time_utc, "date_to_simple_time_utc" },
448 + { 0x016F, glk_date_to_simple_time_local, "date_to_simple_time_local" },
449 +#endif /* GLK_MODULE_DATETIME */
450 +#ifdef GLK_MODULE_RESOURCE_STREAM
451 + { 0x0049, glk_stream_open_resource, "stream_open_resource" },
452 + { 0x013A, glk_stream_open_resource_uni, "stream_open_resource_uni" },
453 +#endif /* GLK_MODULE_RESOURCE_STREAM */
456 glui32 gidispatch_count_classes()
458 - return 4;
459 + return NUMCLASSES;
462 +gidispatch_intconst_t *gidispatch_get_class(glui32 index)
464 + if (index < 0 || index >= NUMCLASSES)
465 + return NULL;
466 + return &(class_table[index]);
469 glui32 gidispatch_count_intconst()
470 @@ -352,7 +440,7 @@
471 case 0x0042: /* stream_open_file */
472 return "4QcIuIu:Qb";
473 case 0x0043: /* stream_open_memory */
474 - return "4&+#!CnIuIu:Qb";
475 + return "4&#!CnIuIu:Qb";
476 case 0x0044: /* stream_close */
477 return "2Qb<[2IuIu]:";
478 case 0x0045: /* stream_set_position */
479 @@ -398,7 +486,7 @@
480 case 0x0087: /* set_style_stream */
481 return "2QbIu:";
482 case 0x0090: /* get_char_stream */
483 - return "2Qb:Iu";
484 + return "2Qb:Is";
485 case 0x0091: /* get_line_stream */
486 return "3Qb<+#Cn:Iu";
487 case 0x0092: /* get_buffer_stream */
488 @@ -468,7 +558,21 @@
489 return "2QdIu:";
490 case 0x00FC: /* sound_load_hint */
491 return "2IuIu:";
493 +#ifdef GLK_MODULE_SOUND2
494 + case 0x00F4: /* schannel_create_ext */
495 + return "3IuIu:Qd";
496 + case 0x00F7: /* schannel_play_multi */
497 + return "4>+#Qd>+#IuIu:Iu";
498 + case 0x00FD: /* schannel_set_volume_ext */
499 + return "4QdIuIuIu:";
500 + case 0x00FE: /* schannel_pause */
501 + return "1Qd:";
502 + case 0x00FF: /* schannel_unpause */
503 + return "1Qd:";
504 +#endif /* GLK_MODULE_SOUND2 */
505 #endif /* GLK_MODULE_SOUND */
507 #ifdef GLK_MODULE_HYPERLINKS
508 case 0x0100: /* set_hyperlink */
509 return "1Iu:";
510 @@ -480,6 +584,88 @@
511 return "1Qa:";
512 #endif /* GLK_MODULE_HYPERLINKS */
514 +#ifdef GLK_MODULE_UNICODE
515 + case 0x0120: /* buffer_to_lower_case_uni */
516 + return "3&+#IuIu:Iu";
517 + case 0x0121: /* buffer_to_upper_case_uni */
518 + return "3&+#IuIu:Iu";
519 + case 0x0122: /* buffer_to_title_case_uni */
520 + return "4&+#IuIuIu:Iu";
521 + case 0x0128: /* put_char_uni */
522 + return "1Iu:";
523 + case 0x0129: /* put_string_uni */
524 + return "1U:";
525 + case 0x012A: /* put_buffer_uni */
526 + return "1>+#Iu:";
527 + case 0x012B: /* put_char_stream_uni */
528 + return "2QbIu:";
529 + case 0x012C: /* put_string_stream_uni */
530 + return "2QbU:";
531 + case 0x012D: /* put_buffer_stream_uni */
532 + return "2Qb>+#Iu:";
533 + case 0x0130: /* get_char_stream_uni */
534 + return "2Qb:Is";
535 + case 0x0131: /* get_buffer_stream_uni */
536 + return "3Qb<+#Iu:Iu";
537 + case 0x0132: /* get_line_stream_uni */
538 + return "3Qb<+#Iu:Iu";
539 + case 0x0138: /* stream_open_file_uni */
540 + return "4QcIuIu:Qb";
541 + case 0x0139: /* stream_open_memory_uni */
542 + return "4&#!IuIuIu:Qb";
543 + case 0x0140: /* request_char_event_uni */
544 + return "1Qa:";
545 + case 0x0141: /* request_line_event_uni */
546 + return "3Qa&+#!IuIu:";
547 +#endif /* GLK_MODULE_UNICODE */
549 +#ifdef GLK_MODULE_UNICODE_NORM
550 + case 0x0123: /* buffer_canon_decompose_uni */
551 + return "3&+#IuIu:Iu";
552 + case 0x0124: /* buffer_canon_normalize_uni */
553 + return "3&+#IuIu:Iu";
554 +#endif /* GLK_MODULE_UNICODE_NORM */
556 +#ifdef GLK_MODULE_LINE_ECHO
557 + case 0x0150: /* set_echo_line_event */
558 + return "2QaIu:";
559 +#endif /* GLK_MODULE_LINE_ECHO */
561 +#ifdef GLK_MODULE_LINE_TERMINATORS
562 + case 0x0151: /* set_terminators_line_event */
563 + return "2Qa>#Iu:";
564 +#endif /* GLK_MODULE_LINE_TERMINATORS */
566 +#ifdef GLK_MODULE_DATETIME
567 + case 0x0160: /* current_time */
568 + return "1<+[3IsIuIs]:";
569 + case 0x0161: /* current_simple_time */
570 + return "2Iu:Is";
571 + case 0x0168: /* time_to_date_utc */
572 + return "2>+[3IsIuIs]<+[8IsIsIsIsIsIsIsIs]:";
573 + case 0x0169: /* time_to_date_local */
574 + return "2>+[3IsIuIs]<+[8IsIsIsIsIsIsIsIs]:";
575 + case 0x016A: /* simple_time_to_date_utc */
576 + return "3IsIu<+[8IsIsIsIsIsIsIsIs]:";
577 + case 0x016B: /* simple_time_to_date_local */
578 + return "3IsIu<+[8IsIsIsIsIsIsIsIs]:";
579 + case 0x016C: /* date_to_time_utc */
580 + return "2>+[8IsIsIsIsIsIsIsIs]<+[3IsIuIs]:";
581 + case 0x016D: /* date_to_time_local */
582 + return "2>+[8IsIsIsIsIsIsIsIs]<+[3IsIuIs]:";
583 + case 0x016E: /* date_to_simple_time_utc */
584 + return "3>+[8IsIsIsIsIsIsIsIs]Iu:Is";
585 + case 0x016F: /* date_to_simple_time_local */
586 + return "3>+[8IsIsIsIsIsIsIsIs]Iu:Is";
587 +#endif /* GLK_MODULE_DATETIME */
589 +#ifdef GLK_MODULE_RESOURCE_STREAM
590 + case 0x0049: /* stream_open_resource */
591 + return "3IuIu:Qb";
592 + case 0x013A: /* stream_open_resource_uni */
593 + return "3IuIu:Qb";
594 +#endif /* GLK_MODULE_RESOURCE_STREAM */
596 default:
597 return NULL;
599 @@ -697,7 +883,7 @@
600 glk_fileref_delete_file(arglist[0].opaqueref);
601 break;
602 case 0x0067: /* fileref_does_file_exist */
603 - arglist[1].uint = glk_fileref_does_file_exist(arglist[0].opaqueref);
604 + arglist[2].uint = glk_fileref_does_file_exist(arglist[0].opaqueref);
605 break;
606 case 0x0068: /* fileref_create_from_fileref */
607 arglist[4].opaqueref = glk_fileref_create_from_fileref(arglist[0].uint,
608 @@ -736,7 +922,7 @@
609 glk_set_style_stream(arglist[0].opaqueref, arglist[1].uint);
610 break;
611 case 0x0090: /* get_char_stream */
612 - arglist[2].uint = glk_get_char_stream(arglist[0].opaqueref);
613 + arglist[2].sint = glk_get_char_stream(arglist[0].opaqueref);
614 break;
615 case 0x0091: /* get_line_stream */
616 if (arglist[1].ptrflag)
617 @@ -927,7 +1115,33 @@
618 case 0x00FC: /* sound_load_hint */
619 glk_sound_load_hint(arglist[0].uint, arglist[1].uint);
620 break;
622 +#ifdef GLK_MODULE_SOUND2
623 + case 0x00F4: /* schannel_create_ext */
624 + arglist[3].opaqueref = glk_schannel_create_ext(arglist[0].uint, arglist[1].uint);
625 + break;
626 + case 0x00F7: /* schannel_play_multi */
627 + if (arglist[0].ptrflag && arglist[3].ptrflag)
628 + arglist[8].uint = glk_schannel_play_multi(arglist[1].array, arglist[2].uint, arglist[4].array, arglist[5].uint, arglist[6].uint);
629 + else if (arglist[0].ptrflag)
630 + arglist[6].uint = glk_schannel_play_multi(arglist[1].array, arglist[2].uint, NULL, 0, arglist[4].uint);
631 + else if (arglist[1].ptrflag)
632 + arglist[6].uint = glk_schannel_play_multi(NULL, 0, arglist[2].array, arglist[3].uint, arglist[4].uint);
633 + else
634 + arglist[4].uint = glk_schannel_play_multi(NULL, 0, NULL, 0, arglist[2].uint);
635 + break;
636 + case 0x00FD: /* schannel_set_volume_ext */
637 + glk_schannel_set_volume_ext(arglist[0].opaqueref, arglist[1].uint, arglist[2].uint, arglist[3].uint);
638 + break;
639 + case 0x00FE: /* schannel_pause */
640 + glk_schannel_pause(arglist[0].opaqueref);
641 + break;
642 + case 0x00FF: /* schannel_unpause */
643 + glk_schannel_unpause(arglist[0].opaqueref);
644 + break;
645 +#endif /* GLK_MODULE_SOUND2 */
646 #endif /* GLK_MODULE_SOUND */
648 #ifdef GLK_MODULE_HYPERLINKS
649 case 0x0100: /* set_hyperlink */
650 glk_set_hyperlink(arglist[0].uint);
651 @@ -943,6 +1157,342 @@
652 break;
653 #endif /* GLK_MODULE_HYPERLINKS */
655 +#ifdef GLK_MODULE_UNICODE
656 + case 0x0120: /* buffer_to_lower_case_uni */
657 + if (arglist[0].ptrflag)
658 + arglist[5].uint = glk_buffer_to_lower_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint);
659 + else
660 + arglist[3].uint = glk_buffer_to_lower_case_uni(NULL, 0, arglist[1].uint);
661 + break;
662 + case 0x0121: /* buffer_to_upper_case_uni */
663 + if (arglist[0].ptrflag)
664 + arglist[5].uint = glk_buffer_to_upper_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint);
665 + else
666 + arglist[3].uint = glk_buffer_to_upper_case_uni(NULL, 0, arglist[1].uint);
667 + break;
668 + case 0x0122: /* buffer_to_title_case_uni */
669 + if (arglist[0].ptrflag)
670 + arglist[6].uint = glk_buffer_to_title_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint, arglist[4].uint);
671 + else
672 + arglist[4].uint = glk_buffer_to_title_case_uni(NULL, 0, arglist[1].uint, arglist[2].uint);
673 + break;
674 + case 0x0128: /* put_char_uni */
675 + glk_put_char_uni(arglist[0].uint);
676 + break;
677 + case 0x0129: /* put_string_uni */
678 + glk_put_string_uni(arglist[0].unicharstr);
679 + break;
680 + case 0x012A: /* put_buffer_uni */
681 + if (arglist[0].ptrflag)
682 + glk_put_buffer_uni(arglist[1].array, arglist[2].uint);
683 + else
684 + glk_put_buffer_uni(NULL, 0);
685 + break;
686 + case 0x012B: /* put_char_stream_uni */
687 + glk_put_char_stream_uni(arglist[0].opaqueref, arglist[1].uint);
688 + break;
689 + case 0x012C: /* put_string_stream_uni */
690 + glk_put_string_stream_uni(arglist[0].opaqueref, arglist[1].unicharstr);
691 + break;
692 + case 0x012D: /* put_buffer_stream_uni */
693 + if (arglist[1].ptrflag)
694 + glk_put_buffer_stream_uni(arglist[0].opaqueref,
695 + arglist[2].array, arglist[3].uint);
696 + else
697 + glk_put_buffer_stream_uni(arglist[0].opaqueref,
698 + NULL, 0);
699 + break;
700 + case 0x0130: /* get_char_stream_uni */
701 + arglist[2].sint = glk_get_char_stream_uni(arglist[0].opaqueref);
702 + break;
703 + case 0x0131: /* get_buffer_stream_uni */
704 + if (arglist[1].ptrflag)
705 + arglist[5].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref,
706 + arglist[2].array, arglist[3].uint);
707 + else
708 + arglist[3].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref,
709 + NULL, 0);
710 + break;
711 + case 0x0132: /* get_line_stream_uni */
712 + if (arglist[1].ptrflag)
713 + arglist[5].uint = glk_get_line_stream_uni(arglist[0].opaqueref,
714 + arglist[2].array, arglist[3].uint);
715 + else
716 + arglist[3].uint = glk_get_line_stream_uni(arglist[0].opaqueref,
717 + NULL, 0);
718 + break;
719 + case 0x0138: /* stream_open_file_uni */
720 + arglist[4].opaqueref = glk_stream_open_file_uni(arglist[0].opaqueref, arglist[1].uint,
721 + arglist[2].uint);
722 + break;
723 + case 0x0139: /* stream_open_memory_uni */
724 + if (arglist[0].ptrflag)
725 + arglist[6].opaqueref = glk_stream_open_memory_uni(arglist[1].array,
726 + arglist[2].uint, arglist[3].uint, arglist[4].uint);
727 + else
728 + arglist[4].opaqueref = glk_stream_open_memory_uni(NULL,
729 + 0, arglist[1].uint, arglist[2].uint);
730 + break;
731 + case 0x0140: /* request_char_event_uni */
732 + glk_request_char_event_uni(arglist[0].opaqueref);
733 + break;
734 + case 0x0141: /* request_line_event_uni */
735 + if (arglist[1].ptrflag)
736 + glk_request_line_event_uni(arglist[0].opaqueref, arglist[2].array,
737 + arglist[3].uint, arglist[4].uint);
738 + else
739 + glk_request_line_event_uni(arglist[0].opaqueref, NULL,
740 + 0, arglist[2].uint);
741 + break;
742 +#endif /* GLK_MODULE_UNICODE */
744 +#ifdef GLK_MODULE_UNICODE_NORM
745 + case 0x0123: /* buffer_canon_decompose_uni */
746 + if (arglist[0].ptrflag)
747 + arglist[5].uint = glk_buffer_canon_decompose_uni(arglist[1].array, arglist[2].uint, arglist[3].uint);
748 + else
749 + arglist[3].uint = glk_buffer_canon_decompose_uni(NULL, 0, arglist[1].uint);
750 + break;
751 + case 0x0124: /* buffer_canon_normalize_uni */
752 + if (arglist[0].ptrflag)
753 + arglist[5].uint = glk_buffer_canon_normalize_uni(arglist[1].array, arglist[2].uint, arglist[3].uint);
754 + else
755 + arglist[3].uint = glk_buffer_canon_normalize_uni(NULL, 0, arglist[1].uint);
756 + break;
757 +#endif /* GLK_MODULE_UNICODE_NORM */
759 +#ifdef GLK_MODULE_LINE_ECHO
760 + case 0x0150: /* set_echo_line_event */
761 + glk_set_echo_line_event(arglist[0].opaqueref, arglist[1].uint);
762 + break;
763 +#endif /* GLK_MODULE_LINE_ECHO */
765 +#ifdef GLK_MODULE_LINE_TERMINATORS
766 + case 0x0151: /* set_terminators_line_event */
767 + if (arglist[1].ptrflag)
768 + glk_set_terminators_line_event(arglist[0].opaqueref,
769 + arglist[2].array, arglist[3].uint);
770 + else
771 + glk_set_terminators_line_event(arglist[0].opaqueref,
772 + NULL, 0);
773 + break;
774 +#endif /* GLK_MODULE_LINE_TERMINATORS */
776 +#ifdef GLK_MODULE_DATETIME
777 + case 0x0160: /* current_time */
778 + if (arglist[0].ptrflag) {
779 + glktimeval_t dat;
780 + glk_current_time(&dat);
781 + arglist[1].sint = dat.high_sec;
782 + arglist[2].uint = dat.low_sec;
783 + arglist[3].sint = dat.microsec;
785 + else {
786 + glk_current_time(NULL);
788 + break;
789 + case 0x0161: /* current_simple_time */
790 + arglist[2].sint = glk_current_simple_time(arglist[0].uint);
791 + break;
792 + case 0x0168: /* time_to_date_utc */ {
793 + glktimeval_t timeval;
794 + glktimeval_t *timeptr = NULL;
795 + glkdate_t date;
796 + glkdate_t *dateptr = NULL;
797 + int ix = 0;
798 + if (arglist[ix++].ptrflag) {
799 + timeptr = &timeval;
800 + timeval.high_sec = arglist[ix++].sint;
801 + timeval.low_sec = arglist[ix++].uint;
802 + timeval.microsec = arglist[ix++].sint;
804 + if (arglist[ix++].ptrflag) {
805 + dateptr = &date;
807 + glk_time_to_date_utc(timeptr, dateptr);
808 + if (dateptr) {
809 + arglist[ix++].sint = date.year;
810 + arglist[ix++].sint = date.month;
811 + arglist[ix++].sint = date.day;
812 + arglist[ix++].sint = date.weekday;
813 + arglist[ix++].sint = date.hour;
814 + arglist[ix++].sint = date.minute;
815 + arglist[ix++].sint = date.second;
816 + arglist[ix++].sint = date.microsec;
819 + break;
820 + case 0x0169: /* time_to_date_local */ {
821 + glktimeval_t timeval;
822 + glktimeval_t *timeptr = NULL;
823 + glkdate_t date;
824 + glkdate_t *dateptr = NULL;
825 + int ix = 0;
826 + if (arglist[ix++].ptrflag) {
827 + timeptr = &timeval;
828 + timeval.high_sec = arglist[ix++].sint;
829 + timeval.low_sec = arglist[ix++].uint;
830 + timeval.microsec = arglist[ix++].sint;
832 + if (arglist[ix++].ptrflag) {
833 + dateptr = &date;
835 + glk_time_to_date_local(timeptr, dateptr);
836 + if (dateptr) {
837 + arglist[ix++].sint = date.year;
838 + arglist[ix++].sint = date.month;
839 + arglist[ix++].sint = date.day;
840 + arglist[ix++].sint = date.weekday;
841 + arglist[ix++].sint = date.hour;
842 + arglist[ix++].sint = date.minute;
843 + arglist[ix++].sint = date.second;
844 + arglist[ix++].sint = date.microsec;
847 + break;
848 + case 0x016A: /* simple_time_to_date_utc */ {
849 + glkdate_t date;
850 + glkdate_t *dateptr = NULL;
851 + int ix = 2;
852 + if (arglist[ix++].ptrflag) {
853 + dateptr = &date;
855 + glk_simple_time_to_date_utc(arglist[0].sint, arglist[1].uint, dateptr);
856 + if (dateptr) {
857 + arglist[ix++].sint = date.year;
858 + arglist[ix++].sint = date.month;
859 + arglist[ix++].sint = date.day;
860 + arglist[ix++].sint = date.weekday;
861 + arglist[ix++].sint = date.hour;
862 + arglist[ix++].sint = date.minute;
863 + arglist[ix++].sint = date.second;
864 + arglist[ix++].sint = date.microsec;
867 + break;
868 + case 0x016B: /* simple_time_to_date_local */ {
869 + glkdate_t date;
870 + glkdate_t *dateptr = NULL;
871 + int ix = 2;
872 + if (arglist[ix++].ptrflag) {
873 + dateptr = &date;
875 + glk_simple_time_to_date_local(arglist[0].sint, arglist[1].uint, dateptr);
876 + if (dateptr) {
877 + arglist[ix++].sint = date.year;
878 + arglist[ix++].sint = date.month;
879 + arglist[ix++].sint = date.day;
880 + arglist[ix++].sint = date.weekday;
881 + arglist[ix++].sint = date.hour;
882 + arglist[ix++].sint = date.minute;
883 + arglist[ix++].sint = date.second;
884 + arglist[ix++].sint = date.microsec;
887 + break;
888 + case 0x016C: /* date_to_time_utc */ {
889 + glkdate_t date;
890 + glkdate_t *dateptr = NULL;
891 + glktimeval_t timeval;
892 + glktimeval_t *timeptr = NULL;
893 + int ix = 0;
894 + if (arglist[ix++].ptrflag) {
895 + dateptr = &date;
896 + date.year = arglist[ix++].sint;
897 + date.month = arglist[ix++].sint;
898 + date.day = arglist[ix++].sint;
899 + date.weekday = arglist[ix++].sint;
900 + date.hour = arglist[ix++].sint;
901 + date.minute = arglist[ix++].sint;
902 + date.second = arglist[ix++].sint;
903 + date.microsec = arglist[ix++].sint;
905 + if (arglist[ix++].ptrflag) {
906 + timeptr = &timeval;
908 + glk_date_to_time_utc(dateptr, timeptr);
909 + if (timeptr) {
910 + arglist[ix++].sint = timeval.high_sec;
911 + arglist[ix++].uint = timeval.low_sec;
912 + arglist[ix++].sint = timeval.microsec;
915 + break;
916 + case 0x016D: /* date_to_time_local */ {
917 + glkdate_t date;
918 + glkdate_t *dateptr = NULL;
919 + glktimeval_t timeval;
920 + glktimeval_t *timeptr = NULL;
921 + int ix = 0;
922 + if (arglist[ix++].ptrflag) {
923 + dateptr = &date;
924 + date.year = arglist[ix++].sint;
925 + date.month = arglist[ix++].sint;
926 + date.day = arglist[ix++].sint;
927 + date.weekday = arglist[ix++].sint;
928 + date.hour = arglist[ix++].sint;
929 + date.minute = arglist[ix++].sint;
930 + date.second = arglist[ix++].sint;
931 + date.microsec = arglist[ix++].sint;
933 + if (arglist[ix++].ptrflag) {
934 + timeptr = &timeval;
936 + glk_date_to_time_local(dateptr, timeptr);
937 + if (timeptr) {
938 + arglist[ix++].sint = timeval.high_sec;
939 + arglist[ix++].uint = timeval.low_sec;
940 + arglist[ix++].sint = timeval.microsec;
943 + break;
944 + case 0x016E: /* date_to_simple_time_utc */ {
945 + glkdate_t date;
946 + glkdate_t *dateptr = NULL;
947 + int ix = 0;
948 + if (arglist[ix++].ptrflag) {
949 + dateptr = &date;
950 + date.year = arglist[ix++].sint;
951 + date.month = arglist[ix++].sint;
952 + date.day = arglist[ix++].sint;
953 + date.weekday = arglist[ix++].sint;
954 + date.hour = arglist[ix++].sint;
955 + date.minute = arglist[ix++].sint;
956 + date.second = arglist[ix++].sint;
957 + date.microsec = arglist[ix++].sint;
959 + arglist[ix+2].sint = glk_date_to_simple_time_utc(dateptr, arglist[ix].uint);
961 + break;
962 + case 0x016F: /* date_to_simple_time_local */ {
963 + glkdate_t date;
964 + glkdate_t *dateptr = NULL;
965 + int ix = 0;
966 + if (arglist[ix++].ptrflag) {
967 + dateptr = &date;
968 + date.year = arglist[ix++].sint;
969 + date.month = arglist[ix++].sint;
970 + date.day = arglist[ix++].sint;
971 + date.weekday = arglist[ix++].sint;
972 + date.hour = arglist[ix++].sint;
973 + date.minute = arglist[ix++].sint;
974 + date.second = arglist[ix++].sint;
975 + date.microsec = arglist[ix++].sint;
977 + arglist[ix+2].sint = glk_date_to_simple_time_local(dateptr, arglist[ix].uint);
979 + break;
980 +#endif /* GLK_MODULE_DATETIME */
982 +#ifdef GLK_MODULE_RESOURCE_STREAM
983 + case 0x0049: /* stream_open_resource */
984 + arglist[3].opaqueref = glk_stream_open_resource(arglist[0].uint, arglist[1].uint);
985 + break;
986 + case 0x013A: /* stream_open_resource_uni */
987 + arglist[3].opaqueref = glk_stream_open_resource_uni(arglist[0].uint, arglist[1].uint);
988 + break;
989 +#endif /* GLK_MODULE_RESOURCE_STREAM */
991 default:
992 /* do nothing */
993 break;
994 --- glkloader-0.3.2/gi_dispa.h~ 2001-03-14 03:07:59.000000000 +0000
995 +++ glkloader-0.3.2/gi_dispa.h 2012-01-30 03:56:25.000000000 +0000
996 @@ -1,11 +1,11 @@
997 #ifndef _GI_DISPA_H
998 #define _GI_DISPA_H
1000 -/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.6.1.
1001 +/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.7.4.
1002 Designed by Andrew Plotkin <erkyrath@eblong.com>
1003 - http://www.eblong.com/zarf/glk/index.html
1004 + http://eblong.com/zarf/glk/index.html
1006 - This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
1007 + This file is copyright 1998-2012 by Andrew Plotkin. You may copy,
1008 distribute, and incorporate it into your own programs, by any means
1009 and under any conditions, as long as you do not modify it. You may
1010 also modify this file, incorporate it into your own programs,
1011 @@ -33,6 +33,7 @@
1012 signed char sch; /* Cs */
1013 char ch; /* Cn */
1014 char *charstr; /* S */
1015 + glui32 *unicharstr; /* U */
1016 void *array; /* all # arguments */
1017 glui32 ptrflag; /* [ ... ] or *? */
1018 } gluniversal_t;
1019 @@ -36,8 +37,9 @@
1020 void *array; /* all # arguments */
1021 glui32 ptrflag; /* [ ... ] or *? */
1022 } gluniversal_t;
1024 /* Some well-known structures:
1025 - event_t : [4IuQwIuIu]
1026 + event_t : [4IuQaIuIu]
1027 stream_result_t : [2IuIu]
1030 @@ -79,6 +81,7 @@
1031 gluniversal_t *arglist);
1032 extern char *gidispatch_prototype(glui32 funcnum);
1033 extern glui32 gidispatch_count_classes(void);
1034 +extern gidispatch_intconst_t *gidispatch_get_class(glui32 index);
1035 extern glui32 gidispatch_count_intconst(void);
1036 extern gidispatch_intconst_t *gidispatch_get_intconst(glui32 index);
1037 extern glui32 gidispatch_count_functions(void);
1038 --- glkloader-0.3.2/func.txt~ 2001-03-14 03:07:59.000000000 +0000
1039 +++ glkloader-0.3.2/func.txt 2013-07-08 14:37:24.000000000 +0100
1040 @@ -1,5 +1,5 @@
1041 #This is the list of glk selectors and functions, from Andrew Plotkin's Glk
1042 -#Specification, version 0.6.1
1043 +#Specification, version 0.7.4
1045 0x0001: glk_exit
1046 0x0002: glk_set_interrupt_handler
1047 @@ -87,4 +87,35 @@
1048 0x0101: glk_set_hyperlink_stream
1049 0x0102: glk_request_hyperlink_event
1050 0x0103: glk_cancel_hyperlink_event
1051 +0x0120: glk_buffer_to_lower_case_uni
1052 +0x0121: glk_buffer_to_upper_case_uni
1053 +0x0122: glk_buffer_to_title_case_uni
1054 +0x0123: glk_buffer_canon_decompose_uni
1055 +0x0124: glk_buffer_canon_normalize_uni
1056 +0x0128: glk_put_char_uni
1057 +0x0129: glk_put_string_uni
1058 +0x012A: glk_put_buffer_uni
1059 +0x012B: glk_put_char_stream_uni
1060 +0x012C: glk_put_string_stream_uni
1061 +0x012D: glk_put_buffer_stream_uni
1062 +0x0130: glk_get_char_stream_uni
1063 +0x0131: glk_get_buffer_stream_uni
1064 +0x0132: glk_get_line_stream_uni
1065 +0x0138: glk_stream_open_file_uni
1066 +0x0139: glk_stream_open_memory_uni
1067 +0x013A: glk_stream_open_resource_uni
1068 +0x0140: glk_request_char_event_uni
1069 +0x0141: glk_request_line_event_uni
1070 +0x0150: glk_set_echo_line_event
1071 +0x0151: glk_set_terminators_line_event
1072 +0x0160: glk_current_time
1073 +0x0161: glk_current_simple_time
1074 +0x0168: glk_time_to_date_utc
1075 +0x0169: glk_time_to_date_local
1076 +0x016A: glk_simple_time_to_date_utc
1077 +0x016B: glk_simple_time_to_date_local
1078 +0x016C: glk_date_to_time_utc
1079 +0x016D: glk_date_to_time_local
1080 +0x016E: glk_date_to_simple_time_utc
1081 +0x016F: glk_date_to_simple_time_local
1083 --- glkloader-0.3.2/unixfuncs.c~ 2001-03-14 03:07:59.000000000 +0000
1084 +++ glkloader-0.3.2/unixfuncs.c 2013-07-08 14:50:32.000000000 +0100
1085 @@ -38,6 +38,7 @@
1087 * Unix startup code functions:
1088 * glkunix_stream_open_pathname
1089 + * glkunix_stream_open_pathname_gen
1090 * glkunix_set_base_file
1092 * :FIXME: should these be hard-coded here?
1093 @@ -58,6 +59,21 @@
1094 return (*funcPtr)(pathname, textmode, rock);
1097 +strid_t glkunix_stream_open_pathname_gen(char *pathname, glui32 writemode, glui32 textmode,
1098 + glui32 rock)
1100 + strid_t (*funcPtr)(char *pathname, glui32 writemode, glui32 textmode, glui32 rock);
1101 + char * errBuf = NULL;
1103 + funcPtr = loadSymbol(gGlkLib, "glkunix_stream_open_pathname_gen", &errBuf);
1104 + if (NULL != errBuf) {
1105 + fprintf(stderr, "%s\n", errBuf);
1106 + exit(1);
1109 + return (*funcPtr)(pathname, writemode, textmode, rock);
1112 void glkunix_set_base_file(char *filename)
1114 void (*funcPtr)(char *filename);