~ubuntu-branches/ubuntu/karmic/fweb/karmic

« back to all changes in this revision

Viewing changes to Web/trunc.hweb

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-01-04 23:20:22 UTC
  • Revision ID: james.westby@ubuntu.com-20020104232022-330ad4iyzpvb5bm4
Tags: upstream-1.62
ImportĀ upstreamĀ versionĀ 1.62

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@z --- trunc.hweb ---
 
2
 
 
3
FWEB version 1.62 (September 25, 1998)
 
4
 
 
5
Based on version 0.5 of S. Levy's CWEB [copyright (C) 1987 Princeton University]
 
6
 
 
7
@x-----------------------------------------------------------------------------
 
8
 
 
9
@ Various structure definitions for identifier truncation.
 
10
 
 
11
@d BP_MARKER 1
 
12
 
 
13
@d PROPER_END(end) 
 
14
        end = (np+1)->byte_start; 
 
15
        if(*end == BP_MARKER && np != npmax) end = ((BP *)end)->byte_start@;
 
16
 
 
17
@d MAX_ID_LENGTH 32 // Truncated identifiers can't be longer than this.
 
18
 
 
19
@<Typedef...@>=
 
20
 
 
21
#if(0)
 
22
IN_COMMON boolean truncate_ids; /* Truncate identifers? */
 
23
IN_COMMON unsigned short tr_max[]; /* Truncate to this length. */
 
24
IN_COMMON name_pointer npmax; /* |name_ptr - 1|. */
 
25
#endif
 
26
 
 
27
/* Back-pointer structure points back to the original name in |name_dir|. */
 
28
typedef struct Bp
 
29
        {
 
30
        ASCII c; // Dummy byte that always remains~|BP_MARKER|.
 
31
        LANGUAGE Language;
 
32
        CONST ASCII HUGE *byte_start,HUGE *byte_end; /* Points to original,
 
33
untruncated name. */ 
 
34
        struct Bp HUGE *next; /* Links to next back-pointer structure, in
 
35
case a truncated name came from more than one original name. */  
 
36
        struct Trunc HUGE *Root;
 
37
        } BP;
 
38
 
 
39
/* Info about a truncated identifier. */
 
40
typedef struct Trunc
 
41
        {
 
42
        boolean Language; // All languages associated with this name.
 
43
        size_t num[NUM_LANGUAGES]; 
 
44
                // \# of instances of the truncated name.
 
45
        ASCII HUGE *id, HUGE *id_end; // Truncated variable name.
 
46
        BP HUGE *first, HUGE *last; // First and last back-pointer structures.
 
47
        struct Trunc HUGE *next; // Next structure in truncated chain.
 
48
        } TRUNC;