w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

splineutil2.c
Go to the documentation of this file.
1 /* Copyright (C) 2000-2008 by George Williams */
2 /*
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are met:
5 
6  * Redistributions of source code must retain the above copyright notice, this
7  * list of conditions and the following disclaimer.
8 
9  * Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12 
13  * The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15 
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 #include "pfaedit.h"
28 #include <math.h>
29 #include "ustring.h"
30 #include "chardata.h"
31 #include <unistd.h>
32 #include <time.h>
33 #include <stdlib.h>
34 
35 int new_em_size = 1000;
43 int snaptoint=0;
44 
45 /*#define DEBUG 1*/
46 
48  real d;
49 
50 #if 0 /* def FONTFORGE_CONFIG_USE_DOUBLE*/
51  if ( a==0 )
52 return( b>-1e-8 && b<1e-8 );
53  if ( b==0 )
54 return( a>-1e-8 && a<1e-8 );
55 
56  d = a/(1024*1024.);
57  if ( d<0 ) d = -d;
58 return( b>a-d && b<a+d );
59 #else /* For floats */
60  if ( a==0 )
61 return( b>-1e-5 && b<1e-5 );
62  if ( b==0 )
63 return( a>-1e-5 && a<1e-5 );
64 
65  d = a/(1024*64.);
66  if ( d<0 ) d = -d;
67 return( b>a-d && b<a+d );
68 #endif
69 }
70 
72 
73  if ( a-b<.001 && a-b>-.001 )
74 return( true );
75 return( false );
76 }
77 
79 
80  if ( a==0 ) {
81  if ( b<.0001 && b>-.0001 )
82 return( true );
83  } else if ( b==0 ) {
84  if ( a<.0001 && a>-.0001 )
85 return( true );
86  } else {
87  a /= b;
88  if ( a>=.95 && a<=1.05 )
89 return( true );
90  }
91 return( false );
92 }
93 
94 int RealWithin(real a,real b,real fudge) {
95 
96 return( b>=a-fudge && b<=a+fudge );
97 }
98 
99 int RealRatio(real a,real b,real fudge) {
100 
101  if ( b==0 )
102 return( RealWithin(a,b,fudge));
103 
104 return( RealWithin(a/b,1.0,fudge));
105 }
106 
107 static int MinMaxWithin(Spline *spline) {
108  extended dx, dy;
109  int which;
110  extended t1, t2;
111  extended w;
112  /* We know that this "spline" is basically one dimensional. As long as its*/
113  /* extrema are between the start and end points on that line then we can */
114  /* treat it as a line. If the extrema are way outside the line segment */
115  /* then it's a line that backtracks on itself */
116 
117  if ( (dx = spline->to->me.x - spline->from->me.x)<0 ) dx = -dx;
118  if ( (dy = spline->to->me.y - spline->from->me.y)<0 ) dy = -dy;
119  which = dx<dy;
120  SplineFindExtrema(&spline->splines[which],&t1,&t2);
121  if ( t1==-1 )
122 return( true );
123  w = ((spline->splines[which].a*t1 + spline->splines[which].b)*t1
124  + spline->splines[which].c)*t1 + spline->splines[which].d;
125  if ( RealNear(w, (&spline->to->me.x)[which]) || RealNear(w, (&spline->from->me.x)[which]) )
126  /* Close enough */;
127  else if ( (w<(&spline->to->me.x)[which] && w<(&spline->from->me.x)[which]) ||
128  (w>(&spline->to->me.x)[which] && w>(&spline->from->me.x)[which]) )
129 return( false ); /* Outside */
130 
131  w = ((spline->splines[which].a*t2 + spline->splines[which].b)*t2
132  + spline->splines[which].c)*t2 + spline->splines[which].d;
133  if ( RealNear(w, (&spline->to->me.x)[which]) || RealNear(w, (&spline->from->me.x)[which]) )
134  /* Close enough */;
135  else if ( (w<(&spline->to->me.x)[which] && w<(&spline->from->me.x)[which]) ||
136  (w>(&spline->to->me.x)[which] && w>(&spline->from->me.x)[which]) )
137 return( false ); /* Outside */
138 
139 return( true );
140 }
141 
143  double t1,t2, t3,t4;
144  int ret;
145 
146  if ( spline->knownlinear )
147 return( true );
148  if ( spline->knowncurved )
149 return( false );
150 
151  if ( spline->splines[0].a==0 && spline->splines[0].b==0 &&
152  spline->splines[1].a==0 && spline->splines[1].b==0 )
153 return( true );
154 
155  /* Something is linear if the control points lie on the line between the */
156  /* two base points */
157 
158  /* Vertical lines */
159  if ( RealNear(spline->from->me.x,spline->to->me.x) ) {
162  if ( ! ((spline->from->nextcp.y >= spline->from->me.y &&
163  spline->from->nextcp.y <= spline->to->me.y &&
164  spline->to->prevcp.y >= spline->from->me.y &&
165  spline->to->prevcp.y <= spline->to->me.y ) ||
166  (spline->from->nextcp.y <= spline->from->me.y &&
167  spline->from->nextcp.y >= spline->to->me.y &&
168  spline->to->prevcp.y <= spline->from->me.y &&
169  spline->to->prevcp.y >= spline->to->me.y )) )
171  /* Horizontal lines */
172  } else if ( RealNear(spline->from->me.y,spline->to->me.y) ) {
175  if ( ! ((spline->from->nextcp.x >= spline->from->me.x &&
176  spline->from->nextcp.x <= spline->to->me.x &&
177  spline->to->prevcp.x >= spline->from->me.x &&
178  spline->to->prevcp.x <= spline->to->me.x) ||
179  (spline->from->nextcp.x <= spline->from->me.x &&
180  spline->from->nextcp.x >= spline->to->me.x &&
181  spline->to->prevcp.x <= spline->from->me.x &&
182  spline->to->prevcp.x >= spline->to->me.x)) )
184  } else {
185  ret = true;
186  t1 = (spline->from->nextcp.y-spline->from->me.y)/(spline->to->me.y-spline->from->me.y);
187  t2 = (spline->from->nextcp.x-spline->from->me.x)/(spline->to->me.x-spline->from->me.x);
188  t3 = (spline->to->me.y-spline->to->prevcp.y)/(spline->to->me.y-spline->from->me.y);
189  t4 = (spline->to->me.x-spline->to->prevcp.x)/(spline->to->me.x-spline->from->me.x);
190  ret = (RealApprox(t1,t2) || (RealApprox(t1,0) && RealApprox(t2,0))) &&
191  (RealApprox(t3,t4) || (RealApprox(t3,0) && RealApprox(t4,0)));
192  if ( ret ) {
193  if ( t1<0 || t2<0 || t3<0 || t4<0 ||
194  t1>1 || t2>1 || t3>1 || t4>1 )
196  }
197  }
198  spline->knowncurved = !ret;
200  if ( ret ) {
201  /* A few places that if the spline is knownlinear then its splines[?] */
202  /* are linear. So give the linear version and not that suggested by */
203  /* the control points */
204  spline->splines[0].a = spline->splines[0].b = 0;
205  spline->splines[0].d = spline->from->me.x;
206  spline->splines[0].c = spline->to->me.x-spline->from->me.x;
207  spline->splines[1].a = spline->splines[1].b = 0;
208  spline->splines[1].d = spline->from->me.y;
209  spline->splines[1].c = spline->to->me.y-spline->from->me.y;
210  }
211 return( ret );
212 }
213 
215 
216  if ( spline->islinear )
217 return( true );
218  if ( SplineIsLinear(spline)) {
220  spline->from->nextcp = spline->from->me;
221  if ( spline->from->nonextcp && spline->from->noprevcp )
223  else if ( spline->from->pointtype == pt_curve || spline->from->pointtype == pt_hvcurve )
225  spline->to->prevcp = spline->to->me;
226  if ( spline->to->nonextcp && spline->to->noprevcp )
228  else if ( spline->to->pointtype == pt_curve || spline->to->pointtype == pt_hvcurve )
231  }
232 return( spline->islinear );
233 }
234 
236  TPoint *mid, int cnt, int order2) {
237  double vx, vy, slope;
238  int i;
239 
240  vx = to->me.x-from->me.x; vy = to->me.y-from->me.y;
241  if ( vx==0 && vy==0 ) {
242  for ( i=0; i<cnt; ++i )
243  if ( mid[i].x != from->me.x || mid[i].y != from->me.y )
244 return( NULL );
245  } else if ( fabs(vx)>fabs(vy) ) {
246  slope = vy/vx;
247  for ( i=0; i<cnt; ++i )
248  if ( !RealWithin(mid[i].y,from->me.y+slope*(mid[i].x-from->me.x),.7) )
249 return( NULL );
250  } else {
251  slope = vx/vy;
252  for ( i=0; i<cnt; ++i )
253  if ( !RealWithin(mid[i].x,from->me.x+slope*(mid[i].y-from->me.y),.7) )
254 return( NULL );
255  }
256  from->nonextcp = to->noprevcp = true;
257 return( SplineMake(from,to,order2) );
258 }
259 
260 /* Least squares tells us that:
261  | S(xi*ti^3) | | S(ti^6) S(ti^5) S(ti^4) S(ti^3) | | a |
262  | S(xi*ti^2) | = | S(ti^5) S(ti^4) S(ti^3) S(ti^2) | * | b |
263  | S(xi*ti) | | S(ti^4) S(ti^3) S(ti^2) S(ti) | | c |
264  | S(xi) | | S(ti^3) S(ti^2) S(ti) n | | d |
265  and the definition of a spline tells us:
266  | x1 | = | 1 1 1 1 | * (a b c d)
267  | x0 | = | 0 0 0 1 | * (a b c d)
268 So we're a bit over specified. Let's use the last two lines of least squares
269 and the 2 from the spline defn. So d==x0. Now we've got three unknowns
270 and only three equations...
271 
272 For order2 splines we've got
273  | S(xi*ti^2) | | S(ti^4) S(ti^3) S(ti^2) | | b |
274  | S(xi*ti) | = | S(ti^3) S(ti^2) S(ti) | * | c |
275  | S(xi) | | S(ti^2) S(ti) n | | d |
276  and the definition of a spline tells us:
277  | x1 | = | 1 1 1 | * (b c d)
278  | x0 | = | 0 0 1 | * (b c d)
279 =>
280  d = x0
281  b+c = x1-x0
282  S(ti^2)*b + S(ti)*c = S(xi)-n*x0
283  S(ti^2)*b + S(ti)*(x1-x0-b) = S(xi)-n*x0
284  [ S(ti^2)-S(ti) ]*b = S(xi)-S(ti)*(x1-x0) - n*x0
285 */
287  TPoint *mid, int cnt, BasePoint *nextcp, BasePoint *prevcp,
288  int order2) {
289  double tt, ttn;
290  int i, j, ret;
291  double vx[3], vy[3], m[3][3];
292  double ts[7], xts[4], yts[4];
293  BasePoint nres, pres;
294  int nrescnt=0, prescnt=0;
295  double nmin, nmax, pmin, pmax, test, ptest;
296  double bx, by, cx, cy;
297 
298  memset(&nres,0,sizeof(nres)); memset(&pres,0,sizeof(pres));
299 
300  /* Add the initial and end points */
301  ts[0] = 2; for ( i=1; i<7; ++i ) ts[i] = 1;
302  xts[0] = from->me.x+to->me.x; yts[0] = from->me.y+to->me.y;
303  xts[3] = xts[2] = xts[1] = to->me.x; yts[3] = yts[2] = yts[1] = to->me.y;
304  nmin = pmin = 0; nmax = pmax = (to->me.x-from->me.x)*(to->me.x-from->me.x)+(to->me.y-from->me.y)*(to->me.y-from->me.y);
305  for ( i=0; i<cnt; ++i ) {
306  xts[0] += mid[i].x;
307  yts[0] += mid[i].y;
308  ++ts[0];
309  tt = mid[i].t;
310  xts[1] += tt*mid[i].x;
311  yts[1] += tt*mid[i].y;
312  ts[1] += tt;
313  ts[2] += (ttn=tt*tt);
314  xts[2] += ttn*mid[i].x;
315  yts[2] += ttn*mid[i].y;
316  ts[3] += (ttn*=tt);
317  xts[3] += ttn*mid[i].x;
318  yts[3] += ttn*mid[i].y;
319  ts[4] += (ttn*=tt);
320  ts[5] += (ttn*=tt);
321  ts[6] += (ttn*=tt);
322 
323  test = (mid[i].x-from->me.x)*(to->me.x-from->me.x) + (mid[i].y-from->me.y)*(to->me.y-from->me.y);
324  if ( test<nmin ) nmin=test;
325  if ( test>nmax ) nmax=test;
326  test = (mid[i].x-to->me.x)*(from->me.x-to->me.x) + (mid[i].y-to->me.y)*(from->me.y-to->me.y);
327  if ( test<pmin ) pmin=test;
328  if ( test>pmax ) pmax=test;
329  }
330  pmin *= 1.2; pmax *= 1.2; nmin *= 1.2; nmax *= 1.2;
331 
332  for ( j=0; j<3; ++j ) {
333  if ( order2 ) {
334  if ( RealNear(ts[j+2],ts[j+1]) )
335  continue;
336  /* This produces really bad results!!!! But I don't see what I can do to improve it */
337  bx = (xts[j]-ts[j+1]*(to->me.x-from->me.x) - ts[j]*from->me.x) / (ts[j+2]-ts[j+1]);
338  by = (yts[j]-ts[j+1]*(to->me.y-from->me.y) - ts[j]*from->me.y) / (ts[j+2]-ts[j+1]);
339  cx = to->me.x-from->me.x-bx;
340  cy = to->me.y-from->me.y-by;
341 
342  nextcp->x = from->me.x + cx/2;
343  nextcp->y = from->me.y + cy/2;
344  *prevcp = *nextcp;
345  } else {
346  vx[0] = xts[j+1]-ts[j+1]*from->me.x;
347  vx[1] = xts[j]-ts[j]*from->me.x;
348  vx[2] = to->me.x-from->me.x; /* always use the defn of spline */
349 
350  vy[0] = yts[j+1]-ts[j+1]*from->me.y;
351  vy[1] = yts[j]-ts[j]*from->me.y;
352  vy[2] = to->me.y-from->me.y;
353 
354  m[0][0] = ts[j+4]; m[0][1] = ts[j+3]; m[0][2] = ts[j+2];
355  m[1][0] = ts[j+3]; m[1][1] = ts[j+2]; m[1][2] = ts[j+1];
356  m[2][0] = 1; m[2][1] = 1; m[2][2] = 1;
357 
358  /* Remove a terms from rows 0 and 1 */
359  vx[0] -= ts[j+4]*vx[2];
360  vy[0] -= ts[j+4]*vy[2];
361  m[0][0] = 0; m[0][1] -= ts[j+4]; m[0][2] -= ts[j+4];
362  vx[1] -= ts[j+3]*vx[2];
363  vy[1] -= ts[j+3]*vy[2];
364  m[1][0] = 0; m[1][1] -= ts[j+3]; m[1][2] -= ts[j+3];
365 
366  if ( fabs(m[1][1])<fabs(m[0][1]) ) {
367  double temp;
368  temp = vx[1]; vx[1] = vx[0]; vx[0] = temp;
369  temp = vy[1]; vy[1] = vy[0]; vy[0] = temp;
370  temp = m[1][1]; m[1][1] = m[0][1]; m[0][1] = temp;
371  temp = m[1][2]; m[1][2] = m[0][2]; m[0][2] = temp;
372  }
373  /* remove b terms from rows 0 and 2 (first normalize row 1 so m[1][1] is 1*/
374  vx[1] /= m[1][1];
375  vy[1] /= m[1][1];
376  m[1][2] /= m[1][1];
377  m[1][1] = 1;
378  vx[0] -= m[0][1]*vx[1];
379  vy[0] -= m[0][1]*vy[1];
380  m[0][2] -= m[0][1]*m[1][2]; m[0][1] = 0;
381  vx[2] -= m[2][1]*vx[1];
382  vy[2] -= m[2][1]*vy[1];
383  m[2][2] -= m[2][1]*m[1][2]; m[2][1] = 0;
384 
385  vx[0] /= m[0][2]; /* This is cx */
386  vy[0] /= m[0][2]; /* This is cy */
387  /*m[0][2] = 1;*/
388 
389  vx[1] -= m[1][2]*vx[0]; /* This is bx */
390  vy[1] -= m[1][2]*vy[0]; /* This is by */
391  /* m[1][2] = 0; */
392  vx[2] -= m[2][2]*vx[0]; /* This is ax */
393  vy[2] -= m[2][2]*vy[0]; /* This is ay */
394  /* m[2][2] = 0; */
395 
396  nextcp->x = from->me.x + vx[0]/3;
397  nextcp->y = from->me.y + vy[0]/3;
398  prevcp->x = nextcp->x + (vx[0]+vx[1])/3;
399  prevcp->y = nextcp->y + (vy[0]+vy[1])/3;
400  }
401 
402  test = (nextcp->x-from->me.x)*(to->me.x-from->me.x) +
403  (nextcp->y-from->me.y)*(to->me.y-from->me.y);
404  ptest = (prevcp->x-to->me.x)*(from->me.x-to->me.x) +
405  (prevcp->y-to->me.y)*(from->me.y-to->me.y);
406  if ( order2 &&
407  (test<nmin || test>nmax || ptest<pmin || ptest>pmax))
408  continue;
409  if ( test>=nmin && test<=nmax ) {
410  nres.x += nextcp->x; nres.y += nextcp->y;
411  ++nrescnt;
412  }
413  if ( test>=pmin && test<=pmax ) {
414  pres.x += prevcp->x; pres.y += prevcp->y;
415  ++prescnt;
416  }
417  if ( nrescnt==1 && prescnt==1 )
418  break;
419  }
420 
421  ret = 0;
422  if ( nrescnt>0 ) {
423  ret |= 1;
424  nextcp->x = nres.x/nrescnt;
425  nextcp->y = nres.y/nrescnt;
426  } else
427  *nextcp = from->nextcp;
428  if ( prescnt>0 ) {
429  ret |= 2;
430  prevcp->x = pres.x/prescnt;
431  prevcp->y = pres.y/prescnt;
432  } else
433  *prevcp = to->prevcp;
434  if ( order2 && ret!=3 ) {
435  nextcp->x = (nextcp->x + prevcp->x)/2;
436  nextcp->y = (nextcp->y + prevcp->y)/2;
437  }
438  if ( order2 )
439  *prevcp = *nextcp;
440 return( ret );
441 }
442 
444  BasePoint off, cpoff, cpoff2;
445  double len, co, co2;
446 
447  /* Did we make a line? */
448  off.x = to->me.x-from->me.x; off.y = to->me.y-from->me.y;
449  len = sqrt(off.x*off.x + off.y*off.y);
450  if ( len!=0 ) {
451  off.x /= len; off.y /= len;
452  cpoff.x = from->nextcp.x-from->me.x; cpoff.y = from->nextcp.y-from->me.y;
453  len = sqrt(cpoff.x*cpoff.x + cpoff.y*cpoff.y);
454  if ( len!=0 ) {
455  cpoff.x /= len; cpoff.y /= len;
456  }
457  cpoff2.x = to->prevcp.x-from->me.x; cpoff2.y = to->prevcp.y-from->me.y;
458  len = sqrt(cpoff2.x*cpoff2.x + cpoff2.y*cpoff2.y);
459  if ( len!=0 ) {
460  cpoff2.x /= len; cpoff2.y /= len;
461  }
462  co = cpoff.x*off.y - cpoff.y*off.x; co2 = cpoff2.x*off.y - cpoff2.y*off.x;
463  if ( co<.05 && co>-.05 && co2<.05 && co2>-.05 ) {
464  from->nextcp = from->me; from->nonextcp = true;
465  to->prevcp = to->me; to->noprevcp = true;
466  } else {
467  Spline temp;
468  memset(&temp,0,sizeof(temp));
469  temp.from = from; temp.to = to;
471  if ( SplineIsLinear(&temp)) {
472  from->nextcp = from->me; from->nonextcp = true;
473  to->prevcp = to->me; to->noprevcp = true;
474  }
475  }
476  }
477 }
478 
479 /* Find a spline which best approximates the list of intermediate points we */
480 /* are given. No attempt is made to fix the slopes */
482  TPoint *mid, int cnt, int order2) {
483  int ret;
484  Spline *spline;
485  BasePoint nextcp, prevcp;
486 
487  if ( (spline = IsLinearApprox(from,to,mid,cnt,order2))!=NULL )
488 return( spline );
489 
490  ret = _ApproximateSplineFromPoints(from,to,mid,cnt,&nextcp,&prevcp,order2);
491 
492  if ( ret&1 ) {
493  from->nextcp = nextcp;
494  from->nonextcp = false;
495  } else {
496  from->nextcp = from->me;
497  from->nonextcp = true;
498  }
499  if ( ret&2 ) {
500  to->prevcp = prevcp;
501  to->noprevcp = false;
502  } else {
503  to->prevcp = to->me;
504  to->noprevcp = true;
505  }
506  TestForLinear(from,to);
507  spline = SplineMake(from,to,order2);
508 return( spline );
509 }
510 
511 static double ClosestSplineSolve(Spline1D *sp,double sought,double close_to_t) {
512  /* We want to find t so that spline(t) = sought */
513  /* find the value which is closest to close_to_t */
514  /* on error return closetot */
515  Spline1D temp;
516  extended ts[3];
517  int i;
518  double t, best, test;
519 
520  temp = *sp;
521  temp.d -= sought;
522  CubicSolve(&temp,ts);
523  best = 9e20; t= close_to_t;
524  for ( i=0; i<3; ++i ) if ( ts[i]!=-1 ) {
525  if ( (test=ts[i]-close_to_t)<0 ) test = -test;
526  if ( test<best ) {
527  best = test;
528  t = ts[i];
529  }
530  }
531 
532 return( t );
533 }
534 
535 struct dotbounds {
538  double len;
539  double min,max; /* If min<0 || max>len the spline extends beyond its endpoints */
540 };
541 
542 static double SigmaDeltas(Spline *spline,TPoint *mid, int cnt, DBounds *b, struct dotbounds *db) {
543  int i, lasti;
544  double xdiff, ydiff, sum, temp, t, lastt;
545  SplinePoint *to = spline->to, *from = spline->from;
546  extended ts[2], x,y;
547  struct dotbounds db2;
548  double dot;
549 
550  if ( (xdiff = to->me.x-from->me.x)<0 ) xdiff = -xdiff;
551  if ( (ydiff = to->me.y-from->me.y)<0 ) ydiff = -ydiff;
552 
553  sum = 0; lastt = -1; lasti = -1;
554  for ( i=0; i<cnt; ++i ) {
555  if ( ydiff>2*xdiff ) {
556  t = ClosestSplineSolve(&spline->splines[1],mid[i].y,mid[i].t);
557  } else if ( xdiff>2*ydiff ) {
558  t = ClosestSplineSolve(&spline->splines[0],mid[i].x,mid[i].t);
559  } else {
560  t = (ClosestSplineSolve(&spline->splines[1],mid[i].y,mid[i].t) +
561  ClosestSplineSolve(&spline->splines[0],mid[i].x,mid[i].t))/2;
562  }
563  if ( t==lastt ) /* These last* values appear to be debugging */
564  t = lastt + (mid[i].t - mid[lasti].t);
565  else {
566  lastt = t;
567  lasti = i;
568  }
569  temp = mid[i].x - ( ((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c)*t + spline->splines[0].d );
570  sum += temp*temp;
571  temp = mid[i].y - ( ((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c)*t + spline->splines[1].d );
572  sum += temp*temp;
573  }
574 
575  /* Ok, we've got distances from a set of points on the old spline to the */
576  /* new one. Let's do the reverse: find the extrema of the new and see how*/
577  /* close they get to the bounding box of the old */
578  /* And get really unhappy if the spline extends beyond the end-points */
579  db2.min = 0; db2.max = db->len;
580  SplineFindExtrema(&spline->splines[0],&ts[0],&ts[1]);
581  for ( i=0; i<2; ++i ) {
582  if ( ts[i]!=-1 ) {
583  x = ((spline->splines[0].a*ts[i]+spline->splines[0].b)*ts[i]+spline->splines[0].c)*ts[i] + spline->splines[0].d;
584  y = ((spline->splines[1].a*ts[i]+spline->splines[1].b)*ts[i]+spline->splines[1].c)*ts[i] + spline->splines[1].d;
585  if ( x<b->minx )
586  sum += (x-b->minx)*(x-b->minx);
587  else if ( x>b->maxx )
588  sum += (x-b->maxx)*(x-b->maxx);
589  dot = (x-db->base.x)*db->unit.x + (y-db->base.y)*db->unit.y;
590  if ( dot<db2.min ) db2.min = dot;
591  if ( dot>db2.max ) db2.max = dot;
592  }
593  }
594  SplineFindExtrema(&spline->splines[1],&ts[0],&ts[1]);
595  for ( i=0; i<2; ++i ) {
596  if ( ts[i]!=-1 ) {
597  x = ((spline->splines[0].a*ts[i]+spline->splines[0].b)*ts[i]+spline->splines[0].c)*ts[i] + spline->splines[0].d;
598  y = ((spline->splines[1].a*ts[i]+spline->splines[1].b)*ts[i]+spline->splines[1].c)*ts[i] + spline->splines[1].d;
599  if ( y<b->miny )
600  sum += (y-b->miny)*(y-b->miny);
601  else if ( y>b->maxy )
602  sum += (y-b->maxy)*(y-b->maxy);
603  dot = (x-db->base.x)*db->unit.x + (y-db->base.y)*db->unit.y;
604  if ( dot<db2.min ) db2.min = dot;
605  if ( dot>db2.max ) db2.max = dot;
606  }
607  }
608 
609  /* Big penalty for going beyond the range of the desired spline */
610  if ( db->min==0 && db2.min<0 )
611  sum += 10000 + db2.min*db2.min;
612  else if ( db2.min<db->min )
613  sum += 100 + (db2.min-db->min)*(db2.min-db->min);
614  if ( db->max==db->len && db2.max>db->len )
615  sum += 10000 + (db2.max-db->max)*(db2.max-db->max);
616  else if ( db2.max>db->max )
617  sum += 100 + (db2.max-db->max)*(db2.max-db->max);
618 
619 return( sum );
620 }
621 
622 static void ApproxBounds(DBounds *b,TPoint *mid, int cnt, struct dotbounds *db) {
623  int i;
624  double dot;
625 
626  b->minx = b->maxx = mid[0].x;
627  b->miny = b->maxy = mid[0].y;
628  db->min = 0; db->max = db->len;
629  for ( i=1; i<cnt; ++i ) {
630  if ( mid[i].x>b->maxx ) b->maxx = mid[i].x;
631  if ( mid[i].x<b->minx ) b->minx = mid[i].x;
632  if ( mid[i].y>b->maxy ) b->maxy = mid[i].y;
633  if ( mid[i].y<b->miny ) b->miny = mid[i].y;
634  dot = (mid[i].x-db->base.x)*db->unit.x + (mid[i].y-db->base.y)*db->unit.y;
635  if ( dot<db->min ) db->min = dot;
636  if ( dot>db->max ) db->max = dot;
637  }
638 }
639 
640 static int GoodCurve(SplinePoint *sp, int check_prev ) {
641  double dx, dy, lenx, leny;
642 
643  if ( sp->pointtype!=pt_curve && sp->pointtype!=pt_hvcurve )
644 return( false );
645  if ( check_prev ) {
646  dx = sp->me.x - sp->prevcp.x;
647  dy = sp->me.y - sp->prevcp.y;
648  } else {
649  dx = sp->me.x - sp->nextcp.x;
650  dy = sp->me.y - sp->nextcp.y;
651  }
652  /* If the cp is very close to the base point the point might as well be a corner */
653  if ( dx<0 ) dx = -dx;
654  if ( dy<0 ) dy = -dy;
655  if ( dx+dy<1 )
656 return( false );
657 
658  if ( check_prev ) {
659  if ( sp->prev==NULL )
660 return( true );
661  lenx = sp->me.x - sp->prev->from->me.x;
662  leny = sp->me.y - sp->prev->from->me.y;
663  } else {
664  if ( sp->next==NULL )
665 return( true );
666  lenx = sp->me.x - sp->next->to->me.x;
667  leny = sp->me.y - sp->next->to->me.y;
668  }
669  if ( lenx<0 ) lenx = -lenx;
670  if ( leny<0 ) leny = -leny;
671  if ( 50*(dx+dy) < lenx+leny )
672 return( false );
673 
674 return( true );
675 }
676 
677 #if 0
678 static int totcnt_cnt, nocnt_cnt, incr_cnt, curdiff_cnt;
679 #endif
680 
681 /* I used to do a least squares aproach adding two more to the above set of equations */
682 /* which held the slopes constant. But that didn't work very well. So instead*/
683 /* Then I tried doing the approximation, and then forcing the control points */
684 /* to be in line (witht the original slopes), getting a better approximation */
685 /* to "t" for each data point and then calculating an error array, approximating*/
686 /* it, and using that to fix up the final result */
687 /* Then I tried checking various possible cp lengths in the desired directions*/
688 /* finding the best one or two, and doing a 2D binary search using that as a */
689 /* starting point. */
690 /* And sometimes a least squares approach will give us the right answer, so */
691 /* try that too. */
692 /* This still isn't as good as I'd like it... But I haven't been able to */
693 /* improve it further yet */
694 #define TRY_CNT 2
695 #define DECIMATION 5
697  TPoint *mid, int cnt, int order2) {
698  BasePoint tounit, fromunit, ftunit;
699  double flen,tlen,ftlen;
700  Spline *spline, temp;
701  BasePoint nextcp;
702  int bettern, betterp;
703  double offn, offp, incrn, incrp, trylen;
704  int nocnt = 0, totcnt;
705  double curdiff, bestdiff[TRY_CNT];
706  int i,j,besti[TRY_CNT],bestj[TRY_CNT],k,l;
707  double fdiff, tdiff, fmax, tmax, fdotft, tdotft;
708  DBounds b;
709  struct dotbounds db;
710  double offn_, offp_, finaldiff;
711 
712  /* If all the selected points are at the same spot, and one of the */
713  /* end-points is also at that spot, then just copy the control point */
714  /* But our caller seems to have done that for us */
715 
716  /* If the two end-points are corner points then allow the slope to vary */
717  /* Or if one end-point is a tangent but the point defining the tangent's */
718  /* slope is being removed then allow the slope to vary */
719  /* Except if the slope is horizontal or vertical then keep it fixed */
720  if ( ( !from->nonextcp && ( from->nextcp.x==from->me.x || from->nextcp.y==from->me.y)) ||
721  (!to->noprevcp && ( to->prevcp.x==to->me.x || to->prevcp.y==to->me.y)) )
722  /* Preserve the slope */;
723  else if ( ((from->pointtype == pt_corner && from->nonextcp) ||
724  (from->pointtype == pt_tangent &&
725  ((from->nonextcp && from->noprevcp) || !from->noprevcp))) &&
726  ((to->pointtype == pt_corner && to->noprevcp) ||
727  (to->pointtype == pt_tangent &&
728  ((to->nonextcp && to->noprevcp) || !to->nonextcp))) ) {
729  from->pointtype = to->pointtype = pt_corner;
730 return( ApproximateSplineFromPoints(from,to,mid,cnt,order2) );
731  }
732 
733  /* If we are going to honour the slopes of a quadratic spline, there is */
734  /* only one possibility */
735  if ( order2 ) {
736  if ( from->nonextcp )
737  from->nextcp = from->next->to->me;
738  if ( to->noprevcp )
739  to->prevcp = to->prev->from->me;
740  from->nonextcp = to->noprevcp = false;
741  fromunit.x = from->nextcp.x-from->me.x; fromunit.y = from->nextcp.y-from->me.y;
742  tounit.x = to->prevcp.x-to->me.x; tounit.y = to->prevcp.y-to->me.y;
743 
744  if ( !IntersectLines(&nextcp,&from->nextcp,&from->me,&to->prevcp,&to->me) ||
745  (nextcp.x-from->me.x)*fromunit.x + (nextcp.y-from->me.y)*fromunit.y < 0 ||
746  (nextcp.x-to->me.x)*tounit.x + (nextcp.y-to->me.y)*tounit.y < 0 ) {
747  /* If the slopes don't intersect then use a line */
748  /* (or if the intersection is patently absurd) */
749  from->nonextcp = to->noprevcp = true;
750  from->nextcp = from->me;
751  to->prevcp = to->me;
752  TestForLinear(from,to);
753  } else {
754  from->nextcp = to->prevcp = nextcp;
755  from->nonextcp = to->noprevcp = false;
756  }
757 return( SplineMake2(from,to));
758  }
759  /* From here down we are only working with cubic splines */
760 
761  if ( cnt==0 ) {
762  /* Just use what we've got, no data to improve it */
763  /* But we do sometimes get some cps which are too big */
764  double len = sqrt((to->me.x-from->me.x)*(to->me.x-from->me.x) + (to->me.y-from->me.y)*(to->me.y-from->me.y));
765  if ( len==0 ) {
766  from->nonextcp = to->noprevcp = true;
767  from->nextcp = from->me;
768  to->prevcp = to->me;
769  } else {
770  BasePoint noff, poff;
771  double nlen, plen;
772  noff.x = from->nextcp.x-from->me.x; noff.y = from->nextcp.y-from->me.y;
773  poff.x = to->me.x-to->prevcp.x; poff.y = to->me.y-to->prevcp.y;
774  nlen = sqrt(noff.x*noff.x + noff.y+noff.y);
775  plen = sqrt(poff.x*poff.x + poff.y+poff.y);
776  if ( nlen>len/3 ) {
777  noff.x *= len/3/nlen; noff.y *= len/3/nlen;
778  from->nextcp.x = from->me.x + noff.x;
779  from->nextcp.y = from->me.y + noff.y;
780  }
781  if ( plen>len/3 ) {
782  poff.x *= len/3/plen; poff.y *= len/3/plen;
783  to->prevcp.x = to->me.x + poff.x;
784  to->prevcp.y = to->me.y + poff.y;
785  }
786  }
787 return( SplineMake3(from,to));
788  }
789 
790  if ( to->prev!=NULL && (( to->noprevcp && to->nonextcp ) || to->prev->knownlinear )) {
791  tounit.x = to->prev->from->me.x-to->me.x; tounit.y = to->prev->from->me.y-to->me.y;
792  } else if ( !to->noprevcp || to->pointtype == pt_corner ) {
793  tounit.x = to->prevcp.x-to->me.x; tounit.y = to->prevcp.y-to->me.y;
794  } else {
795  tounit.x = to->me.x-to->nextcp.x; tounit.y = to->me.y-to->nextcp.y;
796  }
797  tlen = sqrt(tounit.x*tounit.x + tounit.y*tounit.y);
798  if ( from->next!=NULL && (( from->noprevcp && from->nonextcp ) || from->next->knownlinear) ) {
799  fromunit.x = from->next->to->me.x-from->me.x; fromunit.y = from->next->to->me.y-from->me.y;
800  } else if ( !from->nonextcp || from->pointtype == pt_corner ) {
801  fromunit.x = from->nextcp.x-from->me.x; fromunit.y = from->nextcp.y-from->me.y;
802  } else {
803  fromunit.x = from->me.x-from->prevcp.x; fromunit.y = from->me.y-from->prevcp.y;
804  }
805  flen = sqrt(fromunit.x*fromunit.x + fromunit.y*fromunit.y);
806  if ( tlen==0 || flen==0 ) {
807  if ( from->next!=NULL )
808  temp = *from->next;
809  else {
810  memset(&temp,0,sizeof(temp));
811  temp.from = from; temp.to = to;
813  from->next = to->prev = NULL;
814  }
815  }
816  if ( tlen==0 ) {
817  if ( (to->pointtype==pt_curve || to->pointtype==pt_hvcurve) &&
818  to->next && !to->nonextcp ) {
819  tounit.x = to->me.x-to->nextcp.x; tounit.y = to->me.y-to->nextcp.y;
820 /* Doesn't work
821  } else if ( to->pointtype==pt_tangent && to->next ) {
822  tounit.x = to->me.x-to->next->to->me.x; tounit.y = to->me.y-to->next->to->me.y;
823 */
824  } else {
825  tounit.x = -( (3*temp.splines[0].a*.9999+2*temp.splines[0].b)*.9999+temp.splines[0].c );
826  tounit.y = -( (3*temp.splines[1].a*.9999+2*temp.splines[1].b)*.9999+temp.splines[1].c );
827  }
828  tlen = sqrt(tounit.x*tounit.x + tounit.y*tounit.y);
829  }
830  tounit.x /= tlen; tounit.y /= tlen;
831 
832  if ( flen==0 ) {
833  if ( (from->pointtype==pt_curve || from->pointtype==pt_hvcurve) &&
834  from->prev && !from->noprevcp ) {
835  fromunit.x = from->me.x-from->prevcp.x; fromunit.y = from->me.y-from->prevcp.y;
836 /*
837  } else if ( from->pointtype==pt_tangent && from->prev ) {
838  fromunit.x = from->me.x-from->prev->from->me.x; fromunit.y = from->me.y-from->prev->from->me.y;
839 */
840  } else {
841  fromunit.x = ( (3*temp.splines[0].a*.0001+2*temp.splines[0].b)*.0001+temp.splines[0].c );
842  fromunit.y = ( (3*temp.splines[1].a*.0001+2*temp.splines[1].b)*.0001+temp.splines[1].c );
843  }
844  flen = sqrt(fromunit.x*fromunit.x + fromunit.y*fromunit.y);
845  }
846  fromunit.x /= flen; fromunit.y /= flen;
847 
848  trylen = (to->me.x-from->me.x)*fromunit.x + (to->me.y-from->me.y)*fromunit.y;
849  if ( trylen>flen ) flen = trylen;
850 
851  trylen = (from->me.x-to->me.x)*tounit.x + (from->me.y-to->me.y)*tounit.y;
852  if ( trylen>tlen ) tlen = trylen;
853 
854  ftunit.x = (to->me.x-from->me.x); ftunit.y = (to->me.y-from->me.y);
855  ftlen = sqrt(ftunit.x*ftunit.x + ftunit.y*ftunit.y);
856  if ( ftlen!=0 ) {
857  ftunit.x /= ftlen; ftunit.y /= ftlen;
858  }
859  fdotft = fromunit.x*ftunit.x + fromunit.y*ftunit.y;
860  fmax = fdotft>0 ? ftlen/fdotft : 1e10;
861  tdotft = -tounit.x*ftunit.x - tounit.y*ftunit.y;
862  tmax = tdotft>0 ? ftlen/tdotft : 1e10;
863  /* At fmax, tmax the control points will stretch beyond the other endpoint*/
864  /* when projected along the line between the two endpoints */
865 
866  db.base = from->me;
867  db.unit.x = (to->me.x-from->me.x); db.unit.y = (to->me.y-from->me.y);
868  db.len = sqrt(db.unit.x*db.unit.x + db.unit.y*db.unit.y);
869  if ( db.len!=0 ) {
870  db.unit.x /= db.len;
871  db.unit.y /= db.len;
872  }
873  ApproxBounds(&b,mid,cnt,&db);
874 
875  for ( k=0; k<TRY_CNT; ++k ) {
876  bestdiff[k] = 1e20;
877  besti[k] = -1; bestj[k] = -1;
878  }
879  fdiff = flen/DECIMATION;
880  tdiff = tlen/DECIMATION;
881  from->nextcp = from->me;
882  from->nonextcp = false;
883  to->noprevcp = false;
884  memset(&temp,0,sizeof(Spline));
885  temp.from = from; temp.to = to;
886  for ( i=1; i<DECIMATION; ++i ) {
887  from->nextcp.x += fdiff*fromunit.x; from->nextcp.y += fdiff*fromunit.y;
888  to->prevcp = to->me;
889  for ( j=1; j<DECIMATION; ++j ) {
890  to->prevcp.x += tdiff*tounit.x; to->prevcp.y += tdiff*tounit.y;
892  curdiff = SigmaDeltas(&temp,mid,cnt,&b,&db);
893  for ( k=0; k<TRY_CNT; ++k ) {
894  if ( curdiff<bestdiff[k] ) {
895  for ( l=TRY_CNT-1; l>k; --l ) {
896  bestdiff[l] = bestdiff[l-1];
897  besti[l] = besti[l-1];
898  bestj[l] = bestj[l-1];
899  }
900  bestdiff[k] = curdiff;
901  besti[k] = i; bestj[k]=j;
902  break;
903  }
904  }
905  }
906  }
907 
908  finaldiff = 1e20;
909  offn_ = offp_ = -1;
910  spline = SplineMake(from,to,false);
911  for ( k=-1; k<TRY_CNT; ++k ) {
912  if ( k<0 ) {
913  BasePoint nextcp, prevcp;
914  double temp1, temp2;
915  int ret = _ApproximateSplineFromPoints(from,to,mid,cnt,&nextcp,&prevcp,false);
916  /* sometimes least squares gives us the right answer */
917  if ( !(ret&1) || !(ret&2))
918  continue;
919  temp1 = (prevcp.x-to->me.x)*tounit.x + (prevcp.y-to->me.y)*tounit.y;
920  temp2 = (nextcp.x-from->me.x)*fromunit.x + (nextcp.y-from->me.y)*fromunit.y;
921  if ( temp1<=0 || temp2<=0 ) /* A nice solution... but the control points are diametrically opposed to what they should be */
922  continue;
923  tlen = temp1; flen = temp2;
924  } else {
925  if ( bestj[k]<0 || besti[k]<0 )
926  continue;
927  tlen = bestj[k]*tdiff; flen = besti[k]*fdiff;
928  }
929  to->prevcp.x = to->me.x + tlen*tounit.x; to->prevcp.y = to->me.y + tlen*tounit.y;
930  from->nextcp.x = from->me.x + flen*fromunit.x; from->nextcp.y = from->me.y + flen*fromunit.y;
932 
933  bettern = betterp = false;
934  incrn = tdiff/2.0; incrp = fdiff/2.0;
935  offn = flen; offp = tlen;
936  nocnt = 0;
937  curdiff = SigmaDeltas(spline,mid,cnt,&b,&db);
938  totcnt = 0;
939  forever {
940  double fadiff, fsdiff;
941  double tadiff, tsdiff;
942 
943  from->nextcp.x = from->me.x + (offn+incrn)*fromunit.x; from->nextcp.y = from->me.y + (offn+incrn)*fromunit.y;
944  to->prevcp.x = to->me.x + offp*tounit.x; to->prevcp.y = to->me.y + offp*tounit.y;
946  fadiff = SigmaDeltas(spline,mid,cnt,&b,&db);
947  from->nextcp.x = from->me.x + (offn-incrn)*fromunit.x; from->nextcp.y = from->me.y + (offn-incrn)*fromunit.y;
949  fsdiff = SigmaDeltas(spline,mid,cnt,&b,&db);
950  from->nextcp.x = from->me.x + offn*fromunit.x; from->nextcp.y = from->me.y + offn*fromunit.y;
951  if ( offn-incrn<=0 )
952  fsdiff += 1e10;
953 
954  to->prevcp.x = to->me.x + (offp+incrp)*tounit.x; to->prevcp.y = to->me.y + (offp+incrp)*tounit.y;
956  tadiff = SigmaDeltas(spline,mid,cnt,&b,&db);
957  to->prevcp.x = to->me.x + (offp-incrp)*tounit.x; to->prevcp.y = to->me.y + (offp-incrp)*tounit.y;
959  tsdiff = SigmaDeltas(spline,mid,cnt,&b,&db);
960  to->prevcp.x = to->me.x + offp*tounit.x; to->prevcp.y = to->me.y + offp*tounit.y;
961  if ( offp-incrp<=0 )
962  tsdiff += 1e10;
963 
964  if ( offn>=incrn && fsdiff<curdiff &&
965  (fsdiff<fadiff && fsdiff<tsdiff && fsdiff<tadiff)) {
966  offn -= incrn;
967  if ( bettern>0 )
968  incrn /= 2;
969  bettern = -1;
970  nocnt = 0;
971  curdiff = fsdiff;
972  } else if ( offn+incrn<fmax && fadiff<curdiff &&
973  (fadiff<=fsdiff && fadiff<tsdiff && fadiff<tadiff)) {
974  offn += incrn;
975  if ( bettern<0 )
976  incrn /= 2;
977  bettern = 1;
978  nocnt = 0;
979  curdiff = fadiff;
980  } else if ( offp>=incrp && tsdiff<curdiff &&
981  (tsdiff<=fsdiff && tsdiff<=fadiff && tsdiff<tadiff)) {
982  offp -= incrp;
983  if ( betterp>0 )
984  incrp /= 2;
985  betterp = -1;
986  nocnt = 0;
987  curdiff = tsdiff;
988  } else if ( offp+incrp<tmax && tadiff<curdiff &&
989  (tadiff<=fsdiff && tadiff<=fadiff && tadiff<=tsdiff)) {
990  offp += incrp;
991  if ( betterp<0 )
992  incrp /= 2;
993  betterp = 1;
994  nocnt = 0;
995  curdiff = tadiff;
996  } else {
997  if ( ++nocnt > 6 )
998  break;
999  incrn /= 2;
1000  incrp /= 2;
1001  }
1002  if ( curdiff<1 )
1003  break;
1004  if ( incrp<tdiff/1024 || incrn<fdiff/1024 )
1005  break;
1006  if ( ++totcnt>200 )
1007  break;
1008  if ( offn<0 || offp<0 ) {
1009  IError("Approximation got inverse control points");
1010  break;
1011  }
1012  }
1013 #if 0
1014  if ( nocnt>6 )
1015  nocnt_cnt++;
1016  else if ( curdiff<1 )
1017  curdiff_cnt++;
1018  else if ( totcnt>200 )
1019  totcnt_cnt++;
1020  else
1021  incr_cnt++;
1022 #endif
1023  if ( curdiff<finaldiff ) {
1024  finaldiff = curdiff;
1025  offn_ = offn;
1026  offp_ = offp;
1027  }
1028  }
1029 
1030  to->noprevcp = offp_==0;
1031  from->nonextcp = offn_==0;
1032  to->prevcp.x = to->me.x + offp_*tounit.x; to->prevcp.y = to->me.y + offp_*tounit.y;
1033  from->nextcp.x = from->me.x + offn_*fromunit.x; from->nextcp.y = from->me.y + offn_*fromunit.y;
1034  /* I used to check for a spline very close to linear (and if so, make it */
1035  /* linear). But in when stroking a path with an eliptical pen we transform*/
1036  /* the coordinate system and our normal definitions of "close to linear" */
1037  /* don't apply */
1038  /*TestForLinear(from,to);*/
1040 
1041 return( spline );
1042 }
1043 #undef TRY_CNT
1044 #undef DECIMATION
1045 
1046  /* calculating the actual length of a spline is hard, this gives a very */
1047  /* rough (but quick) approximation */
1048 static double SplineLenApprox(Spline *spline) {
1049  double len, slen, temp;
1050 
1051  if ( (temp = spline->to->me.x-spline->from->me.x)<0 ) temp = -temp;
1052  len = temp;
1053  if ( (temp = spline->to->me.y-spline->from->me.y)<0 ) temp = -temp;
1054  len += temp;
1055  if ( !spline->to->noprevcp || !spline->from->nonextcp ) {
1056  if ( (temp = spline->from->nextcp.x-spline->from->me.x)<0 ) temp = -temp;
1057  slen = temp;
1058  if ( (temp = spline->from->nextcp.y-spline->from->me.y)<0 ) temp = -temp;
1059  slen += temp;
1060  if ( (temp = spline->to->prevcp.x-spline->from->nextcp.x)<0 ) temp = -temp;
1061  slen += temp;
1062  if ( (temp = spline->to->prevcp.y-spline->from->nextcp.y)<0 ) temp = -temp;
1063  slen += temp;
1064  if ( (temp = spline->to->me.x-spline->to->prevcp.x)<0 ) temp = -temp;
1065  slen += temp;
1066  if ( (temp = spline->to->me.y-spline->to->prevcp.y)<0 ) temp = -temp;
1067  slen += temp;
1068  len = (len + slen)/2;
1069  }
1070 return( len );
1071 }
1072 
1074  /* I ignore the constant term. It's just an unneeded addition */
1075  double len, t;
1076  double lastx = 0, lasty = 0;
1077  double curx, cury;
1078 
1079  len = 0;
1080  for ( t=1.0/128; t<=1.0001 ; t+=1.0/128 ) {
1081  curx = ((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c)*t;
1082  cury = ((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c)*t;
1083  len += sqrt( (curx-lastx)*(curx-lastx) + (cury-lasty)*(cury-lasty) );
1084  lastx = curx; lasty = cury;
1085  }
1086 return( len );
1087 }
1088 
1089 
1091  int *tot) {
1092  int cnt, i, j, pcnt;
1093  double len, slen, lbase;
1094  SplinePoint *np;
1095  TPoint *tp;
1096  double _lens[10], *lens = _lens;
1097  int _cnts[10], *cnts = _cnts;
1098  /* I used just to give every spline 10 points. But that gave much more */
1099  /* weight to small splines than to big ones */
1100 
1101  cnt = 0;
1102  for ( np = from->next->to; ; np = np->next->to ) {
1103  ++cnt;
1104  if ( np==to )
1105  break;
1106  }
1107  if ( cnt>10 ) {
1108  lens = galloc(cnt*sizeof(double));
1109  cnts = galloc(cnt*sizeof(int));
1110  }
1111  cnt = 0; len = 0;
1112  for ( np = from->next->to; ; np = np->next->to ) {
1113  lens[cnt] = SplineLenApprox(np->prev);
1114  len += lens[cnt];
1115  ++cnt;
1116  if ( np==to )
1117  break;
1118  }
1119  if ( len!=0 ) {
1120  pcnt = 0;
1121  for ( i=0; i<cnt; ++i ) {
1122  int pnts = rint( (10*cnt*lens[i])/len );
1123  if ( pnts<2 ) pnts = 2;
1124  cnts[i] = pnts;
1125  pcnt += pnts;
1126  }
1127  } else
1128  pcnt = 2*cnt;
1129 
1130  tp = galloc((pcnt+1)*sizeof(TPoint)); i = 0;
1131  if ( len==0 ) {
1132  for ( i=0; i<=pcnt; ++i ) {
1133  tp[i].t = i/(pcnt);
1134  tp[i].x = from->me.x;
1135  tp[i].y = from->me.y;
1136  }
1137  } else {
1138  lbase = 0;
1139  for ( i=cnt=0, np = from->next->to; ; np = np->next->to, ++cnt ) {
1140  slen = SplineLenApprox(np->prev);
1141  for ( j=0; j<cnts[cnt]; ++j ) {
1142  double t = j/(double) cnts[cnt];
1143  tp[i].t = (lbase+ t*slen)/len;
1144  tp[i].x = ((np->prev->splines[0].a*t+np->prev->splines[0].b)*t+np->prev->splines[0].c)*t + np->prev->splines[0].d;
1145  tp[i++].y = ((np->prev->splines[1].a*t+np->prev->splines[1].b)*t+np->prev->splines[1].c)*t + np->prev->splines[1].d;
1146  }
1147  lbase += slen;
1148  if ( np==to )
1149  break;
1150  }
1151  }
1152  if ( cnts!=_cnts ) free(cnts);
1153  if ( lens!=_lens ) free(lens);
1154 
1155  *tot = i;
1156 
1157 return( tp );
1158 }
1159 
1160 static void SplinePointReCatagorize(SplinePoint *sp,int oldpt) {
1162  if ( sp->pointtype!=oldpt ) {
1163  if ( sp->pointtype==pt_curve && oldpt==pt_hvcurve &&
1164  ((sp->nextcp.x == sp->me.x && sp->nextcp.y != sp->me.y ) ||
1165  (sp->nextcp.y == sp->me.y && sp->nextcp.x != sp->me.x )))
1166  sp->pointtype = pt_hvcurve;
1167  }
1168 }
1169 
1171  int tot;
1172  TPoint *tp;
1173  SplinePoint *np, oldfrom;
1174  int oldfpt = from->pointtype, oldtpt = to->pointtype;
1175  Spline *sp;
1176  int order2 = from->next->order2;
1177 
1178  oldfrom = *from;
1179  tp = SplinesFigureTPsBetween(from,to,&tot);
1180 
1181  if ( type==1 )
1182  ApproximateSplineFromPointsSlopes(from,to,tp,tot-1,order2);
1183  else
1184  ApproximateSplineFromPoints(from,to,tp,tot-1,order2);
1185 
1186  /* Have to do the frees after the approximation because the approx */
1187  /* uses the splines to determine slopes */
1188  for ( sp = oldfrom.next; ; ) {
1189  np = sp->to;
1190  SplineFree(sp);
1191  if ( np==to )
1192  break;
1193  sp = np->next;
1195  }
1196 
1197  free(tp);
1198 
1199  SplinePointReCatagorize(from,oldfpt);
1200  SplinePointReCatagorize(to,oldtpt);
1201 }
1202 
1203 
1205  double len, normal, dir;
1206  Spline *s, *first;
1207  BasePoint unit, off;
1208 
1209  /* Also remove really stupid control points: Tiny offsets pointing in */
1210  /* totally the wrong direction. Some of the TeX fonts we get have these */
1211  /* We get equally bad results with a control point that points beyond the */
1212  /* other end point */
1213  first = NULL;
1214  for ( s = spl->first->next; s!=NULL && s!=first; s=s->to->next ) {
1215  unit.x = s->to->me.x-s->from->me.x;
1216  unit.y = s->to->me.y-s->from->me.y;
1217  len = sqrt(unit.x*unit.x+unit.y*unit.y);
1218  if ( len!=0 ) {
1219  int refigure = false;
1220  unit.x /= len; unit.y /= len;
1221  if ( !s->from->nonextcp ) {
1222  off.x = s->from->nextcp.x-s->from->me.x;
1223  off.y = s->from->nextcp.y-s->from->me.y;
1224  if ((normal = off.x*unit.y - off.y*unit.x)<0 ) normal = -normal;
1225  dir = off.x*unit.x + off.y*unit.y;
1226  if (( normal<dir && normal<1 && dir<0 ) || (normal<.5 && dir<-.5) ||
1227  (normal<.1 && dir>len)) {
1228  s->from->nextcp = s->from->me;
1229  s->from->nonextcp = true;
1230  refigure = true;
1231  }
1232  }
1233  if ( !s->to->noprevcp ) {
1234  off.x = s->to->me.x - s->to->prevcp.x;
1235  off.y = s->to->me.y - s->to->prevcp.y;
1236  if ((normal = off.x*unit.y - off.y*unit.x)<0 ) normal = -normal;
1237  dir = off.x*unit.x + off.y*unit.y;
1238  if (( normal<-dir && normal<1 && dir<0 ) || (normal<.5 && dir>-.5 && dir<0) ||
1239  (normal<.1 && dir>len)) {
1240  s->to->prevcp = s->to->me;
1241  s->to->noprevcp = true;
1242  refigure = true;
1243  }
1244  }
1245  if ( refigure )
1246  SplineRefigure(s);
1247  }
1248  if ( first==NULL ) first = s;
1249  }
1250 }
1251 
1253  SplineSet *spl;
1254 
1255  for (spl=base; spl!=NULL; spl=spl->next )
1257 }
1258 
1259 static void OverlapClusterCpAngles(SplineSet *spl,double within) {
1260  double len, nlen, plen;
1261  double startoff, endoff;
1262  SplinePoint *sp, *nsp, *psp;
1263  BasePoint *nbp, *pbp;
1264  BasePoint pdir, ndir, fpdir, fndir;
1265  int nbad, pbad;
1266 
1267  /* If we have a junction point (right mid of 3) where the two splines */
1268  /* are almost, but not quite moving in the same direction as they go */
1269  /* away from the point, and if there is a tiny overlap because of this */
1270  /* "almost" same, then we will probably get a bit confused in remove */
1271  /* overlap */
1272 
1273  for ( sp = spl->first; ; ) {
1274  if ( sp->next==NULL )
1275  break;
1276  nsp = sp->next->to;
1277  if (( !sp->nonextcp || !sp->noprevcp ) && sp->prev!=NULL ) {
1278  psp = sp->prev->from;
1279  nbp = !sp->nonextcp ? &sp->nextcp : !nsp->noprevcp ? &nsp->prevcp : &nsp->me;
1280  pbp = !sp->noprevcp ? &sp->prevcp : !psp->nonextcp ? &psp->nextcp : &psp->me;
1281 
1282  pdir.x = pbp->x-sp->me.x; pdir.y = pbp->y-sp->me.y;
1283  ndir.x = nbp->x-sp->me.x; ndir.y = nbp->y-sp->me.y;
1284  fpdir.x = psp->me.x-sp->me.x; fpdir.y = psp->me.y-sp->me.y;
1285  fndir.x = nsp->me.x-sp->me.x; fndir.y = nsp->me.y-sp->me.y;
1286 
1287  plen = sqrt(pdir.x*pdir.x+pdir.y*pdir.y);
1288  if ( plen!=0 ) {
1289  pdir.x /= plen; pdir.y /= plen;
1290  }
1291 
1292  nlen = sqrt(ndir.x*ndir.x+ndir.y*ndir.y);
1293  if ( nlen!=0 ) {
1294  ndir.x /= nlen; ndir.y /= nlen;
1295  }
1296 
1297  nbad = pbad = false;
1298  if ( !sp->nonextcp && plen!=0 && nlen!=0 ) {
1299  len = sqrt(fndir.x*fndir.x+fndir.y*fndir.y);
1300  if ( len!=0 ) {
1301  fndir.x /= len; fndir.y /= len;
1302  startoff = ndir.x*pdir.y - ndir.y*pdir.x;
1303  endoff = fndir.x*pdir.y - fndir.y*pdir.x;
1304  if (( (startoff<0 && endoff>0) || (startoff>0 && endoff<0)) &&
1305  startoff > -within && startoff < within )
1306  nbad = true;
1307  }
1308  }
1309  if ( !sp->noprevcp && plen!=0 && nlen!=0 ) {
1310  len = sqrt(fpdir.x*fpdir.x+fpdir.y*fpdir.y);
1311  if ( len!=0 ) {
1312  fpdir.x /= len; fpdir.y /= len;
1313  startoff = pdir.x*ndir.y - pdir.y*ndir.x;
1314  endoff = fpdir.x*ndir.y - fpdir.y*ndir.x;
1315  if (( (startoff<0 && endoff>0) || (startoff>0 && endoff<0)) &&
1316  startoff > -within && startoff < within )
1317  pbad = true;
1318  }
1319  }
1320  if ( nbad && pbad ) {
1321  if ( ndir.x==0 || ndir.y==0 )
1322  nbad = false;
1323  else if ( pdir.x==0 || pdir.y==0 )
1324  pbad = false;
1325  }
1326  if ( nbad && pbad ) {
1327  if ( ndir.x*pdir.x + ndir.y*pdir.y > 0 ) {
1328  ndir.x = pdir.x = (ndir.x + pdir.x)/2;
1329  ndir.y = pdir.y = (ndir.x + pdir.x)/2;
1330  } else {
1331  ndir.x = (ndir.x - pdir.x)/2;
1332  ndir.y = (ndir.y - pdir.y)/2;
1333  pdir.x = -ndir.x; pdir.y = -ndir.y;
1334  }
1335  sp->nextcp.x = sp->me.x + nlen*ndir.x;
1336  sp->nextcp.y = sp->me.y + nlen*ndir.y;
1337  sp->prevcp.x = sp->me.x + plen*pdir.x;
1338  sp->prevcp.y = sp->me.y + plen*pdir.y;
1339  SplineRefigure(sp->next); SplineRefigure(sp->prev);
1340  } else if ( nbad ) {
1341  if ( ndir.x*pdir.x + ndir.y*pdir.y < 0 ) {
1342  pdir.x = -pdir.x;
1343  pdir.y = -pdir.y;
1344  }
1345  sp->nextcp.x = sp->me.x + nlen*pdir.x;
1346  sp->nextcp.y = sp->me.y + nlen*pdir.y;
1347  SplineRefigure(sp->next);
1348  } else if ( pbad ) {
1349  if ( ndir.x*pdir.x + ndir.y*pdir.y < 0 ) {
1350  ndir.x = -ndir.x;
1351  ndir.y = -ndir.y;
1352  }
1353  sp->prevcp.x = sp->me.x + plen*ndir.x;
1354  sp->prevcp.y = sp->me.y + plen*ndir.y;
1355  SplineRefigure(sp->prev);
1356  }
1357  }
1358  if ( nsp==spl->first )
1359  break;
1360  sp = nsp;
1361  }
1362 }
1363 
1365  SplineSet *spl;
1366 
1367  for (spl=base; spl!=NULL; spl=spl->next )
1369 }
1370 
1371 
1372 Spline *SplineAddExtrema(Spline *s,int always,real lenbound, real offsetbound,
1373  DBounds *b) {
1374  /* First find the extrema, if any */
1375  bigreal t[4], min;
1376  uint8 rmfrom[4], rmto[4];
1377  int p, i,j, p_s, mini;
1378  SplinePoint *sp;
1379  real len = 0; /* Init variable to silence compiler warnings */
1380 
1381  if ( !always ) {
1382  real xlen, ylen;
1383  xlen = (s->from->me.x-s->to->me.x);
1384  ylen = (s->from->me.y-s->to->me.y);
1385  len = xlen*xlen + ylen*ylen;
1386  lenbound *= lenbound;
1387  if ( len < lenbound ) {
1388  len = SplineLength(s);
1389  len *= len;
1390  }
1391  }
1392 
1393  memset(rmfrom,0,sizeof(rmfrom));
1394  memset(rmto,0,sizeof(rmto));
1395 
1396  forever {
1397  if ( s->knownlinear )
1398 return(s);
1399  p = 0;
1400  if ( s->splines[0].a!=0 ) {
1401  double d = 4*s->splines[0].b*s->splines[0].b-4*3*s->splines[0].a*s->splines[0].c;
1402  if ( d>0 ) {
1403  d = sqrt(d);
1404  t[p++] = CheckExtremaForSingleBitErrors(&s->splines[0],(-2*s->splines[0].b+d)/(2*3*s->splines[0].a));
1405  t[p++] = CheckExtremaForSingleBitErrors(&s->splines[0],(-2*s->splines[0].b-d)/(2*3*s->splines[0].a));
1406  }
1407  } else if ( s->splines[0].b!=0 )
1408  t[p++] = -s->splines[0].c/(2*s->splines[0].b);
1409  if ( !always ) {
1410  /* Generally we are only interested in extrema on long splines, or */
1411  /* extrema which are extrema for the entire contour, not just this */
1412  /* spline */
1413  /* Also extrema which are very close to one of the end-points can */
1414  /* be ignored. */
1415  /* No they can't. But we need to remove the original point in this*/
1416  /* case */
1417  for ( i=0; i<p; ++i ) {
1418  real x = ((s->splines[0].a*t[i]+s->splines[0].b)*t[i]+s->splines[0].c)*t[i]+s->splines[0].d;
1419  real y = ((s->splines[1].a*t[i]+s->splines[1].b)*t[i]+s->splines[1].c)*t[i]+s->splines[1].d;
1420  int close_from = ( x-s->from->me.x<offsetbound && x-s->from->me.x>-offsetbound) &&
1421  ( y-s->from->me.y<10*offsetbound && y-s->from->me.y>-10*offsetbound );
1422  int close_to = ( x-s->to->me.x<offsetbound && x-s->to->me.x>-offsetbound) &&
1423  ( y-s->to->me.y<10*offsetbound && y-s->to->me.y>-10*offsetbound );
1424  int remove_from = close_from && GoodCurve(s->from,true);
1425  int remove_to = close_to && GoodCurve(s->to,false);
1426  if (( x>b->minx && x<b->maxx && len<lenbound ) ||
1427  (close_from && !remove_from) || (close_to && !remove_to) ) {
1428  --p;
1429  for ( j=i; j<p; ++j )
1430  t[j] = t[j+1];
1431  --i;
1432  } else {
1433  rmfrom[i] = remove_from;
1434  rmto[i] = remove_to;
1435  }
1436  }
1437  }
1438 
1439  p_s = p;
1440  if ( s->splines[1].a!=0 ) {
1441  double d = 4*s->splines[1].b*s->splines[1].b-4*3*s->splines[1].a*s->splines[1].c;
1442  if ( d>0 ) {
1443  d = sqrt(d);
1444  t[p++] = CheckExtremaForSingleBitErrors(&s->splines[1],(-2*s->splines[1].b+d)/(2*3*s->splines[1].a));
1445  t[p++] = CheckExtremaForSingleBitErrors(&s->splines[1],(-2*s->splines[1].b-d)/(2*3*s->splines[1].a));
1446  }
1447  } else if ( s->splines[1].b!=0 )
1448  t[p++] = -s->splines[1].c/(2*s->splines[1].b);
1449  if ( !always ) {
1450  for ( i=p_s; i<p; ++i ) {
1451  real x = ((s->splines[0].a*t[i]+s->splines[0].b)*t[i]+s->splines[0].c)*t[i]+s->splines[0].d;
1452  real y = ((s->splines[1].a*t[i]+s->splines[1].b)*t[i]+s->splines[1].c)*t[i]+s->splines[1].d;
1453  int close_from =( y-s->from->me.y<offsetbound && y-s->from->me.y>-offsetbound ) &&
1454  ( x-s->from->me.x<offsetbound && x-s->from->me.x>-offsetbound);
1455  int close_to = ( y-s->to->me.y<offsetbound && y-s->to->me.y>-offsetbound ) &&
1456  ( x-s->to->me.x<offsetbound && x-s->to->me.x>-offsetbound);
1457  int remove_from = close_from && GoodCurve(s->from,true);
1458  int remove_to = close_to && GoodCurve(s->to,false);
1459  if (( y>b->miny && y<b->maxy && len<lenbound ) ||
1460  (close_from && !remove_from) || (close_to && !remove_to) ) {
1461  --p;
1462  for ( j=i; j<p; ++j )
1463  t[j] = t[j+1];
1464  --i;
1465  } else {
1466  rmfrom[i] = remove_from;
1467  rmto[i] = remove_to;
1468  }
1469  }
1470  }
1471 
1472  /* Throw out any t values which are not between 0 and 1 */
1473  /* (we do a little fudging near the endpoints so we don't get confused */
1474  /* by rounding errors) */
1475  for ( i=0; i<p; ++i ) {
1476  if ( t[i]>0 && t[i]<.05 ) {
1477  BasePoint test;
1478  /* Expand strong gets very confused on zero-length splines so */
1479  /* don't let that happen */
1480  test.x = ((s->splines[0].a*t[i]+s->splines[0].b)*t[i]+s->splines[0].c)*t[i]+s->splines[0].d;
1481  test.y = ((s->splines[1].a*t[i]+s->splines[1].b)*t[i]+s->splines[1].c)*t[i]+s->splines[1].d;
1482  if ( test.x== s->from->me.x && test.y==s->from->me.y )
1483  t[i] = 0; /* Throw it out */
1484  }
1485  if ( t[i]<1 && t[i]>.95 ) {
1486  BasePoint test;
1487  test.x = ((s->splines[0].a*t[i]+s->splines[0].b)*t[i]+s->splines[0].c)*t[i]+s->splines[0].d;
1488  test.y = ((s->splines[1].a*t[i]+s->splines[1].b)*t[i]+s->splines[1].c)*t[i]+s->splines[1].d;
1489  if ( test.x== s->to->me.x && test.y==s->to->me.y )
1490  t[i] = 1.0; /* Throw it out */
1491  }
1492 
1493  if ( t[i]<.0001 || t[i]>.9999 ) {
1494  --p;
1495  for ( j=i; j<p; ++j ) {
1496  t[j] = t[j+1];
1497  rmfrom[j] = rmfrom[j+1];
1498  rmto[j] = rmto[j+1];
1499  }
1500  --i;
1501  }
1502  }
1503 
1504  if ( p==0 )
1505 return(s);
1506 
1507  /* Find the smallest of all the interesting points */
1508  min = t[0]; mini = 0;
1509  for ( i=1; i<p; ++i ) {
1510  if ( t[i]<min ) {
1511  min=t[i];
1512  mini = i;
1513  }
1514  }
1515  sp = SplineBisect(s,min);
1516 /* On the mac we get rounding errors in the bisect routine */
1517  { double dx, dy;
1518  if ( (dx = sp->me.x - sp->prevcp.x)<0 ) dx=-dx;
1519  if ( (dy = sp->me.y - sp->prevcp.y)<0 ) dy=-dy;
1520  if ( dx!=0 && dy!=0 ) {
1521  if ( dx<dy )
1522  sp->prevcp.x = sp->me.x;
1523  else
1524  sp->prevcp.y = sp->me.y;
1525  }
1526  if ( (dx = sp->me.x - sp->nextcp.x)<0 ) dx=-dx;
1527  if ( (dy = sp->me.y - sp->nextcp.y)<0 ) dy=-dy;
1528  if ( dx!=0 && dy!=0 ) {
1529  if ( dx<dy )
1530  sp->nextcp.x = sp->me.x;
1531  else
1532  sp->nextcp.y = sp->me.y;
1533  }
1534  }
1535 
1536  if ( rmfrom[mini] ) sp->prev->from->ticked = true;
1537  if ( rmto[mini] ) sp->next->to->ticked = true;
1538  s = sp->next;
1539  if ( p==1 )
1540 return( s );
1541  /* Don't try to use any other computed t values, it is easier to */
1542  /* recompute them than to try and figure out what they map to on the */
1543  /* new spline */
1544  }
1545 }
1546 
1547 void SplineSetAddExtrema(SplineChar *sc, SplineSet *ss,enum ae_type between_selected, int emsize) {
1548  Spline *s, *first;
1549  DBounds b;
1550  int always = true;
1551  real lenbound = 0;
1552  real offsetbound=0;
1553  SplinePoint *sp, *nextp;
1554 
1555  if ( between_selected==ae_only_good ) {
1556  SplineSetQuickBounds(ss,&b);
1557  lenbound = (emsize)/32.0;
1558  always = false;
1559  offsetbound = .5;
1560  between_selected = ae_only_good_rm_later;
1561  for ( sp = ss->first; ; ) {
1562  sp->ticked = false;
1563  if ( sp->next==NULL )
1564  break;
1565  sp = sp->next->to;
1566  if ( sp==ss->first )
1567  break;
1568  }
1569  }
1570 
1571  first = NULL;
1572  for ( s = ss->first->next; s!=NULL && s!=first; s = s->to->next ) {
1573  if ( between_selected!=ae_between_selected ||
1574  (s->from->selected && s->to->selected))
1575  s = SplineAddExtrema(s,always,lenbound,offsetbound,&b);
1576  if ( first==NULL ) first = s;
1577  }
1578  if ( between_selected == ae_only_good_rm_later ) {
1579  for ( sp = ss->first; ; ) {
1580  if ( sp->next==NULL )
1581  break;
1582  nextp = sp->next->to;
1583  if ( sp->ticked ) {
1584  if ( sp==ss->first )
1585  ss->first = ss->last = nextp;
1586  SplinesRemoveBetween(sc,sp->prev->from,nextp,1);
1587  }
1588  sp = nextp;
1589  if ( sp==ss->first )
1590  break;
1591  }
1592  }
1593 }
1594 
1595 
1596 char *GetNextUntitledName(void) {
1597  static int untitled_cnt=1;
1598  char buffer[80];
1599 
1600  sprintf( buffer, "Untitled%d", untitled_cnt++ );
1601 return( copy(buffer));
1602 }
1603 
1606  time_t now;
1607  SplineFont *sf;
1608 
1609  sf = gcalloc(1,sizeof(SplineFont));
1610  sf->pfminfo.fstype = -1;
1611  sf->top_enc = -1;
1612  sf->macstyle = -1;
1613  sf->desired_row_cnt = default_fv_row_count; sf->desired_col_cnt = default_fv_col_count;
1614  sf->display_antialias = default_fv_antialias;
1615  sf->display_bbsized = default_fv_bbsized;
1616  sf->display_size = -default_fv_font_size;
1617  sf->display_layer = ly_fore;
1618  sf->pfminfo.winascent_add = sf->pfminfo.windescent_add = true;
1619  sf->pfminfo.hheadascent_add = sf->pfminfo.hheaddescent_add = true;
1620  sf->pfminfo.typoascent_add = sf->pfminfo.typodescent_add = true;
1621  if ( TTFFoundry!=NULL )
1622  strncpy(sf->pfminfo.os2_vendor,TTFFoundry,4);
1623  else
1624  memcpy(sf->pfminfo.os2_vendor,"PfEd",4);
1625  sf->for_new_glyphs = DefaultNameListForNewFonts();
1626  time(&now);
1627  sf->creationtime = sf->modificationtime = now;
1628 
1629  sf->layer_cnt = 2;
1630  sf->layers = gcalloc(2,sizeof(LayerInfo));
1631  sf->layers[0].name = copy(_("Back"));
1632  sf->layers[0].background = true;
1633  sf->layers[1].name = copy(_("Fore"));
1634  sf->layers[1].background = false;
1635  sf->grid.background = true;
1636 
1637 return( sf );
1638 }
1639 
1640 
1641 static void SFChangeXUID(SplineFont *sf, int random) {
1642  char *pt, *new, *npt;
1643  int val;
1644 
1645  if ( sf->xuid==NULL )
1646 return;
1647  pt = strrchr(sf->xuid,' ');
1648  if ( pt==NULL )
1649  pt = strchr(sf->xuid,'[');
1650  if ( pt==NULL )
1651  pt = sf->xuid;
1652  else
1653  ++pt;
1654  if ( random )
1655  val = rand()&0xffffff;
1656  else {
1657  val = strtol(pt,NULL,10);
1658  val = (val+1)&0xffffff;
1659  }
1660 
1661  new = galloc(pt-sf->xuid+12);
1662  strncpy(new,sf->xuid,pt-sf->xuid);
1663  npt = new + (pt-sf->xuid);
1664  if ( npt==new ) *npt++ = '[';
1665  sprintf(npt, "%d]", val );
1666  free(sf->xuid); sf->xuid = new;
1667  sf->changed = true;
1668  sf->changed_since_xuidchanged = false;
1669 }
1670 
1672  SFChangeXUID(sf,false);
1673 }
1674 
1676  SFChangeXUID(sf,true);
1677 }
1678 
1680  double pangle, nangle, angle, plen, nlen, c, s;
1681  if ( sp->noprevcp || sp->nonextcp )
1682  /*SPAverageCps(sp)*/; /* Expand Stroke wants this case to hold still */
1683  else if (( sp->pointtype==pt_curve || sp->pointtype==pt_hvcurve) &&
1684  sp->prev && sp->next ) {
1685  pangle = atan2(sp->me.y-sp->prevcp.y,sp->me.x-sp->prevcp.x);
1686  nangle = atan2(sp->nextcp.y-sp->me.y,sp->nextcp.x-sp->me.x);
1687  if ( pangle<0 && nangle>0 && nangle-pangle>=3.1415926 )
1688  pangle += 2*3.1415926535897932;
1689  else if ( pangle>0 && nangle<0 && pangle-nangle>=3.1415926 )
1690  nangle += 2*3.1415926535897932;
1691  plen = sqrt((sp->me.y-sp->prevcp.y)*(sp->me.y-sp->prevcp.y) +
1692  (sp->me.x-sp->prevcp.x)*(sp->me.x-sp->prevcp.x));
1693  nlen = sqrt((sp->nextcp.y-sp->me.y)*(sp->nextcp.y-sp->me.y) +
1694  (sp->nextcp.x-sp->me.x)*(sp->nextcp.x-sp->me.x));
1695  if ( plen+nlen==0 )
1696  angle = (nangle+pangle)/2;
1697  else
1698  angle = (plen*pangle + nlen*nangle)/(plen+nlen);
1699  plen = -plen;
1700  c = cos(angle); s=sin(angle);
1701  sp->nextcp.x = c*nlen + sp->me.x;
1702  sp->nextcp.y = s*nlen + sp->me.y;
1703  sp->prevcp.x = c*plen + sp->me.x;
1704  sp->prevcp.y = s*plen + sp->me.y;
1705  SplineRefigure(sp->prev);
1706  SplineRefigure(sp->next);
1707  } else
1708  SPAverageCps(sp);
1709 }
1710 
1712  double pangle, nangle, angle, plen, nlen, c, s;
1713  if (( sp->pointtype==pt_curve || sp->pointtype==pt_hvcurve) &&
1714  sp->prev && sp->next ) {
1715  if ( sp->noprevcp )
1716  pangle = atan2(sp->me.y-sp->prev->from->me.y,sp->me.x-sp->prev->from->me.x);
1717  else
1718  pangle = atan2(sp->me.y-sp->prevcp.y,sp->me.x-sp->prevcp.x);
1719  if ( sp->nonextcp )
1720  nangle = atan2(sp->next->to->me.y-sp->me.y,sp->next->to->me.x-sp->me.x);
1721  else
1722  nangle = atan2(sp->nextcp.y-sp->me.y,sp->nextcp.x-sp->me.x);
1723  if ( pangle<0 && nangle>0 && nangle-pangle>=3.1415926 )
1724  pangle += 2*3.1415926535897932;
1725  else if ( pangle>0 && nangle<0 && pangle-nangle>=3.1415926 )
1726  nangle += 2*3.1415926535897932;
1727  angle = (nangle+pangle)/2;
1728  plen = -sqrt((sp->me.y-sp->prevcp.y)*(sp->me.y-sp->prevcp.y) +
1729  (sp->me.x-sp->prevcp.x)*(sp->me.x-sp->prevcp.x));
1730  nlen = sqrt((sp->nextcp.y-sp->me.y)*(sp->nextcp.y-sp->me.y) +
1731  (sp->nextcp.x-sp->me.x)*(sp->nextcp.x-sp->me.x));
1732  c = cos(angle); s=sin(angle);
1733  sp->nextcp.x = c*nlen + sp->me.x;
1734  sp->nextcp.y = s*nlen + sp->me.y;
1735  sp->prevcp.x = c*plen + sp->me.x;
1736  sp->prevcp.y = s*plen + sp->me.y;
1737  SplineRefigure(sp->prev);
1738  SplineRefigure(sp->next);
1739  } else if ( sp->pointtype==pt_tangent && sp->prev && sp->next ) {
1740  if ( !sp->noprevcp ) {
1741  nangle = atan2(sp->next->to->me.y-sp->me.y,sp->next->to->me.x-sp->me.x);
1742  plen = -sqrt((sp->me.y-sp->prevcp.y)*(sp->me.y-sp->prevcp.y) +
1743  (sp->me.x-sp->prevcp.x)*(sp->me.x-sp->prevcp.x));
1744  c = cos(nangle); s=sin(nangle);
1745  sp->prevcp.x = c*plen + sp->me.x;
1746  sp->prevcp.y = s*plen + sp->me.y;
1747  SplineRefigure(sp->prev);
1748  }
1749  if ( !sp->nonextcp ) {
1750  pangle = atan2(sp->me.y-sp->prev->from->me.y,sp->me.x-sp->prev->from->me.x);
1751  nlen = sqrt((sp->nextcp.y-sp->me.y)*(sp->nextcp.y-sp->me.y) +
1752  (sp->nextcp.x-sp->me.x)*(sp->nextcp.x-sp->me.x));
1753  c = cos(pangle); s=sin(pangle);
1754  sp->nextcp.x = c*nlen + sp->me.x;
1755  sp->nextcp.y = s*nlen + sp->me.y;
1756  SplineRefigure(sp->next);
1757  }
1758  }
1759 }
1760 
1761 
1763  double len;
1764  BasePoint *bp, unit;
1765  extern int snaptoint;
1766 
1767  if ( sp->prev==NULL )
1768 return;
1769  bp = &sp->prev->from->me;
1770 
1771  unit.y = sp->me.y-bp->y; unit.x = sp->me.x-bp->x;
1772  len = sqrt( unit.x*unit.x + unit.y*unit.y );
1773  if ( len!=0 ) {
1774  unit.x /= len;
1775  unit.y /= len;
1776  }
1777  len = sqrt((sp->nextcp.y-sp->me.y)*(sp->nextcp.y-sp->me.y) + (sp->nextcp.x-sp->me.x)*(sp->nextcp.x-sp->me.x));
1778  sp->nextcp.x = sp->me.x + len*unit.x;
1779  sp->nextcp.y = sp->me.y + len*unit.y;
1780  if ( snaptoint ) {
1781  sp->nextcp.x = rint(sp->nextcp.x);
1782  sp->nextcp.y = rint(sp->nextcp.y);
1783  } else {
1784  sp->nextcp.x = rint(sp->nextcp.x*1024)/1024;
1785  sp->nextcp.y = rint(sp->nextcp.y*1024)/1024;
1786  }
1787  if ( sp->next!=NULL && sp->next->order2 )
1788  sp->next->to->prevcp = sp->nextcp;
1789 }
1790 
1792  double len;
1793  BasePoint *bp, unit;
1794  extern int snaptoint;
1795 
1796  if ( sp->next==NULL )
1797 return;
1798  bp = &sp->next->to->me;
1799 
1800  unit.y = sp->me.y-bp->y; unit.x = sp->me.x-bp->x;
1801  len = sqrt( unit.x*unit.x + unit.y*unit.y );
1802  if ( len!=0 ) {
1803  unit.x /= len;
1804  unit.y /= len;
1805  }
1806  len = sqrt((sp->prevcp.y-sp->me.y)*(sp->prevcp.y-sp->me.y) + (sp->prevcp.x-sp->me.x)*(sp->prevcp.x-sp->me.x));
1807  sp->prevcp.x = sp->me.x + len*unit.x;
1808  sp->prevcp.y = sp->me.y + len*unit.y;
1809  if ( snaptoint ) {
1810  sp->prevcp.x = rint(sp->prevcp.x);
1811  sp->prevcp.y = rint(sp->prevcp.y);
1812  } else {
1813  sp->prevcp.x = rint(sp->prevcp.x*1024)/1024;
1814  sp->prevcp.y = rint(sp->prevcp.y*1024)/1024;
1815  }
1816  if ( sp->prev!=NULL && sp->prev->order2 )
1817  sp->prev->from->nextcp = sp->prevcp;
1818 }
1819 
1820 static void BP_HVForce(BasePoint *vector) {
1821  /* Force vector to be horizontal/vertical */
1822  double dx, dy, len;
1823 
1824  if ( (dx= vector->x)<0 ) dx = -dx;
1825  if ( (dy= vector->y)<0 ) dy = -dy;
1826  if ( dx==0 || dy==0 )
1827 return;
1828  len = sqrt(dx*dx + dy*dy);
1829  if ( dx>dy ) {
1830  vector->x = vector->x<0 ? -len : len;
1831  vector->y = 0;
1832  } else {
1833  vector->y = vector->y<0 ? -len : len;
1834  vector->x = 0;
1835  }
1836 }
1837 
1838 #define NICE_PROPORTION .39
1841  double len, plen, ulen;
1842  BasePoint unit;
1843  extern int snaptoint;
1844 
1845  if ( base->next==NULL )
1846 return;
1847  if ( base->next->order2 ) {
1848  SplineRefigureFixup(base->next);
1849 return;
1850  }
1851  if ( !base->nextcpdef ) {
1852  if ( base->pointtype==pt_tangent )
1854 return;
1855  }
1856  next = base->next->to;
1857  if ( base->prev!=NULL )
1858  prev = base->prev->from;
1859 
1860  len = NICE_PROPORTION * sqrt((base->me.x-next->me.x)*(base->me.x-next->me.x) +
1861  (base->me.y-next->me.y)*(base->me.y-next->me.y));
1862  unit.x = next->me.x - base->me.x;
1863  unit.y = next->me.y - base->me.y;
1864  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1865  if ( ulen!=0 )
1866  unit.x /= ulen, unit.y /= ulen;
1867  base->nonextcp = false;
1868 
1869  if ( base->pointtype == pt_curve || base->pointtype == pt_hvcurve ) {
1870  if ( prev!=NULL && (base->prevcpdef || base->noprevcp)) {
1871  unit.x = next->me.x - prev->me.x;
1872  unit.y = next->me.y - prev->me.y;
1873  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1874  if ( ulen!=0 )
1875  unit.x /= ulen, unit.y /= ulen;
1876  if ( base->pointtype == pt_hvcurve )
1877  BP_HVForce(&unit);
1878  plen = sqrt((base->prevcp.x-base->me.x)*(base->prevcp.x-base->me.x) +
1879  (base->prevcp.y-base->me.y)*(base->prevcp.y-base->me.y));
1880  base->prevcp.x = base->me.x - plen*unit.x;
1881  base->prevcp.y = base->me.y - plen*unit.y;
1882  if ( snaptoint ) {
1883  base->prevcp.x = rint(base->prevcp.x);
1884  base->prevcp.y = rint(base->prevcp.y);
1885  }
1886  SplineRefigureFixup(base->prev);
1887  } else if ( prev!=NULL ) {
1888  /* The prev control point is fixed. So we've got to use the same */
1889  /* angle it uses */
1890  unit.x = base->me.x-base->prevcp.x;
1891  unit.y = base->me.y-base->prevcp.y;
1892  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1893  if ( ulen!=0 )
1894  unit.x /= ulen, unit.y /= ulen;
1895  } else {
1896  base->prevcp = base->me;
1897  base->noprevcp = true;
1898  base->prevcpdef = true;
1899  }
1900  if ( base->pointtype == pt_hvcurve )
1901  BP_HVForce(&unit);
1902  } else if ( base->pointtype == pt_corner ) {
1903  if ( next->pointtype != pt_curve && next->pointtype != pt_hvcurve ) {
1904  base->nonextcp = true;
1905  }
1906  } else /* tangent */ {
1907  if ( next->pointtype != pt_curve ) {
1908  base->nonextcp = true;
1909  } else {
1910  if ( prev!=NULL ) {
1911  if ( !base->noprevcp ) {
1912  plen = sqrt((base->prevcp.x-base->me.x)*(base->prevcp.x-base->me.x) +
1913  (base->prevcp.y-base->me.y)*(base->prevcp.y-base->me.y));
1914  base->prevcp.x = base->me.x - plen*unit.x;
1915  base->prevcp.y = base->me.y - plen*unit.y;
1916  SplineRefigureFixup(base->prev);
1917  }
1918  unit.x = base->me.x-prev->me.x;
1919  unit.y = base->me.y-prev->me.y;
1920  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1921  if ( ulen!=0 )
1922  unit.x /= ulen, unit.y /= ulen;
1923  }
1924  }
1925  }
1926  if ( base->nonextcp )
1927  base->nextcp = base->me;
1928  else {
1929  base->nextcp.x = base->me.x + len*unit.x;
1930  base->nextcp.y = base->me.y + len*unit.y;
1931  if ( snaptoint ) {
1932  base->nextcp.x = rint(base->nextcp.x);
1933  base->nextcp.y = rint(base->nextcp.y);
1934  } else {
1935  base->nextcp.x = rint(base->nextcp.x*1024)/1024;
1936  base->nextcp.y = rint(base->nextcp.y*1024)/1024;
1937  }
1938  if ( base->next != NULL )
1939  SplineRefigureFixup(base->next);
1940  }
1941 }
1942 
1945  double len, nlen, ulen;
1946  BasePoint unit;
1947  extern int snaptoint;
1948 
1949  if ( base->prev==NULL )
1950 return;
1951  if ( base->prev->order2 ) {
1952  SplineRefigureFixup(base->prev);
1953 return;
1954  }
1955  if ( !base->prevcpdef ) {
1956  if ( base->pointtype==pt_tangent )
1958 return;
1959  }
1960  prev = base->prev->from;
1961  if ( base->next!=NULL )
1962  next = base->next->to;
1963 
1964  len = NICE_PROPORTION * sqrt((base->me.x-prev->me.x)*(base->me.x-prev->me.x) +
1965  (base->me.y-prev->me.y)*(base->me.y-prev->me.y));
1966  unit.x = prev->me.x - base->me.x;
1967  unit.y = prev->me.y - base->me.y;
1968  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1969  if ( ulen!=0 )
1970  unit.x /= ulen, unit.y /= ulen;
1971  base->noprevcp = false;
1972 
1973  if ( base->pointtype == pt_curve || base->pointtype == pt_hvcurve ) {
1974  if ( next!=NULL && (base->nextcpdef || base->nonextcp)) {
1975  unit.x = prev->me.x - next->me.x;
1976  unit.y = prev->me.y - next->me.y;
1977  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1978  if ( ulen!=0 )
1979  unit.x /= ulen, unit.y /= ulen;
1980  if ( base->pointtype == pt_hvcurve )
1981  BP_HVForce(&unit);
1982  nlen = sqrt((base->nextcp.x-base->me.x)*(base->nextcp.x-base->me.x) +
1983  (base->nextcp.y-base->me.y)*(base->nextcp.y-base->me.y));
1984  base->nextcp.x = base->me.x - nlen*unit.x;
1985  base->nextcp.y = base->me.y - nlen*unit.y;
1986  if ( snaptoint ) {
1987  base->nextcp.x = rint(base->nextcp.x);
1988  base->nextcp.y = rint(base->nextcp.y);
1989  }
1990  SplineRefigureFixup(base->next);
1991  } else if ( next!=NULL ) {
1992  /* The next control point is fixed. So we got to use the same */
1993  /* angle it uses */
1994  unit.x = base->me.x-base->nextcp.x;
1995  unit.y = base->me.y-base->nextcp.y;
1996  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
1997  if ( ulen!=0 )
1998  unit.x /= ulen, unit.y /= ulen;
1999  } else {
2000  base->nextcp = base->me;
2001  base->nonextcp = true;
2002  base->nextcpdef = true;
2003  }
2004  if ( base->pointtype == pt_hvcurve )
2005  BP_HVForce(&unit);
2006  } else if ( base->pointtype == pt_corner ) {
2007  if ( prev->pointtype != pt_curve && prev->pointtype != pt_hvcurve ) {
2008  base->noprevcp = true;
2009  }
2010  } else /* tangent */ {
2011  if ( prev->pointtype != pt_curve ) {
2012  base->noprevcp = true;
2013  } else {
2014  if ( next!=NULL ) {
2015  if ( !base->nonextcp ) {
2016  nlen = sqrt((base->nextcp.x-base->me.x)*(base->nextcp.x-base->me.x) +
2017  (base->nextcp.y-base->me.y)*(base->nextcp.y-base->me.y));
2018  base->nextcp.x = base->me.x - nlen*unit.x;
2019  base->nextcp.y = base->me.y - nlen*unit.y;
2020  SplineRefigureFixup(base->next);
2021  }
2022  unit.x = base->me.x-next->me.x;
2023  unit.y = base->me.y-next->me.y;
2024  ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
2025  if ( ulen!=0 )
2026  unit.x /= ulen, unit.y /= ulen;
2027  }
2028  }
2029  }
2030  if ( base->noprevcp )
2031  base->prevcp = base->me;
2032  else {
2033  base->prevcp.x = base->me.x + len*unit.x;
2034  base->prevcp.y = base->me.y + len*unit.y;
2035  if ( snaptoint ) {
2036  base->prevcp.x = rint(base->prevcp.x);
2037  base->prevcp.y = rint(base->prevcp.y);
2038  } else {
2039  base->prevcp.x = rint(base->prevcp.x*1024)/1024;
2040  base->prevcp.y = rint(base->prevcp.y*1024)/1024;
2041  }
2042  if ( base->prev!=NULL )
2043  SplineRefigureFixup(base->prev);
2044  }
2045 }
2046 
2047 
2049  Spline *spline, *first, *next;
2050  BasePoint tp;
2051  SplinePoint *temp;
2052  int bool;
2053  /* reverse the splineset so that what was the start point becomes the end */
2054  /* and vice versa. This entails reversing every individual spline, and */
2055  /* each point */
2056 
2057  first = NULL;
2058  spline = spl->first->next;
2059  if ( spline==NULL )
2060 return( spl ); /* Only one point, reversal is meaningless */
2061 
2062  tp = spline->from->nextcp;
2064  spline->from->prevcp = tp;
2065  bool = spline->from->nonextcp;
2067  spline->from->noprevcp = bool;
2068  bool = spline->from->nextcpdef;
2070  spline->from->prevcpdef = bool;
2071 
2072  for ( ; spline!=NULL && spline!=first; spline=next ) {
2073  next = spline->to->next;
2074 
2075  if ( spline->to!=spl->first ) { /* On a closed spline don't want to reverse the first point twice */
2076  tp = spline->to->nextcp;
2077  spline->to->nextcp = spline->to->prevcp;
2078  spline->to->prevcp = tp;
2079  bool = spline->to->nonextcp;
2081  spline->to->noprevcp = bool;
2082  bool = spline->to->nextcpdef;
2084  spline->to->prevcpdef = bool;
2085  }
2086 
2087  temp = spline->to;
2088  spline->to = spline->from;
2089  spline->from = temp;
2090  spline->from->next = spline;
2091  spline->to->prev = spline;
2093  if ( first==NULL ) first = spline;
2094  }
2095 
2096  if ( spl->first!=spl->last ) {
2097  temp = spl->first;
2098  spl->first = spl->last;
2099  spl->last = temp;
2100  spl->first->prev = NULL;
2101  spl->last->next = NULL;
2102  }
2103 
2104 return( spl );
2105 }
2106 
2107 static void SplineSetsUntick(SplineSet *spl) {
2108  Spline *spline, *first;
2109 
2110  while ( spl!=NULL ) {
2111  first = NULL;
2112  spl->first->isintersection = false;
2113  for ( spline=spl->first->next; spline!=first && spline!=NULL; spline = spline->to->next ) {
2114  spline->isticked = false;
2115  spline->isneeded = false;
2116  spline->isunneeded = false;
2117  spline->ishorvert = false;
2118  spline->to->isintersection = false;
2119  if ( first==NULL ) first = spline;
2120  }
2121  spl = spl->next;
2122  }
2123 }
2124 
2125 static void SplineSetTick(SplineSet *spl) {
2126  Spline *spline, *first;
2127 
2128  first = NULL;
2129  for ( spline=spl->first->next; spline!=first && spline!=NULL; spline = spline->to->next ) {
2130  spline->isticked = true;
2131  if ( first==NULL ) first = spline;
2132  }
2133 }
2134 
2136  Spline *spline, *first;
2137 
2138  while ( spl!=NULL ) {
2139  first = NULL;
2140  for ( spline=spl->first->next; spline!=first && spline!=NULL; spline = spline->to->next ) {
2141  if ( spline==search )
2142 return( spl );
2143  if ( first==NULL ) first = spline;
2144  }
2145  spl = spl->next;
2146  }
2147 return( NULL );
2148 }
2149 
2151  Spline *first, *s;
2152 
2153  first = NULL;
2154  for ( s = spl->first->next; s!=NULL && s!=first; s = s->to->next ) {
2155  if ( s==spline )
2156 return( true );
2157  if ( first==NULL ) first = s;
2158  }
2159 return( false );
2160 }
2161 
2162 #include "edgelist.h"
2163 
2164 static void EdgeListReverse(EdgeList *es, SplineSet *spl) {
2165  int i;
2166 
2167  if ( es->edges!=NULL ) {
2168  for ( i=0; i<es->cnt; ++i ) {
2169  Edge *e;
2170  for ( e = es->edges[i]; e!=NULL; e = e->esnext ) {
2171  if ( SplineInSplineSet(e->spline,spl)) {
2172  e->up = !e->up;
2173  e->t_mmin = 1-e->t_mmin;
2174  e->t_mmax = 1-e->t_mmax;
2175  e->t_cur = 1-e->t_cur;
2176  }
2177  }
2178  }
2179  }
2180 }
2181 
2182 static int SSCheck(SplineSet *base,Edge *active, int up, EdgeList *es,int *changed) {
2183  SplineSet *spl;
2184  if ( active->spline->isticked )
2185 return( 0 );
2186  spl = SplineSetOfSpline(base,active->spline);
2187  if ( active->up!=up ) {
2188  SplineSetReverse(spl);
2189  *changed = true;
2190  EdgeListReverse(es,spl);
2191  }
2192  SplineSetTick(spl);
2193 return( 1 );
2194 }
2195 
2196 
2197 /* The idea behind SplineSetsCorrect is simple. However there are many splinesets */
2198 /* where it is impossible, so bear in mind that this only works for nice */
2199 /* splines. Figure 8's, interesecting splines all cause problems */
2200 /* The outermost spline should be clockwise (up), the next splineset we find */
2201 /* should be down, if it isn't reverse it (if it's already been dealt with */
2202 /* then ignore it) */
2204  SplineSet *spl;
2205  int sscnt, check_cnt;
2206  EdgeList es;
2207  DBounds b;
2208  Edge *active=NULL, *apt, *pr, *e;
2209  int i, winding;
2210 
2211  *changed = false;
2212 
2214  for (sscnt=0,spl=base; spl!=NULL; spl=spl->next, ++sscnt );
2215 
2217  memset(&es,'\0',sizeof(es));
2218  es.scale = 1.0;
2219  es.mmin = floor(b.miny*es.scale);
2220  es.mmax = ceil(b.maxy*es.scale);
2221  es.omin = b.minx*es.scale;
2222  es.omax = b.maxx*es.scale;
2223  es.layer = ly_fore; /* Not meaningful */
2224 
2225 /* Give up if we are given unreasonable values (ie. if rounding errors might screw us up) */
2226  if ( es.mmin<1e5 && es.mmax>-1e5 && es.omin<1e5 && es.omax>-1e5 ) {
2227  es.cnt = (int) (es.mmax-es.mmin) + 1;
2228  es.edges = gcalloc(es.cnt,sizeof(Edge *));
2229  es.interesting = gcalloc(es.cnt,sizeof(char));
2230  es.sc = NULL;
2231  es.major = 1; es.other = 0;
2232  FindEdgesSplineSet(base,&es,false);
2233 
2234  check_cnt = 0;
2235  for ( i=0; i<es.cnt && check_cnt<sscnt; ++i ) {
2237  if ( es.edges[i]!=NULL )
2238  continue; /* Just too hard to get the edges sorted when we are at a start vertex */
2239  if ( /*es.edges[i]==NULL &&*/ !es.interesting[i] &&
2240  !(i>0 && es.interesting[i-1]) && !(i>0 && es.edges[i-1]!=NULL) &&
2241  !(i<es.cnt-1 && es.edges[i+1]!=NULL) &&
2242  !(i<es.cnt-1 && es.interesting[i+1])) /* interesting things happen when we add (or remove) entries */
2243  continue; /* and where we have extrema */
2244  for ( apt=active; apt!=NULL; apt = e) {
2245  check_cnt += SSCheck(base,apt,true,&es,changed);
2246  winding = apt->up?1:-1;
2247  for ( pr=apt, e=apt->aenext; e!=NULL && winding!=0; pr=e, e=e->aenext ) {
2248  if ( !e->spline->isticked )
2249  check_cnt += SSCheck(base,e,winding<0,&es,changed);
2250  if ( pr->up!=e->up )
2251  winding += (e->up?1:-1);
2252  else if ( (pr->before==e || pr->after==e ) &&
2253  (( pr->mmax==i && e->mmin==i ) ||
2254  ( pr->mmin==i && e->mmax==i )) )
2255  /* This just continues the line and doesn't change count */;
2256  else
2257  winding += (e->up?1:-1);
2258  }
2259  /* color a horizontal line that comes out of the last vertex */
2260  if ( e!=NULL && (e->before==pr || e->after==pr) &&
2261  (( pr->mmax==i && e->mmin==i ) ||
2262  ( pr->mmin==i && e->mmax==i )) ) {
2263  pr = e;
2264  e = e->aenext;
2265  }
2266  }
2267  }
2268  FreeEdges(&es);
2269  }
2270 return( base );
2271 }
2272 
2273 
2275  EIList el;
2276  EI *active=NULL, *apt, *e;
2277  int i, change,waschange;
2278  SplineChar dummy;
2279  SplineSet *next;
2280  int ret = -1, maybe=-1;
2281  Layer layers[2];
2282 
2283  if ( spl->first!=spl->last || spl->first->next == NULL )
2284 return( -1 ); /* Open paths, (open paths with only one point are a special case) */
2285 
2286  memset(&el,'\0',sizeof(el));
2287  memset(&dummy,'\0',sizeof(dummy));
2288  memset(layers,0,sizeof(layers));
2289  el.layer = ly_fore;
2290  dummy.layers = layers;
2291  dummy.layer_cnt = 2;
2292  dummy.layers[ly_fore].splines = (SplineSet *) spl;
2293  next = spl->next; ((SplineSet *) spl)->next = NULL;
2294  ELFindEdges(&dummy,&el);
2295  if ( el.coordmax[1]-el.coordmin[1] > 1.e6 ) {
2296  LogError( _("Warning: Unreasonably big splines. They will be ignored.\n") );
2297 return( -1 );
2298  }
2299  el.major = 1;
2300  ELOrder(&el,el.major);
2301 
2302  waschange = false;
2303  for ( i=0; i<el.cnt && ret==-1; ++i ) {
2304  active = EIActiveEdgesRefigure(&el,active,i,1,&change);
2305  if ( el.ordered[i]!=NULL || el.ends[i] || waschange || change ) {
2306  waschange = change;
2307  if ( active!=NULL )
2308  maybe = active->up;
2309  continue; /* Just too hard to get the edges sorted when we are at a start vertex */
2310  }
2311  waschange = change;
2312  for ( apt=active; apt!=NULL && ret==-1; apt = e) {
2313  if ( EISkipExtremum(apt,i+el.low,1)) {
2314  e = apt->aenext->aenext;
2315  continue;
2316  }
2317  ret = apt->up;
2318  break;
2319  }
2320  }
2321  free(el.ordered);
2322  free(el.ends);
2323  ElFreeEI(&el);
2324  ((SplineSet *) spl)->next = next;
2325  if ( ret==-1 )
2326  ret = maybe;
2327 return( ret );
2328 }
double __cdecl atan2(double _Y, double _X)
double __cdecl rint(double _X)
long __cdecl strtol(char const *_String, char **_EndPtr, int _Radix)
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
static int pr(int(*writeFunc)(void *stream, const char *data, int size), void *stream, const char *data)
Definition: HTMLGen.cc:249
bp
Definition: action.c:1035
#define sc
Definition: aptex-macros.h:57
#define active
Definition: aptex-macros.h:325
#define type(a)
Definition: aptex-macros.h:171
#define next(a)
Definition: aptex-macros.h:924
#define bool
Definition: autosp.c:101
#define b
Definition: jpegint.h:372
#define free(a)
Definition: decNumber.cpp:310
char * within
Definition: definitions.c:59
#define strrchr
Definition: detex.c:67
#define dummy
Definition: devnag.c:313
int dummy
Definition: dummy.c:29
int w
Definition: dviconv.c:26
static int np
Definition: bifont.c:64
double real
Definition: dvips.h:66
double cos()
double sin()
double sqrt()
char * strncpy()
char * temp
Definition: dvidvi.c:137
char * TTFFoundry
Definition: tottf.c:40
#define _(String)
Definition: ftxerr18.c:64
static void copy(GlyphCachePtr *root)
Definition: gcache.c:378
#define tp
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
static FIELD_PTR prev
Definition: genind.c:36
#define dot
Definition: globals.h:56
__gmp_expr< mpf_t, __gmp_unary_expr< __gmp_expr< mpf_t, U >, __gmp_ceil_function > > ceil(const __gmp_expr< mpf_t, U > &expr)
Definition: gmpxx.h:3340
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
#define d(n)
Definition: gpos-common.c:151
int base
Definition: gsftopk.c:1502
#define strchr
Definition: gsftopk.c:59
#define memcpy(d, s, n)
Definition: gsftopk.c:64
#define slen
Definition: hpcdtoppm.c:1329
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
#define forever
Definition: ftrandom.c:53
kerning y
Definition: ttdriver.c:212
int int cy
Definition: gdfx.h:13
int cx
Definition: gdfx.h:12
#define rand()
Definition: mem.h:49
static int ret
Definition: convert.c:72
#define fabs(x)
Definition: cpascal.h:211
#define floor(x)
Definition: cpascal.h:52
#define normal
Definition: ctangleboot.c:124
#define fmax
Definition: synctex_main.c:96
#define test
Definition: tie.c:129
long time_t
Definition: types.h:18
#define sprintf
Definition: snprintf.c:44
unsigned char uint8
Definition: tiff.h:60
int unit
Definition: tfmread.c:8
angle
Definition: cordic.py:17
float x
Definition: cordic.py:15
dictionary off
Definition: fc-lang.py:226
int k
Definition: otp-parser.c:70
boolean changed
Definition: parse_ofm.c:90
#define min(a, b)
Definition: pbmplus.h:223
#define t4
#define t1
#define t3
#define t2
static int cnt
Definition: pkout.c:166
real to[600]
Definition: pmxab.c:87
static int32_t first
Definition: ppagelist.c:29
int db
Definition: ppmqvga.c:68
static int cury
Definition: ppmtogif.c:300
static int curx
Definition: ppmtogif.c:300
bstring c int memset(void *s, int c, int length)
time_t time()
#define dir
C API: Unicode string handling functions.
void ElFreeEI(EIList *el)
Definition: autohint.c:595
int EISkipExtremum(EI *e, float i, int major)
Definition: autohint.c:1021
EI * EIActiveEdgesRefigure(EIList *el, EI *active, float i, int major, int *_change)
Definition: autohint.c:925
void ELFindEdges(SplineChar *sc, EIList *el)
Definition: autohint.c:723
void ELOrder(EIList *el, int major)
Definition: autohint.c:774
void FreeEdges(EdgeList *es)
Definition: splinefill.c:61
NameList * DefaultNameListForNewFonts(void)
Definition: namelist.c:151
ae_type
Definition: splinefont.h:2193
@ ae_only_good
Definition: splinefont.h:2193
@ ae_between_selected
Definition: splinefont.h:2193
@ ae_only_good_rm_later
Definition: splinefont.h:2193
Spline * SplineMake(SplinePoint *from, SplinePoint *to, int order2)
double CheckExtremaForSingleBitErrors(const Spline1D *sp, double t, double othert)
Definition: splineutil.c:1630
int IntersectLines(BasePoint *inter, BasePoint *line1_1, BasePoint *line1_2, BasePoint *line2_1, BasePoint *line2_2)
Definition: splineutil.c:1877
SplinePoint * SplineBisect(Spline *spline, double t)
Definition: splineutil.c:3485
@ ly_fore
Definition: splinefont.h:1209
#define extended
Definition: splinefont.h:52
@ pt_hvcurve
Definition: splinefont.h:951
@ pt_curve
Definition: splinefont.h:951
@ pt_tangent
Definition: splinefont.h:951
@ pt_corner
Definition: splinefont.h:951
void SplineRefigureFixup(Spline *spline)
Spline * SplineMake2(SplinePoint *from, SplinePoint *to)
#define bigreal
Definition: splinefont.h:49
void SplineFindExtrema(const Spline1D *sp, double *_t1, double *_t2)
Definition: splineutil.c:1668
void SplineFree(Spline *spline)
Definition: splineutil.c:115
int CubicSolve(const Spline1D *sp, double sought, double ts[3])
Definition: splineutil.c:1480
Spline * SplineMake3(SplinePoint *from, SplinePoint *to)
Definition: splineutil.c:133
void SplineSetQuickBounds(SplineSet *ss, DBounds *b)
Definition: splineutil.c:538
void SplineRefigure(Spline *spline)
SplineFont * SplineFontEmpty(void)
Definition: splineutil2.c:776
void SplineCharDefaultNextCP(SplinePoint *base)
Definition: splineutil2.c:928
int new_fonts_are_order2
Definition: splineutil2.c:33
int RealWithin(float a, float b, float fudge)
Definition: splineutil2.c:159
int snaptoint
Definition: splineutil2.c:40
int RealNear(float a, float b)
Definition: splineutil2.c:112
int SplineIsLinear(Spline *spline)
Definition: splineutil2.c:199
int RealApprox(float a, float b)
Definition: splineutil2.c:143
int RealNearish(float a, float b)
Definition: splineutil2.c:137
int default_fv_antialias
Definition: splineutil2.c:38
Spline * SplineAddExtrema(Spline *s, int always, float lenbound, float offsetbound, DBounds *b)
Definition: splineutil2.c:573
int default_fv_row_count
Definition: splineutil2.c:35
void SplineCharDefaultPrevCP(SplinePoint *base)
Definition: splineutil2.c:1032
void BP_HVForce(BasePoint *vector)
Definition: splineutil2.c:909
int default_fv_bbsized
Definition: splineutil2.c:39
int SplinePointListIsClockwise(const SplineSet *spl)
Definition: splineutil2.c:1344
int default_fv_font_size
Definition: splineutil2.c:37
void SplineCharTangentNextCP(SplinePoint *sp)
Definition: splineutil2.c:851
double SplineLength(Spline *spline)
Definition: splineutil2.c:383
void SFIncrementXUID(SplineFont *sf)
Definition: splineutil2.c:847
void SplineCharTangentPrevCP(SplinePoint *sp)
Definition: splineutil2.c:880
int default_fv_col_count
Definition: splineutil2.c:36
int loaded_fonts_same_as_new
Definition: splineutil2.c:34
SplineSet * SplineSetReverse(SplineSet *spl)
Definition: splineutil2.c:1264
int new_em_size
Definition: splineutil2.c:32
#define IError
Definition: uiinterface.h:124
#define LogError
Definition: uiinterface.h:125
test
Definition: parser.c:257
void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es, int ignore_clip)
Definition: splinefill.c:431
Edge * ActiveEdgesRefigure(EdgeList *es, Edge *active, double i)
Definition: splinefill.c:481
void SplinePointMDFree(SplineChar *sc, SplinePoint *sp)
Definition: splineutil.c:254
void SplinePointCatagorize(SplinePoint *sp)
Definition: splineutil.c:827
void SplineSetFindBounds(const SplinePointList *spl, DBounds *bounds)
Definition: splineutil.c:530
static void SplinePointReCatagorize(SplinePoint *sp, int oldpt)
Definition: splineutil2.c:1160
static void TestForLinear(SplinePoint *from, SplinePoint *to)
Definition: splineutil2.c:443
void SSOverlapClusterCpAngles(SplineSet *base, double within)
Definition: splineutil2.c:1364
void SPWeightedAverageCps(SplinePoint *sp)
Definition: splineutil2.c:1679
static int MinMaxWithin(Spline *spline)
Definition: splineutil2.c:107
static void SplineSetsUntick(SplineSet *spl)
Definition: splineutil2.c:2107
char * GetNextUntitledName(void)
Definition: splineutil2.c:1596
static void SFChangeXUID(SplineFont *sf, int random)
Definition: splineutil2.c:1641
static int _ApproximateSplineFromPoints(SplinePoint *from, SplinePoint *to, TPoint *mid, int cnt, BasePoint *nextcp, BasePoint *prevcp, int order2)
Definition: splineutil2.c:286
static int SplineInSplineSet(Spline *spline, SplineSet *spl)
Definition: splineutil2.c:2150
static TPoint * SplinesFigureTPsBetween(SplinePoint *from, SplinePoint *to, int *tot)
Definition: splineutil2.c:1090
static void RemoveStupidControlPoints(SplineSet *spl)
Definition: splineutil2.c:1204
Spline * ApproximateSplineFromPointsSlopes(SplinePoint *from, SplinePoint *to, TPoint *mid, int cnt, int order2)
Definition: splineutil2.c:696
static void OverlapClusterCpAngles(SplineSet *spl, double within)
Definition: splineutil2.c:1259
int RealRatio(double a, double b, double fudge)
Definition: splineutil2.c:99
static SplineSet * SplineSetOfSpline(SplineSet *spl, Spline *search)
Definition: splineutil2.c:2135
#define DECIMATION
Definition: splineutil2.c:695
static double SplineLenApprox(Spline *spline)
Definition: splineutil2.c:1048
void SplineSetAddExtrema(SplineChar *sc, SplineSet *ss, enum ae_type between_selected, int emsize)
Definition: splineutil2.c:1547
static double SigmaDeltas(Spline *spline, TPoint *mid, int cnt, DBounds *b, struct dotbounds *db)
Definition: splineutil2.c:542
static Spline * IsLinearApprox(SplinePoint *from, SplinePoint *to, TPoint *mid, int cnt, int order2)
Definition: splineutil2.c:235
static double ClosestSplineSolve(Spline1D *sp, double sought, double close_to_t)
Definition: splineutil2.c:511
void SFRandomChangeXUID(SplineFont *sf)
Definition: splineutil2.c:1675
static void SplineSetTick(SplineSet *spl)
Definition: splineutil2.c:2125
void SplinesRemoveBetween(SplineChar *sc, SplinePoint *from, SplinePoint *to, int type)
Definition: splineutil2.c:1170
SplineSet * SplineSetsCorrect(SplineSet *base, int *changed)
Definition: splineutil2.c:2203
static int SSCheck(SplineSet *base, Edge *active, int up, EdgeList *es, int *changed)
Definition: splineutil2.c:2182
static void ApproxBounds(DBounds *b, TPoint *mid, int cnt, struct dotbounds *db)
Definition: splineutil2.c:622
void SPAverageCps(SplinePoint *sp)
Definition: splineutil2.c:1711
Spline * ApproximateSplineFromPoints(SplinePoint *from, SplinePoint *to, TPoint *mid, int cnt, int order2)
Definition: splineutil2.c:481
#define TRY_CNT
Definition: splineutil2.c:694
void SSRemoveStupidControlPoints(SplineSet *base)
Definition: splineutil2.c:1252
int SplineIsLinearMake(Spline *spline)
Definition: splineutil2.c:214
#define NICE_PROPORTION
Definition: splineutil2.c:1838
static int GoodCurve(SplinePoint *sp, int check_prev)
Definition: splineutil2.c:640
static void EdgeListReverse(EdgeList *es, SplineSet *spl)
Definition: splineutil2.c:2164
void * gcalloc(int cnt, long size)
void * galloc(long size)
ShellFileEnvironment e
Definition: sh6.c:388
Long y
Definition: ftraster.c:330
Long x
Definition: ftraster.c:329
float x
Definition: splinefont.h:70
float y
Definition: splinefont.h:71
Definition: utils.c:300
double max
Definition: splineutil2.c:539
BasePoint unit
Definition: splineutil2.c:536
double min
Definition: splineutil2.c:539
BasePoint base
Definition: splineutil2.c:537
double len
Definition: splineutil2.c:538
float scale
Definition: edgelist.h:65
float omin
Definition: edgelist.h:64
int layer
Definition: edgelist.h:70
int major
Definition: edgelist.h:72
float mmax
Definition: edgelist.h:63
SplineChar * sc
Definition: edgelist.h:69
char * interesting
Definition: edgelist.h:71
int other
Definition: edgelist.h:72
int cnt
Definition: edgelist.h:62
float mmin
Definition: edgelist.h:63
Edge ** edges
Definition: edgelist.h:61
float omax
Definition: edgelist.h:64
char * ends
Definition: edgelist.h:124
int major
Definition: edgelist.h:127
float coordmax[2]
Definition: edgelist.h:121
float coordmin[2]
Definition: edgelist.h:120
int layer
Definition: edgelist.h:126
int low
Definition: edgelist.h:122
EI ** ordered
Definition: edgelist.h:123
int cnt
Definition: edgelist.h:122
SplinePointList * splines
Definition: splinefont.h:1201
Definition: search.h:25
Definition: tfmaux.c:31
float a
Definition: splinefont.h:1010
float d
Definition: splinefont.h:1010
float b
Definition: splinefont.h:1010
float c
Definition: splinefont.h:1010
unsigned int order2
Definition: splinefont.h:1032
unsigned int knowncurved
Definition: splinefont.h:1029
unsigned int ishorvert
Definition: splinefont.h:1028
Spline1D splines[2]
Definition: splinefont.h:1039
unsigned int islinear
Definition: splinefont.h:1022
SplinePoint * to
Definition: splinefont.h:1038
unsigned int isunneeded
Definition: splinefont.h:1026
unsigned int knownlinear
Definition: splinefont.h:1030
unsigned int isticked
Definition: splinefont.h:1024
SplinePoint * from
Definition: splinefont.h:1037
unsigned int isneeded
Definition: splinefont.h:1025
unsigned int isintersection
Definition: splinefont.h:964
unsigned int pointtype
Definition: splinefont.h:963
BasePoint me
Definition: splinefont.h:953
unsigned int noprevcp
Definition: splinefont.h:957
struct spline * next
Definition: splinefont.h:979
struct spline * prev
Definition: splinefont.h:980
unsigned int nonextcp
Definition: splinefont.h:956
BasePoint nextcp
Definition: splinefont.h:954
unsigned int prevcpdef
Definition: splinefont.h:959
BasePoint prevcp
Definition: splinefont.h:955
unsigned int nextcpdef
Definition: splinefont.h:958
struct splinepointlist * next
Definition: splinefont.h:1073
SplinePoint * last
Definition: splinefont.h:1072
SplinePoint * first
Definition: splinefont.h:1072
Definition: dvips.h:235
Definition: fio.h:71
Definition: strexpr.c:21
Definition: sed.h:50
int j
Definition: t4ht.c:1589
up
Definition: tex4ht.c:2558
val
Definition: tex4ht.c:3227
m
Definition: tex4ht.c:3990
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
#define sp
Definition: stack.c:11
PATTERN * pt
Definition: vlna.c:74