X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fdoc.c;h=2b603733e8705f11e326015d02d8b6481fd944a9;hb=95f3e35d90c857ee15c30b91ad2f3aa6e3867879;hp=5881072b004620d442f5aa3d4cb6a9f99fbc4f51;hpb=98ce0c00f8b0b0484b7d56cbb160501000edfd28;p=projects%2Fchimara%2Fchimara.git diff --git a/src/doc.c b/src/doc.c index 5881072..2b60373 100644 --- a/src/doc.c +++ b/src/doc.c @@ -176,9 +176,9 @@ * * For each class of opaque objects, there is an iterate function, which you can * use to obtain a list of all existing objects of that class. It takes the form - * + * |[ * CLASSid_t glk_CLASS_iterate(CLASSid_t obj, #glui32 *rockptr); - * + * ]| * ...where CLASS represents one of the * opaque object classes. * @@ -202,13 +202,13 @@ * * * You usually use this as follows: - * + * |[ * obj = glk_CLASS_iterate(NULL, NULL); * while (obj) { * /* ...do something with obj... */ * obj = glk_CLASS_iterate(obj, NULL); * } - * + * ]| * * * If you create or destroy objects inside this loop, obviously, the results are @@ -772,10 +772,10 @@ * * For an example of the gestalt mechanism, consider the selector * #gestalt_Version. If you do - * + * |[ * #glui32 res; * res = #glk_gestalt(#gestalt_Version, 0); - * + * ]| * res will be set to a 32-bit number which encodes the version of * the Glk spec which the library implements. The upper 16 bits stores the major * version number; the next 8 bits stores the minor version number; the low 8 @@ -788,10 +788,10 @@ * The current Glk specification version is 0.7.0, so this selector will return * 0x00000700. * - * + * |[ * #glui32 res; * res = #glk_gestalt_ext(#gestalt_Version, 0, NULL, 0); - * + * ]| * does exactly the same thing. Note that, in either case, the second argument * is not used; so you should always pass 0 to avoid future surprises. */ @@ -801,10 +801,10 @@ * * If you set ch to a character code, or a special code (from * 0xFFFFFFFF down), and call - * + * |[ * #glui32 res; * res = #glk_gestalt(#gestalt_CharInput, ch); - * + * ]| * then res will be %TRUE (1) if that character can be typed by * the player in character input, and %FALSE (0) if not. See Character Input. @@ -814,10 +814,10 @@ * gestalt_LineInput: * * If you set ch to a character code, and call - * + * |[ * #glui32 res; * res = #glk_gestalt(#gestalt_LineInput, ch); - * + * ]| * then res will be %TRUE (1) if that character can be typed by the * player in line input, and %FALSE (0) if not. Note that if ch is * a nonprintable Latin-1 character (0 to 31, 127 to 159), then this is @@ -829,10 +829,10 @@ * gestalt_CharOutput: * * If you set ch to a character code (Latin-1 or higher), and call - * + * |[ * #glui32 res, len; * res = #glk_gestalt_ext(#gestalt_CharOutput, ch, &len, 1); - * + * ]| * then res will be one of #gestalt_CharOutput_CannotPrint, * #gestalt_CharOutput_ExactPrint, or #gestalt_CharOutput_ApproxPrint (see * below.) @@ -859,15 +859,11 @@ * Make sure you do not get confused by signed byte values. If you set a * char variable ch to 0xFE, the * small-thorn character (þ), and then call - * - * res = #glk_gestalt(#gestalt_CharOutput, ch); - * + * |[ res = #glk_gestalt(#gestalt_CharOutput, ch); ]| * then (by the definition of C/C++) ch will be sign-extended to * 0xFFFFFFFE, which is not a legitimate character, even in Unicode. You * should write - * - * res = #glk_gestalt(#gestalt_CharOutput, (unsigned char)ch); - * + * |[ res = #glk_gestalt(#gestalt_CharOutput, (unsigned char)ch); ]| * instead. * * @@ -915,10 +911,10 @@ * The basic text functions will be available in every Glk library. The Unicode * functions may or may not be available. Before calling them, you should use * the following gestalt selector: - * + * |[ * glui32 res; * res = #glk_gestalt(#gestalt_Unicode, 0); - * + * ]| * * This returns 1 if the Unicode functions are available. If it returns 0, you * should not try to call them. They may print nothing, print gibberish, or