Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 116062 | Differences between
and this patch

Collapse All | Expand All

(-)glkloader-0.3.2/glk.h~ (-2 / +35 lines)
Lines 1-11 Link Here
1
#ifndef GLK_H
1
#ifndef GLK_H
2
#define GLK_H
2
#define GLK_H
3
3
4
/* glk.h: Header file for Glk API, version 0.6.1.
4
/* glk.h: Header file for Glk API, version 0.7.0.
5
    Designed by Andrew Plotkin <erkyrath@eblong.com>
5
    Designed by Andrew Plotkin <erkyrath@eblong.com>
6
    http://www.eblong.com/zarf/glk/index.html
6
    http://www.eblong.com/zarf/glk/index.html
7
7
8
    This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
8
    This file is copyright 1998-2004 by Andrew Plotkin. You may copy,
9
    distribute, and incorporate it into your own programs, by any means
9
    distribute, and incorporate it into your own programs, by any means
10
    and under any conditions, as long as you do not modify it. You may
10
    and under any conditions, as long as you do not modify it. You may
11
    also modify this file, incorporate it into your own programs, 
11
    also modify this file, incorporate it into your own programs, 
Lines 22-27 Link Here
22
22
23
/* These are the compile-time conditionals that reveal various Glk optional
23
/* These are the compile-time conditionals that reveal various Glk optional
24
    modules. */
24
    modules. */
25
#define GLK_MODULE_UNICODE
25
#define GLK_MODULE_IMAGE
26
#define GLK_MODULE_IMAGE
26
#define GLK_MODULE_SOUND
27
#define GLK_MODULE_SOUND
27
#define GLK_MODULE_HYPERLINKS
28
#define GLK_MODULE_HYPERLINKS
Lines 51-56 Link Here
51
#define gestalt_HyperlinkInput (12)
52
#define gestalt_HyperlinkInput (12)
52
#define gestalt_SoundMusic (13)
53
#define gestalt_SoundMusic (13)
53
#define gestalt_GraphicsTransparency (14)
54
#define gestalt_GraphicsTransparency (14)
55
#define gestalt_Unicode (15)
54
56
55
#define evtype_None (0)
57
#define evtype_None (0)
56
#define evtype_Timer (1)
58
#define evtype_Timer (1)
Lines 263-268 Link Here
263
extern void glk_cancel_char_event(winid_t win);
265
extern void glk_cancel_char_event(winid_t win);
264
extern void glk_cancel_mouse_event(winid_t win); 
266
extern void glk_cancel_mouse_event(winid_t win); 
265
267
268
#ifdef GLK_MODULE_UNICODE
269
270
extern glui32 glk_buffer_to_lower_case_uni(glui32 *buf, glui32 len,
271
    glui32 numchars);
272
extern glui32 glk_buffer_to_upper_case_uni(glui32 *buf, glui32 len,
273
    glui32 numchars);
274
extern glui32 glk_buffer_to_title_case_uni(glui32 *buf, glui32 len,
275
    glui32 numchars, glui32 lowerrest);
276
277
extern void glk_put_char_uni(glui32 ch);
278
extern void glk_put_string_uni(glui32 *s);
279
extern void glk_put_buffer_uni(glui32 *buf, glui32 len);
280
extern void glk_put_char_stream_uni(strid_t str, glui32 ch);
281
extern void glk_put_string_stream_uni(strid_t str, glui32 *s);
282
extern void glk_put_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len);
283
284
extern glsi32 glk_get_char_stream_uni(strid_t str);
285
extern glui32 glk_get_buffer_stream_uni(strid_t str, glui32 *buf, glui32 len);
286
extern glui32 glk_get_line_stream_uni(strid_t str, glui32 *buf, glui32 len);
287
288
extern strid_t glk_stream_open_file_uni(frefid_t fileref, glui32 fmode,
289
    glui32 rock);
290
extern strid_t glk_stream_open_memory_uni(glui32 *buf, glui32 buflen,
291
    glui32 fmode, glui32 rock);
292
293
extern void glk_request_char_event_uni(winid_t win);
294
extern void glk_request_line_event_uni(winid_t win, glui32 *buf,
295
    glui32 maxlen, glui32 initlen);
296
297
#endif /* GLK_MODULE_UNICODE */
298
266
#ifdef GLK_MODULE_IMAGE
299
#ifdef GLK_MODULE_IMAGE
267
300
268
#define imagealign_InlineUp (0x01)
301
#define imagealign_InlineUp (0x01)
(-)glkloader-0.3.2/gi_dispa.c~ (-6 / +167 lines)
Lines 1-8 Link Here
1
/* gi_dispa.c: Dispatch layer for Glk API, version 0.6.1.
1
/* gi_dispa.c: Dispatch layer for Glk API, version 0.7.0.
2
    Designed by Andrew Plotkin <erkyrath@eblong.com>
2
    Designed by Andrew Plotkin <erkyrath@eblong.com>
3
    http://www.eblong.com/zarf/glk/index.html
3
    http://www.eblong.com/zarf/glk/index.html
4
4
5
    This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
5
    This file is copyright 1998-2004 by Andrew Plotkin. You may copy,
6
    distribute, and incorporate it into your own programs, by any means
6
    distribute, and incorporate it into your own programs, by any means
7
    and under any conditions, as long as you do not modify it. You may
7
    and under any conditions, as long as you do not modify it. You may
8
    also modify this file, incorporate it into your own programs,
8
    also modify this file, incorporate it into your own programs,
Lines 21-26 Link Here
21
#define NULL 0
21
#define NULL 0
22
#endif
22
#endif
23
23
24
#define NUMCLASSES   \
25
    (sizeof(class_table) / sizeof(gidispatch_intconst_t))
26
24
#define NUMINTCONSTANTS   \
27
#define NUMINTCONSTANTS   \
25
    (sizeof(intconstant_table) / sizeof(gidispatch_intconst_t))
28
    (sizeof(intconstant_table) / sizeof(gidispatch_intconst_t))
26
29
Lines 28-33 Link Here
28
    (sizeof(function_table) / sizeof(gidispatch_function_t))
31
    (sizeof(function_table) / sizeof(gidispatch_function_t))
29
32
30
/* The constants in this table must be ordered alphabetically. */
33
/* The constants in this table must be ordered alphabetically. */
34
static gidispatch_intconst_t class_table[] = {
35
    { "fileref", (2) },   /* "Qc" */
36
    { "schannel", (3) },  /* "Qd" */
37
    { "stream", (1) },    /* "Qb" */
38
    { "window", (0) },    /* "Qa" */
39
};
40
41
/* The constants in this table must be ordered alphabetically. */
31
static gidispatch_intconst_t intconstant_table[] = {
42
static gidispatch_intconst_t intconstant_table[] = {
32
    { "evtype_Arrange", (5)  },
43
    { "evtype_Arrange", (5)  },
33
    { "evtype_CharInput", (2) },
44
    { "evtype_CharInput", (2) },
Lines 66-71 Link Here
66
    { "gestalt_SoundNotify", (10) },
77
    { "gestalt_SoundNotify", (10) },
67
    { "gestalt_SoundVolume", (9) },
78
    { "gestalt_SoundVolume", (9) },
68
    { "gestalt_Timer", (5) },
79
    { "gestalt_Timer", (5) },
80
    { "gestalt_Unicode", (15) },
69
    { "gestalt_Version", (0) },
81
    { "gestalt_Version", (0) },
70
#ifdef GLK_MODULE_IMAGE
82
#ifdef GLK_MODULE_IMAGE
71
    { "imagealign_InlineCenter",  (0x03) },
83
    { "imagealign_InlineCenter",  (0x03) },
Lines 240-250 Link Here
240
    { 0x0102, glk_request_hyperlink_event, "request_hyperlink_event" },
252
    { 0x0102, glk_request_hyperlink_event, "request_hyperlink_event" },
241
    { 0x0103, glk_cancel_hyperlink_event, "cancel_hyperlink_event" },
253
    { 0x0103, glk_cancel_hyperlink_event, "cancel_hyperlink_event" },
242
#endif /* GLK_MODULE_HYPERLINKS */
254
#endif /* GLK_MODULE_HYPERLINKS */
255
#ifdef GLK_MODULE_UNICODE
256
    { 0x0120, glk_buffer_to_lower_case_uni, "buffer_to_lower_case_uni" },
257
    { 0x0121, glk_buffer_to_upper_case_uni, "buffer_to_upper_case_uni" },
258
    { 0x0122, glk_buffer_to_title_case_uni, "buffer_to_title_case_uni" },
259
    { 0x0128, glk_put_char_uni, "put_char_uni" },
260
    { 0x0129, glk_put_string_uni, "put_string_uni" },
261
    { 0x012A, glk_put_buffer_uni, "put_buffer_uni" },
262
    { 0x012B, glk_put_char_stream_uni, "put_char_stream_uni" },
263
    { 0x012C, glk_put_string_stream_uni, "put_string_stream_uni" },
264
    { 0x012D, glk_put_buffer_stream_uni, "put_buffer_stream_uni" },
265
    { 0x0130, glk_get_char_stream_uni, "get_char_stream_uni" },
266
    { 0x0131, glk_get_buffer_stream_uni, "get_buffer_stream_uni" },
267
    { 0x0132, glk_get_line_stream_uni, "get_line_stream_uni" },
268
    { 0x0138, glk_stream_open_file_uni, "stream_open_file_uni" },
269
    { 0x0139, glk_stream_open_memory_uni, "stream_open_memory_uni" },
270
    { 0x0140, glk_request_char_event_uni, "request_char_event_uni" },
271
    { 0x0141, glk_request_line_event_uni, "request_line_event_uni" },
272
#endif /* GLK_MODULE_UNICODE */
243
};
273
};
244
274
245
glui32 gidispatch_count_classes()
275
glui32 gidispatch_count_classes()
246
{
276
{
247
    return 4;
277
    return NUMCLASSES;
278
}
279
280
gidispatch_intconst_t *gidispatch_get_class(glui32 index)
281
{
282
    if (index < 0 || index >= NUMCLASSES)
283
        return NULL;
284
    return &(class_table[index]);
248
}
285
}
249
286
250
glui32 gidispatch_count_intconst()
287
glui32 gidispatch_count_intconst()
Lines 398-404 Link Here
398
        case 0x0087: /* set_style_stream */
435
        case 0x0087: /* set_style_stream */
399
            return "2QbIu:";
436
            return "2QbIu:";
400
        case 0x0090: /* get_char_stream */
437
        case 0x0090: /* get_char_stream */
401
            return "2Qb:Iu";
438
            return "2Qb:Is";
402
        case 0x0091: /* get_line_stream */
439
        case 0x0091: /* get_line_stream */
403
            return "3Qb<+#Cn:Iu"; 
440
            return "3Qb<+#Cn:Iu"; 
404
        case 0x0092: /* get_buffer_stream */
441
        case 0x0092: /* get_buffer_stream */
Lines 480-485 Link Here
480
            return "1Qa:";
520
            return "1Qa:";
481
#endif /* GLK_MODULE_HYPERLINKS */
521
#endif /* GLK_MODULE_HYPERLINKS */
482
            
522
            
523
#ifdef GLK_MODULE_UNICODE
524
        case 0x0120: /* buffer_to_lower_case_uni */
525
            return "3&+#IuIu:Iu";
526
        case 0x0121: /* buffer_to_upper_case_uni */
527
            return "3&+#IuIu:Iu";
528
        case 0x0122: /* buffer_to_title_case_uni */
529
            return "4&+#IuIuIu:Iu";
530
        case 0x0128: /* put_char_uni */
531
            return "1Iu:";
532
        case 0x0129: /* put_string_uni */
533
            return "1U:";
534
        case 0x012A: /* put_buffer_uni */
535
            return "1>+#Iu:";
536
        case 0x012B: /* put_char_stream_uni */
537
            return "2QbIu:";
538
        case 0x012C: /* put_string_stream_uni */
539
            return "2QbU:";
540
        case 0x012D: /* put_buffer_stream_uni */
541
            return "2Qb>+#Iu:"; 
542
        case 0x0130: /* get_char_stream_uni */
543
            return "2Qb:Is";
544
        case 0x0131: /* get_buffer_stream_uni */
545
            return "3Qb<+#Iu:Iu"; 
546
        case 0x0132: /* get_line_stream_uni */
547
            return "3Qb<+#Iu:Iu"; 
548
        case 0x0138: /* stream_open_file_uni */
549
            return "4QcIuIu:Qb";
550
        case 0x0139: /* stream_open_memory_uni */
551
            return "4&+#!IuIuIu:Qb";
552
        case 0x0140: /* request_char_event_uni */
553
            return "1Qa:";
554
        case 0x0141: /* request_line_event_uni */
555
            return "3Qa&+#!IuIu:";
556
#endif /* GLK_MODULE_UNICODE */
557
            
483
        default:
558
        default:
484
            return NULL;
559
            return NULL;
485
    }
560
    }
Lines 697-703 Link Here
697
            glk_fileref_delete_file(arglist[0].opaqueref);
772
            glk_fileref_delete_file(arglist[0].opaqueref);
698
            break;
773
            break;
699
        case 0x0067: /* fileref_does_file_exist */
774
        case 0x0067: /* fileref_does_file_exist */
700
            arglist[1].uint = glk_fileref_does_file_exist(arglist[0].opaqueref);
775
            arglist[2].uint = glk_fileref_does_file_exist(arglist[0].opaqueref);
701
            break;
776
            break;
702
        case 0x0068: /* fileref_create_from_fileref */
777
        case 0x0068: /* fileref_create_from_fileref */
703
            arglist[4].opaqueref = glk_fileref_create_from_fileref(arglist[0].uint, 
778
            arglist[4].opaqueref = glk_fileref_create_from_fileref(arglist[0].uint, 
Lines 736-742 Link Here
736
            glk_set_style_stream(arglist[0].opaqueref, arglist[1].uint);
811
            glk_set_style_stream(arglist[0].opaqueref, arglist[1].uint);
737
            break;
812
            break;
738
        case 0x0090: /* get_char_stream */
813
        case 0x0090: /* get_char_stream */
739
            arglist[2].uint = glk_get_char_stream(arglist[0].opaqueref);
814
            arglist[2].sint = glk_get_char_stream(arglist[0].opaqueref);
740
            break;
815
            break;
741
        case 0x0091: /* get_line_stream */
816
        case 0x0091: /* get_line_stream */
742
            if (arglist[1].ptrflag) 
817
            if (arglist[1].ptrflag) 
Lines 943-948 Link Here
943
            break;
1021
            break;
944
#endif /* GLK_MODULE_HYPERLINKS */
1022
#endif /* GLK_MODULE_HYPERLINKS */
945
            
1023
            
1024
#ifdef GLK_MODULE_UNICODE
1025
        case 0x0120: /* buffer_to_lower_case_uni */
1026
            if (arglist[0].ptrflag) 
1027
                arglist[5].uint = glk_buffer_to_lower_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint);
1028
            else
1029
                arglist[3].uint = glk_buffer_to_lower_case_uni(NULL, 0, arglist[1].uint);
1030
            break;
1031
        case 0x0121: /* buffer_to_upper_case_uni */
1032
            if (arglist[0].ptrflag) 
1033
                arglist[5].uint = glk_buffer_to_upper_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint);
1034
            else
1035
                arglist[3].uint = glk_buffer_to_upper_case_uni(NULL, 0, arglist[1].uint);
1036
            break;
1037
        case 0x0122: /* buffer_to_title_case_uni */
1038
            if (arglist[0].ptrflag) 
1039
                arglist[6].uint = glk_buffer_to_title_case_uni(arglist[1].array, arglist[2].uint, arglist[3].uint, arglist[4].uint);
1040
            else
1041
                arglist[4].uint = glk_buffer_to_title_case_uni(NULL, 0, arglist[1].uint, arglist[2].uint);
1042
            break;
1043
        case 0x0128: /* put_char_uni */
1044
            glk_put_char_uni(arglist[0].uint);
1045
            break;
1046
        case 0x0129: /* put_string_uni */
1047
            glk_put_string_uni(arglist[0].unicharstr);
1048
            break;
1049
        case 0x012A: /* put_buffer_uni */
1050
            if (arglist[0].ptrflag) 
1051
                glk_put_buffer_uni(arglist[1].array, arglist[2].uint);
1052
            else
1053
                glk_put_buffer_uni(NULL, 0);
1054
            break;
1055
        case 0x012B: /* put_char_stream_uni */
1056
            glk_put_char_stream_uni(arglist[0].opaqueref, arglist[1].uint);
1057
            break;
1058
        case 0x012C: /* put_string_stream_uni */
1059
            glk_put_string_stream_uni(arglist[0].opaqueref, arglist[1].unicharstr);
1060
            break;
1061
        case 0x012D: /* put_buffer_stream_uni */
1062
            if (arglist[1].ptrflag) 
1063
                glk_put_buffer_stream_uni(arglist[0].opaqueref, 
1064
                    arglist[2].array, arglist[3].uint);
1065
            else
1066
                glk_put_buffer_stream_uni(arglist[0].opaqueref, 
1067
                    NULL, 0);
1068
            break;
1069
        case 0x0130: /* get_char_stream_uni */
1070
            arglist[2].sint = glk_get_char_stream_uni(arglist[0].opaqueref);
1071
            break;
1072
        case 0x0131: /* get_buffer_stream_uni */
1073
            if (arglist[1].ptrflag) 
1074
                arglist[5].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref, 
1075
                    arglist[2].array, arglist[3].uint);
1076
            else
1077
                arglist[3].uint = glk_get_buffer_stream_uni(arglist[0].opaqueref, 
1078
                    NULL, 0);
1079
            break;
1080
        case 0x0132: /* get_line_stream_uni */
1081
            if (arglist[1].ptrflag) 
1082
                arglist[5].uint = glk_get_line_stream_uni(arglist[0].opaqueref, 
1083
                    arglist[2].array, arglist[3].uint);
1084
            else
1085
                arglist[3].uint = glk_get_line_stream_uni(arglist[0].opaqueref, 
1086
                    NULL, 0);
1087
            break;
1088
        case 0x0138: /* stream_open_file_uni */
1089
            arglist[4].opaqueref = glk_stream_open_file_uni(arglist[0].opaqueref, arglist[1].uint, 
1090
                arglist[2].uint);
1091
            break;
1092
        case 0x0139: /* stream_open_memory_uni */
1093
            if (arglist[0].ptrflag) 
1094
                arglist[6].opaqueref = glk_stream_open_memory_uni(arglist[1].array, 
1095
                    arglist[2].uint, arglist[3].uint, arglist[4].uint);
1096
            else
1097
                arglist[4].opaqueref = glk_stream_open_memory_uni(NULL, 
1098
                    0, arglist[1].uint, arglist[2].uint);
1099
            break;
1100
        case 0x0140: /* request_char_event_uni */
1101
            glk_request_char_event_uni(arglist[0].opaqueref);
1102
            break;
1103
        case 0x0141: /* request_line_event_uni */
1104
            if (arglist[1].ptrflag)
1105
                glk_request_line_event_uni(arglist[0].opaqueref, arglist[2].array,
1106
                    arglist[3].uint, arglist[4].uint);
1107
            else
1108
                glk_request_line_event_uni(arglist[0].opaqueref, NULL,
1109
                    0, arglist[2].uint);
1110
            break;
1111
#endif /* GLK_MODULE_UNICODE */
1112
            
946
        default:
1113
        default:
947
            /* do nothing */
1114
            /* do nothing */
948
            break;
1115
            break;
(-)glkloader-0.3.2/gi_dispa.h~ (-3 / +6 lines)
Lines 1-11 Link Here
1
#ifndef _GI_DISPA_H
1
#ifndef _GI_DISPA_H
2
#define _GI_DISPA_H
2
#define _GI_DISPA_H
3
3
4
/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.6.1.
4
/* gi_dispa.h: Header file for dispatch layer of Glk API, version 0.7.0.
5
    Designed by Andrew Plotkin <erkyrath@eblong.com>
5
    Designed by Andrew Plotkin <erkyrath@eblong.com>
6
    http://www.eblong.com/zarf/glk/index.html
6
    http://www.eblong.com/zarf/glk/index.html
7
7
8
    This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
8
    This file is copyright 1998-2004 by Andrew Plotkin. You may copy,
9
    distribute, and incorporate it into your own programs, by any means
9
    distribute, and incorporate it into your own programs, by any means
10
    and under any conditions, as long as you do not modify it. You may
10
    and under any conditions, as long as you do not modify it. You may
11
    also modify this file, incorporate it into your own programs,
11
    also modify this file, incorporate it into your own programs,
Lines 33-38 Link Here
33
    signed char sch; /* Cs */
33
    signed char sch; /* Cs */
34
    char ch; /* Cn */
34
    char ch; /* Cn */
35
    char *charstr; /* S */
35
    char *charstr; /* S */
36
    glui32 *unicharstr; /* U */
36
    void *array; /* all # arguments */
37
    void *array; /* all # arguments */
37
    glui32 ptrflag; /* [ ... ] or *? */
38
    glui32 ptrflag; /* [ ... ] or *? */
38
} gluniversal_t;
39
} gluniversal_t;
Lines 36-43 Link Here
36
    void *array; /* all # arguments */
37
    void *array; /* all # arguments */
37
    glui32 ptrflag; /* [ ... ] or *? */
38
    glui32 ptrflag; /* [ ... ] or *? */
38
} gluniversal_t;
39
} gluniversal_t;
40
39
/* Some well-known structures:
41
/* Some well-known structures:
40
    event_t : [4IuQwIuIu]
42
    event_t : [4IuQaIuIu]
41
    stream_result_t : [2IuIu] 
43
    stream_result_t : [2IuIu] 
42
*/
44
*/
43
45
Lines 79-84 Link Here
79
    gluniversal_t *arglist);
81
    gluniversal_t *arglist);
80
extern char *gidispatch_prototype(glui32 funcnum);
82
extern char *gidispatch_prototype(glui32 funcnum);
81
extern glui32 gidispatch_count_classes(void);
83
extern glui32 gidispatch_count_classes(void);
84
extern gidispatch_intconst_t *gidispatch_get_class(glui32 index);
82
extern glui32 gidispatch_count_intconst(void);
85
extern glui32 gidispatch_count_intconst(void);
83
extern gidispatch_intconst_t *gidispatch_get_intconst(glui32 index);
86
extern gidispatch_intconst_t *gidispatch_get_intconst(glui32 index);
84
extern glui32 gidispatch_count_functions(void);
87
extern glui32 gidispatch_count_functions(void);
(-)glkloader-0.3.2/func.txt~ (+16 lines)
Lines 87-90 Link Here
87
0x0101: glk_set_hyperlink_stream
87
0x0101: glk_set_hyperlink_stream
88
0x0102: glk_request_hyperlink_event
88
0x0102: glk_request_hyperlink_event
89
0x0103: glk_cancel_hyperlink_event
89
0x0103: glk_cancel_hyperlink_event
90
0x0120: glk_buffer_to_lower_case_uni
91
0x0121: glk_buffer_to_upper_case_uni
92
0x0122: glk_buffer_to_title_case_uni
93
0x0128: glk_put_char_uni
94
0x0129: glk_put_string_uni
95
0x012A: glk_put_buffer_uni
96
0x012B: glk_put_char_stream_uni
97
0x012C: glk_put_string_stream_uni
98
0x012D: glk_put_buffer_stream_uni
99
0x0130: glk_get_char_stream_uni
100
0x0131: glk_get_buffer_stream_uni
101
0x0132: glk_get_line_stream_uni
102
0x0138: glk_stream_open_file_uni
103
0x0139: glk_stream_open_memory_uni
104
0x0140: glk_request_char_event_uni
105
0x0141: glk_request_line_event_uni
90
106

Return to bug 116062