home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / gcc / bug / 2228 < prev    next >
Encoding:
Text File  |  1992-09-01  |  46.6 KB  |  1,720 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!cs.wisc.edu!tim
  3. From: tim@cs.wisc.edu (Tim Theisen)
  4. Subject: Internal compiler error on hppa1.1-bsd.
  5. Message-ID: <9209010253.AA26334@appenzell.cs.wisc.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: University of Wisconsin-Madison, Department of Computer Sciences
  8. Distribution: gnu
  9. Date: Mon, 31 Aug 1992 16:53:14 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 1707
  12.  
  13. gcc 2.2.2 encounters and internal compiler error when invoked as follows:
  14.  
  15. $ gcc -v -c -O2 spinfo.c
  16. Reading specs from /usr/gnu/lib/gcc-lib/hppa1.1-bsd/2.2.2/specs
  17. gcc version 2.2.2
  18.  /usr/gnu/lib/gcc-lib/hppa1.1-bsd/2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__unix__ -D___HPUX_SOURCE__ -D__hp9000__ -D__hp800__ -D__spectrum__ -D__REVARGV__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__unix -D___HPUX_SOURCE -D__hp9000 -D__hp800 -D__spectrum -D__REVARGV -D__OPTIMIZE__ spinfo.c /usr/tmp/cc019387.i
  19. GNU CPP version 2.2.2 (hp9000s800)
  20.  /usr/gnu/lib/gcc-lib/hppa1.1-bsd/2.2.2/cc1 /usr/tmp/cc019387.i -quiet -dumpbase spinfo.c -O2 -version -o /usr/tmp/cc019387.s
  21. GNU C version 2.2.2 (hp9000s800) compiled by GNU C version 2.2.2.
  22. spinfo.c: In function `compute_sp_bounds':
  23. spinfo.c:1601: internal error--insn does not satisfy its constraints:
  24. (insn 174 164 167 (set (reg:SI 112)
  25.        (reg:SI 77)) 32 {movsi+1} (insn_list:REG_DEP_ANTI 164 (nil))
  26.    (expr_list:REG_EQUAL (const_int 15)
  27.        (nil)))
  28. gcc: Internal compiler error: program cc1 got fatal signal 4
  29.  
  30.  
  31. Here is the input file (already preprocessed by cpp):
  32. -----------------8<--- cut here -------- spinfo.c -----------
  33. typedef    unsigned char    u_char;
  34. typedef    unsigned short    u_short;
  35. typedef    unsigned int    u_int;
  36. typedef    unsigned long    u_long;
  37. typedef    unsigned short    ushort;         
  38. typedef struct  _physadr { int r[1]; } *physadr;
  39. typedef struct  label_t {
  40.     int     lbl_rp;
  41.     int     lbl_sp;
  42.     int     lbl_s[17];
  43.     int     lbl_ss[1];
  44.     double  lbl_sf[10];     
  45. } label_t;
  46. typedef    u_int    space_t;
  47. typedef    struct    _uquad    { u_long val[2]; } u_quad_t;
  48. typedef    struct    _quad    {   long val[2]; } quad_t;
  49. typedef    long *    qaddr_t;
  50. typedef    long    daddr_t;
  51. typedef    char *    caddr_t;
  52. typedef    u_long    ino_t;
  53. typedef    long    swblk_t;
  54. typedef    short    dev_t;
  55. typedef    long    off_t;
  56. typedef    u_short    nlink_t;     
  57. typedef    u_short    uid_t;
  58. typedef    u_short    gid_t;
  59. typedef    short    pid_t;         
  60. typedef    u_short    mode_t;         
  61. typedef    u_long    fixpt_t;
  62. typedef    unsigned long            clock_t;
  63. typedef    unsigned int            size_t;
  64. typedef    int                ptrdiff_t;
  65. typedef unsigned short               wchar_t;
  66. typedef    int                ssize_t;
  67. typedef    long                time_t;
  68. typedef long    fd_mask;
  69. typedef    struct fd_set {
  70.     fd_mask    fds_bits[(((256 )+(( (sizeof(fd_mask) * 8        )    )-1))/( (sizeof(fd_mask) * 8        )    )) ];
  71. } fd_set;
  72. char    *memchr (const void *, int, size_t)        ;
  73. int     memcmp (const void *, const void *, size_t)        ;
  74. void    *memcpy (void *, const void *, size_t)        ;
  75. char    *memmove (void *, const void *, size_t)        ;
  76. char    *memset (void *, int, size_t)        ;
  77. char    *strcat (char *, const char *)        ;
  78. char    *strchr (const char *, int)        ;
  79. int     strcmp (const char *, const char *)        ;
  80. int     strcoll (const char *, const char *)        ;
  81. char    *strcpy (char *, const char *)        ;
  82. size_t     strcspn (const char *, const char *)        ;
  83. char    *strerror (int)        ;
  84. size_t     strlen (const char *)        ;
  85. char    *strncat (char *, const char *, size_t)        ;
  86. int     strncmp (const char *, const char *, size_t)        ;
  87. char    *strncpy (char *, const char *, size_t)        ;
  88. char    *strpbrk (const char *, const char *)        ;
  89. char    *strrchr (const char *, int)        ;
  90. size_t     strspn (const char *, const char *)        ;
  91. char    *strstr (const char *, const char *)        ;
  92. char    *strtok (char *, const char *)        ;
  93. size_t     strxfrm (char *, const char *, size_t)        ;
  94. int     bcmp (const void *, const void *, size_t)        ;
  95. void     bcopy (const void *, void *, size_t)        ;
  96. void     bzero (void *, size_t)        ;
  97. int     ffs (int)        ;
  98. char    *index (const char *, int)        ;
  99. char    *memccpy (void *, const void *, int, size_t)        ;
  100. char    *rindex (const char *, int)        ;
  101. int     strcasecmp (const char *, const char *)        ;
  102. char    *strdup (const char *)        ;
  103. void     strmode (int, char *)        ;
  104. int     strncasecmp (const char *, const char *, size_t)        ;
  105. char    *strsep (char **, const char *)        ;
  106. void     swab (const void *, void *, size_t)        ;
  107. struct flock {
  108.     short    l_type;         
  109.     short    l_whence;     
  110.     off_t    l_start;     
  111.     off_t    l_len;         
  112.     pid_t    l_pid;         
  113. };
  114. int    open (const char *, int, ...)        ;
  115. int    creat (const char *, mode_t)        ;
  116. int    fcntl (int, int, ...)        ;
  117. int    flock (int, int)        ;
  118. struct timeval {
  119.     long    tv_sec;         
  120.     long    tv_usec;     
  121. };
  122. struct timezone {
  123.     int    tz_minuteswest;     
  124.     int    tz_dsttime;     
  125. };
  126. struct    itimerval {
  127.     struct    timeval it_interval;     
  128.     struct    timeval it_value;     
  129. };
  130. struct clockinfo {
  131.     int hz;         
  132.     int tick;     
  133.     int phz;     
  134.     int profhz;     
  135. };
  136. struct tm {
  137.     int    tm_sec;
  138.     int    tm_min;
  139.     int    tm_hour;
  140.     int    tm_mday;
  141.     int    tm_mon;
  142.     int    tm_year;
  143.     int    tm_wday;
  144.     int    tm_yday;
  145.     int    tm_isdst;
  146.     long    tm_gmtoff;
  147.     char    *tm_zone;
  148. };
  149. extern    struct tm *gmtime(), *localtime();
  150. extern    char *asctime(), *ctime();
  151. int    adjtime (const struct timeval *, struct timeval *)        ;
  152. int    getitimer (int, struct itimerval *)        ;
  153. int    gettimeofday (struct timeval *, struct timezone *)        ;
  154. int    setitimer (int, const struct itimerval *, struct itimerval *)        ;
  155. int    settimeofday (const struct timeval *, const struct timezone *)        ;
  156. int    utimes (const char *, const struct timeval *)        ;
  157. void bcopy();
  158. void bzero();
  159. int bcmp();
  160. typedef unsigned char    *pointer;
  161. typedef int        Bool;
  162. typedef unsigned long    Atom;
  163. typedef unsigned long    XID;
  164. extern char        *NameForAtom ();
  165. typedef long           INT32;
  166. typedef short          INT16;
  167. typedef signed char    INT8;
  168. typedef unsigned long CARD32;
  169. typedef unsigned short CARD16;
  170. typedef unsigned char  CARD8;
  171. typedef unsigned long        BITS32;
  172. typedef unsigned short        BITS16;
  173. typedef unsigned char        BYTE;
  174. typedef unsigned char            BOOL;
  175. typedef struct _xSegment {
  176.     INT16 x1  , y1  , x2  , y2  ;
  177. } xSegment;
  178. typedef struct _xPoint {
  179.     INT16        x  , y  ;
  180. } xPoint;
  181. typedef struct _xRectangle {
  182.     INT16 x  , y  ;
  183.     CARD16  width  , height  ;
  184. } xRectangle;
  185. typedef struct _xArc {
  186.     INT16 x  , y  ;
  187.     CARD16   width  , height  ;
  188.     INT16   angle1  , angle2  ;
  189. } xArc;
  190. typedef CARD16 KeyButMask;
  191. typedef struct {
  192.     CARD8    byteOrder;
  193.     BYTE    pad;
  194.     CARD16    majorVersion  , minorVersion  ;
  195.     CARD16    nbytesAuthProto  ;     
  196.     CARD16    nbytesAuthString  ;     
  197.     CARD16    pad2;
  198. } xConnClientPrefix;
  199. typedef struct {
  200.     BOOL           success;
  201.     BYTE           lengthReason;  
  202.     CARD16         majorVersion  , 
  203.                    minorVersion  ;
  204.     CARD16         length  ;   
  205. } xConnSetupPrefix;
  206. typedef struct {
  207.     CARD32         release  ;
  208.     CARD32         ridBase  , 
  209.                    ridMask  ;
  210.     CARD32         motionBufferSize  ;
  211.     CARD16         nbytesVendor  ;   
  212.     CARD16         maxRequestSize  ;
  213.     CARD8          numRoots;           
  214.     CARD8          numFormats;         
  215.     CARD8          imageByteOrder;         
  216.     CARD8          bitmapBitOrder;         
  217.     CARD8          bitmapScanlineUnit,      
  218.                    bitmapScanlinePad;      
  219.     CARD8        minKeyCode, maxKeyCode;
  220.     CARD32       pad2  ;
  221. } xConnSetup;
  222. typedef struct {
  223.     CARD8          depth;
  224.     CARD8          bitsPerPixel;
  225.     CARD8          scanLinePad;
  226.     CARD8          pad1;
  227.     CARD32       pad2  ;
  228. } xPixmapFormat;
  229. typedef struct {
  230.     CARD8     depth;
  231.     CARD8     pad1;
  232.     CARD16    nVisuals  ;   
  233.     CARD32    pad2  ;
  234.     } xDepth;
  235. typedef struct {
  236.     CARD32  visualID  ;
  237.     CARD8 class;
  238.     CARD8 bitsPerRGB;
  239.     CARD16 colormapEntries  ;
  240.     CARD32 redMask  , greenMask  , blueMask  ;
  241.     CARD32 pad  ;
  242.     } xVisualType;
  243. typedef struct {
  244.     CARD32          windowId  ;
  245.     CARD32        defaultColormap  ;
  246.     CARD32         whitePixel  , blackPixel  ;
  247.     CARD32         currentInputMask  ;   
  248.     CARD16         pixWidth  , pixHeight  ;
  249.     CARD16         mmWidth  , mmHeight  ;
  250.     CARD16         minInstalledMaps  , maxInstalledMaps  ;
  251.     CARD32        rootVisualID  ;
  252.     CARD8          backingStore;
  253.     BOOL           saveUnders;
  254.     CARD8          rootDepth;
  255.     CARD8          nDepths;   
  256. } xWindowRoot;
  257.  
  258. typedef struct {
  259.     CARD32 time  ;
  260.     INT16 x  , y  ;
  261. } xTimecoord;
  262. typedef struct {
  263.     CARD8 family;
  264.     BYTE pad;
  265.     CARD16 length  ;
  266. } xHostEntry;
  267. typedef struct {
  268.     INT16 leftSideBearing  ,
  269.       rightSideBearing  ,
  270.       characterWidth  ,
  271.       ascent  ,
  272.       descent  ;
  273.     CARD16 attributes  ;
  274. } xCharInfo;
  275. typedef struct {
  276.     CARD32  name  ;
  277.     CARD32 value  ;
  278. } xFontProp;
  279. typedef struct {            
  280.     CARD8 len;     
  281.     INT8 delta;
  282. } xTextElt;
  283. typedef struct {        
  284.     CARD32 pixel  ;
  285.     CARD16 red  , green  , blue  ;
  286.     CARD8 flags;   
  287.     CARD8 pad;
  288. } xColorItem;
  289. typedef struct {
  290.     CARD16 red  , green  , blue  , pad  ;
  291. } xrgb;
  292. typedef CARD8 KEYCODE;
  293.  
  294.  
  295. typedef struct {
  296.     BYTE type;                   
  297.     BYTE errorCode;
  298.     CARD16 sequenceNumber  ;        
  299.     CARD32 resourceID  ;
  300.     CARD16 minorCode  ;
  301.     CARD8 majorCode;
  302.     BYTE pad1;
  303.     CARD32 pad3  ;
  304.     CARD32 pad4  ;
  305.     CARD32 pad5  ;
  306.     CARD32 pad6  ;
  307.     CARD32 pad7  ;
  308. } xError;
  309.  
  310. typedef struct {
  311.     CARD8 reqType;
  312.     CARD8 data;             
  313.     CARD16 length  ;          
  314. } xReq;
  315. typedef struct {
  316.     CARD8 reqType;
  317.     BYTE pad;
  318.     CARD16 length  ;
  319.     CARD32 id  ;   
  320.     } xResourceReq;
  321. typedef struct {
  322.     CARD8 reqType;
  323.     CARD8 depth;
  324.     CARD16 length  ;
  325.     CARD32  wid  , parent  ;
  326.     INT16 x  , y  ;
  327.     CARD16 width  , height  , borderWidth  ;  
  328.     CARD16 class  ;
  329.     CARD32  visual  ;
  330.     CARD32 mask  ;
  331. } xCreateWindowReq;
  332. typedef struct {
  333.     CARD8 reqType;
  334.     BYTE pad;
  335.     CARD16 length  ;
  336.     CARD32  window  ;
  337.     CARD32 valueMask  ; 
  338. } xChangeWindowAttributesReq;
  339. typedef struct {
  340.     CARD8 reqType;
  341.     BYTE mode;
  342.     CARD16 length  ;
  343.     CARD32  window  ;
  344. } xChangeSaveSetReq;
  345. typedef struct {
  346.     CARD8 reqType;
  347.     BYTE pad;
  348.     CARD16 length  ;
  349.     CARD32  window  , parent  ;
  350.     INT16 x  , y  ;
  351. } xReparentWindowReq;
  352. typedef struct {
  353.     CARD8 reqType;
  354.     CARD8 pad;
  355.     CARD16 length  ;
  356.     CARD32  window  ;
  357.     CARD16 mask  ;
  358.     CARD16 pad2  ;
  359. } xConfigureWindowReq;
  360. typedef struct {
  361.     CARD8 reqType;
  362.     CARD8 direction;
  363.     CARD16 length  ;
  364.     CARD32  window  ;
  365. } xCirculateWindowReq;
  366. typedef struct {     
  367.     CARD8 reqType;
  368.     BOOL onlyIfExists;
  369.     CARD16 length  ;
  370.     CARD16 nbytes   ;     
  371.     CARD16 pad  ;
  372. } xInternAtomReq;
  373. typedef struct {
  374.     CARD8 reqType;
  375.     CARD8 mode;
  376.     CARD16 length  ;
  377.     CARD32  window  ;
  378.     CARD32  property  , type  ;
  379.     CARD8 format;
  380.     BYTE pad[3];
  381.     CARD32 nUnits  ;      
  382. } xChangePropertyReq;
  383. typedef struct {
  384.     CARD8 reqType;
  385.     BYTE pad;
  386.     CARD16 length  ;
  387.     CARD32  window  ;
  388.     CARD32  property  ;
  389. } xDeletePropertyReq;
  390. typedef struct {
  391.     CARD8 reqType;
  392.     BOOL delete;
  393.     CARD16 length  ;
  394.     CARD32  window  ;
  395.     CARD32  property  , type  ;
  396.     CARD32 longOffset  ;
  397.     CARD32 longLength  ;
  398. } xGetPropertyReq;
  399. typedef struct {
  400.     CARD8 reqType;
  401.     BYTE pad;
  402.     CARD16 length  ;
  403.     CARD32  window  ;
  404.     CARD32  selection  ;
  405.     CARD32  time  ;
  406. } xSetSelectionOwnerReq;
  407. typedef struct {
  408.     CARD8 reqType;
  409.     BYTE pad;
  410.     CARD16 length  ;
  411.     CARD32  requestor  ;
  412.     CARD32  selection  , target  , property  ;
  413.     CARD32  time  ;
  414.     } xConvertSelectionReq;
  415. typedef struct {
  416.     CARD8 reqType;
  417.     BOOL ownerEvents;
  418.     CARD16 length  ;
  419.     CARD32  grabWindow  ;
  420.     CARD16 eventMask  ;
  421.     BYTE pointerMode, keyboardMode;
  422.     CARD32  confineTo  ;
  423.     CARD32  cursor  ;
  424.     CARD32  time  ;
  425. } xGrabPointerReq;
  426. typedef struct {
  427.     CARD8 reqType;
  428.     BOOL ownerEvents;
  429.     CARD16 length  ;
  430.     CARD32  grabWindow  ;
  431.     CARD16 eventMask  ;
  432.     BYTE pointerMode, keyboardMode;
  433.     CARD32  confineTo  ;
  434.     CARD32  cursor  ;
  435.     CARD8 button;
  436.     BYTE pad;
  437.     CARD16 modifiers  ;
  438. } xGrabButtonReq;
  439. typedef struct {
  440.     CARD8 reqType;
  441.     CARD8 button;
  442.     CARD16 length  ;
  443.     CARD32  grabWindow  ;
  444.     CARD16 modifiers  ;
  445.     CARD16 pad  ;
  446. } xUngrabButtonReq;
  447. typedef struct {
  448.     CARD8 reqType;
  449.     BYTE pad;
  450.     CARD16 length  ;
  451.     CARD32  cursor  ;
  452.     CARD32  time  ;
  453.     CARD16 eventMask  ;
  454.     CARD16 pad2  ;
  455. } xChangeActivePointerGrabReq;
  456. typedef struct {
  457.     CARD8 reqType;
  458.     BOOL ownerEvents;
  459.     CARD16 length  ;
  460.     CARD32  grabWindow  ;
  461.     CARD32  time  ;
  462.     BYTE pointerMode, keyboardMode;  
  463.     CARD16 pad  ;
  464. } xGrabKeyboardReq;
  465. typedef struct {
  466.     CARD8 reqType;
  467.     BOOL ownerEvents;
  468.     CARD16 length  ;
  469.     CARD32  grabWindow  ;
  470.     CARD16 modifiers  ;
  471.     CARD8 key;
  472.     BYTE pointerMode, keyboardMode;  
  473.     BYTE pad1, pad2, pad3;
  474. } xGrabKeyReq;
  475. typedef struct {
  476.     CARD8 reqType;
  477.     CARD8 key;
  478.     CARD16 length  ;
  479.     CARD32  grabWindow  ;
  480.     CARD16 modifiers  ;
  481.     CARD16 pad  ;
  482. } xUngrabKeyReq;
  483. typedef struct {
  484.     CARD8 reqType;
  485.     CARD8 mode;
  486.     CARD16 length  ;
  487.     CARD32  time  ;
  488. } xAllowEventsReq;
  489. typedef struct {
  490.     CARD8 reqType;
  491.     BYTE pad;
  492.     CARD16 length  ;
  493.     CARD32  window  ;
  494.     CARD32  start  , stop  ;
  495. } xGetMotionEventsReq;
  496. typedef struct {
  497.     CARD8 reqType;
  498.     BYTE pad;
  499.     CARD16 length  ;
  500.     CARD32  srcWid  , dstWid  ;
  501.     INT16 srcX  , srcY  ;
  502. } xTranslateCoordsReq;
  503. typedef struct {
  504.     CARD8 reqType;
  505.     BYTE pad;
  506.     CARD16 length  ;
  507.     CARD32  srcWid  , dstWid  ;
  508.     INT16 srcX  , srcY  ;
  509.     CARD16 srcWidth  , srcHeight  ;
  510.     INT16 dstX  , dstY  ;
  511. } xWarpPointerReq;
  512. typedef struct {
  513.     CARD8 reqType;
  514.     CARD8 revertTo;
  515.     CARD16 length  ;
  516.     CARD32  focus  ;
  517.     CARD32  time  ;
  518. } xSetInputFocusReq;
  519. typedef struct {
  520.     CARD8 reqType;
  521.     BYTE pad;
  522.     CARD16 length  ;
  523.     CARD32  fid  ;
  524.     CARD16 nbytes  ;
  525.     BYTE pad1, pad2;     
  526. } xOpenFontReq;
  527. typedef struct {
  528.     CARD8 reqType;
  529.     BOOL oddLength;
  530.     CARD16 length  ;
  531.     CARD32  fid  ;
  532.     } xQueryTextExtentsReq;
  533. typedef struct {
  534.     CARD8 reqType;
  535.     BYTE pad;
  536.     CARD16 length  ;
  537.     CARD16 maxNames  ;
  538.     CARD16 nbytes  ;   
  539. } xListFontsReq;
  540. typedef xListFontsReq xListFontsWithInfoReq;
  541. typedef struct {
  542.     CARD8 reqType;
  543.     BYTE pad;
  544.     CARD16 length  ;
  545.     CARD16 nFonts  ;
  546.     BYTE pad1, pad2;     
  547. } xSetFontPathReq;
  548. typedef struct {
  549.     CARD8 reqType;
  550.     CARD8 depth;
  551.     CARD16 length  ;
  552.     CARD32  pid  ;
  553.     CARD32  drawable  ;
  554.     CARD16 width  , height  ;
  555. } xCreatePixmapReq;
  556. typedef struct {
  557.     CARD8 reqType;
  558.     BYTE pad;
  559.     CARD16 length  ;
  560.     CARD32  gc  ;
  561.     CARD32  drawable  ;
  562.     CARD32 mask  ;
  563. } xCreateGCReq;
  564. typedef struct {
  565.     CARD8 reqType;
  566.     BYTE pad;
  567.     CARD16 length  ;
  568.     CARD32  gc  ;
  569.     CARD32 mask  ;
  570. } xChangeGCReq;    
  571. typedef struct {
  572.     CARD8 reqType;
  573.     BYTE pad;
  574.     CARD16 length  ;
  575.     CARD32  srcGC  , dstGC  ;
  576.     CARD32 mask  ;
  577. } xCopyGCReq;    
  578. typedef struct {
  579.     CARD8 reqType;
  580.     BYTE pad;
  581.     CARD16 length  ;
  582.     CARD32  gc  ;
  583.     CARD16 dashOffset  ;
  584.     CARD16 nDashes  ;         
  585. } xSetDashesReq;    
  586. typedef struct {
  587.     CARD8 reqType;
  588.     BYTE ordering;
  589.     CARD16 length  ;
  590.     CARD32  gc  ;
  591.     INT16 xOrigin  , yOrigin  ;
  592. } xSetClipRectanglesReq;    
  593. typedef struct {
  594.     CARD8 reqType;
  595.     BOOL exposures;
  596.     CARD16 length  ;
  597.     CARD32  window  ;
  598.     INT16 x  , y  ;
  599.     CARD16 width  , height  ;
  600. } xClearAreaReq;
  601. typedef struct {
  602.     CARD8 reqType;
  603.     BYTE pad;
  604.     CARD16 length  ;
  605.     CARD32  srcDrawable  , dstDrawable  ;
  606.     CARD32  gc  ;
  607.     INT16 srcX  , srcY  , dstX  , dstY  ;
  608.     CARD16 width  , height  ;
  609. } xCopyAreaReq;    
  610. typedef struct {
  611.     CARD8 reqType;
  612.     BYTE pad;
  613.     CARD16 length  ;
  614.     CARD32  srcDrawable  , dstDrawable  ;
  615.     CARD32  gc  ;
  616.     INT16 srcX  , srcY  , dstX  , dstY  ;
  617.     CARD16 width  , height  ;
  618.     CARD32 bitPlane  ;
  619. } xCopyPlaneReq;    
  620. typedef struct {
  621.     CARD8 reqType;
  622.     BYTE coordMode;
  623.     CARD16 length  ;
  624.     CARD32  drawable  ;
  625.     CARD32  gc  ;
  626. } xPolyPointReq;    
  627. typedef xPolyPointReq xPolyLineReq;   
  628. typedef struct {
  629.     CARD8 reqType;
  630.     BYTE pad;
  631.     CARD16 length  ;
  632.     CARD32  drawable  ;
  633.     CARD32  gc  ;
  634. } xPolySegmentReq;    
  635. typedef xPolySegmentReq xPolyArcReq;
  636. typedef xPolySegmentReq xPolyRectangleReq;
  637. typedef xPolySegmentReq xPolyFillRectangleReq;
  638. typedef xPolySegmentReq xPolyFillArcReq;
  639. typedef struct _FillPolyReq {
  640.     CARD8 reqType;
  641.     BYTE pad;
  642.     CARD16 length  ;
  643.     CARD32  drawable  ;
  644.     CARD32  gc  ;
  645.     BYTE shape;
  646.     BYTE coordMode;
  647.     CARD16 pad1  ;
  648. } xFillPolyReq;    
  649. typedef struct _PutImageReq {
  650.     CARD8 reqType;
  651.     CARD8 format;
  652.     CARD16 length  ;
  653.     CARD32  drawable  ;
  654.     CARD32  gc  ;
  655.     CARD16 width  , height  ;
  656.     INT16 dstX  , dstY  ;
  657.     CARD8 leftPad;
  658.     CARD8 depth;
  659.     CARD16 pad  ;
  660. } xPutImageReq;    
  661. typedef struct {
  662.     CARD8 reqType;
  663.     CARD8 format;
  664.     CARD16 length  ;
  665.     CARD32  drawable  ;
  666.     INT16 x  , y  ;
  667.     CARD16 width  , height  ;
  668.     CARD32 planeMask  ;
  669. } xGetImageReq;    
  670. typedef struct {
  671.     CARD8 reqType;
  672.     CARD8 pad;
  673.     CARD16 length  ;
  674.     CARD32  drawable  ;
  675.     CARD32  gc  ;
  676.     INT16 x  , y  ;         
  677. } xPolyTextReq;    
  678. typedef xPolyTextReq xPolyText8Req;
  679. typedef xPolyTextReq xPolyText16Req;
  680. typedef struct {
  681.     CARD8 reqType;
  682.     BYTE nChars;
  683.     CARD16 length  ;
  684.     CARD32  drawable  ;
  685.     CARD32  gc  ;
  686.     INT16 x  , y  ;
  687. } xImageTextReq;    
  688. typedef xImageTextReq xImageText8Req;
  689. typedef xImageTextReq xImageText16Req;
  690. typedef struct {
  691.     CARD8 reqType;
  692.     BYTE alloc;
  693.     CARD16 length  ;
  694.     CARD32  mid  ;
  695.     CARD32  window  ;
  696.     CARD32  visual  ;
  697. } xCreateColormapReq;    
  698. typedef struct {
  699.     CARD8 reqType;
  700.     BYTE pad;
  701.     CARD16 length  ;
  702.     CARD32  mid  ;
  703.     CARD32  srcCmap  ;
  704. } xCopyColormapAndFreeReq;    
  705. typedef struct {
  706.     CARD8 reqType;
  707.     BYTE pad;
  708.     CARD16 length  ;
  709.     CARD32  cmap  ;
  710.     CARD16 red  , green  , blue  ;
  711.     CARD16 pad2  ;
  712. } xAllocColorReq;    
  713. typedef struct {
  714.     CARD8 reqType;
  715.     BYTE pad;
  716.     CARD16 length  ;
  717.     CARD32  cmap  ;
  718.     CARD16 nbytes  ;   
  719.     BYTE pad1, pad2;
  720. } xAllocNamedColorReq;    
  721. typedef struct {
  722.     CARD8 reqType;
  723.     BOOL contiguous;
  724.     CARD16 length  ;
  725.     CARD32  cmap  ;
  726.     CARD16 colors  , planes  ;
  727. } xAllocColorCellsReq;    
  728. typedef struct {
  729.     CARD8 reqType;
  730.     BOOL contiguous;
  731.     CARD16 length  ;
  732.     CARD32  cmap  ;
  733.     CARD16 colors  , red  , green  , blue  ;
  734. } xAllocColorPlanesReq;    
  735. typedef struct {
  736.     CARD8 reqType;
  737.     BYTE pad;
  738.     CARD16 length  ;
  739.     CARD32  cmap  ;
  740.     CARD32 planeMask  ;
  741. } xFreeColorsReq;    
  742. typedef struct {
  743.     CARD8 reqType;
  744.     BYTE pad;
  745.     CARD16 length  ;
  746.     CARD32  cmap  ;
  747. } xStoreColorsReq;    
  748. typedef struct {
  749.     CARD8 reqType;
  750.     CARD8 flags;    
  751.     CARD16 length  ;
  752.     CARD32  cmap  ;
  753.     CARD32 pixel  ;
  754.     CARD16 nbytes  ;   
  755.     BYTE pad1, pad2;
  756.     } xStoreNamedColorReq;
  757. typedef struct {
  758.     CARD8 reqType;
  759.     BYTE pad;
  760.     CARD16 length  ;
  761.     CARD32  cmap  ;
  762. } xQueryColorsReq;    
  763. typedef struct {     
  764.     CARD8 reqType;
  765.     BYTE pad;
  766.     CARD16 length  ;
  767.     CARD32  cmap  ;
  768.     CARD16 nbytes  ;   
  769.     BYTE pad1, pad2;
  770. } xLookupColorReq;    
  771. typedef struct {
  772.     CARD8 reqType;
  773.     BYTE pad;
  774.     CARD16 length  ;
  775.     CARD32  cid  ;
  776.     CARD32  source  , mask  ;
  777.     CARD16 foreRed  , foreGreen  , foreBlue  ;
  778.     CARD16 backRed  , backGreen  , backBlue  ;
  779.     CARD16 x  , y  ;
  780. } xCreateCursorReq;    
  781. typedef struct {
  782.     CARD8 reqType;
  783.     BYTE pad;
  784.     CARD16 length  ;
  785.     CARD32  cid  ;
  786.     CARD32  source  , mask  ;
  787.     CARD16 sourceChar  , maskChar  ;
  788.     CARD16 foreRed  , foreGreen  , foreBlue  ;
  789.     CARD16 backRed  , backGreen  , backBlue  ;
  790. } xCreateGlyphCursorReq;    
  791. typedef struct {
  792.     CARD8 reqType;
  793.     BYTE pad;
  794.     CARD16 length  ;
  795.     CARD32  cursor  ;
  796.     CARD16 foreRed  , foreGreen  , foreBlue  ;
  797.     CARD16 backRed  , backGreen  , backBlue  ;
  798. } xRecolorCursorReq;    
  799. typedef struct {
  800.     CARD8 reqType;
  801.     CARD8 class;
  802.     CARD16 length  ;
  803.     CARD32  drawable  ;
  804.     CARD16 width  , height  ;
  805. } xQueryBestSizeReq;    
  806. typedef struct {
  807.     CARD8 reqType;
  808.     BYTE pad;
  809.     CARD16 length  ;
  810.     CARD16 nbytes  ;   
  811.     BYTE pad1, pad2;
  812. } xQueryExtensionReq;
  813. typedef struct {
  814.     CARD8   reqType;
  815.     CARD8   numKeyPerModifier;
  816.     CARD16  length  ;
  817. } xSetModifierMappingReq;
  818. typedef struct {
  819.     CARD8 reqType;
  820.     CARD8 nElts;   
  821.     CARD16 length  ;
  822. } xSetPointerMappingReq;
  823. typedef struct {
  824.     CARD8 reqType;
  825.     BYTE pad;
  826.     CARD16 length  ;
  827.     CARD8  firstKeyCode;
  828.     CARD8 count;
  829.     CARD16 pad1  ;
  830. } xGetKeyboardMappingReq;    
  831. typedef struct {
  832.     CARD8 reqType;
  833.     CARD8 keyCodes;
  834.     CARD16 length  ;
  835.     CARD8  firstKeyCode;
  836.     CARD8 keySymsPerKeyCode;
  837.     CARD16 pad1  ;
  838. } xChangeKeyboardMappingReq;
  839. typedef struct {
  840.     CARD8 reqType;
  841.     BYTE pad;
  842.     CARD16 length  ;
  843.     CARD32 mask  ;
  844. } xChangeKeyboardControlReq;    
  845. typedef struct {
  846.     CARD8 reqType;
  847.     INT8 percent;   
  848.     CARD16 length  ;
  849. } xBellReq;    
  850. typedef struct {
  851.     CARD8 reqType;
  852.     BYTE pad;
  853.     CARD16 length  ;
  854.     INT16 accelNum  , accelDenum  ;
  855.     INT16 threshold  ;             
  856.     BOOL doAccel, doThresh;
  857. } xChangePointerControlReq;    
  858. typedef struct {
  859.     CARD8 reqType;
  860.     BYTE pad;
  861.     CARD16 length  ;
  862.     INT16 timeout  , interval  ;
  863.     BYTE preferBlank, allowExpose;  
  864.     CARD16 pad2  ;
  865. } xSetScreenSaverReq;    
  866. typedef struct {
  867.     CARD8 reqType;
  868.     BYTE mode;
  869.     CARD16 length  ;
  870.     CARD8 hostFamily;
  871.     BYTE pad;
  872.     CARD16 hostLength  ;
  873. } xChangeHostsReq;    
  874. typedef struct {
  875.     CARD8 reqType;
  876.     BYTE pad;
  877.     CARD16 length  ;
  878.     } xListHostsReq;
  879. typedef struct {
  880.     CARD8 reqType;
  881.     BYTE mode;
  882.     CARD16 length  ;
  883.     } xChangeModeReq;
  884. typedef xChangeModeReq xSetAccessControlReq;
  885. typedef xChangeModeReq xSetCloseDownModeReq;
  886. typedef xChangeModeReq xForceScreenSaverReq;
  887. typedef struct {  
  888.     CARD8 reqType;
  889.     BYTE pad;
  890.     CARD16 length  ;
  891.     CARD32  window  ;
  892.     CARD16 nAtoms  ;
  893.     INT16 nPositions  ;
  894.     } xRotatePropertiesReq;
  895.  
  896. typedef unsigned long  fsBitmapFormat;
  897. typedef unsigned long  fsBitmapFormatMask;
  898. typedef struct _Font *FontPtr;
  899. typedef struct _FontInfo *FontInfoPtr;
  900. typedef struct _FontProp *FontPropPtr;
  901. typedef struct _ExtentInfo *ExtentInfoPtr;
  902. typedef struct _FontPathElement *FontPathElementPtr;
  903. typedef struct _CharInfo *CharInfoPtr;
  904. typedef struct _FontNames *FontNamesPtr;
  905. typedef struct _FontResolution *FontResolutionPtr;
  906. typedef int DrawDirection;
  907. typedef char *closure;
  908. extern int  StartListFontsWithInfo(   );
  909. extern int  ListFonts(   );
  910. extern FontNamesPtr MakeFontNamesRecord(   );
  911. extern void FreeFontNames();
  912. extern int  AddFontNamesName();
  913. extern int  FontToFSError();
  914. extern FontResolutionPtr GetClientResolution();
  915. typedef struct _FontPatternCache    *FontPatternCachePtr;
  916. extern FontPatternCachePtr  MakeFontPatternCache ();
  917. extern void            FreeFontPatternCache ();
  918. extern void            EmtpyFontPatternCache ();
  919. extern void            CacheFontPattern ();
  920. extern FontPtr            FindCachedFontPattern ();
  921. extern void            RemoveCachedFontPattern ();
  922. typedef enum {
  923.     Linear8Bit, TwoD8Bit, Linear16Bit, TwoD16Bit
  924. }           FontEncoding;
  925. typedef struct _FontProp {
  926.     long        name;
  927.     long        value;         
  928. }           FontPropRec;
  929. typedef struct _FontResolution {
  930.     unsigned short x_resolution;
  931.     unsigned short y_resolution;
  932.     unsigned short point_size;
  933. }           FontResolutionRec;
  934. typedef struct _ExtentInfo {
  935.     DrawDirection drawDirection;
  936.     int         fontAscent;
  937.     int         fontDescent;
  938.     int         overallAscent;
  939.     int         overallDescent;
  940.     int         overallWidth;
  941.     int         overallLeft;
  942.     int         overallRight;
  943. }           ExtentInfoRec;
  944. typedef struct _CharInfo {
  945.     xCharInfo   metrics;     
  946.     char       *bits;         
  947. }           CharInfoRec;
  948. typedef struct _FontInfo {
  949.     unsigned short firstCol;
  950.     unsigned short lastCol;
  951.     unsigned short firstRow;
  952.     unsigned short lastRow;
  953.     unsigned short defaultCh;
  954.     unsigned int noOverlap:1;
  955.     unsigned int terminalFont:1;
  956.     unsigned int constantMetrics:1;
  957.     unsigned int constantWidth:1;
  958.     unsigned int inkInside:1;
  959.     unsigned int inkMetrics:1;
  960.     unsigned int allExist:1;
  961.     unsigned int drawDirection:2;
  962.     unsigned int cachable:1;
  963.     unsigned int anamorphic:1;
  964.     short       maxOverlap;
  965.     short       pad;
  966.     xCharInfo   maxbounds;
  967.     xCharInfo   minbounds;
  968.     xCharInfo   ink_maxbounds;
  969.     xCharInfo   ink_minbounds;
  970.     short       fontAscent;
  971.     short       fontDescent;
  972.     int         nprops;
  973.     FontPropPtr props;
  974.     char       *isStringProp;
  975. }           FontInfoRec;
  976. typedef struct _Font {
  977.     int         refcnt;
  978.     FontInfoRec info;
  979.     char        bit;
  980.     char        byte;
  981.     char        glyph;
  982.     char        scan;
  983.     fsBitmapFormat format;
  984.     int         (*get_glyphs) (   );
  985.     int         (*get_metrics) (   );
  986.     void        (*unload_font) (   );
  987.     FontPathElementPtr fpe;
  988.     pointer     svrPrivate;
  989.     pointer     fontPrivate;
  990.     pointer     fpePrivate;
  991.     int        maxPrivate;
  992.     pointer    *devPrivates;
  993. }           FontRec;
  994. extern Bool    _FontSetNewPrivate ( );
  995. extern int    AllocateFontPrivateIndex ();
  996. typedef struct _FontNames {
  997.     int         nnames;
  998.     int         size;
  999.     int        *length;
  1000.     char      **names;
  1001. }           FontNamesRec;
  1002. typedef struct _FontPathElement {
  1003.     int         name_length;
  1004.     char       *name;
  1005.     int         type;
  1006.     int         refcount;
  1007.     pointer     private;
  1008. }           FontPathElementRec;
  1009. typedef struct _FPEFunctions {
  1010.     int         (*name_check) (   );
  1011.     int         (*init_fpe) (   );
  1012.     int         (*reset_fpe) (   );
  1013.     int         (*free_fpe) (   );
  1014.     int         (*open_font) (     
  1015.  );
  1016.     int         (*close_font) (   );
  1017.     int         (*list_fonts) (     
  1018.  );
  1019.     int         (*start_list_fonts_with_info) (     
  1020.  );
  1021.     int         (*list_next_font_with_info) (     
  1022.  );
  1023.     int         (*wakeup_fpe) (   );
  1024.     int        (*client_died) (   );
  1025. }           FPEFunctionsRec, FPEFunctions;
  1026. extern int  InitFPETypes();
  1027. typedef struct _FontEntry        *FontEntryPtr;
  1028. typedef struct _FontTable        *FontTablePtr;
  1029. typedef struct _FontName        *FontNamePtr;
  1030. typedef struct _FontScaled        *FontScaledPtr;
  1031. typedef struct _FontScalableExtra   *FontScalableExtraPtr;
  1032. typedef struct _FontScalableEntry   *FontScalableEntryPtr;
  1033. typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr;
  1034. typedef struct _FontBitmapEntry        *FontBitmapEntryPtr;
  1035. typedef struct _FontAliasEntry        *FontAliasEntryPtr;
  1036. typedef struct _FontBCEntry        *FontBCEntryPtr;
  1037. typedef struct _FontDirectory        *FontDirectoryPtr;
  1038. typedef struct _FontRenderer        *FontRendererPtr;
  1039. extern FontEntryPtr    FontFileFindNameInDir ();
  1040. extern FontDirectoryPtr    FontFileMakeDir ();
  1041. extern FontRendererPtr    FontFileMatchRenderer ();
  1042. extern char        *SaveString ();
  1043. extern FontScaledPtr    FontFileFindScaledInstance ();
  1044. typedef struct _FontScalable {
  1045.     int         pixel,
  1046.                 point,
  1047.                 x,
  1048.                 y,
  1049.                 width;
  1050. }           FontScalableRec, *FontScalablePtr;
  1051. extern Bool FontParseXLFDName();
  1052. typedef struct _FontName {
  1053.     char    *name;
  1054.     short    length;
  1055.     short    ndashes;
  1056. } FontNameRec;
  1057. typedef struct _FontScaled {
  1058.     FontScalableRec    vals;
  1059.     FontEntryPtr    bitmap;
  1060.     FontPtr        pFont;
  1061. } FontScaledRec;
  1062. typedef struct _FontScalableExtra {
  1063.     FontScalableRec    defaults;
  1064.     int            numScaled;
  1065.     int            sizeScaled;
  1066.     FontScaledPtr    scaled;
  1067.     pointer        private;
  1068. } FontScalableExtraRec;
  1069. typedef struct _FontScalableEntry {
  1070.     FontRendererPtr        renderer;
  1071.     char            *fileName;
  1072.     FontScalableExtraPtr   extra;
  1073. } FontScalableEntryRec;
  1074. typedef struct _FontScaleAliasEntry {
  1075.     char        *resolved;
  1076. } FontScaleAliasEntryRec;
  1077. typedef struct _FontBitmapEntry {
  1078.     FontRendererPtr    renderer;
  1079.     char        *fileName;
  1080.     FontPtr        pFont;
  1081. } FontBitmapEntryRec;
  1082. typedef struct _FontAliasEntry {
  1083.     char    *resolved;
  1084. } FontAliasEntryRec;
  1085. typedef struct _FontBCEntry {
  1086.     FontScalableRec        vals;
  1087.     FontEntryPtr        entry;
  1088. } FontBCEntryRec;
  1089. typedef struct _FontEntry {
  1090.     FontNameRec    name;
  1091.     int        type;
  1092.     union _FontEntryParts {
  1093.     FontScalableEntryRec    scalable;
  1094.     FontBitmapEntryRec    bitmap;
  1095.     FontAliasEntryRec    alias;
  1096.     FontBCEntryRec        bc;
  1097.     } u;
  1098. } FontEntryRec;
  1099. typedef struct _FontTable {
  1100.     int            used;
  1101.     int            size;
  1102.     FontEntryPtr    entries;
  1103.     Bool        sorted;
  1104. } FontTableRec;
  1105. typedef struct _FontDirectory {
  1106.     char        *directory;
  1107.     unsigned long   dir_mtime;
  1108.     unsigned long   alias_mtime;
  1109.     FontTableRec    scalable;
  1110.     FontTableRec    nonScalable;
  1111. } FontDirectoryRec;
  1112. typedef struct _FontRenderer {
  1113.     char    *fileSuffix;
  1114.     int        fileSuffixLen;
  1115.     int        (*OpenBitmap)( );
  1116.     int        (*OpenScalable)( );
  1117.     int        (*GetInfoBitmap)( );
  1118.     int        (*GetInfoScalable)( );
  1119.     int        number;
  1120. } FontRendererRec;
  1121. typedef struct _FontRenders {
  1122.     int            number;
  1123.     FontRendererPtr *renderers;
  1124. } FontRenderersRec, *FontRenderersPtr;
  1125. typedef struct _BitmapInstance {
  1126.     FontScalableRec    vals;
  1127.     FontBitmapEntryPtr    bitmap;
  1128. } BitmapInstanceRec, *BitmapInstancePtr;
  1129. typedef struct _BitmapScalablePrivate {
  1130.     int            numInstances;
  1131.     BitmapInstancePtr    instances;
  1132. } BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
  1133. typedef struct _BitmapSources {
  1134.     FontPathElementPtr    *fpe;
  1135.     int            size;
  1136.     int            count;
  1137. } BitmapSourcesRec, *BitmapSourcesPtr;
  1138. extern BitmapSourcesRec    FontFileBitmapSources;
  1139. extern    struct    _iobuf {
  1140.     int    _cnt;
  1141.     char    *_ptr;         
  1142.     char    *_base;         
  1143.     int    _bufsiz;
  1144.     short    _flag;
  1145.     char    _file;         
  1146. } _iob[];
  1147. struct _iobuf     *fopen();
  1148. struct _iobuf     *fdopen();
  1149. struct _iobuf     *freopen();
  1150. struct _iobuf     *popen();
  1151. long    ftell();
  1152. char    *fgets();
  1153. char    *gets();
  1154. typedef signed char fix7;
  1155. typedef   double   real;
  1156. typedef   unsigned char
  1157.                    ufix8,
  1158.                    boolean;
  1159. typedef   short    fix15;
  1160. typedef   unsigned short
  1161.                    ufix16;
  1162. typedef   long     fix31;
  1163. typedef   unsigned long
  1164.                    ufix32;
  1165. typedef
  1166. struct buff_tag
  1167.     {
  1168.     ufix8                      *org;                    
  1169.     ufix32  no_bytes;               
  1170.     } 
  1171. buff_t;                             
  1172. typedef  struct constr_tag
  1173.     {
  1174.     ufix8                      *org;                    
  1175.     ufix16  font_id;                
  1176.     fix15   xppo;                   
  1177.     fix15   yppo;                   
  1178.     boolean font_id_valid;          
  1179.     boolean data_valid;             
  1180.     boolean active;                 
  1181.     }                  
  1182. constr_t;                           
  1183. typedef  struct kern_tag
  1184.     {
  1185.     ufix8                      *tkorg;                  
  1186.     ufix8                      *pkorg;                  
  1187.     fix15   no_tracks;              
  1188.     fix15   no_pairs;               
  1189.     }                  
  1190. kern_t;                             
  1191. typedef struct specs_tag
  1192.     {
  1193.     buff_t                  *pfont;                  
  1194.     fix31   xxmult;                 
  1195.     fix31   xymult;                 
  1196.     fix31   xoffset;                
  1197.     fix31   yxmult;                 
  1198.     fix31   yymult;                 
  1199.     fix31   yoffset;                
  1200.     ufix32  flags;                  
  1201.     void *out_info;                 
  1202.     }
  1203. specs_t;                            
  1204. typedef struct tcb_tag
  1205.     {
  1206.     fix15   xxmult;                 
  1207.     fix15   xymult;                 
  1208.     fix31   xoffset;                
  1209.     fix15   yxmult;                 
  1210.     fix15   yymult;                 
  1211.     fix31   yoffset;                
  1212.     fix15   xppo;                   
  1213.     fix15   yppo;                   
  1214.     fix15   xpos;                   
  1215.     fix15   ypos;                   
  1216.     ufix16  xtype;                  
  1217.     ufix16  ytype;                  
  1218.     ufix16  xmode;                  
  1219.     ufix16  ymode;                  
  1220.     fix15  mirror;                 
  1221.     }
  1222. tcb_t;                              
  1223. typedef struct point_tag
  1224.     {
  1225.     fix15   x;                      
  1226.     fix15   y;                      
  1227.     }
  1228. point_t;                            
  1229. typedef struct band_tag
  1230.     {
  1231.     fix15   band_max;
  1232.     fix15   band_min;
  1233.     fix15   band_array_offset;
  1234.     fix15   band_floor;
  1235.     fix15   band_ceiling;
  1236.     } band_t;
  1237. typedef struct bbox_tag
  1238.     {
  1239.     fix31   xmin;
  1240.     fix31   xmax;
  1241.     fix31   ymin;
  1242.     fix31   ymax;
  1243.     } bbox_t;
  1244. typedef  ufix16   cdr_t;           
  1245. typedef struct speedo_global_data 
  1246.     {
  1247.          kern_t  kern;               
  1248.      point_t   Psw;              
  1249.          fix15  cb_offset;           
  1250.      point_t  P0;                
  1251.      fix15    x_orus;            
  1252.      fix15    y_orus;            
  1253.      fix15    x_pix;             
  1254.      fix15    y_pix;             
  1255.      ufix8    x_int;             
  1256.      ufix8    y_int;             
  1257.      band_t   y_band;            
  1258.      struct set_width_tag
  1259.         {
  1260.         fix31 x;
  1261.         fix31 y;
  1262.         } set_width;  
  1263.      boolean  first_pass;        
  1264.      boolean  extents_running;   
  1265.      fix15    x0_spxl;           
  1266.      fix15    y0_spxl;           
  1267.      fix15    y_pxl;             
  1268.      fix15    car[1000      ];  
  1269.      cdr_t    cdr[1000      ];  
  1270.          ufix8    inttype[1000      ];
  1271.          ufix8    leftedge;
  1272.          ufix16   fracpix;
  1273.      fix15    bmap_xmin;         
  1274.      fix15    bmap_xmax;         
  1275.      fix15    bmap_ymin;         
  1276.      fix15    bmap_ymax;         
  1277.      fix15    no_y_lists;        
  1278.      fix15    first_offset;      
  1279.      fix15    next_offset;       
  1280.      boolean  intercept_oflo;    
  1281.      fix15    xmin;              
  1282.      fix15    xmax;              
  1283.      fix15    ymin;              
  1284.      fix15    ymax;              
  1285.          fix15    no_x_lists;        
  1286.          band_t   x_band;            
  1287.          boolean  x_scan_active;     
  1288.          ufix16   key32;             
  1289.          ufix8    key4;              
  1290.          ufix8    key6;              
  1291.          ufix8    key7;              
  1292.          ufix8    key8;              
  1293.          buff_t   font;
  1294.          buff_t   *pfont;  
  1295.          fix31    font_buff_size;  
  1296.          ufix8                      *pchar_dir;  
  1297.          fix15    first_char_idx;  
  1298.          fix15    no_chars_avail;  
  1299.          fix15    orus_per_em;     
  1300.          fix15    metric_resolution;  
  1301.          tcb_t    tcb0;            
  1302.          boolean  specs_valid;     
  1303.          fix15    depth_adj;       
  1304.          boolean  curves_out;      
  1305.          fix15    output_mode;     
  1306.          fix15    thresh;          
  1307.          boolean  normal;          
  1308.          fix15    multshift;       
  1309.          fix15    pixshift;        
  1310.          fix15    poshift;         
  1311.          fix15    mpshift;         
  1312.          fix31    multrnd;         
  1313.          fix15    pixrnd;          
  1314.          fix31    mprnd;           
  1315.          fix15    pixfix;          
  1316.          fix15    onepix;          
  1317.          boolean (*init_out)();
  1318.          boolean (*begin_char)(); 
  1319.          void    (*begin_sub_char)();
  1320.          void    (*begin_contour)(); 
  1321.          void    (*curve)();         
  1322.          void    (*line)();               
  1323.          void    (*end_contour)(); 
  1324.          void    (*end_sub_char)();
  1325.          boolean (*end_char)();
  1326.          specs_t   *pspecs;     
  1327.          specs_t specs;                 
  1328.          ufix8                       *font_org;      
  1329.          ufix8                       *hdr2_org;      
  1330.          tcb_t    tcb;                  
  1331.          ufix8    Y_edge_org;           
  1332.          ufix8    Y_int_org;            
  1333.          fix31    rnd_xmin;             
  1334.          fix15    orus[ 256       ];    
  1335.          fix15    pix[ 256       ];     
  1336.          fix15    mult[  256       ];     
  1337.          fix31    offset[  256       ];   
  1338.          fix15    no_X_orus;               
  1339.          fix15    no_Y_orus;               
  1340.          ufix16   Y_constr_org;            
  1341.          constr_t constr;                  
  1342.          boolean  c_act[    750       ];       
  1343.          fix15    c_pix[    750       ];       
  1344.          boolean squeezing_compound;        
  1345.     fix31 clip_xmax;
  1346.     fix31 clip_ymax;
  1347.     fix31 clip_xmin;
  1348.     fix31 clip_ymin;
  1349.     } SPEEDO_GLOBALS;
  1350. extern  SPEEDO_GLOBALS   sp_globals;
  1351. boolean sp_make_char();           
  1352. ufix16  sp_get_char_id();         
  1353. fix31   sp_get_char_width();      
  1354. fix15   sp_get_track_kern();      
  1355. fix31   sp_get_pair_kern();       
  1356. boolean sp_get_char_bbox();
  1357. static boolean sp_make_simp_char();  
  1358. static boolean sp_make_comp_char();  
  1359. static ufix8                      *sp_get_char_org();    
  1360. static fix15   sp_get_posn_arg();    
  1361. static fix15   sp_get_scale_arg();   
  1362. ufix8                      *sp_read_bbox();               
  1363. void   sp_proc_outl_data();          
  1364. static void   sp_split_curve();             
  1365. static ufix8                      *sp_get_args();       
  1366. boolean sp_init_black();
  1367. boolean sp_begin_char_black();
  1368. void sp_begin_contour_black();
  1369. void sp_line_black();
  1370. boolean sp_end_char_black();
  1371. static void    sp_add_intercept_black();
  1372. static void    sp_proc_intercepts_black();
  1373. void sp_init_char_out();
  1374. void sp_begin_sub_char_out();
  1375. void sp_curve_out();
  1376. void sp_end_contour_out();
  1377. void sp_end_sub_char_out();
  1378. void sp_init_intercepts_out();
  1379. void sp_restart_intercepts_out();
  1380. void sp_set_first_band_out();
  1381. void sp_reduce_band_size_out();
  1382. boolean sp_next_band_out();
  1383. void sp_reset();                  
  1384. void sp_set_key();
  1385. ufix16 sp_get_cust_no();
  1386. boolean    sp_set_specs();        
  1387. void       sp_type_tcb();            
  1388. static void    sp_setup_tcb();       
  1389. static fix15 sp_setup_mult();        
  1390. static fix31 sp_setup_offset();      
  1391. static boolean sp_setup_consts();    
  1392. fix31   sp_read_long();       
  1393. fix15   sp_read_word_u();     
  1394. void    sp_init_tcb();               
  1395. void    sp_scale_tcb();              
  1396. ufix8                      *sp_plaid_tcb();              
  1397. ufix8                      *sp_skip_interpolation_table();
  1398. ufix8                      *sp_skip_control_zone();
  1399. static void sp_constr_update();      
  1400. ufix8                      *sp_read_oru_table();     
  1401. static ufix8                      *sp_setup_pix_table();    
  1402. static ufix8                      *sp_setup_int_table();    
  1403. void sp_open_bitmap();
  1404. void sp_set_bitmap_bits();
  1405. void sp_close_bitmap();
  1406. buff_t *sp_load_char_data();         
  1407. boolean sp_init_screen();         
  1408. boolean sp_begin_char_screen();       
  1409. void    sp_begin_contour_screen();    
  1410. void    sp_line_screen();             
  1411. void    sp_curve_screen();            
  1412. void sp_scan_curve_screen();
  1413. void sp_vert_line_screen();
  1414. void sp_end_contour_screen();
  1415. boolean sp_end_char_screen();         
  1416. static void    sp_add_intercept_screen();
  1417. static void    sp_proc_intercepts_screen();
  1418. boolean sp_init_outline();         
  1419. boolean sp_begin_char_outline();       
  1420. void    sp_begin_sub_char_outline();   
  1421. void    sp_begin_contour_outline();    
  1422. void    sp_curve_outline();            
  1423. void    sp_line_outline();             
  1424. void    sp_end_contour_outline();      
  1425. void    sp_end_sub_char_outline();     
  1426. boolean sp_end_char_outline();         
  1427. boolean sp_init_2d();        
  1428. boolean sp_begin_char_2d();      
  1429. void    sp_begin_contour_2d();   
  1430. void    sp_line_2d();            
  1431. boolean sp_end_char_2d();        
  1432. static void    sp_add_intercept_2d();
  1433. static void    sp_proc_intercepts_2d();
  1434. static void    sp_draw_vector_to_2d();
  1435. typedef struct _sp_master {
  1436.     FontEntryPtr    entry;     
  1437.     struct _iobuf        *fp;
  1438.     char       *fname;
  1439.     ufix8      *f_buffer;
  1440.     ufix8      *c_buffer;
  1441.     char       *copyright;
  1442.     ufix8      *key;
  1443.     buff_t      font;
  1444.     buff_t      char_data;
  1445.     ufix16      mincharsize;
  1446.     int         first_char_id;
  1447.     int         num_chars;
  1448.     int         max_id;
  1449.     int         state;         
  1450.     int         refcount;     
  1451.     int        *enc;
  1452.     int         enc_size;
  1453. }           SpeedoMasterFontRec, *SpeedoMasterFontPtr;
  1454. typedef struct _cur_font_stats {
  1455.     fsBitmapFormat format;
  1456.     ufix16      char_index;
  1457.     ufix16      char_id;
  1458.     fix15       bit_width,
  1459.                 bit_height;
  1460.     fix15       cur_y;
  1461.     int         bpr;
  1462.     fix15       last_y;
  1463.     int         trunc;
  1464.     pointer     bp;
  1465.     int         scanpad;
  1466. }           CurrentFontValuesRec, *CurrentFontValuesPtr;
  1467. typedef struct _sp_font {
  1468.     struct _sp_master *master;
  1469.     specs_t     specs;
  1470.     FontEntryPtr    entry;
  1471.     FontScalableRec vals;
  1472.     CharInfoPtr encoding;
  1473.     CharInfoPtr pDefault;
  1474.     pointer     bitmaps;
  1475. }           SpeedoFontRec, *SpeedoFontPtr;
  1476. extern SpeedoFontPtr cur_spf;
  1477. extern int  open_sp_font();
  1478. extern void close_sp_font();
  1479. extern void close_master_file();
  1480. extern void sp_reset_master();
  1481. extern void SpeedoErr();
  1482. extern void make_sp_standard_props();
  1483. extern void make_sp_header();
  1484. extern void compute_sp_bounds();
  1485. extern void compute_sp_props();
  1486. extern int  build_all_sp_bitmaps();
  1487. extern unsigned long compute_sp_data_size();
  1488. extern int  bics_map[];
  1489. extern int  bics_map_size;
  1490. enum scaleType {
  1491.     atom, pixel_size, point_size, resolution_x, resolution_y, average_width,
  1492.     scaledX, scaledY, unscaled, scaledXoverY, uncomputed
  1493. };
  1494. typedef struct _fontProp {
  1495.     char       *name;
  1496.     long        atom;
  1497.     enum scaleType type;
  1498. }           fontProp;
  1499. static fontProp fontNamePropTable[] = {
  1500.     "FOUNDRY", 0, atom,
  1501.     "FAMILY_NAME", 0, atom,
  1502.     "WEIGHT_NAME", 0, atom,
  1503.     "SLANT", 0, atom,
  1504.     "SETWIDTH_NAME", 0, atom,
  1505.     "ADD_STYLE_NAME", 0, atom,
  1506.     "PIXEL_SIZE", 0, pixel_size,
  1507.     "POINT_SIZE", 0, point_size,
  1508.     "RESOLUTION_X", 0, resolution_x,
  1509.     "RESOLUTION_Y", 0, resolution_y,
  1510.     "SPACING", 0, atom,
  1511.     "AVERAGE_WIDTH", 0, average_width,
  1512.     "CHARSET_REGISTRY", 0, atom,
  1513.     "CHARSET_ENCODING", 0, atom,
  1514. };
  1515. static fontProp extraProps[] = {
  1516.     "FONT", 0, atom,
  1517.     "COPYRIGHT", 0, atom,
  1518. };
  1519. void
  1520. make_sp_standard_props()
  1521. {
  1522.     int         i;
  1523.     fontProp   *t;
  1524.     i = sizeof(fontNamePropTable) / sizeof(fontProp);
  1525.     for (t = fontNamePropTable; i; i--, t++)
  1526.     t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), 1 );
  1527.     i = sizeof(extraProps) / sizeof(fontProp);
  1528.     for (t = extraProps; i; i--, t++)
  1529.     t->atom = MakeAtom(t->name, (unsigned) strlen(t->name), 1 );
  1530. }
  1531. void
  1532. make_sp_header(spf, pinfo)
  1533.     SpeedoFontPtr spf;
  1534.     FontInfoPtr pinfo;
  1535. {
  1536.     int         pixel_size;
  1537.     SpeedoMasterFontPtr spmf = spf->master;
  1538.     pinfo->firstCol = spmf->first_char_id & 0xff;
  1539.     pinfo->firstRow = spmf->first_char_id >> 8;
  1540.     pinfo->lastCol = spmf->max_id & 0xff;
  1541.     pinfo->lastRow = spmf->max_id >> 8;
  1542.     pinfo->defaultCh = 0;
  1543.     pinfo->inkMetrics = 0;
  1544.     pinfo->allExist = 0;
  1545.     pinfo->drawDirection = 0 ;
  1546.     pinfo->cachable = 1;
  1547.     pinfo->anamorphic = 0;
  1548.     if (spf->specs.xxmult != spf->specs.yymult)
  1549.     pinfo->anamorphic = 1 ;
  1550.     pixel_size = spf->vals.pixel * 120  / 100;
  1551.     pinfo->fontAscent = pixel_size * 764 / 1000;     
  1552.     pinfo->fontDescent = pixel_size - pinfo->fontAscent;
  1553. }
  1554. static void
  1555. adjust_min_max(minc, maxc, tmp)
  1556.     xCharInfo  *minc,
  1557.                *maxc,
  1558.                *tmp;
  1559. {
  1560.     if (minc->ascent > ( tmp)->ascent) minc->ascent = ( tmp)->ascent; if (maxc->ascent < ( tmp)->ascent) maxc->ascent = ( tmp)->ascent; ;
  1561.     if (minc->descent > ( tmp)->descent) minc->descent = ( tmp)->descent; if (maxc->descent < ( tmp)->descent) maxc->descent = ( tmp)->descent; ;
  1562.     if (minc->leftSideBearing > ( tmp)->leftSideBearing) minc->leftSideBearing = ( tmp)->leftSideBearing; if (maxc->leftSideBearing < ( tmp)->leftSideBearing) maxc->leftSideBearing = ( tmp)->leftSideBearing; ;
  1563.     if (minc->rightSideBearing > ( tmp)->rightSideBearing) minc->rightSideBearing = ( tmp)->rightSideBearing; if (maxc->rightSideBearing < ( tmp)->rightSideBearing) maxc->rightSideBearing = ( tmp)->rightSideBearing; ;
  1564.     if (minc->characterWidth > ( tmp)->characterWidth) minc->characterWidth = ( tmp)->characterWidth; if (maxc->characterWidth < ( tmp)->characterWidth) maxc->characterWidth = ( tmp)->characterWidth; ;
  1565. }
  1566. void
  1567. compute_sp_bounds(spf, pinfo, flags)
  1568.     SpeedoFontPtr spf;
  1569.     FontInfoPtr pinfo;
  1570.     unsigned long flags;
  1571. {
  1572.     int         i,
  1573.                 id,
  1574.                 index,
  1575.         maxOverlap,
  1576.         overlap;
  1577.     xCharInfo   minchar,
  1578.                 maxchar,
  1579.                 tmpchar;
  1580.     bbox_t      bbox;
  1581.     fix31       width;
  1582.     double      pix_width,
  1583.                 total_width = 0.0;
  1584.     SpeedoMasterFontPtr spmf = spf->master;
  1585.     int    firstChar;
  1586.     firstChar = spmf->first_char_id;
  1587.     minchar.ascent = minchar.descent =
  1588.     minchar.leftSideBearing = minchar.rightSideBearing =
  1589.     minchar.characterWidth = 32767;
  1590.     minchar.attributes = 0;
  1591.     maxchar.ascent = maxchar.descent =
  1592.     maxchar.leftSideBearing = maxchar.rightSideBearing =
  1593.     maxchar.characterWidth = -32767;
  1594.     maxchar.attributes = 0;
  1595.     maxOverlap = -32767;
  1596.     for (i = 0; i < spmf->num_chars; i++) {
  1597.     index = spmf->enc[i * 2 + 1];
  1598.     width = sp_get_char_width(index);
  1599.      
  1600.     pix_width = width * (spf->specs.xxmult / 65536L) +
  1601.         ((ufix32) width * ((ufix32) spf->specs.xxmult & 0xffff))
  1602.         / 65536L;
  1603.     width = (pix_width * 720L) / (spf->specs.yymult);
  1604.     pix_width /= 65536L;
  1605.     (void) sp_get_char_bbox(index, &bbox);
  1606.     bbox.ymax = (bbox.ymax + 32768L) >> 16;
  1607.     bbox.ymin = (bbox.ymin + 32768L) >> 16;
  1608.     bbox.xmin = (bbox.xmin + 32768L) >> 16;
  1609.     bbox.xmax = (bbox.xmax + 32768L) >> 16;
  1610.     tmpchar.ascent = bbox.ymax;
  1611.     tmpchar.descent = -bbox.ymin;
  1612.     tmpchar.leftSideBearing = bbox.xmin;
  1613.     tmpchar.rightSideBearing = bbox.xmax;
  1614.     tmpchar.characterWidth = (int) (pix_width + 0.5);     
  1615.     tmpchar.attributes = 0;
  1616.     adjust_min_max(&minchar, &maxchar, &tmpchar);
  1617.     overlap = tmpchar.rightSideBearing - tmpchar.characterWidth;
  1618.     if (maxOverlap < overlap)
  1619.         maxOverlap = overlap;
  1620.     total_width += pix_width;
  1621.     if (flags & 0x1 ) {
  1622.         id = spmf->enc[i * 2] - firstChar;
  1623.          ;
  1624.         spf->encoding[id].metrics = tmpchar;
  1625.     }
  1626.     }
  1627.     spf->vals.width = total_width / spmf->num_chars * 10;
  1628.     pinfo->maxbounds = maxchar;
  1629.     pinfo->minbounds = minchar;
  1630.     pinfo->ink_maxbounds = maxchar;
  1631.     pinfo->ink_minbounds = minchar;
  1632.     pinfo->maxOverlap = maxOverlap;
  1633. }
  1634. void
  1635. compute_sp_props(spf, fontname, pinfo)
  1636.     SpeedoFontPtr spf;
  1637.     char       *fontname;
  1638.     FontInfoPtr pinfo;
  1639. {
  1640.     FontPropPtr pp;
  1641.     int         i,
  1642.                 nprops;
  1643.     fontProp   *fpt;
  1644.     char       *is_str;
  1645.     char       *ptr1,
  1646.                *ptr2;
  1647.     nprops = pinfo->nprops = ((sizeof(fontNamePropTable) / sizeof(fontProp))  + (sizeof(extraProps) / sizeof(fontProp)) ) ;
  1648.     pinfo->isStringProp = (char *)   Xalloc ((unsigned) sizeof(char) * nprops) ;
  1649.     pinfo->props = (FontPropPtr)   Xalloc ((unsigned) sizeof(FontPropRec) * nprops) ;
  1650.     if (!pinfo->isStringProp || !pinfo->props) {
  1651.        Xfree ((pointer) pinfo->isStringProp) ;
  1652.     pinfo->isStringProp = (char *) 0;
  1653.        Xfree ((pointer) pinfo->props) ;
  1654.     pinfo->props = (FontPropPtr) 0;
  1655.     return;
  1656.     }
  1657.     bzero(pinfo->isStringProp, (sizeof(char) * nprops));
  1658.     ptr2 = fontname;
  1659.     for (i = (sizeof(fontNamePropTable) / sizeof(fontProp)) , pp = pinfo->props, fpt = fontNamePropTable,
  1660.         is_str = pinfo->isStringProp;
  1661.         i;
  1662.         i--, pp++, fpt++, is_str++) {
  1663.     ptr1 = ptr2 + 1;
  1664.     if (*ptr1 == '-')
  1665.         ptr2 = ptr1;
  1666.     else {
  1667.         if (i > 1)
  1668.         ptr2 = index(ptr1 + 1, '-');
  1669.         else
  1670.         ptr2 = index(ptr1 + 1, '\0');
  1671.     }
  1672.     pp->name = fpt->atom;
  1673.     switch (fpt->type) {
  1674.     case atom:
  1675.         *is_str = 1 ;
  1676.         pp->value = MakeAtom(ptr1, ptr2 - ptr1, 1 );
  1677.         break;
  1678.     case pixel_size:
  1679.         pp->value = spf->vals.pixel;
  1680.         break;
  1681.     case point_size:
  1682.         pp->value = spf->vals.point;
  1683.         break;
  1684.     case resolution_x:
  1685.         pp->value = spf->vals.x;
  1686.         break;
  1687.     case resolution_y:
  1688.         pp->value = spf->vals.y;
  1689.         break;
  1690.     case average_width:
  1691.         pp->value = spf->vals.width;
  1692.         break;
  1693.     }
  1694.     }
  1695.     for (i = 0, fpt = extraProps; i < (sizeof(extraProps) / sizeof(fontProp)) ; i++, is_str++, pp++, fpt++) {
  1696.     pp->name = fpt->atom;
  1697.     switch (i) {
  1698.     case 0 :
  1699.         *is_str = 1 ;
  1700.         pp->value = MakeAtom(fontname, strlen(fontname), 1 );
  1701.         break;
  1702.     case 1 :
  1703.         *is_str = 1 ;
  1704.         pp->value = MakeAtom(spf->master->copyright,
  1705.                  strlen(spf->master->copyright), 1 );
  1706.         break;
  1707.     }
  1708.     }
  1709. }
  1710. -------------------------------------------------------------
  1711.  
  1712. Good Luck!   ...Tim
  1713.  
  1714.           Tim Theisen           Systems Programmer
  1715. Internet: tim@cs.wisc.edu       Department of Computer Sciences
  1716.     UUCP: uwvax!tim             University of Wisconsin-Madison
  1717.    Phone: (608)262-0438         1210 West Dayton Street
  1718.      FAX: (608)262-9777         Madison, WI   53706
  1719.  
  1720.