home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb153.zip / fweb-1.53 / web / trunc.hweb < prev    next >
Text File  |  1995-09-23  |  2KB  |  49 lines

  1. @z --- trunc.hweb ---
  2.  
  3. FWEB version 1.53 (September 23, 1995)
  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;
  49.