Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

367 lines
7.0 KiB

  1. /*
  2. ** Copyright 1992, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. **
  17. */
  18. #include <stdlib.h>
  19. #include <setjmp.h>
  20. struct JumpBuffer {
  21. jmp_buf buf;
  22. };
  23. #define mysetjmp(x) setjmp((x)->buf)
  24. #define mylongjmp(x,y) longjmp((x)->buf, y)
  25. /* <<AT&T USL C++ Language System <3.0.1> 02/03/92>> */
  26. /* < ../core/bin.c++ > */
  27. void *__vec_new (void *, int , int , void *);
  28. void __vec_ct (void *, int , int , void *);
  29. void __vec_dt (void *, int , int , void *);
  30. void __vec_delete (void *, int , int , void *, int , int );
  31. typedef int (*__vptp)(void);
  32. struct __mptr {short d; short i; __vptp f; };
  33. typedef unsigned int size_t ;
  34. // extern void *malloc (size_t );
  35. // extern void free (void *);
  36. struct Buffer;
  37. struct Buffer {
  38. struct Buffer *next__6Buffer ;
  39. };
  40. struct Pool;
  41. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  42. struct Pool {
  43. struct Buffer *freelist__4Pool ;
  44. char *blocklist__4Pool [32];
  45. int nextblock__4Pool ;
  46. char *curblock__4Pool ;
  47. int buffersize__4Pool ;
  48. int nextsize__4Pool ;
  49. int nextfree__4Pool ;
  50. int initsize__4Pool ;
  51. char *name__4Pool ;
  52. int magic__4Pool ;
  53. };
  54. void __glgrow__4PoolFv (struct Pool *);
  55. struct PooledObj;
  56. struct PooledObj {
  57. char __W3__9PooledObj ;
  58. };
  59. typedef float REAL ;
  60. typedef void (*Pfvv )(void );
  61. typedef void (*Pfvf )(float *);
  62. typedef int (*cmpfunc )(void *, void *);
  63. typedef REAL Knot ;
  64. typedef REAL *Knot_ptr ;
  65. struct TrimVertex;
  66. struct PwlArc;
  67. struct PwlArc {
  68. char __W3__9PooledObj ;
  69. struct TrimVertex *pts__6PwlArc ;
  70. int npts__6PwlArc ;
  71. long type__6PwlArc ;
  72. };
  73. struct TrimVertex;
  74. struct TrimVertex {
  75. REAL param__10TrimVertex [2];
  76. long nuid__10TrimVertex ;
  77. };
  78. typedef struct TrimVertex *TrimVertex_p ;
  79. struct Bin;
  80. struct Arc;
  81. struct BezierArc;
  82. typedef struct Arc *Arc_ptr ;
  83. enum arc_side { arc_none = 0, arc_right = 1, arc_top = 2, arc_left = 3, arc_bottom = 4} ;
  84. struct Arc;
  85. struct Arc {
  86. char __W3__9PooledObj ;
  87. Arc_ptr prev__3Arc ;
  88. Arc_ptr next__3Arc ;
  89. Arc_ptr link__3Arc ;
  90. struct BezierArc *bezierArc__3Arc ;
  91. struct PwlArc *pwlArc__3Arc ;
  92. long type__3Arc ;
  93. long nuid__3Arc ;
  94. };
  95. extern int __glbezier_tag__3Arc ;
  96. extern int __glarc_tag__3Arc ;
  97. extern int __gltail_tag__3Arc ;
  98. struct Bin;
  99. struct Bin {
  100. struct Arc *head__3Bin ;
  101. struct Arc *current__3Bin ;
  102. };
  103. extern struct __mptr* __ptbl_vec_____core_bin_c_____ct_[];
  104. struct Bin *__gl__ct__3BinFv (struct Bin *__0this )
  105. {
  106. void *__1__Xp00uzigaiaa ;
  107. if (__0this || (__0this = (struct Bin *)( (__1__Xp00uzigaiaa = malloc ( (sizeof (struct Bin))) ), (__1__Xp00uzigaiaa ?(((void *)__1__Xp00uzigaiaa )):(((void *)__1__Xp00uzigaiaa )))) ))
  108. __0this ->
  109. head__3Bin = 0 ;
  110. return __0this ;
  111. }
  112. void __gl__dt__3BinFv (struct Bin *__0this ,
  113. int __0__free )
  114. { if (__0this ){
  115. ((void )0 );
  116. if (__0this )if (__0__free & 1)( (((void *)__0this )?( free ( ((void *)__0this )) , 0 ) :( 0 ) ))
  117. ;
  118. }
  119. }
  120. void __glremove_this_arc__3BinFP3Ar0 (struct Bin *__0this , Arc_ptr __1arc )
  121. {
  122. { { Arc_ptr *__1j ;
  123. __1j = (& __0this -> head__3Bin );
  124. for(;(((*__1j ))!= 0 )&& (((*__1j ))!= __1arc );__1j = (& ((*__1j ))-> link__3Arc )) ;
  125. if (((*__1j ))!= 0 ){
  126. if (((*__1j ))== __0this -> current__3Bin )
  127. __0this -> current__3Bin = ((*__1j ))-> link__3Arc ;
  128. ((*__1j ))= ((*__1j ))-> link__3Arc ;
  129. }
  130. }
  131. }
  132. }
  133. int __glnumarcs__3BinFv (struct Bin *__0this )
  134. {
  135. long __1count ;
  136. __1count = 0 ;
  137. { { Arc_ptr __1jarc ;
  138. struct Arc *__1__Xjarc00munkaiee ;
  139. __1jarc = ( (__0this -> current__3Bin = __0this -> head__3Bin ), ( (__1__Xjarc00munkaiee = __0this -> current__3Bin ), ( (__1__Xjarc00munkaiee ?( (__0this -> current__3Bin =
  140. __1__Xjarc00munkaiee -> link__3Arc ), 0 ) :( 0 ) ), __1__Xjarc00munkaiee ) ) ) ;
  141. for(;__1jarc ;__1jarc = ( (__1__Xjarc00munkaiee = __0this -> current__3Bin ), ( (__1__Xjarc00munkaiee ?( (__0this -> current__3Bin = __1__Xjarc00munkaiee -> link__3Arc ), 0 ) :( 0 )
  142. ), __1__Xjarc00munkaiee ) ) )
  143. __1count ++ ;
  144. return (int )__1count ;
  145. }
  146. }
  147. }
  148. void __glmarkall__3BinFv (struct Bin *);
  149. void __gladopt__3BinFv (struct Bin *__0this )
  150. {
  151. Arc_ptr __1orphan ;
  152. struct Arc *__1__Xjarc00aynkaiee ;
  153. __glmarkall__3BinFv ( __0this ) ;
  154. ;
  155. while (__1orphan = ( (__1__Xjarc00aynkaiee = __0this -> head__3Bin ), ( (__1__Xjarc00aynkaiee ?( (__0this -> head__3Bin = __1__Xjarc00aynkaiee -> link__3Arc ), 0 ) :(
  156. 0 ) ), __1__Xjarc00aynkaiee ) ) ){
  157. { { Arc_ptr __2parent ;
  158. __2parent = __1orphan -> next__3Arc ;
  159. for(;__2parent != __1orphan ;__2parent = __2parent -> next__3Arc ) {
  160. if (! ( (((struct Arc *)__2parent )-> type__3Arc & __glarc_tag__3Arc )) ){
  161. __1orphan ->
  162. link__3Arc = __2parent -> link__3Arc ;
  163. __2parent -> link__3Arc = __1orphan ;
  164. ( (((struct Arc *)__1orphan )-> type__3Arc &= (~ __glarc_tag__3Arc ))) ;
  165. break ;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. }
  172. void __glshow__3BinFPc (struct Bin *__0this , char *__1name )
  173. {
  174. }
  175. void __glmarkall__3BinFv (struct Bin *__0this )
  176. {
  177. { { Arc_ptr __1jarc ;
  178. struct Arc *__1__Xjarc00munkaiee ;
  179. __1jarc = ( (__0this -> current__3Bin = __0this -> head__3Bin ), ( (__1__Xjarc00munkaiee = __0this -> current__3Bin ), ( (__1__Xjarc00munkaiee ?( (__0this -> current__3Bin =
  180. __1__Xjarc00munkaiee -> link__3Arc ), 0 ) :( 0 ) ), __1__Xjarc00munkaiee ) ) ) ;
  181. for(;__1jarc ;__1jarc = ( (__1__Xjarc00munkaiee = __0this -> current__3Bin ), ( (__1__Xjarc00munkaiee ?( (__0this -> current__3Bin = __1__Xjarc00munkaiee -> link__3Arc ), 0 ) :( 0 )
  182. ), __1__Xjarc00munkaiee ) ) )
  183. ( (((struct Arc *)__1jarc )-> type__3Arc |= __glarc_tag__3Arc )) ;
  184. }
  185. }
  186. }
  187. void __gllistBezier__3BinFv (struct Bin *__0this )
  188. {
  189. { { Arc_ptr __1jarc ;
  190. struct Arc *__1__Xjarc00munkaiee ;
  191. __1jarc = ( (__0this -> current__3Bin = __0this -> head__3Bin ), ( (__1__Xjarc00munkaiee = __0this -> current__3Bin ), ( (__1__Xjarc00munkaiee ?( (__0this -> current__3Bin =
  192. __1__Xjarc00munkaiee -> link__3Arc ), 0 ) :( 0 ) ), __1__Xjarc00munkaiee ) ) ) ;
  193. for(;__1jarc ;__1jarc = ( (__1__Xjarc00munkaiee = __0this -> current__3Bin ), ( (__1__Xjarc00munkaiee ?( (__0this -> current__3Bin = __1__Xjarc00munkaiee -> link__3Arc ), 0 ) :( 0 )
  194. ), __1__Xjarc00munkaiee ) ) ) {
  195. if (( (((struct Arc *)__1jarc )-> type__3Arc & __glbezier_tag__3Arc )) ){
  196. ((void )0 );
  197. { struct TrimVertex *__3pts ;
  198. REAL __3s1 ;
  199. REAL __3t1 ;
  200. REAL __3s2 ;
  201. REAL __3t2 ;
  202. __3pts = __1jarc -> pwlArc__3Arc -> pts__6PwlArc ;
  203. __3s1 = ((__3pts [0 ]). param__10TrimVertex [0 ]);
  204. __3t1 = ((__3pts [0 ]). param__10TrimVertex [1 ]);
  205. __3s2 = ((__3pts [1 ]). param__10TrimVertex [0 ]);
  206. __3t2 = ((__3pts [1 ]). param__10TrimVertex [1 ]);
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. /* the end */