~ubuntu-branches/ubuntu/karmic/luatex/karmic

« back to all changes in this revision

Viewing changes to src/texk/web2c/cwebdir/cweav-bs.ch

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-05-29 04:44:18 UTC
  • mfrom: (1.1.6 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090529044418-b4d230tscam6pgt3
Tags: 0.40.2-1ubuntu1
* Merge with Debian (LP: #381539). No changes remaining.
* debian/patches/ubuntu_libpoppler-0.11: fix a FTBFS because of unuseful
  call to GfxFont destructor (virtual and protected).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Changes for CWEAVE for MSDOS and Borland C++ 3.1 using the following
2
 
options (and perhaps others):
3
 
 
4
 
    -mc -w-pro -Ff=5000 -Z- -O-p
5
 
 
6
 
The options -Z- and -O-p explicitly turn off optimizations that break
7
 
the code.  (See makefile.bs.)
8
 
 
9
 
The main purpose of these changes is to support MSDOS with full-size arrays
10
 
by using "huge" pointers.
11
 
 
12
 
This file contributed by Barry Schwartz, trashman@crud.mn.org, 28 Jun 94.
13
 
(Includes workaround for compiler bug [pointers wrapping around at
14
 
 segment boundaries], November 1993, contributed by Jorge Fernandez Arnaiz
15
 
 -- arnaiz@redvax1.dgsca.unam.mx)
16
 
(Last revised 5 Dec 94 with help of bob@microprograms.com.)
17
 
 
18
 
 
19
 
@x Section 1.
20
 
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
21
 
is modified.
22
 
 
23
 
@d banner "This is CWEAVE (Version 3.64)\n"
24
 
@y
25
 
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
26
 
is modified.
27
 
 
28
 
@d banner "This is CWEAVE (Version 3.64pc/big)\n"
29
 
@z
30
 
 
31
 
 
32
 
@x Section 9.
33
 
@d chunk_marker 0
34
 
 
35
 
@<Common code...@>=
36
 
typedef struct name_info {
37
 
  char *byte_start; /* beginning of the name in |byte_mem| */
38
 
  struct name_info *link;
39
 
  union {
40
 
    struct name_info *Rlink; /* right link in binary search tree for section
41
 
      names */
42
 
    char Ilk; /* used by identifiers in \.{CWEAVE} only */
43
 
  } dummy;
44
 
  char *equiv_or_xref; /* info corresponding to names */
45
 
} name_info; /* contains information about an identifier or section name */
46
 
typedef name_info *name_pointer; /* pointer into array of \&{name\_info}s */
47
 
typedef name_pointer *hash_pointer;
48
 
extern char byte_mem[]; /* characters of names */
49
 
extern char *byte_mem_end; /* end of |byte_mem| */
50
 
extern name_info name_dir[]; /* information about names */
51
 
extern name_pointer name_dir_end; /* end of |name_dir| */
52
 
extern name_pointer name_ptr; /* first unused position in |byte_start| */
53
 
extern char *byte_ptr; /* first unused position in |byte_mem| */
54
 
extern name_pointer hash[]; /* heads of hash lists */
55
 
extern hash_pointer hash_end; /* end of |hash| */
56
 
extern hash_pointer h; /* index into hash-head array */
57
 
extern name_pointer id_lookup(); /* looks up a string in the identifier table */
58
 
extern name_pointer section_lookup(); /* finds section name */
59
 
extern void print_section_name(), sprint_section_name();
60
 
@y
61
 
@d chunk_marker 0
62
 
 
63
 
@f huge extern
64
 
 
65
 
@<Common code...@>=
66
 
typedef struct name_info {
67
 
  char huge* byte_start; /* beginning of the name in |byte_mem| */
68
 
  struct name_info *link;
69
 
  union {
70
 
    struct name_info *Rlink; /* right link in binary search tree for section
71
 
      names */
72
 
    char Ilk; /* used by identifiers in \.{CWEAVE} only */
73
 
  } dummy;
74
 
  union {
75
 
    char *equiv_member;
76
 
    char huge* xref_member;
77
 
  } ptr_union; /* info corresponding to names */
78
 
} name_info; /* contains information about an identifier or section name */
79
 
typedef name_info *name_pointer; /* pointer into array of \&{name\_info}s */
80
 
typedef name_pointer *hash_pointer;
81
 
extern char huge byte_mem[]; /* characters of names */
82
 
extern char huge* byte_mem_end; /* end of |byte_mem| */
83
 
extern name_info name_dir[]; /* information about names */
84
 
extern name_pointer name_dir_end; /* end of |name_dir| */
85
 
extern name_pointer name_ptr; /* first unused position in |byte_start| */
86
 
extern char huge* byte_ptr; /* first unused position in |byte_mem| */
87
 
extern name_pointer hash[]; /* heads of hash lists */
88
 
extern hash_pointer hash_end; /* end of |hash| */
89
 
extern hash_pointer h; /* index into hash-head array */
90
 
extern name_pointer id_lookup(); /* looks up a string in the identifier table */
91
 
extern name_pointer section_lookup(); /* finds section name */
92
 
extern void print_section_name(), sprint_section_name();
93
 
@z
94
 
 
95
 
 
96
 
@x Section 18.
97
 
typedef struct xref_info {
98
 
  sixteen_bits num; /* section number plus zero or |def_flag| */
99
 
  struct xref_info *xlink; /* pointer to the previous cross-reference */
100
 
} xref_info;
101
 
typedef xref_info *xref_pointer;
102
 
@y
103
 
typedef struct xref_info {
104
 
  sixteen_bits num; /* section number plus zero or |def_flag| */
105
 
  struct xref_info huge* xlink; /* pointer to the previous cross-reference */
106
 
} xref_info;
107
 
typedef xref_info huge* xref_pointer;
108
 
@z
109
 
 
110
 
 
111
 
@x Section 19.
112
 
xref_info xmem[max_refs]; /* contains cross-reference information */
113
 
xref_pointer xmem_end = xmem+max_refs-1;
114
 
@y
115
 
xref_info huge xmem[max_refs]; /* contains cross-reference information */
116
 
xref_pointer xmem_end;
117
 
@z
118
 
 
119
 
 
120
 
@x Section 20.
121
 
@d xref equiv_or_xref
122
 
@y
123
 
@d xref ptr_union.xref_member
124
 
@z
125
 
 
126
 
 
127
 
@x Section 20.
128
 
xref_ptr=xmem; name_dir->xref=(char*)xmem; xref_switch=0; section_xref_switch=0;
129
 
xmem->num=0; /* sentinel value */
130
 
@y
131
 
xmem_end = xmem + max_refs - 1;
132
 
xref_ptr=xmem; name_dir->xref=(char*)xmem; xref_switch=0; section_xref_switch=0;
133
 
xmem->num=0; /* sentinel value */
134
 
@z
135
 
 
136
 
 
137
 
@x Section 21.
138
 
  append_xref(m); xref_ptr->xlink=q; p->xref=(char*)xref_ptr;
139
 
@y
140
 
  append_xref(m); xref_ptr->xlink=q; p->xref=(char huge*)xref_ptr;
141
 
@z
142
 
 
143
 
 
144
 
@x Section 22.
145
 
  if (r==xmem) p->xref=(char*)xref_ptr;
146
 
@y
147
 
  if (r==xmem) p->xref=(char huge*)xref_ptr;
148
 
@z
149
 
 
150
 
 
151
 
@x Section 23.
152
 
  q=(xref_pointer)p->xref;
153
 
  if (q->num==file_flag) return;
154
 
  append_xref(file_flag);
155
 
  xref_ptr->xlink = q;
156
 
  p->xref = (char *)xref_ptr;
157
 
@y
158
 
  q=(xref_pointer)p->xref;
159
 
  if (q->num==file_flag) return;
160
 
  append_xref(file_flag);
161
 
  xref_ptr->xlink = q;
162
 
  p->xref = (char huge*)xref_ptr;
163
 
@z
164
 
 
165
 
@x Section 25. (to please Borland's C++, version 4.02)
166
 
token tok_mem[max_toks]; /* tokens */
167
 
token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
168
 
token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
169
 
token_pointer tok_ptr; /* first unused position in |tok_mem| */
170
 
text_pointer text_ptr; /* first unused position in |tok_start| */
171
 
text_pointer tok_start_end = tok_start+max_texts-1; /* end of |tok_start| */
172
 
token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
173
 
@y
174
 
token tok_mem[max_toks]; /* tokens */
175
 
token_pointer tok_mem_end; /* end of |tok_mem| */
176
 
token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
177
 
token_pointer tok_ptr; /* first unused position in |tok_mem| */
178
 
text_pointer text_ptr; /* first unused position in |tok_start| */
179
 
text_pointer tok_start_end; /* end of |tok_start| */
180
 
token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
181
 
@z
182
 
 
183
 
@x Section 26. (goes with the previous change)
184
 
tok_start[1]=tok_mem+1;
185
 
max_tok_ptr=tok_mem+1; max_text_ptr=tok_start+1;
186
 
@y
187
 
tok_start[1]=tok_mem+1;
188
 
tok_mem_end=tok_mem+max_toks-1;
189
 
tok_start_end=tok_start+max_texts-1;
190
 
max_tok_ptr=tok_mem+1; max_text_ptr=tok_start+1;
191
 
@z
192
 
 
193
 
 
194
 
@x Section 27.
195
 
  p->ilk=t; p->xref=(char*)xmem;
196
 
@y
197
 
  p->ilk=t; p->xref=(char huge*)xmem;
198
 
@z
199
 
 
200
 
 
201
 
@x Section 27.
202
 
  p->xref=(char*)xmem;
203
 
@y
204
 
  p->xref=(char huge*)xmem;
205
 
@z
206
 
 
207
 
 
208
 
@x Section 70.
209
 
      if (unindexed(lhs)) { /* retain only underlined entries */
210
 
        xref_pointer q,r=NULL;
211
 
        for (q=(xref_pointer)lhs->xref;q>xmem;q=q->xlink)
212
 
          if (q->num<def_flag)
213
 
            if (r) r->xlink=q->xlink;
214
 
            else lhs->xref=(char*)q->xlink;
215
 
          else r=q;
216
 
      }
217
 
@y
218
 
      if (unindexed(lhs)) { /* retain only underlined entries */
219
 
        xref_pointer q,r=NULL;
220
 
        for (q=(xref_pointer)lhs->xref;q>xmem;q=q->xlink)
221
 
          if (q->num<def_flag)
222
 
            if (r) r->xlink=q->xlink;
223
 
            else lhs->xref=(char huge*)q->xlink;
224
 
          else r=q;
225
 
      }
226
 
@z
227
 
 
228
 
 
229
 
@x Section 87.
230
 
  char *k, *k_end=(p+1)->byte_start; /* pointers into |byte_mem| */
231
 
  out('{');
232
 
  for (k=p->byte_start; k<k_end; k++) {
233
 
@y
234
 
  char huge* k, huge* k_end=(p+1)->byte_start; /* pointers into |byte_mem| */
235
 
  out('{');
236
 
  for (k=p->byte_start; k<k_end; k++) {
237
 
@z
238
 
 
239
 
 
240
 
@x Section 116.
241
 
  append_xref(0); /* this number doesn't matter */
242
 
  xref_ptr->xlink=(xref_pointer)p->xref; r=xref_ptr;
243
 
  p->xref=(char*)xref_ptr;
244
 
  while (r->xlink!=q) {r->num=r->xlink->num; r=r->xlink;}
245
 
  r->num=m; /* everything from |q| on is left undisturbed */
246
 
@y
247
 
  append_xref(0); /* this number doesn't matter */
248
 
  xref_ptr->xlink=(xref_pointer)p->xref; r=xref_ptr;
249
 
  p->xref=(char huge*)xref_ptr;
250
 
  while (r->xlink!=q) {r->num=r->xlink->num; r=r->xlink;}
251
 
  r->num=m; /* everything from |q| on is left undisturbed */
252
 
@z
253
 
 
254
 
 
255
 
@x Section 163.
256
 
@ @<Change |pp| to $\max...@>=
257
 
@y
258
 
@ @<Change |pp| to $\max...@>=
259
 
#ifdef __MSDOS__
260
 
if (d<0 && pp+d>pp) pp=scrap_base; /* segmented architecture caused wrap */
261
 
else
262
 
#endif
263
 
@z
264
 
 
265
 
 
266
 
@x Section 194.
267
 
  char *p; /* index into |byte_mem| */
268
 
@y
269
 
  char huge *p; /* index into |byte_mem| */
270
 
@z
271
 
 
272
 
 
273
 
@x Section 229.
274
 
    if (cur_name->xref!=(char*)xmem) {
275
 
@y
276
 
    if (cur_name->xref!=(char huge*)xmem) {
277
 
@z
278
 
 
279
 
 
280
 
@x Section 232.
281
 
char *cur_byte; /* index into |byte_mem| */
282
 
@y
283
 
char huge* cur_byte; /* index into |byte_mem| */
284
 
@z
285
 
 
286
 
 
287
 
@x Section 241.
288
 
switch (cur_name->ilk) {
289
 
  case normal: if (is_tiny(cur_name)) out_str("\\|");
290
 
    else {char *j;
291
 
@y
292
 
switch (cur_name->ilk) {
293
 
  case normal: if (is_tiny(cur_name)) out_str("\\|");
294
 
    else {char huge* j;
295
 
@z
296
 
 
297
 
 
298
 
@x Section 241.
299
 
  case custom: case quoted: {char *j; out_str("$\\");
300
 
@y
301
 
  case custom: case quoted: {char huge* j; out_str("$\\");
302
 
@z