From 34d84c5c366be68d114624aca38efe60ef6748a2 Mon Sep 17 00:00:00 2001 From: David Leverton Date: Mon, 8 Jul 2013 15:14:38 +0100 Subject: [PATCH] Revbump glkloader for Glk 0.7.4 support Also drop Gtk and X from the config file as per previous commits. --- dev-games/glkloader/Manifest | 22 +- .../files/glkloader-0.3.2-glk-0.7.0.patch | 389 ------- .../files/glkloader-0.3.2-glk-0.7.4.patch | 1114 ++++++++++++++++++++ ...kloader-0.3.2-r4-cache-function-pointers.patch} | 43 +- ...r-0.3.2-r3.ebuild => glkloader-0.3.2-r4.ebuild} | 10 +- 5 files changed, 1161 insertions(+), 417 deletions(-) rewrite dev-games/glkloader/Manifest (100%) delete mode 100644 dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.0.patch create mode 100644 dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.4.patch rename dev-games/glkloader/files/{glkloader-0.3.2-cache-function-pointers.patch => glkloader-0.3.2-r4-cache-function-pointers.patch} (90%) rename dev-games/glkloader/{glkloader-0.3.2-r3.ebuild => glkloader-0.3.2-r4.ebuild} (86%) diff --git a/dev-games/glkloader/Manifest b/dev-games/glkloader/Manifest dissimilarity index 100% index af83923..acac1a5 100644 --- a/dev-games/glkloader/Manifest +++ b/dev-games/glkloader/Manifest @@ -1,11 +1,11 @@ -AUX glkloader-0.3.2-cache-function-pointers.patch 12577 RMD160 dcc4332f248bc579ad8faebe8ba62b006b76f7ca SHA1 1c369c851d9a8541132fcda741307ced323d3d59 SHA256 30bb6056f64d7dd7cc14b34624e4095e47ad445e122b30a06a131030686f354d -AUX glkloader-0.3.2-configure.ac 310 RMD160 39939abe174a6e96a7477f8f5a7deaf332cf9797 SHA1 e0d52ca624634d4b5f3b453607c3478b1689249d SHA256 0fbe12563951e821d5e23e60ae1b98a223face8494df0d3d84f9e05ed083e546 -AUX glkloader-0.3.2-double-free.patch 415 RMD160 87d26d64ca0b4db0e87708387f39d3bc13912ebd SHA1 e44b1c7e3ad7a9ef49985fda37d287c0e984dd62 SHA256 02a9b44b4435083e7f50cc4e85c0f68db715316da1ba9b17298b75c6591fabab -AUX glkloader-0.3.2-dynamic-blorb-dispa.patch 7219 RMD160 2fdef9139d44e2f96ccbc801ab9affafc6c72c40 SHA1 1d3efebf98689717bfd90e82c839f91fb8af8a14 SHA256 e699c2f4e21db7be894b4ae7783ed73e9b054668e550a3ff7036c7c6996aed2a -AUX glkloader-0.3.2-glk-0.7.0.patch 15716 RMD160 6700159f0010f7d905dfa4e8242ef6d9305d828b SHA1 949740c164824cc1860a2050fd5db07d8227fd19 SHA256 79ed5e4cd85072f2570cb5e09824ce9362053d5f31d6118ed7c824d58151af63 -AUX glkloader-0.3.2-no-rdynamic.patch 813 RMD160 c109187f08f31ffa55e4f7ee6ba7846c319a6494 SHA1 b96e04e3b14140db06a10e63fda1cb7e695e67ed SHA256 f15a7f6797c77103af3ffa811603a9b024366f1e2bf84c29d4f6341b8fdc3695 -AUX glkloader-0.3.2-r1-Makefile.am 693 RMD160 cd245740204dd38ea6cd597c9acd1e9f579fbc7f SHA1 5fd04be03efe145d53ad396eaf21606cc2288e0e SHA256 71ac0caf4a57c62f8269712e6afcf88d1738f4cbb7a6a23bccd94cff9d722982 -AUX glkloader-0.3.2-r1-garglk-extensions.patch 461 RMD160 335e33241c94d38165dae93504f4ce088c649daa SHA1 bdc8477d087b53840fed453e4e206abb2f75947b SHA256 cb6c107ce95aa5f584b0a91b946dea4f57d7871083c2813a91bf2372683f3df2 -EBUILD glkloader-0.3.2-r3.ebuild 2003 RMD160 3dd969c996db263a0e9c70bfdf0a0c59806ce50c SHA1 b3590b34c5c800d3f20f9e7e8619507b9942134a SHA256 def9097f543a7449e62aa6833ffe69f533462564290d20613a2b24573bc93e63 -MISC metadata.xml 229 RMD160 05d41c316709d6fff71eaf40e582bb77d06eafc3 SHA1 e00aca92ab168425a0557b4aea5fa07777d8cea6 SHA256 a45114b45eed9371b0a54391c22c5242cf2ba9d78a8d2d07c043331240471655 -DIST glkloader-0.3.2.tar.gz 179678 RMD160 7e060fca1ebbbc7154b4077700b74c124a4fa9ca SHA1 b8de6cfe47c656dbd32ecad79d5253ade6c5cb50 SHA256 aef6e3d39da8219cf8c9a66dd4133048af828128f76115088ecf7c86fbf519d4 +AUX glkloader-0.3.2-configure.ac 310 SHA256 0fbe12563951e821d5e23e60ae1b98a223face8494df0d3d84f9e05ed083e546 SHA512 f856a92000d8df318995afc09936ce8f98aa6a418c84042e1cbadfd2f75fcc8bc6840e801cf42ffe7b152df252b7160ac86cc1e6a4ecbe8795278d8ec6a75c7b WHIRLPOOL 672737f9323da378ba54fb787c3c8ccef67f36e6f29607807f7e4f9b1b248a49d0b63b4a7c105d2698b7c71473e6740fb58ef6166f1f91304290e9478f12dd2f +AUX glkloader-0.3.2-double-free.patch 415 SHA256 02a9b44b4435083e7f50cc4e85c0f68db715316da1ba9b17298b75c6591fabab SHA512 e8e8c4ccc4ec6ebf1e5c5e725362dabe2aa4ad0797679a5ee9b8655f8a6a00ee4c390e3b05bb0b890da70589876d2a5a435bae6f06e57722f798194ee5785cd2 WHIRLPOOL 55c7624fb22cfa4e7f11990bfe66dfa03bae5b2b75f73ca0fcf9aac3ec23be43fabd4534bc949067a0e1880ea3f3372b3161f6c15f4d80001b88595bb8560380 +AUX glkloader-0.3.2-dynamic-blorb-dispa.patch 7219 SHA256 e699c2f4e21db7be894b4ae7783ed73e9b054668e550a3ff7036c7c6996aed2a SHA512 e077006adebc78f148385c7cd9ce17e7cf37b071ad4e2ceac6bd45c946bdbca88a1b9ff205759b7fb44d268f36626ac0c3b956b45c17f73269af187a91047b4e WHIRLPOOL 82439e076ef21f3f97259c82d7dc655b0ef164f3055ac9c1d37d5cccbfa0d7c7457afa2ddf14c7808e9c89180d17ba7e11c47387ca6cedcc5292a8d7ecc7ab97 +AUX glkloader-0.3.2-glk-0.7.4.patch 44290 SHA256 38b3463d692bdc625c512b1f839b07afe645a537ea3b0136b296ccc8d142ac16 SHA512 cff471d8c7303c3f46c562ffdd0a561d83ca9ebd2eb3834f27b500d79c812aae6f5c755c33e5f6db939ec7194797fd1617e1b7e94c2abb1213d08fd54ee12d66 WHIRLPOOL bba13d38cbff0eabd31e5d215ed0c5384130ba2e2711b82602adf515b5270e133971a3251e5ce86b41ee27cb2857ee22a12af40406d7f98072bc72323ece6b79 +AUX glkloader-0.3.2-no-rdynamic.patch 813 SHA256 f15a7f6797c77103af3ffa811603a9b024366f1e2bf84c29d4f6341b8fdc3695 SHA512 42b8df526c3c6e6af7756615fe4529bc92acba7e853be65381faff9d7b19361b4aba34018a48a4c91980e644e4fd5c3b84d1135bdbeaa8183437f05b87858d88 WHIRLPOOL 61a0b258ce362299cc41dad8db17a21e65e3b1fec4116cbee393235840711de8050230db5100c6b201360eb9320c646de0f3aa2ddcad5b5ce289e814c1961aa9 +AUX glkloader-0.3.2-r1-Makefile.am 693 SHA256 71ac0caf4a57c62f8269712e6afcf88d1738f4cbb7a6a23bccd94cff9d722982 SHA512 6b382d51a60ad36ae1b49b94b8721c7bea7cbae7cfa8ed1d78161f67dba936abda91ee4416b86f3ecd3a86161f2832b12ef07ecb60de3ae3d62980f7030e9363 WHIRLPOOL 8c9ebfde0bcaa8ed6fbc7a1da726d8aa4b8b96620fc59548938e922e09903e141181a779d1418dad0eb685a9f5cca2c31b39d50d2150f4282e663e69ff5cede6 +AUX glkloader-0.3.2-r1-garglk-extensions.patch 461 SHA256 cb6c107ce95aa5f584b0a91b946dea4f57d7871083c2813a91bf2372683f3df2 SHA512 9416340b4c390678a4d0acffe5f5057d311673e529af403f0e6de3167d42856484b4d75dc3a49f34c78840844b18355fbf9d27d3bedc39f8e815fcec56d482fa WHIRLPOOL 2cdac29e51db6db15503d5638cdcda8b6f0d16e08ee54761274d6f5c56fcb1182020deaf1a193b0ba3c09bfbf240a69aa9683365cf516fd176f6bad421826686 +AUX glkloader-0.3.2-r4-cache-function-pointers.patch 13236 SHA256 fd054396598d64f872181488babe0b38db1b2e1217c1ee14357350aa8206eb0f SHA512 ba09c100a2b73aedbca3692f11062f3b47d77c1ff24d0f74745c5b3fd8d9629a7a64ee16c421b3411986e8650ee0c037ec559a05e5b4e0cd7ce541e6fba5aa52 WHIRLPOOL 61225c2c4b18883457ba56f2a3a2d9c2fc4fcf63cb51540c4793a7d3f048e9594f08bce69b563d558a3badaddb7c7861a978915b087605b01746060e9562ae7d +DIST glkloader-0.3.2.tar.gz 179678 SHA256 aef6e3d39da8219cf8c9a66dd4133048af828128f76115088ecf7c86fbf519d4 SHA512 8c3274e88fb48ab693b96a9412a1d1e9ea2ebb0f26b69f0520bc521155b0904d0dbed87882ecce1fc7957bf64c9612441a94aff6b1f700c5b5d25f698168343e WHIRLPOOL 4ad155b3361ed993e81d66a4ab03b97df08ac84bde2d8d1e0b5ed354d988cb0adb5bdcd67ea9cff92b6fbc40ae13c44d19283e87c493a1a5f774f7f4a5466d87 +EBUILD glkloader-0.3.2-r4.ebuild 1963 SHA256 5c95cba962687d2a832e7a1f22181631b689967b47534fb86bc9a724b0eed040 SHA512 dfe5cab4367ced058a8b1d42629ff753203bbec598f594f70ea68c0f5cd11a17cad77286d0990fe6fd180cc0a1cd00dd2bc42cbbb5ddd318507698ff4040bed2 WHIRLPOOL b0439f3aef9e336dc89b48b651fcf219ec538bc0e9cad3e854b0bd1198b6cce959f70933bf85694096432e0c734a62beda4b5b55ddfbf16f5d5442cd062b80c0 +MISC metadata.xml 229 SHA256 a45114b45eed9371b0a54391c22c5242cf2ba9d78a8d2d07c043331240471655 SHA512 7c2c112e47287ce6f55bfaeee236df7ba8d6f45b864449712e802116e745a2ec419251906ad543a204b855903b7cb99cda7d4db443ab859263ceee1b7cd55c86 WHIRLPOOL 64e6990b070419e0c6c46f4dec3fd98cdff05b364a56ec5298242c4c0985da89a7f20b74845b5bd0b4526bf9f9cabf644f552fe71942ec323f3e29b7e3c8ee86 diff --git a/dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.0.patch b/dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.0.patch deleted file mode 100644 index 6f4a50c..0000000 --- a/dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.0.patch +++ /dev/null @@ -1,389 +0,0 @@ -Source: dleverton -Upstream: submitted -Reason: update to Glk 0.7.0 - ---- glkloader-0.3.2/glk.h~ 2007-12-08 21:58:26.000000000 +0000 -+++ glkloader-0.3.2/glk.h 2007-12-08 21:58:48.000000000 +0000 -@@ -1,11 +1,11 @@ - #ifndef GLK_H - #define GLK_H - --/* glk.h: Header file for Glk API, version 0.6.1. -+/* glk.h: Header file for Glk API, version 0.7.0. - Designed by Andrew Plotkin - http://www.eblong.com/zarf/glk/index.html - -- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, -+ This file is copyright 1998-2004 by Andrew Plotkin. You may copy, - distribute, and incorporate it into your own programs, by any means - and under any conditions, as long as you do not modify it. You may - also modify this file, incorporate it into your own programs, -@@ -22,6 +22,7 @@ - - /* These are the compile-time conditionals that reveal various Glk optional - modules. */ -+#define GLK_MODULE_UNICODE - #define GLK_MODULE_IMAGE - #define GLK_MODULE_SOUND - #define GLK_MODULE_HYPERLINKS -@@ -51,6 +52,7 @@ - #define gestalt_HyperlinkInput (12) - #define gestalt_SoundMusic (13) - #define gestalt_GraphicsTransparency (14) -+#define gestalt_Unicode (15) - - #define evtype_None (0) - #define evtype_Timer (1) -@@ -263,6 +265,37 @@ - extern void glk_cancel_char_event(winid_t win); - extern void glk_cancel_mouse_event(winid_t win); - -+#ifdef GLK_MODULE_UNICODE -+ -+extern glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len, -+ glui32 numchars); -+extern glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len, -+ glui32 numchars); -+extern glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, -+ glui32 numchars, glui32 lowerrest); -+ -+extern void glk_put_char_uni(glui32 ch); -+extern void glk_put_string_uni(glui32 *s); -+extern void glk_put_buffer_uni(glui32 *buf, glui32 len); -+extern void glk_put_char_stream_uni(strid_t str, glui32 ch); -+extern void glk_put_string_stream_uni(strid_t str, glui32 *s); -+extern void glk_put_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len); -+ -+extern glsi32 glk_get_char_stream_uni(strid_t str); -+extern glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len); -+extern glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len); -+ -+extern strid_t glk_stream_open_file_uni(frefid_t fileref, glui32 fmode, -+ glui32 rock); -+extern strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen, -+ glui32 fmode, glui32 rock); -+ -+extern void glk_request_char_event_uni(winid_t win); -+extern void glk_request_line_event_uni(winid_t win, glui32 *buf, -+ glui32 maxlen, glui32 initlen); -+ -+#endif /* GLK_MODULE_UNICODE */ -+ - #ifdef GLK_MODULE_IMAGE - - #define imagealign_InlineUp (0x01) ---- glkloader-0.3.2/gi_dispa.c~ 2001-03-14 03:07:59.000000000 +0000 -+++ glkloader-0.3.2/gi_dispa.c 2007-12-08 21:42:23.000000000 +0000 -@@ -1,8 +1,8 @@ --/* gi_dispa.c: Dispatch layer for Glk API, version 0.6.1. -+/* gi_dispa.c: Dispatch layer for Glk API, version 0.7.0. - Designed by Andrew Plotkin - http://www.eblong.com/zarf/glk/index.html - -- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, -+ This file is copyright 1998-2004 by Andrew Plotkin. You may copy, - distribute, and incorporate it into your own programs, by any means - and under any conditions, as long as you do not modify it. You may - also modify this file, incorporate it into your own programs, -@@ -21,6 +21,9 @@ - #define NULL 0 - #endif - -+#define NUMCLASSES \ -+ (sizeof(class_table) / sizeof(gidispatch_intconst_t)) -+ - #define NUMINTCONSTANTS \ - (sizeof(intconstant_table) / sizeof(gidispatch_intconst_t)) - -@@ -28,6 +31,14 @@ - (sizeof(function_table) / sizeof(gidispatch_function_t)) - - /* The constants in this table must be ordered alphabetically. */ -+static gidispatch_intconst_t class_table[] = { -+ { "fileref", (2) }, /* "Qc" */ -+ { "schannel", (3) }, /* "Qd" */ -+ { "stream", (1) }, /* "Qb" */ -+ { "window", (0) }, /* "Qa" */ -+}; -+ -+/* The constants in this table must be ordered alphabetically. */ - static gidispatch_intconst_t intconstant_table[] = { - { "evtype_Arrange", (5) }, - { "evtype_CharInput", (2) }, -@@ -66,6 +77,7 @@ - { "gestalt_SoundNotify", (10) }, - { "gestalt_SoundVolume", (9) }, - { "gestalt_Timer", (5) }, -+ { "gestalt_Unicode", (15) }, - { "gestalt_Version", (0) }, - #ifdef GLK_MODULE_IMAGE - { "imagealign_InlineCenter", (0x03) }, -@@ -240,11 +252,36 @@ - { 0x0102, glk_request_hyperlink_event, "request_hyperlink_event" }, - { 0x0103, glk_cancel_hyperlink_event, "cancel_hyperlink_event" }, - #endif /* GLK_MODULE_HYPERLINKS */ -+#ifdef GLK_MODULE_UNICODE -+ { 0x0120, glk_buffer_to_lower_case_uni, "buffer_to_lower_case_uni" }, -+ { 0x0121, glk_buffer_to_upper_case_uni, "buffer_to_upper_case_uni" }, -+ { 0x0122, glk_buffer_to_title_case_uni, "buffer_to_title_case_uni" }, -+ { 0x0128, glk_put_char_uni, "put_char_uni" }, -+ { 0x0129, glk_put_string_uni, "put_string_uni" }, -+ { 0x012A, glk_put_buffer_uni, "put_buffer_uni" }, -+ { 0x012B, glk_put_char_stream_uni, "put_char_stream_uni" }, -+ { 0x012C, glk_put_string_stream_uni, "put_string_stream_uni" }, -+ { 0x012D, glk_put_buffer_stream_uni, "put_buffer_stream_uni" }, -+ { 0x0130, glk_get_char_stream_uni, "get_char_stream_uni" }, -+ { 0x0131, glk_get_buffer_stream_uni, "get_buffer_stream_uni" }, -+ { 0x0132, glk_get_line_stream_uni, "get_line_stream_uni" }, -+ { 0x0138, glk_stream_open_file_uni, "stream_open_file_uni" }, -+ { 0x0139, glk_stream_open_memory_uni, "stream_open_memory_uni" }, -+ { 0x0140, glk_request_char_event_uni, "request_char_event_uni" }, -+ { 0x0141, glk_request_line_event_uni, "request_line_event_uni" }, -+#endif /* GLK_MODULE_UNICODE */ - }; - - glui32 gidispatch_count_classes() - { -- return 4; -+ return NUMCLASSES; -+} -+ -+gidispatch_intconst_t *gidispatch_get_class(glui32 index) -+{ -+ if (index < 0 || index >= NUMCLASSES) -+ return NULL; -+ return &(class_table[index]); - } - - glui32 gidispatch_count_intconst() -@@ -398,7 +435,7 @@ - case 0x0087: /* set_style_stream */ - return "2QbIu:"; - case 0x0090: /* get_char_stream */ -- return "2Qb:Iu"; -+ return "2Qb:Is"; - case 0x0091: /* get_line_stream */ - return "3Qb<+#Cn:Iu"; - case 0x0092: /* get_buffer_stream */ -@@ -480,6 +520,41 @@ - return "1Qa:"; - #endif /* GLK_MODULE_HYPERLINKS */ - -+#ifdef GLK_MODULE_UNICODE -+ case 0x0120: /* buffer_to_lower_case_uni */ -+ return "3&+#IuIu:Iu"; -+ case 0x0121: /* buffer_to_upper_case_uni */ -+ return "3&+#IuIu:Iu"; -+ case 0x0122: /* buffer_to_title_case_uni */ -+ return "4&+#IuIuIu:Iu"; -+ case 0x0128: /* put_char_uni */ -+ return "1Iu:"; -+ case 0x0129: /* put_string_uni */ -+ return "1U:"; -+ case 0x012A: /* put_buffer_uni */ -+ return "1>+#Iu:"; -+ case 0x012B: /* put_char_stream_uni */ -+ return "2QbIu:"; -+ case 0x012C: /* put_string_stream_uni */ -+ return "2QbU:"; -+ case 0x012D: /* put_buffer_stream_uni */ -+ return "2Qb>+#Iu:"; -+ case 0x0130: /* get_char_stream_uni */ -+ return "2Qb:Is"; -+ case 0x0131: /* get_buffer_stream_uni */ -+ return "3Qb<+#Iu:Iu"; -+ case 0x0132: /* get_line_stream_uni */ -+ return "3Qb<+#Iu:Iu"; -+ case 0x0138: /* stream_open_file_uni */ -+ return "4QcIuIu:Qb"; -+ case 0x0139: /* stream_open_memory_uni */ -+ return "4&+#!IuIuIu:Qb"; -+ case 0x0140: /* request_char_event_uni */ -+ return "1Qa:"; -+ case 0x0141: /* request_line_event_uni */ -+ return "3Qa&+#!IuIu:"; -+#endif /* GLK_MODULE_UNICODE */ -+ - default: - return NULL; - } -@@ -697,7 +772,7 @@ - glk_fileref_delete_file(arglist[0].opaqueref); - break; - case 0x0067: /* fileref_does_file_exist */ -- arglist[1].uint = glk_fileref_does_file_exist(arglist[0].opaqueref); -+ arglist[2].uint = glk_fileref_does_file_exist(arglist[0].opaqueref); - break; - case 0x0068: /* fileref_create_from_fileref */ - arglist[4].opaqueref = glk_fileref_create_from_fileref(arglist[0].uint, -@@ -736,7 +811,7 @@ - glk_set_style_stream(arglist[0].opaqueref, arglist[1].uint); - break; - case 0x0090: /* get_char_stream */ -- arglist[2].uint = glk_get_char_stream(arglist[0].opaqueref); -+ arglist[2].sint = glk_get_char_stream(arglist[0].opaqueref); - break; - case 0x0091: /* get_line_stream */ - if (arglist[1].ptrflag) -@@ -943,6 +1021,95 @@ - break; - #endif /* GLK_MODULE_HYPERLINKS */ - -+#ifdef GLK_MODULE_UNICODE -+ case 0x0120: /* buffer_to_lower_case_uni */ -+ if (arglist[0].ptrflag) -+ arglist[5].uint = glk_buffer_to_lower_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint); -+ else -+ arglist[3].uint = glk_buffer_to_lower_case_uni(NULL, 0, arglist[1].uint); -+ break; -+ case 0x0121: /* buffer_to_upper_case_uni */ -+ if (arglist[0].ptrflag) -+ arglist[5].uint = glk_buffer_to_upper_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint); -+ else -+ arglist[3].uint = glk_buffer_to_upper_case_uni(NULL, 0, arglist[1].uint); -+ break; -+ case 0x0122: /* buffer_to_title_case_uni */ -+ if (arglist[0].ptrflag) -+ arglist[6].uint = glk_buffer_to_title_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint, arglist[4].uint); -+ else -+ arglist[4].uint = glk_buffer_to_title_case_uni(NULL, 0, arglist[1].uint, arglist[2].uint); -+ break; -+ case 0x0128: /* put_char_uni */ -+ glk_put_char_uni(arglist[0].uint); -+ break; -+ case 0x0129: /* put_string_uni */ -+ glk_put_string_uni(arglist[0].unicharstr); -+ break; -+ case 0x012A: /* put_buffer_uni */ -+ if (arglist[0].ptrflag) -+ glk_put_buffer_uni(arglist[1].array, arglist[2].uint); -+ else -+ glk_put_buffer_uni(NULL, 0); -+ break; -+ case 0x012B: /* put_char_stream_uni */ -+ glk_put_char_stream_uni(arglist[0].opaqueref, arglist[1].uint); -+ break; -+ case 0x012C: /* put_string_stream_uni */ -+ glk_put_string_stream_uni(arglist[0].opaqueref, arglist[1].unicharstr); -+ break; -+ case 0x012D: /* put_buffer_stream_uni */ -+ if (arglist[1].ptrflag) -+ glk_put_buffer_stream_uni(arglist[0].opaqueref, -+ arglist[2].array, arglist[3].uint); -+ else -+ glk_put_buffer_stream_uni(arglist[0].opaqueref, -+ NULL, 0); -+ break; -+ case 0x0130: /* get_char_stream_uni */ -+ arglist[2].sint = glk_get_char_stream_uni(arglist[0].opaqueref); -+ break; -+ case 0x0131: /* get_buffer_stream_uni */ -+ if (arglist[1].ptrflag) -+ arglist[5].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref, -+ arglist[2].array, arglist[3].uint); -+ else -+ arglist[3].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref, -+ NULL, 0); -+ break; -+ case 0x0132: /* get_line_stream_uni */ -+ if (arglist[1].ptrflag) -+ arglist[5].uint = glk_get_line_stream_uni(arglist[0].opaqueref, -+ arglist[2].array, arglist[3].uint); -+ else -+ arglist[3].uint = glk_get_line_stream_uni(arglist[0].opaqueref, -+ NULL, 0); -+ break; -+ case 0x0138: /* stream_open_file_uni */ -+ arglist[4].opaqueref = glk_stream_open_file_uni(arglist[0].opaqueref, arglist[1].uint, -+ arglist[2].uint); -+ break; -+ case 0x0139: /* stream_open_memory_uni */ -+ if (arglist[0].ptrflag) -+ arglist[6].opaqueref = glk_stream_open_memory_uni(arglist[1].array, -+ arglist[2].uint, arglist[3].uint, arglist[4].uint); -+ else -+ arglist[4].opaqueref = glk_stream_open_memory_uni(NULL, -+ 0, arglist[1].uint, arglist[2].uint); -+ break; -+ case 0x0140: /* request_char_event_uni */ -+ glk_request_char_event_uni(arglist[0].opaqueref); -+ break; -+ case 0x0141: /* request_line_event_uni */ -+ if (arglist[1].ptrflag) -+ glk_request_line_event_uni(arglist[0].opaqueref, arglist[2].array, -+ arglist[3].uint, arglist[4].uint); -+ else -+ glk_request_line_event_uni(arglist[0].opaqueref, NULL, -+ 0, arglist[2].uint); -+ break; -+#endif /* GLK_MODULE_UNICODE */ -+ - default: - /* do nothing */ - break; ---- glkloader-0.3.2/gi_dispa.h~ 2001-03-14 03:07:59.000000000 +0000 -+++ glkloader-0.3.2/gi_dispa.h 2007-12-08 21:42:25.000000000 +0000 -@@ -1,11 +1,11 @@ - #ifndef _GI_DISPA_H - #define _GI_DISPA_H - --/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.6.1. -+/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.7.0. - Designed by Andrew Plotkin - http://www.eblong.com/zarf/glk/index.html - -- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, -+ This file is copyright 1998-2004 by Andrew Plotkin. You may copy, - distribute, and incorporate it into your own programs, by any means - and under any conditions, as long as you do not modify it. You may - also modify this file, incorporate it into your own programs, -@@ -33,6 +33,7 @@ - signed char sch; /* Cs */ - char ch; /* Cn */ - char *charstr; /* S */ -+ glui32 *unicharstr; /* U */ - void *array; /* all # arguments */ - glui32 ptrflag; /* [ ... ] or *? */ - } gluniversal_t; -@@ -36,8 +37,9 @@ - void *array; /* all # arguments */ - glui32 ptrflag; /* [ ... ] or *? */ - } gluniversal_t; -+ - /* Some well-known structures: -- event_t : [4IuQwIuIu] -+ event_t : [4IuQaIuIu] - stream_result_t : [2IuIu] - */ - -@@ -79,6 +81,7 @@ - gluniversal_t *arglist); - extern char *gidispatch_prototype(glui32 funcnum); - extern glui32 gidispatch_count_classes(void); -+extern gidispatch_intconst_t *gidispatch_get_class(glui32 index); - extern glui32 gidispatch_count_intconst(void); - extern gidispatch_intconst_t *gidispatch_get_intconst(glui32 index); - extern glui32 gidispatch_count_functions(void); ---- glkloader-0.3.2/func.txt~ 2001-03-14 03:07:59.000000000 +0000 -+++ glkloader-0.3.2/func.txt 2007-12-09 01:05:30.000000000 +0000 -@@ -87,4 +87,20 @@ - 0x0101: glk_set_hyperlink_stream - 0x0102: glk_request_hyperlink_event - 0x0103: glk_cancel_hyperlink_event -+0x0120: glk_buffer_to_lower_case_uni -+0x0121: glk_buffer_to_upper_case_uni -+0x0122: glk_buffer_to_title_case_uni -+0x0128: glk_put_char_uni -+0x0129: glk_put_string_uni -+0x012A: glk_put_buffer_uni -+0x012B: glk_put_char_stream_uni -+0x012C: glk_put_string_stream_uni -+0x012D: glk_put_buffer_stream_uni -+0x0130: glk_get_char_stream_uni -+0x0131: glk_get_buffer_stream_uni -+0x0132: glk_get_line_stream_uni -+0x0138: glk_stream_open_file_uni -+0x0139: glk_stream_open_memory_uni -+0x0140: glk_request_char_event_uni -+0x0141: glk_request_line_event_uni - diff --git a/dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.4.patch b/dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.4.patch new file mode 100644 index 0000000..3dd09fc --- /dev/null +++ b/dev-games/glkloader/files/glkloader-0.3.2-glk-0.7.4.patch @@ -0,0 +1,1114 @@ +Source: dleverton +Upstream: previous version submitted +Reason: update to Glk 0.7.4 + +--- glkloader-0.3.2/glk.h~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/glk.h 2012-01-30 04:00:03.000000000 +0000 +@@ -1,11 +1,11 @@ + #ifndef GLK_H + #define GLK_H + +-/* glk.h: Header file for Glk API, version 0.6.1. ++/* glk.h: Header file for Glk API, version 0.7.4. + Designed by Andrew Plotkin +- http://www.eblong.com/zarf/glk/index.html ++ http://eblong.com/zarf/glk/ + +- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, ++ This file is copyright 1998-2012 by Andrew Plotkin. You may copy, + distribute, and incorporate it into your own programs, by any means + and under any conditions, as long as you do not modify it. You may + also modify this file, incorporate it into your own programs, +@@ -14,17 +14,28 @@ + shown above. + */ + +-/* You may have to edit the definition of glui32 to make sure it's really a +- 32-bit unsigned integer type, and glsi32 to make sure it's really a +- 32-bit signed integer type. If they're not, horrible things will happen. */ +-typedef unsigned long glui32; +-typedef signed long glsi32; ++/* If your system does not have , you'll have to remove this ++ include line. Then edit the definition of glui32 to make sure it's ++ really a 32-bit unsigned integer type, and glsi32 to make sure ++ it's really a 32-bit signed integer type. If they're not, horrible ++ things will happen. */ ++#include ++typedef uint32_t glui32; ++typedef int32_t glsi32; + + /* These are the compile-time conditionals that reveal various Glk optional +- modules. */ ++ modules. Note that if GLK_MODULE_SOUND2 is defined, GLK_MODULE_SOUND ++ must be also. */ ++#define GLK_MODULE_LINE_ECHO ++#define GLK_MODULE_LINE_TERMINATORS ++#define GLK_MODULE_UNICODE ++#define GLK_MODULE_UNICODE_NORM + #define GLK_MODULE_IMAGE + #define GLK_MODULE_SOUND ++#define GLK_MODULE_SOUND2 + #define GLK_MODULE_HYPERLINKS ++#define GLK_MODULE_DATETIME ++#define GLK_MODULE_RESOURCE_STREAM + + /* These types are opaque object identifiers. They're pointers to opaque + C structures, which are defined differently by each library. */ +@@ -51,6 +62,14 @@ + #define gestalt_HyperlinkInput (12) + #define gestalt_SoundMusic (13) + #define gestalt_GraphicsTransparency (14) ++#define gestalt_Unicode (15) ++#define gestalt_UnicodeNorm (16) ++#define gestalt_LineInputEcho (17) ++#define gestalt_LineTerminators (18) ++#define gestalt_LineTerminatorKey (19) ++#define gestalt_DateTime (20) ++#define gestalt_Sound2 (21) ++#define gestalt_ResourceStream (22) + + #define evtype_None (0) + #define evtype_Timer (1) +@@ -61,6 +80,7 @@ + #define evtype_Redraw (6) + #define evtype_SoundNotify (7) + #define evtype_Hyperlink (8) ++#define evtype_VolumeNotify (9) + + typedef struct event_struct { + glui32 type; +@@ -131,6 +151,10 @@ + #define winmethod_Proportional (0x20) + #define winmethod_DivisionMask (0xf0) + ++#define winmethod_Border (0x000) ++#define winmethod_NoBorder (0x100) ++#define winmethod_BorderMask (0x100) ++ + #define fileusage_Data (0x00) + #define fileusage_SavedGame (0x01) + #define fileusage_Transcript (0x02) +@@ -263,6 +287,55 @@ + extern void glk_cancel_char_event(winid_t win); + extern void glk_cancel_mouse_event(winid_t win); + ++#ifdef GLK_MODULE_LINE_ECHO ++extern void glk_set_echo_line_event(winid_t win, glui32 val); ++#endif /* GLK_MODULE_LINE_ECHO */ ++ ++#ifdef GLK_MODULE_LINE_TERMINATORS ++extern void glk_set_terminators_line_event(winid_t win, glui32 *keycodes, ++ glui32 count); ++#endif /* GLK_MODULE_LINE_TERMINATORS */ ++ ++#ifdef GLK_MODULE_UNICODE ++ ++extern glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len, ++ glui32 numchars); ++extern glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len, ++ glui32 numchars); ++extern glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len, ++ glui32 numchars, glui32 lowerrest); ++ ++extern void glk_put_char_uni(glui32 ch); ++extern void glk_put_string_uni(glui32 *s); ++extern void glk_put_buffer_uni(glui32 *buf, glui32 len); ++extern void glk_put_char_stream_uni(strid_t str, glui32 ch); ++extern void glk_put_string_stream_uni(strid_t str, glui32 *s); ++extern void glk_put_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len); ++ ++extern glsi32 glk_get_char_stream_uni(strid_t str); ++extern glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len); ++extern glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len); ++ ++extern strid_t glk_stream_open_file_uni(frefid_t fileref, glui32 fmode, ++ glui32 rock); ++extern strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen, ++ glui32 fmode, glui32 rock); ++ ++extern void glk_request_char_event_uni(winid_t win); ++extern void glk_request_line_event_uni(winid_t win, glui32 *buf, ++ glui32 maxlen, glui32 initlen); ++ ++#endif /* GLK_MODULE_UNICODE */ ++ ++#ifdef GLK_MODULE_UNICODE_NORM ++ ++extern glui32 glk_buffer_canon_decompose_uni(glui32 *buf, glui32 len, ++ glui32 numchars); ++extern glui32 glk_buffer_canon_normalize_uni(glui32 *buf, glui32 len, ++ glui32 numchars); ++ ++#endif /* GLK_MODULE_UNICODE_NORM */ ++ + #ifdef GLK_MODULE_IMAGE + + #define imagealign_InlineUp (0x01) +@@ -301,6 +374,19 @@ + + extern void glk_sound_load_hint(glui32 snd, glui32 flag); + ++#ifdef GLK_MODULE_SOUND2 ++/* Note that this section is nested inside the #ifdef GLK_MODULE_SOUND. ++ GLK_MODULE_SOUND must be defined if GLK_MODULE_SOUND2 is. */ ++ ++extern schanid_t glk_schannel_create_ext(glui32 rock, glui32 volume); ++extern glui32 glk_schannel_play_multi(schanid_t *chanarray, glui32 chancount, ++ glui32 *sndarray, glui32 soundcount, glui32 notify); ++extern void glk_schannel_pause(schanid_t chan); ++extern void glk_schannel_unpause(schanid_t chan); ++extern void glk_schannel_set_volume_ext(schanid_t chan, glui32 vol, ++ glui32 duration, glui32 notify); ++ ++#endif /* GLK_MODULE_SOUND2 */ + #endif /* GLK_MODULE_SOUND */ + + #ifdef GLK_MODULE_HYPERLINKS +@@ -312,4 +398,45 @@ + + #endif /* GLK_MODULE_HYPERLINKS */ + ++#ifdef GLK_MODULE_DATETIME ++ ++typedef struct glktimeval_struct { ++ glsi32 high_sec; ++ glui32 low_sec; ++ glsi32 microsec; ++} glktimeval_t; ++ ++typedef struct glkdate_struct { ++ glsi32 year; /* full (four-digit) year */ ++ glsi32 month; /* 1-12, 1 is January */ ++ glsi32 day; /* 1-31 */ ++ glsi32 weekday; /* 0-6, 0 is Sunday */ ++ glsi32 hour; /* 0-23 */ ++ glsi32 minute; /* 0-59 */ ++ glsi32 second; /* 0-59, maybe 60 during a leap second */ ++ glsi32 microsec; /* 0-999999 */ ++} glkdate_t; ++ ++extern void glk_current_time(glktimeval_t *time); ++extern glsi32 glk_current_simple_time(glui32 factor); ++extern void glk_time_to_date_utc(glktimeval_t *time, glkdate_t *date); ++extern void glk_time_to_date_local(glktimeval_t *time, glkdate_t *date); ++extern void glk_simple_time_to_date_utc(glsi32 time, glui32 factor, ++ glkdate_t *date); ++extern void glk_simple_time_to_date_local(glsi32 time, glui32 factor, ++ glkdate_t *date); ++extern void glk_date_to_time_utc(glkdate_t *date, glktimeval_t *time); ++extern void glk_date_to_time_local(glkdate_t *date, glktimeval_t *time); ++extern glsi32 glk_date_to_simple_time_utc(glkdate_t *date, glui32 factor); ++extern glsi32 glk_date_to_simple_time_local(glkdate_t *date, glui32 factor); ++ ++#endif /* GLK_MODULE_DATETIME */ ++ ++#ifdef GLK_MODULE_RESOURCE_STREAM ++ ++extern strid_t glk_stream_open_resource(glui32 filenum, glui32 rock); ++extern strid_t glk_stream_open_resource_uni(glui32 filenum, glui32 rock); ++ ++#endif /* GLK_MODULE_RESOURCE_STREAM */ ++ + #endif /* GLK_H */ +--- glkloader-0.3.2/gi_blorb.c~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/gi_blorb.c 2012-01-30 03:56:26.000000000 +0000 +@@ -1,9 +1,9 @@ + /* gi_blorb.c: Blorb library layer for Glk API. +- gi_blorb version 1.4. ++ gi_blorb version 1.5. + Designed by Andrew Plotkin +- http://www.eblong.com/zarf/glk/index.html ++ http://eblong.com/zarf/glk/ + +- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, ++ This file is copyright 1998-2010 by Andrew Plotkin. You may copy, + distribute, and incorporate it into your own programs, by any means + and under any conditions, as long as you do not modify it. You may + also modify this file, incorporate it into your own programs, +@@ -227,7 +227,6 @@ + giblorb_err_t err; + char *ptr; + glui32 len; +- glui32 val; + glui32 numres; + int gotindex = FALSE; + +@@ -396,7 +395,6 @@ + + case giblorb_method_Memory: + if (!chu->ptr) { +- giblorb_err_t err; + glui32 readlen; + void *dat = giblorb_malloc(chu->len); + +@@ -515,7 +513,7 @@ + + static void giblorb_qsort(giblorb_resdesc_t **list, int len) + { +- int ix, jx, res, val; ++ int ix, jx, res; + giblorb_resdesc_t *tmpptr, *pivot; + + if (len < 6) { +--- glkloader-0.3.2/gi_blorb.h~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/gi_blorb.h 2012-01-30 03:56:26.000000000 +0000 +@@ -2,11 +2,11 @@ + #define _GI_BLORB_H + + /* gi_blorb.h: Blorb library layer for Glk API. +- gi_blorb version 1.4. ++ gi_blorb version 1.5. + Designed by Andrew Plotkin +- http://www.eblong.com/zarf/glk/index.html ++ http://eblong.com/zarf/glk/ + +- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, ++ This file is copyright 1998-2012 by Andrew Plotkin. You may copy, + distribute, and incorporate it into your own programs, by any means + and under any conditions, as long as you do not modify it. You may + also modify this file, incorporate it into your own programs, +@@ -35,12 +35,15 @@ + #define giblorb_make_id(c1, c2, c3, c4) \ + (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4)) + +-#define giblorb_ID_Snd (giblorb_make_id('S', 'n', 'd', ' ')) + #define giblorb_ID_Exec (giblorb_make_id('E', 'x', 'e', 'c')) ++#define giblorb_ID_Snd (giblorb_make_id('S', 'n', 'd', ' ')) + #define giblorb_ID_Pict (giblorb_make_id('P', 'i', 'c', 't')) ++#define giblorb_ID_Data (giblorb_make_id('D', 'a', 't', 'a')) + #define giblorb_ID_Copyright (giblorb_make_id('(', 'c', ')', ' ')) + #define giblorb_ID_AUTH (giblorb_make_id('A', 'U', 'T', 'H')) + #define giblorb_ID_ANNO (giblorb_make_id('A', 'N', 'N', 'O')) ++#define giblorb_ID_TEXT (giblorb_make_id('T', 'E', 'X', 'T')) ++#define giblorb_ID_BINA (giblorb_make_id('B', 'I', 'N', 'A')) + + /* giblorb_map_t: Holds the complete description of an open Blorb + file. This type is opaque for normal interpreter use. */ +--- glkloader-0.3.2/gi_dispa.c~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/gi_dispa.c 2012-01-30 03:56:25.000000000 +0000 +@@ -1,8 +1,8 @@ +-/* gi_dispa.c: Dispatch layer for Glk API, version 0.6.1. ++/* gi_dispa.c: Dispatch layer for Glk API, version 0.7.4. + Designed by Andrew Plotkin +- http://www.eblong.com/zarf/glk/index.html ++ http://eblong.com/zarf/glk/ + +- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, ++ This file is copyright 1998-2012 by Andrew Plotkin. You may copy, + distribute, and incorporate it into your own programs, by any means + and under any conditions, as long as you do not modify it. You may + also modify this file, incorporate it into your own programs, +@@ -21,6 +21,9 @@ + #define NULL 0 + #endif + ++#define NUMCLASSES \ ++ (sizeof(class_table) / sizeof(gidispatch_intconst_t)) ++ + #define NUMINTCONSTANTS \ + (sizeof(intconstant_table) / sizeof(gidispatch_intconst_t)) + +@@ -28,6 +31,14 @@ + (sizeof(function_table) / sizeof(gidispatch_function_t)) + + /* The constants in this table must be ordered alphabetically. */ ++static gidispatch_intconst_t class_table[] = { ++ { "fileref", (2) }, /* "Qc" */ ++ { "schannel", (3) }, /* "Qd" */ ++ { "stream", (1) }, /* "Qb" */ ++ { "window", (0) }, /* "Qa" */ ++}; ++ ++/* The constants in this table must be ordered alphabetically. */ + static gidispatch_intconst_t intconstant_table[] = { + { "evtype_Arrange", (5) }, + { "evtype_CharInput", (2) }, +@@ -38,6 +49,8 @@ + { "evtype_Redraw", (6) }, + { "evtype_SoundNotify", (7) }, + { "evtype_Timer", (1) }, ++ { "evtype_VolumeNotify", (9) }, ++ + { "filemode_Read", (0x02) }, + { "filemode_ReadWrite", (0x03) }, + { "filemode_Write", (0x01) }, +@@ -54,26 +69,34 @@ + { "gestalt_CharOutput_ApproxPrint", (1) }, + { "gestalt_CharOutput_CannotPrint", (0) }, + { "gestalt_CharOutput_ExactPrint", (2) }, ++ { "gestalt_DateTime", (20) }, + { "gestalt_DrawImage", (7) }, + { "gestalt_Graphics", (6) }, + { "gestalt_GraphicsTransparency", (14) }, + { "gestalt_HyperlinkInput", (12) }, + { "gestalt_Hyperlinks", (11) }, + { "gestalt_LineInput", (2) }, ++ { "gestalt_LineInputEcho", (17) }, ++ { "gestalt_LineTerminatorKey", (19) }, ++ { "gestalt_LineTerminators", (18) }, + { "gestalt_MouseInput", (4) }, ++ { "gestalt_ResourceStream", (22) }, + { "gestalt_Sound", (8) }, ++ { "gestalt_Sound2", (21) }, + { "gestalt_SoundMusic", (13) }, + { "gestalt_SoundNotify", (10) }, + { "gestalt_SoundVolume", (9) }, + { "gestalt_Timer", (5) }, ++ { "gestalt_Unicode", (15) }, ++ { "gestalt_UnicodeNorm", (16) }, + { "gestalt_Version", (0) }, +-#ifdef GLK_MODULE_IMAGE ++ + { "imagealign_InlineCenter", (0x03) }, + { "imagealign_InlineDown", (0x02) }, + { "imagealign_MarginLeft", (0x04) }, + { "imagealign_MarginRight", (0x05) }, + { "imagealign_InlineUp", (0x01) }, +-#endif /* GLK_MODULE_IMAGE */ ++ + { "keycode_Delete", (0xfffffff9) }, + { "keycode_Down", (0xfffffffb) }, + { "keycode_End", (0xfffffff3) }, +@@ -130,14 +155,19 @@ + { "stylehint_just_LeftFlush", (0) }, + { "stylehint_just_LeftRight", (1) }, + { "stylehint_just_RightFlush", (3) }, ++ + { "winmethod_Above", (0x02) }, + { "winmethod_Below", (0x03) }, ++ { "winmethod_Border", (0x000) }, ++ { "winmethod_BorderMask", (0x100) }, + { "winmethod_DirMask", (0x0f) }, + { "winmethod_DivisionMask", (0xf0) }, + { "winmethod_Fixed", (0x10) }, + { "winmethod_Left", (0x00) }, ++ { "winmethod_NoBorder", (0x100) }, + { "winmethod_Proportional", (0x20) }, + { "winmethod_Right", (0x01) }, ++ + { "wintype_AllTypes", (0) }, + { "wintype_Blank", (2) }, + { "wintype_Graphics", (5) }, +@@ -233,6 +263,13 @@ + { 0x00FA, glk_schannel_stop, "schannel_stop" }, + { 0x00FB, glk_schannel_set_volume, "schannel_set_volume" }, + { 0x00FC, glk_sound_load_hint, "sound_load_hint" }, ++#ifdef GLK_MODULE_SOUND2 ++ { 0x00F4, glk_schannel_create_ext, "schannel_create_ext" }, ++ { 0x00F7, glk_schannel_play_multi, "schannel_play_multi" }, ++ { 0x00FD, glk_schannel_set_volume_ext, "schannel_set_volume_ext" }, ++ { 0x00FE, glk_schannel_pause, "schannel_pause" }, ++ { 0x00FF, glk_schannel_unpause, "schannel_unpause" }, ++#endif /* GLK_MODULE_SOUND2 */ + #endif /* GLK_MODULE_SOUND */ + #ifdef GLK_MODULE_HYPERLINKS + { 0x0100, glk_set_hyperlink, "set_hyperlink" }, +@@ -240,11 +277,62 @@ + { 0x0102, glk_request_hyperlink_event, "request_hyperlink_event" }, + { 0x0103, glk_cancel_hyperlink_event, "cancel_hyperlink_event" }, + #endif /* GLK_MODULE_HYPERLINKS */ ++#ifdef GLK_MODULE_UNICODE ++ { 0x0120, glk_buffer_to_lower_case_uni, "buffer_to_lower_case_uni" }, ++ { 0x0121, glk_buffer_to_upper_case_uni, "buffer_to_upper_case_uni" }, ++ { 0x0122, glk_buffer_to_title_case_uni, "buffer_to_title_case_uni" }, ++ { 0x0128, glk_put_char_uni, "put_char_uni" }, ++ { 0x0129, glk_put_string_uni, "put_string_uni" }, ++ { 0x012A, glk_put_buffer_uni, "put_buffer_uni" }, ++ { 0x012B, glk_put_char_stream_uni, "put_char_stream_uni" }, ++ { 0x012C, glk_put_string_stream_uni, "put_string_stream_uni" }, ++ { 0x012D, glk_put_buffer_stream_uni, "put_buffer_stream_uni" }, ++ { 0x0130, glk_get_char_stream_uni, "get_char_stream_uni" }, ++ { 0x0131, glk_get_buffer_stream_uni, "get_buffer_stream_uni" }, ++ { 0x0132, glk_get_line_stream_uni, "get_line_stream_uni" }, ++ { 0x0138, glk_stream_open_file_uni, "stream_open_file_uni" }, ++ { 0x0139, glk_stream_open_memory_uni, "stream_open_memory_uni" }, ++ { 0x0140, glk_request_char_event_uni, "request_char_event_uni" }, ++ { 0x0141, glk_request_line_event_uni, "request_line_event_uni" }, ++#endif /* GLK_MODULE_UNICODE */ ++#ifdef GLK_MODULE_UNICODE_NORM ++ { 0x0123, glk_buffer_canon_decompose_uni, "buffer_canon_decompose_uni" }, ++ { 0x0124, glk_buffer_canon_normalize_uni, "buffer_canon_normalize_uni" }, ++#endif /* GLK_MODULE_UNICODE_NORM */ ++#ifdef GLK_MODULE_LINE_ECHO ++ { 0x0150, glk_set_echo_line_event, "set_echo_line_event" }, ++#endif /* GLK_MODULE_LINE_ECHO */ ++#ifdef GLK_MODULE_LINE_TERMINATORS ++ { 0x0151, glk_set_terminators_line_event, "set_terminators_line_event" }, ++#endif /* GLK_MODULE_LINE_TERMINATORS */ ++#ifdef GLK_MODULE_DATETIME ++ { 0x0160, glk_current_time, "current_time" }, ++ { 0x0161, glk_current_simple_time, "current_simple_time" }, ++ { 0x0168, glk_time_to_date_utc, "time_to_date_utc" }, ++ { 0x0169, glk_time_to_date_local, "time_to_date_local" }, ++ { 0x016A, glk_simple_time_to_date_utc, "simple_time_to_date_utc" }, ++ { 0x016B, glk_simple_time_to_date_local, "simple_time_to_date_local" }, ++ { 0x016C, glk_date_to_time_utc, "date_to_time_utc" }, ++ { 0x016D, glk_date_to_time_local, "date_to_time_local" }, ++ { 0x016E, glk_date_to_simple_time_utc, "date_to_simple_time_utc" }, ++ { 0x016F, glk_date_to_simple_time_local, "date_to_simple_time_local" }, ++#endif /* GLK_MODULE_DATETIME */ ++#ifdef GLK_MODULE_RESOURCE_STREAM ++ { 0x0049, glk_stream_open_resource, "stream_open_resource" }, ++ { 0x013A, glk_stream_open_resource_uni, "stream_open_resource_uni" }, ++#endif /* GLK_MODULE_RESOURCE_STREAM */ + }; + + glui32 gidispatch_count_classes() + { +- return 4; ++ return NUMCLASSES; ++} ++ ++gidispatch_intconst_t *gidispatch_get_class(glui32 index) ++{ ++ if (index < 0 || index >= NUMCLASSES) ++ return NULL; ++ return &(class_table[index]); + } + + glui32 gidispatch_count_intconst() +@@ -352,7 +440,7 @@ + case 0x0042: /* stream_open_file */ + return "4QcIuIu:Qb"; + case 0x0043: /* stream_open_memory */ +- return "4&+#!CnIuIu:Qb"; ++ return "4&#!CnIuIu:Qb"; + case 0x0044: /* stream_close */ + return "2Qb<[2IuIu]:"; + case 0x0045: /* stream_set_position */ +@@ -398,7 +486,7 @@ + case 0x0087: /* set_style_stream */ + return "2QbIu:"; + case 0x0090: /* get_char_stream */ +- return "2Qb:Iu"; ++ return "2Qb:Is"; + case 0x0091: /* get_line_stream */ + return "3Qb<+#Cn:Iu"; + case 0x0092: /* get_buffer_stream */ +@@ -468,7 +558,21 @@ + return "2QdIu:"; + case 0x00FC: /* sound_load_hint */ + return "2IuIu:"; ++ ++#ifdef GLK_MODULE_SOUND2 ++ case 0x00F4: /* schannel_create_ext */ ++ return "3IuIu:Qd"; ++ case 0x00F7: /* schannel_play_multi */ ++ return "4>+#Qd>+#IuIu:Iu"; ++ case 0x00FD: /* schannel_set_volume_ext */ ++ return "4QdIuIuIu:"; ++ case 0x00FE: /* schannel_pause */ ++ return "1Qd:"; ++ case 0x00FF: /* schannel_unpause */ ++ return "1Qd:"; ++#endif /* GLK_MODULE_SOUND2 */ + #endif /* GLK_MODULE_SOUND */ ++ + #ifdef GLK_MODULE_HYPERLINKS + case 0x0100: /* set_hyperlink */ + return "1Iu:"; +@@ -480,6 +584,88 @@ + return "1Qa:"; + #endif /* GLK_MODULE_HYPERLINKS */ + ++#ifdef GLK_MODULE_UNICODE ++ case 0x0120: /* buffer_to_lower_case_uni */ ++ return "3&+#IuIu:Iu"; ++ case 0x0121: /* buffer_to_upper_case_uni */ ++ return "3&+#IuIu:Iu"; ++ case 0x0122: /* buffer_to_title_case_uni */ ++ return "4&+#IuIuIu:Iu"; ++ case 0x0128: /* put_char_uni */ ++ return "1Iu:"; ++ case 0x0129: /* put_string_uni */ ++ return "1U:"; ++ case 0x012A: /* put_buffer_uni */ ++ return "1>+#Iu:"; ++ case 0x012B: /* put_char_stream_uni */ ++ return "2QbIu:"; ++ case 0x012C: /* put_string_stream_uni */ ++ return "2QbU:"; ++ case 0x012D: /* put_buffer_stream_uni */ ++ return "2Qb>+#Iu:"; ++ case 0x0130: /* get_char_stream_uni */ ++ return "2Qb:Is"; ++ case 0x0131: /* get_buffer_stream_uni */ ++ return "3Qb<+#Iu:Iu"; ++ case 0x0132: /* get_line_stream_uni */ ++ return "3Qb<+#Iu:Iu"; ++ case 0x0138: /* stream_open_file_uni */ ++ return "4QcIuIu:Qb"; ++ case 0x0139: /* stream_open_memory_uni */ ++ return "4&#!IuIuIu:Qb"; ++ case 0x0140: /* request_char_event_uni */ ++ return "1Qa:"; ++ case 0x0141: /* request_line_event_uni */ ++ return "3Qa&+#!IuIu:"; ++#endif /* GLK_MODULE_UNICODE */ ++ ++#ifdef GLK_MODULE_UNICODE_NORM ++ case 0x0123: /* buffer_canon_decompose_uni */ ++ return "3&+#IuIu:Iu"; ++ case 0x0124: /* buffer_canon_normalize_uni */ ++ return "3&+#IuIu:Iu"; ++#endif /* GLK_MODULE_UNICODE_NORM */ ++ ++#ifdef GLK_MODULE_LINE_ECHO ++ case 0x0150: /* set_echo_line_event */ ++ return "2QaIu:"; ++#endif /* GLK_MODULE_LINE_ECHO */ ++ ++#ifdef GLK_MODULE_LINE_TERMINATORS ++ case 0x0151: /* set_terminators_line_event */ ++ return "2Qa>#Iu:"; ++#endif /* GLK_MODULE_LINE_TERMINATORS */ ++ ++#ifdef GLK_MODULE_DATETIME ++ case 0x0160: /* current_time */ ++ return "1<+[3IsIuIs]:"; ++ case 0x0161: /* current_simple_time */ ++ return "2Iu:Is"; ++ case 0x0168: /* time_to_date_utc */ ++ return "2>+[3IsIuIs]<+[8IsIsIsIsIsIsIsIs]:"; ++ case 0x0169: /* time_to_date_local */ ++ return "2>+[3IsIuIs]<+[8IsIsIsIsIsIsIsIs]:"; ++ case 0x016A: /* simple_time_to_date_utc */ ++ return "3IsIu<+[8IsIsIsIsIsIsIsIs]:"; ++ case 0x016B: /* simple_time_to_date_local */ ++ return "3IsIu<+[8IsIsIsIsIsIsIsIs]:"; ++ case 0x016C: /* date_to_time_utc */ ++ return "2>+[8IsIsIsIsIsIsIsIs]<+[3IsIuIs]:"; ++ case 0x016D: /* date_to_time_local */ ++ return "2>+[8IsIsIsIsIsIsIsIs]<+[3IsIuIs]:"; ++ case 0x016E: /* date_to_simple_time_utc */ ++ return "3>+[8IsIsIsIsIsIsIsIs]Iu:Is"; ++ case 0x016F: /* date_to_simple_time_local */ ++ return "3>+[8IsIsIsIsIsIsIsIs]Iu:Is"; ++#endif /* GLK_MODULE_DATETIME */ ++ ++#ifdef GLK_MODULE_RESOURCE_STREAM ++ case 0x0049: /* stream_open_resource */ ++ return "3IuIu:Qb"; ++ case 0x013A: /* stream_open_resource_uni */ ++ return "3IuIu:Qb"; ++#endif /* GLK_MODULE_RESOURCE_STREAM */ ++ + default: + return NULL; + } +@@ -697,7 +883,7 @@ + glk_fileref_delete_file(arglist[0].opaqueref); + break; + case 0x0067: /* fileref_does_file_exist */ +- arglist[1].uint = glk_fileref_does_file_exist(arglist[0].opaqueref); ++ arglist[2].uint = glk_fileref_does_file_exist(arglist[0].opaqueref); + break; + case 0x0068: /* fileref_create_from_fileref */ + arglist[4].opaqueref = glk_fileref_create_from_fileref(arglist[0].uint, +@@ -736,7 +922,7 @@ + glk_set_style_stream(arglist[0].opaqueref, arglist[1].uint); + break; + case 0x0090: /* get_char_stream */ +- arglist[2].uint = glk_get_char_stream(arglist[0].opaqueref); ++ arglist[2].sint = glk_get_char_stream(arglist[0].opaqueref); + break; + case 0x0091: /* get_line_stream */ + if (arglist[1].ptrflag) +@@ -927,7 +1115,33 @@ + case 0x00FC: /* sound_load_hint */ + glk_sound_load_hint(arglist[0].uint, arglist[1].uint); + break; ++ ++#ifdef GLK_MODULE_SOUND2 ++ case 0x00F4: /* schannel_create_ext */ ++ arglist[3].opaqueref = glk_schannel_create_ext(arglist[0].uint, arglist[1].uint); ++ break; ++ case 0x00F7: /* schannel_play_multi */ ++ if (arglist[0].ptrflag && arglist[3].ptrflag) ++ arglist[8].uint = glk_schannel_play_multi(arglist[1].array, arglist[2].uint, arglist[4].array, arglist[5].uint, arglist[6].uint); ++ else if (arglist[0].ptrflag) ++ arglist[6].uint = glk_schannel_play_multi(arglist[1].array, arglist[2].uint, NULL, 0, arglist[4].uint); ++ else if (arglist[1].ptrflag) ++ arglist[6].uint = glk_schannel_play_multi(NULL, 0, arglist[2].array, arglist[3].uint, arglist[4].uint); ++ else ++ arglist[4].uint = glk_schannel_play_multi(NULL, 0, NULL, 0, arglist[2].uint); ++ break; ++ case 0x00FD: /* schannel_set_volume_ext */ ++ glk_schannel_set_volume_ext(arglist[0].opaqueref, arglist[1].uint, arglist[2].uint, arglist[3].uint); ++ break; ++ case 0x00FE: /* schannel_pause */ ++ glk_schannel_pause(arglist[0].opaqueref); ++ break; ++ case 0x00FF: /* schannel_unpause */ ++ glk_schannel_unpause(arglist[0].opaqueref); ++ break; ++#endif /* GLK_MODULE_SOUND2 */ + #endif /* GLK_MODULE_SOUND */ ++ + #ifdef GLK_MODULE_HYPERLINKS + case 0x0100: /* set_hyperlink */ + glk_set_hyperlink(arglist[0].uint); +@@ -943,6 +1157,342 @@ + break; + #endif /* GLK_MODULE_HYPERLINKS */ + ++#ifdef GLK_MODULE_UNICODE ++ case 0x0120: /* buffer_to_lower_case_uni */ ++ if (arglist[0].ptrflag) ++ arglist[5].uint = glk_buffer_to_lower_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint); ++ else ++ arglist[3].uint = glk_buffer_to_lower_case_uni(NULL, 0, arglist[1].uint); ++ break; ++ case 0x0121: /* buffer_to_upper_case_uni */ ++ if (arglist[0].ptrflag) ++ arglist[5].uint = glk_buffer_to_upper_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint); ++ else ++ arglist[3].uint = glk_buffer_to_upper_case_uni(NULL, 0, arglist[1].uint); ++ break; ++ case 0x0122: /* buffer_to_title_case_uni */ ++ if (arglist[0].ptrflag) ++ arglist[6].uint = glk_buffer_to_title_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint, arglist[4].uint); ++ else ++ arglist[4].uint = glk_buffer_to_title_case_uni(NULL, 0, arglist[1].uint, arglist[2].uint); ++ break; ++ case 0x0128: /* put_char_uni */ ++ glk_put_char_uni(arglist[0].uint); ++ break; ++ case 0x0129: /* put_string_uni */ ++ glk_put_string_uni(arglist[0].unicharstr); ++ break; ++ case 0x012A: /* put_buffer_uni */ ++ if (arglist[0].ptrflag) ++ glk_put_buffer_uni(arglist[1].array, arglist[2].uint); ++ else ++ glk_put_buffer_uni(NULL, 0); ++ break; ++ case 0x012B: /* put_char_stream_uni */ ++ glk_put_char_stream_uni(arglist[0].opaqueref, arglist[1].uint); ++ break; ++ case 0x012C: /* put_string_stream_uni */ ++ glk_put_string_stream_uni(arglist[0].opaqueref, arglist[1].unicharstr); ++ break; ++ case 0x012D: /* put_buffer_stream_uni */ ++ if (arglist[1].ptrflag) ++ glk_put_buffer_stream_uni(arglist[0].opaqueref, ++ arglist[2].array, arglist[3].uint); ++ else ++ glk_put_buffer_stream_uni(arglist[0].opaqueref, ++ NULL, 0); ++ break; ++ case 0x0130: /* get_char_stream_uni */ ++ arglist[2].sint = glk_get_char_stream_uni(arglist[0].opaqueref); ++ break; ++ case 0x0131: /* get_buffer_stream_uni */ ++ if (arglist[1].ptrflag) ++ arglist[5].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref, ++ arglist[2].array, arglist[3].uint); ++ else ++ arglist[3].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref, ++ NULL, 0); ++ break; ++ case 0x0132: /* get_line_stream_uni */ ++ if (arglist[1].ptrflag) ++ arglist[5].uint = glk_get_line_stream_uni(arglist[0].opaqueref, ++ arglist[2].array, arglist[3].uint); ++ else ++ arglist[3].uint = glk_get_line_stream_uni(arglist[0].opaqueref, ++ NULL, 0); ++ break; ++ case 0x0138: /* stream_open_file_uni */ ++ arglist[4].opaqueref = glk_stream_open_file_uni(arglist[0].opaqueref, arglist[1].uint, ++ arglist[2].uint); ++ break; ++ case 0x0139: /* stream_open_memory_uni */ ++ if (arglist[0].ptrflag) ++ arglist[6].opaqueref = glk_stream_open_memory_uni(arglist[1].array, ++ arglist[2].uint, arglist[3].uint, arglist[4].uint); ++ else ++ arglist[4].opaqueref = glk_stream_open_memory_uni(NULL, ++ 0, arglist[1].uint, arglist[2].uint); ++ break; ++ case 0x0140: /* request_char_event_uni */ ++ glk_request_char_event_uni(arglist[0].opaqueref); ++ break; ++ case 0x0141: /* request_line_event_uni */ ++ if (arglist[1].ptrflag) ++ glk_request_line_event_uni(arglist[0].opaqueref, arglist[2].array, ++ arglist[3].uint, arglist[4].uint); ++ else ++ glk_request_line_event_uni(arglist[0].opaqueref, NULL, ++ 0, arglist[2].uint); ++ break; ++#endif /* GLK_MODULE_UNICODE */ ++ ++#ifdef GLK_MODULE_UNICODE_NORM ++ case 0x0123: /* buffer_canon_decompose_uni */ ++ if (arglist[0].ptrflag) ++ arglist[5].uint = glk_buffer_canon_decompose_uni(arglist[1].array, arglist[2].uint, arglist[3].uint); ++ else ++ arglist[3].uint = glk_buffer_canon_decompose_uni(NULL, 0, arglist[1].uint); ++ break; ++ case 0x0124: /* buffer_canon_normalize_uni */ ++ if (arglist[0].ptrflag) ++ arglist[5].uint = glk_buffer_canon_normalize_uni(arglist[1].array, arglist[2].uint, arglist[3].uint); ++ else ++ arglist[3].uint = glk_buffer_canon_normalize_uni(NULL, 0, arglist[1].uint); ++ break; ++#endif /* GLK_MODULE_UNICODE_NORM */ ++ ++#ifdef GLK_MODULE_LINE_ECHO ++ case 0x0150: /* set_echo_line_event */ ++ glk_set_echo_line_event(arglist[0].opaqueref, arglist[1].uint); ++ break; ++#endif /* GLK_MODULE_LINE_ECHO */ ++ ++#ifdef GLK_MODULE_LINE_TERMINATORS ++ case 0x0151: /* set_terminators_line_event */ ++ if (arglist[1].ptrflag) ++ glk_set_terminators_line_event(arglist[0].opaqueref, ++ arglist[2].array, arglist[3].uint); ++ else ++ glk_set_terminators_line_event(arglist[0].opaqueref, ++ NULL, 0); ++ break; ++#endif /* GLK_MODULE_LINE_TERMINATORS */ ++ ++#ifdef GLK_MODULE_DATETIME ++ case 0x0160: /* current_time */ ++ if (arglist[0].ptrflag) { ++ glktimeval_t dat; ++ glk_current_time(&dat); ++ arglist[1].sint = dat.high_sec; ++ arglist[2].uint = dat.low_sec; ++ arglist[3].sint = dat.microsec; ++ } ++ else { ++ glk_current_time(NULL); ++ } ++ break; ++ case 0x0161: /* current_simple_time */ ++ arglist[2].sint = glk_current_simple_time(arglist[0].uint); ++ break; ++ case 0x0168: /* time_to_date_utc */ { ++ glktimeval_t timeval; ++ glktimeval_t *timeptr = NULL; ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ int ix = 0; ++ if (arglist[ix++].ptrflag) { ++ timeptr = &timeval; ++ timeval.high_sec = arglist[ix++].sint; ++ timeval.low_sec = arglist[ix++].uint; ++ timeval.microsec = arglist[ix++].sint; ++ } ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ } ++ glk_time_to_date_utc(timeptr, dateptr); ++ if (dateptr) { ++ arglist[ix++].sint = date.year; ++ arglist[ix++].sint = date.month; ++ arglist[ix++].sint = date.day; ++ arglist[ix++].sint = date.weekday; ++ arglist[ix++].sint = date.hour; ++ arglist[ix++].sint = date.minute; ++ arglist[ix++].sint = date.second; ++ arglist[ix++].sint = date.microsec; ++ } ++ } ++ break; ++ case 0x0169: /* time_to_date_local */ { ++ glktimeval_t timeval; ++ glktimeval_t *timeptr = NULL; ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ int ix = 0; ++ if (arglist[ix++].ptrflag) { ++ timeptr = &timeval; ++ timeval.high_sec = arglist[ix++].sint; ++ timeval.low_sec = arglist[ix++].uint; ++ timeval.microsec = arglist[ix++].sint; ++ } ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ } ++ glk_time_to_date_local(timeptr, dateptr); ++ if (dateptr) { ++ arglist[ix++].sint = date.year; ++ arglist[ix++].sint = date.month; ++ arglist[ix++].sint = date.day; ++ arglist[ix++].sint = date.weekday; ++ arglist[ix++].sint = date.hour; ++ arglist[ix++].sint = date.minute; ++ arglist[ix++].sint = date.second; ++ arglist[ix++].sint = date.microsec; ++ } ++ } ++ break; ++ case 0x016A: /* simple_time_to_date_utc */ { ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ int ix = 2; ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ } ++ glk_simple_time_to_date_utc(arglist[0].sint, arglist[1].uint, dateptr); ++ if (dateptr) { ++ arglist[ix++].sint = date.year; ++ arglist[ix++].sint = date.month; ++ arglist[ix++].sint = date.day; ++ arglist[ix++].sint = date.weekday; ++ arglist[ix++].sint = date.hour; ++ arglist[ix++].sint = date.minute; ++ arglist[ix++].sint = date.second; ++ arglist[ix++].sint = date.microsec; ++ } ++ } ++ break; ++ case 0x016B: /* simple_time_to_date_local */ { ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ int ix = 2; ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ } ++ glk_simple_time_to_date_local(arglist[0].sint, arglist[1].uint, dateptr); ++ if (dateptr) { ++ arglist[ix++].sint = date.year; ++ arglist[ix++].sint = date.month; ++ arglist[ix++].sint = date.day; ++ arglist[ix++].sint = date.weekday; ++ arglist[ix++].sint = date.hour; ++ arglist[ix++].sint = date.minute; ++ arglist[ix++].sint = date.second; ++ arglist[ix++].sint = date.microsec; ++ } ++ } ++ break; ++ case 0x016C: /* date_to_time_utc */ { ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ glktimeval_t timeval; ++ glktimeval_t *timeptr = NULL; ++ int ix = 0; ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ date.year = arglist[ix++].sint; ++ date.month = arglist[ix++].sint; ++ date.day = arglist[ix++].sint; ++ date.weekday = arglist[ix++].sint; ++ date.hour = arglist[ix++].sint; ++ date.minute = arglist[ix++].sint; ++ date.second = arglist[ix++].sint; ++ date.microsec = arglist[ix++].sint; ++ } ++ if (arglist[ix++].ptrflag) { ++ timeptr = &timeval; ++ } ++ glk_date_to_time_utc(dateptr, timeptr); ++ if (timeptr) { ++ arglist[ix++].sint = timeval.high_sec; ++ arglist[ix++].uint = timeval.low_sec; ++ arglist[ix++].sint = timeval.microsec; ++ } ++ } ++ break; ++ case 0x016D: /* date_to_time_local */ { ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ glktimeval_t timeval; ++ glktimeval_t *timeptr = NULL; ++ int ix = 0; ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ date.year = arglist[ix++].sint; ++ date.month = arglist[ix++].sint; ++ date.day = arglist[ix++].sint; ++ date.weekday = arglist[ix++].sint; ++ date.hour = arglist[ix++].sint; ++ date.minute = arglist[ix++].sint; ++ date.second = arglist[ix++].sint; ++ date.microsec = arglist[ix++].sint; ++ } ++ if (arglist[ix++].ptrflag) { ++ timeptr = &timeval; ++ } ++ glk_date_to_time_local(dateptr, timeptr); ++ if (timeptr) { ++ arglist[ix++].sint = timeval.high_sec; ++ arglist[ix++].uint = timeval.low_sec; ++ arglist[ix++].sint = timeval.microsec; ++ } ++ } ++ break; ++ case 0x016E: /* date_to_simple_time_utc */ { ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ int ix = 0; ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ date.year = arglist[ix++].sint; ++ date.month = arglist[ix++].sint; ++ date.day = arglist[ix++].sint; ++ date.weekday = arglist[ix++].sint; ++ date.hour = arglist[ix++].sint; ++ date.minute = arglist[ix++].sint; ++ date.second = arglist[ix++].sint; ++ date.microsec = arglist[ix++].sint; ++ } ++ arglist[ix+2].sint = glk_date_to_simple_time_utc(dateptr, arglist[ix].uint); ++ } ++ break; ++ case 0x016F: /* date_to_simple_time_local */ { ++ glkdate_t date; ++ glkdate_t *dateptr = NULL; ++ int ix = 0; ++ if (arglist[ix++].ptrflag) { ++ dateptr = &date; ++ date.year = arglist[ix++].sint; ++ date.month = arglist[ix++].sint; ++ date.day = arglist[ix++].sint; ++ date.weekday = arglist[ix++].sint; ++ date.hour = arglist[ix++].sint; ++ date.minute = arglist[ix++].sint; ++ date.second = arglist[ix++].sint; ++ date.microsec = arglist[ix++].sint; ++ } ++ arglist[ix+2].sint = glk_date_to_simple_time_local(dateptr, arglist[ix].uint); ++ } ++ break; ++#endif /* GLK_MODULE_DATETIME */ ++ ++#ifdef GLK_MODULE_RESOURCE_STREAM ++ case 0x0049: /* stream_open_resource */ ++ arglist[3].opaqueref = glk_stream_open_resource(arglist[0].uint, arglist[1].uint); ++ break; ++ case 0x013A: /* stream_open_resource_uni */ ++ arglist[3].opaqueref = glk_stream_open_resource_uni(arglist[0].uint, arglist[1].uint); ++ break; ++#endif /* GLK_MODULE_RESOURCE_STREAM */ ++ + default: + /* do nothing */ + break; +--- glkloader-0.3.2/gi_dispa.h~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/gi_dispa.h 2012-01-30 03:56:25.000000000 +0000 +@@ -1,11 +1,11 @@ + #ifndef _GI_DISPA_H + #define _GI_DISPA_H + +-/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.6.1. ++/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.7.4. + Designed by Andrew Plotkin +- http://www.eblong.com/zarf/glk/index.html ++ http://eblong.com/zarf/glk/index.html + +- This file is copyright 1998-2000 by Andrew Plotkin. You may copy, ++ This file is copyright 1998-2012 by Andrew Plotkin. You may copy, + distribute, and incorporate it into your own programs, by any means + and under any conditions, as long as you do not modify it. You may + also modify this file, incorporate it into your own programs, +@@ -33,6 +33,7 @@ + signed char sch; /* Cs */ + char ch; /* Cn */ + char *charstr; /* S */ ++ glui32 *unicharstr; /* U */ + void *array; /* all # arguments */ + glui32 ptrflag; /* [ ... ] or *? */ + } gluniversal_t; +@@ -36,8 +37,9 @@ + void *array; /* all # arguments */ + glui32 ptrflag; /* [ ... ] or *? */ + } gluniversal_t; ++ + /* Some well-known structures: +- event_t : [4IuQwIuIu] ++ event_t : [4IuQaIuIu] + stream_result_t : [2IuIu] + */ + +@@ -79,6 +81,7 @@ + gluniversal_t *arglist); + extern char *gidispatch_prototype(glui32 funcnum); + extern glui32 gidispatch_count_classes(void); ++extern gidispatch_intconst_t *gidispatch_get_class(glui32 index); + extern glui32 gidispatch_count_intconst(void); + extern gidispatch_intconst_t *gidispatch_get_intconst(glui32 index); + extern glui32 gidispatch_count_functions(void); +--- glkloader-0.3.2/func.txt~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/func.txt 2013-07-08 14:37:24.000000000 +0100 +@@ -1,5 +1,5 @@ + #This is the list of glk selectors and functions, from Andrew Plotkin's Glk +-#Specification, version 0.6.1 ++#Specification, version 0.7.4 + + 0x0001: glk_exit + 0x0002: glk_set_interrupt_handler +@@ -87,4 +87,35 @@ + 0x0101: glk_set_hyperlink_stream + 0x0102: glk_request_hyperlink_event + 0x0103: glk_cancel_hyperlink_event ++0x0120: glk_buffer_to_lower_case_uni ++0x0121: glk_buffer_to_upper_case_uni ++0x0122: glk_buffer_to_title_case_uni ++0x0123: glk_buffer_canon_decompose_uni ++0x0124: glk_buffer_canon_normalize_uni ++0x0128: glk_put_char_uni ++0x0129: glk_put_string_uni ++0x012A: glk_put_buffer_uni ++0x012B: glk_put_char_stream_uni ++0x012C: glk_put_string_stream_uni ++0x012D: glk_put_buffer_stream_uni ++0x0130: glk_get_char_stream_uni ++0x0131: glk_get_buffer_stream_uni ++0x0132: glk_get_line_stream_uni ++0x0138: glk_stream_open_file_uni ++0x0139: glk_stream_open_memory_uni ++0x013A: glk_stream_open_resource_uni ++0x0140: glk_request_char_event_uni ++0x0141: glk_request_line_event_uni ++0x0150: glk_set_echo_line_event ++0x0151: glk_set_terminators_line_event ++0x0160: glk_current_time ++0x0161: glk_current_simple_time ++0x0168: glk_time_to_date_utc ++0x0169: glk_time_to_date_local ++0x016A: glk_simple_time_to_date_utc ++0x016B: glk_simple_time_to_date_local ++0x016C: glk_date_to_time_utc ++0x016D: glk_date_to_time_local ++0x016E: glk_date_to_simple_time_utc ++0x016F: glk_date_to_simple_time_local + +--- glkloader-0.3.2/unixfuncs.c~ 2001-03-14 03:07:59.000000000 +0000 ++++ glkloader-0.3.2/unixfuncs.c 2013-07-08 14:50:32.000000000 +0100 +@@ -38,6 +38,7 @@ + /** + * Unix startup code functions: + * glkunix_stream_open_pathname ++ * glkunix_stream_open_pathname_gen + * glkunix_set_base_file + * + * :FIXME: should these be hard-coded here? +@@ -58,6 +59,21 @@ + return (*funcPtr)(pathname, textmode, rock); + } + ++strid_t glkunix_stream_open_pathname_gen(char *pathname, glui32 writemode, glui32 textmode, ++ glui32 rock) ++{ ++ strid_t (*funcPtr)(char *pathname, glui32 writemode, glui32 textmode, glui32 rock); ++ char * errBuf = NULL; ++ ++ funcPtr = loadSymbol(gGlkLib, "glkunix_stream_open_pathname_gen", &errBuf); ++ if (NULL != errBuf) { ++ fprintf(stderr, "%s\n", errBuf); ++ exit(1); ++ } ++ ++ return (*funcPtr)(pathname, writemode, textmode, rock); ++} ++ + void glkunix_set_base_file(char *filename) + { + void (*funcPtr)(char *filename); diff --git a/dev-games/glkloader/files/glkloader-0.3.2-cache-function-pointers.patch b/dev-games/glkloader/files/glkloader-0.3.2-r4-cache-function-pointers.patch similarity index 90% rename from dev-games/glkloader/files/glkloader-0.3.2-cache-function-pointers.patch rename to dev-games/glkloader/files/glkloader-0.3.2-r4-cache-function-pointers.patch index b1228e0..cfcb4ef 100644 --- a/dev-games/glkloader/files/glkloader-0.3.2-cache-function-pointers.patch +++ b/dev-games/glkloader/files/glkloader-0.3.2-r4-cache-function-pointers.patch @@ -1,10 +1,10 @@ Source: dleverton -Upstream: submitted +Upstream: previous version submitted Reason: cache function pointers returned by dlsym() instead of looking them up each time; gives a noticeable speed increase ---- glkloader-0.3.2/generate_glkfuncs.pl~ 2001-03-14 03:07:59.000000000 +0000 -+++ glkloader-0.3.2/generate_glkfuncs.pl 2007-12-10 22:38:02.000000000 +0000 +--- glkloader-0.3.2/generate_glkfuncs.pl~ 2013-07-08 15:05:49.000000000 +0100 ++++ glkloader-0.3.2/generate_glkfuncs.pl 2013-07-08 15:06:07.000000000 +0100 @@ -307,7 +307,9 @@ print OUT_FILE "$ret_type $name(", createArgList (@arg_list), ")\n"; @@ -24,8 +24,8 @@ Reason: cache function pointers returned by dlsym() instead of looking print OUT_FILE "\n"; if ($ret_type eq "void") { ---- glkloader-0.3.2/blorbfuncs.c~ 2007-12-10 22:36:47.000000000 +0000 -+++ glkloader-0.3.2/blorbfuncs.c 2007-12-10 22:38:02.000000000 +0000 +--- glkloader-0.3.2/blorbfuncs.c~ 2013-07-08 15:05:56.000000000 +0100 ++++ glkloader-0.3.2/blorbfuncs.c 2013-07-08 15:06:07.000000000 +0100 @@ -46,7 +46,9 @@ giblorb_err_t giblorb_set_resource_map(strid_t file) @@ -197,8 +197,8 @@ Reason: cache function pointers returned by dlsym() instead of looking return (*funcPtr)(map, usage, num, min, max); } ---- glkloader-0.3.2/dispafuncs.c~ 2007-12-10 22:36:47.000000000 +0000 -+++ glkloader-0.3.2/dispafuncs.c 2007-12-10 22:38:02.000000000 +0000 +--- glkloader-0.3.2/dispafuncs.c~ 2013-07-08 15:05:56.000000000 +0100 ++++ glkloader-0.3.2/dispafuncs.c 2013-07-08 15:06:07.000000000 +0100 @@ -48,9 +48,11 @@ gidispatch_rock_t (*regi)(void *obj, glui32 objclass), void (*unregi)(void *obj, glui32 objclass, gidispatch_rock_t objrock)) @@ -422,9 +422,9 @@ Reason: cache function pointers returned by dlsym() instead of looking return (*funcPtr)(id); } ---- glkloader-0.3.2/unixfuncs.c~ 2001-03-14 03:07:59.000000000 +0000 -+++ glkloader-0.3.2/unixfuncs.c 2007-12-10 22:38:02.000000000 +0000 -@@ -46,7 +46,9 @@ +--- glkloader-0.3.2/unixfuncs.c~ 2013-07-08 15:05:41.000000000 +0100 ++++ glkloader-0.3.2/unixfuncs.c 2013-07-08 15:09:09.000000000 +0100 +@@ -47,7 +47,9 @@ strid_t glkunix_stream_open_pathname(char *pathname, glui32 textmode, glui32 rock) { @@ -435,7 +435,7 @@ Reason: cache function pointers returned by dlsym() instead of looking char * errBuf = NULL; funcPtr = loadSymbol(gGlkLib, "glkunix_stream_open_pathname", &errBuf); -@@ -54,13 +56,16 @@ +@@ -55,6 +57,7 @@ fprintf(stderr, "%s\n", errBuf); exit(1); } @@ -443,6 +443,25 @@ Reason: cache function pointers returned by dlsym() instead of looking return (*funcPtr)(pathname, textmode, rock); } +@@ -62,7 +65,9 @@ + strid_t glkunix_stream_open_pathname_gen(char *pathname, glui32 writemode, glui32 textmode, + glui32 rock) + { +- strid_t (*funcPtr)(char *pathname, glui32 writemode, glui32 textmode, glui32 rock); ++ static strid_t (*funcPtr)(char *pathname, glui32 writemode, glui32 textmode, glui32 rock); ++ ++ if (! funcPtr) { + char * errBuf = NULL; + + funcPtr = loadSymbol(gGlkLib, "glkunix_stream_open_pathname_gen", &errBuf); +@@ -70,13 +75,16 @@ + fprintf(stderr, "%s\n", errBuf); + exit(1); + } ++ } + + return (*funcPtr)(pathname, writemode, textmode, rock); + } void glkunix_set_base_file(char *filename) { @@ -453,7 +472,7 @@ Reason: cache function pointers returned by dlsym() instead of looking char * errBuf = NULL; funcPtr = loadSymbol(gGlkLib, "glkunix_set_base_file", &errBuf); -@@ -68,6 +73,7 @@ +@@ -84,6 +92,7 @@ fprintf(stderr, "%s\n", errBuf); exit(1); } diff --git a/dev-games/glkloader/glkloader-0.3.2-r3.ebuild b/dev-games/glkloader/glkloader-0.3.2-r4.ebuild similarity index 86% rename from dev-games/glkloader/glkloader-0.3.2-r3.ebuild rename to dev-games/glkloader/glkloader-0.3.2-r4.ebuild index 284fbe6..0db3095 100644 --- a/dev-games/glkloader/glkloader-0.3.2-r3.ebuild +++ b/dev-games/glkloader/glkloader-0.3.2-r4.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ @@ -13,7 +13,7 @@ SLOT="0" IUSE="" KEYWORDS="~amd64 ~x86" -DEPEND="|| ( >=dev-games/glk-headers-0.7.0-r1 =dev-games/glkloader-0.3.2 )" +DEPEND=">=dev-games/glk-headers-0.7.4" RDEPEND="virtual/glk" src_unpack() { @@ -21,10 +21,10 @@ src_unpack() { cd "${S}" epatch "${FILESDIR}"/glkloader-0.3.2-double-free.patch - epatch "${FILESDIR}"/glkloader-0.3.2-glk-0.7.0.patch + epatch "${FILESDIR}"/glkloader-0.3.2-glk-0.7.4.patch epatch "${FILESDIR}"/glkloader-0.3.2-r1-garglk-extensions.patch epatch "${FILESDIR}"/glkloader-0.3.2-dynamic-blorb-dispa.patch - epatch "${FILESDIR}"/glkloader-0.3.2-cache-function-pointers.patch + epatch "${FILESDIR}"/glkloader-0.3.2-r4-cache-function-pointers.patch epatch "${FILESDIR}"/glkloader-0.3.2-no-rdynamic.patch cp "${FILESDIR}"/glkloader-0.3.2-configure.ac configure.ac || die "cp configure.ac failed" @@ -59,7 +59,7 @@ src_install() { insinto /etc cat >"${T}"/glkloaderrc <<-EOF [Default] - libs = Gtk Gargoyle X TermW Term Cheap + libs = Gargoyle TermW Term Cheap EOF doins "${T}"/glkloaderrc || die "doins glkloaderrc failed" } -- 2.11.4.GIT