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)  

tottfaat.c
Go to the documentation of this file.
1 /* Copyright (C) 2000-2012 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 "fontforge.h"
28 #include <utype.h>
29 
30 #include "ttf.h"
31 
32 /* This file contains routines to create some of the Apple Advanced Typography Tables */
33 /* (or GX fonts) */
34 
35 /* ************************************************************************** */
36 /* ************************* The 'kern' table ************************* */
37 /* ************************************************************************** */
38 
39 
40 /* Apple's docs imply that kerning info is always provided left to right, even*/
41 /* for right to left scripts. If that be so then we need code in here to reverse */
42 /* the order of the characters for right to left since pfaedit's convention */
43 /* is to follow writing order rather than to go left to right */
44 
45 
46 static void DumpKernClass(FILE *file, uint16 *class,int cnt,int add,int mul) {
47  int i, first=-1, last=-1;
48 
49  for ( i=0; i<cnt; ++i ) {
50  if ( class[i] ) last = i;
51  if ( class[i] && first==-1 ) first = i;
52  }
55  for ( i=first; i<=last; ++i )
56  putshort(file,class[i]*mul+add);
57 }
58 
59 static int morx_dumpASM(FILE *temp,ASM *sm, struct alltabs *at, SplineFont *sf );
60 
61 struct kerncounts {
62  int cnt;
63  int vcnt;
64  int mh, mv;
65  int kccnt;
66  int vkccnt;
67  int ksm;
68  int hsubs;
69  int *hbreaks;
70  int vsubs;
71  int *vbreaks;
72 };
73 
74 static int CountKerns(struct alltabs *at, SplineFont *sf, struct kerncounts *kcnt) {
75  int i, cnt, vcnt, j, kccnt=0, vkccnt=0, ksm=0, mh, mv;
76  KernPair *kp;
77  KernClass *kc;
78  ASM *sm;
79 
80  cnt = mh = vcnt = mv = 0;
81  for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
82  j = 0;
83  for ( kp = sf->glyphs[at->gi.bygid[i]]->kerns; kp!=NULL; kp=kp->next )
84  if ( kp->off!=0 && kp->sc->ttf_glyph!=-1 &&
85  LookupHasDefault(kp->subtable->lookup ))
86  ++cnt, ++j;
87  if ( j>mh ) mh=j;
88  j=0;
89  for ( kp = sf->glyphs[at->gi.bygid[i]]->vkerns; kp!=NULL; kp=kp->next )
90  if ( kp->off!=0 && kp->sc->ttf_glyph!=-1 &&
91  LookupHasDefault(kp->subtable->lookup ))
92  ++vcnt, ++j;
93  if ( j>mv ) mv=j;
94  }
95  kcnt->cnt = cnt;
96  kcnt->vcnt = vcnt;
97  kcnt->mh = mh;
98  kcnt->mv = mv;
99  kcnt->hbreaks = kcnt->vbreaks = NULL;
100  if ( cnt>=10000 ) {
101  /* the sub-table size is 6*cnt+14 or so and needs to be less 65535 */
102  /* so break it up into little bits */
103  /* We might not need this when applemode is set because the subtable */
104  /* length is a long. BUT... there's a damn binsearch header with */
105  /* shorts in it still */
106  int b=0;
107  kcnt->hbreaks = malloc((at->gi.gcnt+1)*sizeof(int));
108  cnt = 0;
109  for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
110  j = 0;
111  for ( kp = sf->glyphs[at->gi.bygid[i]]->kerns; kp!=NULL; kp=kp->next )
112  if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup ))
113  ++j;
114  if ( (cnt+j)*6>64000L && cnt!=0 ) {
115  kcnt->hbreaks[b++] = cnt;
116  cnt = 0;
117  }
118  cnt += j;
119  }
120  kcnt->hbreaks[b++] = cnt;
121  kcnt->hsubs = b;
122  } else if ( cnt!=0 )
123  kcnt->hsubs = 1;
124  else
125  kcnt->hsubs = 0;
126  if ( vcnt>=10000 ) {
127  int b=0;
128  kcnt->vbreaks = malloc((at->gi.gcnt+1)*sizeof(int));
129  vcnt = 0;
130  for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
131  j = 0;
132  for ( kp = sf->glyphs[at->gi.bygid[i]]->vkerns; kp!=NULL; kp=kp->next )
133  if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup))
134  ++j;
135  if ( (vcnt+j)*6>64000L && vcnt!=0 ) {
136  kcnt->vbreaks[b++] = vcnt;
137  vcnt = 0;
138  }
139  vcnt += j;
140  }
141  kcnt->vbreaks[b++] = vcnt;
142  kcnt->vsubs = b;
143  } else if ( vcnt!=0 )
144  kcnt->vsubs = 1;
145  else
146  kcnt->vsubs = 0;
147 
148  if ( at->applemode ) { /* if we aren't outputting Apple's extensions to kerning (by classes, and by state machine) then don't check for those extensions */
149  for ( kc=sf->kerns; kc!=NULL; kc = kc->next ) if ( LookupHasDefault(kc->subtable->lookup) )
150  ++kccnt;
151  for ( kc=sf->vkerns; kc!=NULL; kc = kc->next ) if ( LookupHasDefault(kc->subtable->lookup) )
152  ++vkccnt;
153  for ( sm=sf->sm; sm!=NULL; sm=sm->next )
154  if ( sm->type == asm_kern )
155  ++ksm;
156  }
157  kcnt->kccnt = kccnt;
158  kcnt->vkccnt = vkccnt;
159  kcnt->ksm = ksm;
160 return( kcnt->hsubs + kcnt->vsubs + kccnt + vkccnt + ksm );
161 }
162 
163 static void ttf_dumpsfkerns(struct alltabs *at, SplineFont *sf, int tupleIndex, int version) {
164  struct kerncounts kcnt;
165  int i, j, k, m, c, gid, tot, km;
166  KernPair *kp;
167  KernClass *kc;
168  ASM *sm;
169  uint16 *glnum, *offsets;
170  int isv;
171  int tupleMask = tupleIndex==-1 ? 0 : 0x2000;
172  int b, bmax;
173  int *breaks;
174  int winfail=0;
175  int subtableBeginPos,subtableEndPos;
176 
177  if ( CountKerns(at,sf,&kcnt)==0 )
178 return;
179 
180  if ( tupleIndex==-1 ) tupleIndex = 0;
181 
182  for ( isv=0; isv<2; ++isv ) {
183  c = isv ? kcnt.vcnt : kcnt.cnt;
184  bmax = isv ? kcnt.vsubs : kcnt.hsubs;
185  breaks = isv ? kcnt.vbreaks : kcnt.hbreaks;
186  if ( c!=0 ) {
187  km = isv ? kcnt.mv : kcnt.mh;
188  glnum = malloc(km*sizeof(uint16));
189  offsets = malloc(km*sizeof(uint16));
190  gid = 0;
191  for ( b=0; b<bmax; ++b ) {
192  c = bmax==1 ? c : breaks[b];
193 
194  // skip subtable header because we don't know the number of kern pairs yet
195  subtableBeginPos=ftell(at->kern);
196  if(version==0) fseek(at->kern,7*sizeof(uint16),SEEK_CUR);
197  else fseek(at->kern,8*sizeof(uint16),SEEK_CUR);
198 
199  for ( tot = 0; gid<at->gi.gcnt && tot<c; ++gid ) if ( at->gi.bygid[gid]!=-1 ) {
200  SplineChar *sc = sf->glyphs[at->gi.bygid[gid]];
201  // if requested, omit kern pairs with unmapped glyphs
202  // (required for compatibility with non-OpenType-aware Windows applications)
203  if( (at->gi.flags&ttf_flag_oldkernmappedonly) && (unsigned)(sc->unicodeenc)>0xFFFF ) continue;
204  m = 0;
205  for ( kp = isv ? sc->vkerns : sc->kerns; kp!=NULL; kp=kp->next ) {
206  // if requested, omit kern pairs with unmapped glyphs
207  // (required for compatibility with non-OpenType-aware Windows applications)
208  if( (at->gi.flags&ttf_flag_oldkernmappedonly) && (unsigned)(kp->sc->unicodeenc)>0xFFFF ) continue;
209  if ( kp->off!=0 && kp->sc->ttf_glyph!=-1 &&
210  LookupHasDefault(kp->subtable->lookup)) {
211  /* order the pairs */
212  for ( j=0; j<m; ++j )
213  if ( kp->sc->ttf_glyph<glnum[j] )
214  break;
215  for ( k=m; k>j; --k ) {
216  glnum[k] = glnum[k-1];
217  offsets[k] = offsets[k-1];
218  }
219  glnum[j] = kp->sc->ttf_glyph;
220  offsets[j] = kp->off;
221  ++m;
222  /* check if a pair will cause problems on Windows */
223  /* If the glyph is outside BMP, so either unicode >0xffff */
224  /* or -1. Cast to unsigned catches both */
225  if( (unsigned)(sf->glyphs[at->gi.bygid[gid]]->unicodeenc)>0xFFFF ||
226  (unsigned)(sf->glyphs[at->gi.bygid[glnum[j]]]->unicodeenc)>0xFFFF )
227  winfail++;
228  }
229  }
230  for ( j=0; j<m; ++j ) {
231  putshort(at->kern,gid);
232  putshort(at->kern,glnum[j]);
233  putshort(at->kern,offsets[j]);
234  }
235  tot += m;
236  }
237 
238  // now we can fill the subtable header
239  c=tot;
240  subtableEndPos=ftell(at->kern);
241  fseek(at->kern,subtableBeginPos,SEEK_SET);
242  if ( version==0 ) {
243  putshort(at->kern,0); /* subtable version */
244  if ( c>10920 )
245  ff_post_error(_("Too many kern pairs"),_("The 'kern' table supports at most 10920 kern pairs in a subtable"));
246  putshort(at->kern,(7+3*c)*sizeof(uint16)); /* subtable length */
247  putshort(at->kern,!isv); /* coverage, flags=hor/vert&format=0 */
248  } else {
249  putlong(at->kern,(8+3*c)*sizeof(uint16)); /* subtable length */
250  /* Apple's new format has a completely different coverage format */
251  putshort(at->kern,(isv?0x8000:0)| /* format 0, horizontal/vertical flags (coverage) */
252  tupleMask);
253  putshort(at->kern,tupleIndex);
254  }
255  putshort(at->kern,c);
256  for ( i=1,j=0; i<=c; i<<=1, ++j );
257  i>>=1; --j;
258  putshort(at->kern,i*6); /* binary search headers */
259  putshort(at->kern,j);
260  putshort(at->kern,6*(c-i));
261  fseek(at->kern,subtableEndPos,SEEK_SET);
262  }
263  free(offsets);
264  free(glnum);
265  }
266  }
267  free(kcnt.hbreaks); free(kcnt.vbreaks);
268 
269  if( winfail > 0 )
270  ff_post_error(_("Kerning is likely to fail on Windows"),_(
271  "Note: On Windows many apps can have problems with this font's kerning, because %d of its glyph kern pairs cannot be mapped to unicode-BMP kern pairs (eg, they have a Unicode value of -1) To avoid this, go to Generate, Options, and check the \"Windows-compatible \'kern\'\" option."),
272  winfail);
273 
274  if ( at->applemode ) for ( isv=0; isv<2; ++isv ) {
275  for ( kc=isv ? sf->vkerns : sf->kerns; kc!=NULL; kc=kc->next ) if ( LookupHasDefault(kc->subtable->lookup) ) {
276  /* If we are here, we must be using version 1 */
277  uint32 len_pos = ftell(at->kern), pos;
278  uint16 *class1, *class2;
279  int first_cnt = kc->first_cnt;
280 
281  /* OpenType fonts can actually have a set of glyphs in class[0] of*/
282  /* the first class. This happens when there are glyphs in the */
283  /* coverage table which are not in any of the classes. Otherwise */
284  /* class 0 is sort of useless in opentype */
285  if ( kc->firsts[0]!=NULL )
286  ++first_cnt;
287 
288  putlong(at->kern,0); /* subtable length */
289  putshort(at->kern,(isv?0x8002:2)| /* format 2, horizontal/vertical flags (coverage) */
290  tupleMask);
291  putshort(at->kern,tupleIndex);
292 
293  putshort(at->kern,sizeof(uint16)*kc->second_cnt);
294  putshort(at->kern,0); /* left classes */
295  putshort(at->kern,0); /* right classes */
296  putshort(at->kern,16); /* Offset to array, next byte */
297 
298  if ( kc->firsts[0]!=NULL ) {
299  /* Create a dummy class to correspond to the mac's class 0 */
300  /* all entries will be 0 */
301  for ( i=0 ; i<kc->second_cnt; ++i )
302  putshort(at->kern,0);
303  }
304  for ( i=0; i<kc->first_cnt*kc->second_cnt; ++i )
305  putshort(at->kern,kc->offsets[i]);
306 
307  pos = ftell(at->kern);
308  fseek(at->kern,len_pos+10,SEEK_SET);
309  putshort(at->kern,pos-len_pos);
310  fseek(at->kern,pos,SEEK_SET);
311  class1 = ClassesFromNames(sf,kc->firsts,kc->first_cnt,at->maxp.numGlyphs,NULL,true);
312  DumpKernClass(at->kern,class1,at->maxp.numGlyphs,16,sizeof(uint16)*kc->second_cnt);
313  free(class1);
314 
315  pos = ftell(at->kern);
316  fseek(at->kern,len_pos+12,SEEK_SET);
317  putshort(at->kern,pos-len_pos);
318  fseek(at->kern,pos,SEEK_SET);
319  class2 = ClassesFromNames(sf,kc->seconds,kc->second_cnt,at->maxp.numGlyphs,NULL,true);
320  DumpKernClass(at->kern,class2,at->maxp.numGlyphs,0,sizeof(uint16));
321  free(class2);
322 
323  pos = ftell(at->kern);
324  fseek(at->kern,len_pos,SEEK_SET);
325  putlong(at->kern,pos-len_pos);
326  fseek(at->kern,pos,SEEK_SET);
327  }
328  }
329 
330  if ( at->applemode ) if ( kcnt.ksm!=0 ) {
331  for ( sm=sf->sm; sm!=NULL; sm=sm->next ) if ( sm->type == asm_kern ) {
332  uint32 len_pos = ftell(at->kern), pos;
333 
334  putlong(at->kern,0); /* subtable length */
335  putshort(at->kern,((sm->flags&0x8000)?0x8001:1)| /* format 1, horizontal/vertical flags (coverage) */
336  tupleMask);
337  putshort(at->kern,tupleIndex);
338  morx_dumpASM(at->kern,sm,at,sf);
339 
340  pos = ftell(at->kern);
341  fseek(at->kern,len_pos,SEEK_SET);
342  putlong(at->kern,pos-len_pos);
343  fseek(at->kern,pos,SEEK_SET);
344  }
345  }
346 }
347 
348 void ttf_dumpkerns(struct alltabs *at, SplineFont *sf) {
349  int i, mmcnt=0, sum;
350  int version;
351  MMSet *mm = at->dovariations ? sf->mm : NULL;
352  struct kerncounts kcnt;
353  int must_use_old_style = 0;
354 
355  if ( !at->applemode && (!at->opentypemode || (at->gi.flags&ttf_flag_oldkern)) ) {
356  must_use_old_style = true;
358  mm = NULL;
359  } else {
360  if ( mm!=NULL ) {
361  for ( i=0; i<mm->instance_count; ++i ) {
362  mmcnt += CountKerns(at,mm->instances[i],&kcnt);
363  free(kcnt.hbreaks); free(kcnt.vbreaks);
364  }
365  sf = mm->normal;
366  }
367  }
368 
369  sum = CountKerns(at,sf,&kcnt);
370  free(kcnt.hbreaks); free(kcnt.vbreaks);
371  if ( sum==0 && mmcnt==0 ) {
372  if ( must_use_old_style )
373  SFKernCleanup(sf,false);
374 return;
375  }
376 
377  /* Old kerning format (version 0) uses 16 bit quantities */
378  /* Apple's new format (version 0x00010000) uses 32 bit quantities */
379  at->kern = tmpfile2();
380  if ( must_use_old_style ||
381  ( kcnt.kccnt==0 && kcnt.vkccnt==0 && kcnt.ksm==0 && mmcnt==0 )) {
382  /* MS does not support format 1,2,3 kern sub-tables so if we have them */
383  /* we might as well admit that this table is for apple only and use */
384  /* the new format apple recommends. Otherwise, use the old format */
385  /* If we might need to store tuple data, use the new format */
386  putshort(at->kern,0); /* version */
387  putshort(at->kern,sum); /* number of subtables */
388  version = 0;
389  } else {
390  putlong(at->kern,0x00010000); /* version */
391  putlong(at->kern,sum+mmcnt); /* number of subtables */
392  version = 1;
393  }
394 
395  ttf_dumpsfkerns(at, sf, -1, version);
396  if ( mm!=NULL ) {
397  for ( i=0; i<mm->instance_count; ++i )
398  ttf_dumpsfkerns(at, mm->instances[i], i, version);
399  }
400  if ( must_use_old_style )
401  SFKernCleanup(sf,false);
402 
403  at->kernlen = ftell(at->kern);
404  if ( at->kernlen&2 )
405  putshort(at->kern,0); /* pad it */
406 }
407 
408 /* ************************************************************************** */
409 /* ************************* The 'lcar' table ************************* */
410 /* ************************************************************************** */
411 
413  PST *pst; int j;
414 
415  for ( pst=sc->possub; pst!=NULL && pst->type!=pst_lcaret; pst=pst->next );
416  if ( pst!=NULL ) {
417  if ( !sc->lig_caret_cnt_fixed ) {
418  for ( j=pst->u.lcaret.cnt-1; j>=0 && pst->u.lcaret.carets[j]==0; --j );
419  if ( j==-1 )
420  pst = NULL;
421  } else {
422  if ( pst->u.lcaret.cnt==0 )
423  pst = NULL;
424  }
425  }
426 return( pst );
427 }
428 
429 void aat_dumplcar(struct alltabs *at, SplineFont *sf) {
430  int i, j, k, l, seg_cnt, tot, last, offset;
431  PST *pst;
432  FILE *lcar=NULL;
433  SplineChar *sc;
434  /* We do four passes. The first just calculates how much space we will need */
435  /* the second provides the top-level lookup table structure */
436  /* the third provides the arrays of offsets needed for type 4 lookup tables */
437  /* the fourth provides the actual data on the ligature carets */
438 
439  for ( k=0; k<4; ++k ) {
440  for ( i=seg_cnt=tot=0; i<at->gi.gcnt; ++i )
441  if ( at->gi.bygid[i]!=-1 &&
442  (pst = haslcaret(sc = sf->glyphs[at->gi.bygid[i]]))!=NULL ) {
443  if ( k==1 )
444  tot = 0;
445  else if ( k==2 ) {
446  putshort(lcar,offset);
447  offset += 2 + 2*LigCaretCnt(sc);
448  } else if ( k==3 ) {
449  putshort(lcar,LigCaretCnt(sc));
450  for ( l=0; l<pst->u.lcaret.cnt; ++l )
451  if ( pst->u.lcaret.carets[l]!=0 || sc->lig_caret_cnt_fixed )
452  putshort(lcar,pst->u.lcaret.carets[l]);
453  }
454  last = i;
455  for ( j=i+1, ++tot; j<at->gi.gcnt && at->gi.bygid[j]!=-1; ++j ) {
456  if ( (pst = haslcaret(sc = sf->glyphs[at->gi.bygid[j]]))== NULL )
457  break;
458  ++tot;
459  last = j;
460  if ( k==2 ) {
461  putshort(lcar,offset);
462  offset += 2 + 2*LigCaretCnt(sc);
463  } else if ( k==3 ) {
464  putshort(lcar,LigCaretCnt(sc));
465  for ( l=0; l<pst->u.lcaret.cnt; ++l )
466  if ( pst->u.lcaret.carets[l]!=0 || sc->lig_caret_cnt_fixed )
467  putshort(lcar,pst->u.lcaret.carets[l]);
468  }
469  }
470  if ( k==1 ) {
471  putshort(lcar,last);
472  putshort(lcar,i);
473  putshort(lcar,offset);
474  offset += 2*tot;
475  }
476  ++seg_cnt;
477  i = j-1;
478  }
479  if ( k==0 ) {
480  if ( seg_cnt==0 )
481 return;
482  lcar = tmpfile2();
483  putlong(lcar, 0x00010000); /* version */
484  putshort(lcar,0); /* data are distances (not points) */
485 
486  putshort(lcar,4); /* Lookup table format 4 */
487  /* Binary search header */
488  putshort(lcar,6); /* Entry size */
489  putshort(lcar,seg_cnt); /* Number of segments */
490  for ( j=0,l=1; l<=seg_cnt; l<<=1, ++j );
491  --j; l>>=1;
492  putshort(lcar,6*l);
493  putshort(lcar,j);
494  putshort(lcar,6*(seg_cnt-l));
495  offset = /*4+2+*/6*2 + seg_cnt*6 + 6 /* fake segment at end */;
496  /* Offset relative to lookup table, not to lcar_start */
497  /* Or, that's true while we build the lookup table. Once we */
498  /* start working on the data offsets they are relative to */
499  /* lcar_start */
500  } else if ( k==1 ) { /* flag entry */
501  putshort(lcar,0xffff);
502  putshort(lcar,0xffff);
503  putshort(lcar,0);
504 
505  offset += 6; /* Now offsets are relative to lcar_start */
506  }
507  }
508  at->lcar = lcar;
509  at->lcarlen = ftell(at->lcar);
510  if ( at->lcarlen&2 )
511  putshort(at->lcar,0);
512 }
513 
514 /* ************************************************************************** */
515 /* ************************* The 'morx' table ************************* */
516 /* ************************* (and 'feat') ************************* */
517 /* ************************************************************************** */
518 
519 /* Each lookup gets its own subtable, so there may be multiple subtables */
520 /* with the same feature/setting. The subtables will be ordered the same */
521 /* way the lookups are, which might lead to awkwardness if there are many */
522 /* chains and the same feature occurs in several of them */
523 /* (only the default language will be used) */
524 struct feature {
527  struct macsetting *ms, *sms;
528  unsigned int vertOnly: 1;
529  unsigned int r2l: 1; /* I think this is the "descending" flag */
530  unsigned int needsOff: 1;
531  unsigned int singleMutex: 1;
532  unsigned int dummyOff: 1;
534  int chain;
537  uint32 feature_len; /* Does not include header yet */
538  struct feature *next; /* features in output order */
539  struct feature *nexttype; /* features in feature/setting order */
540  struct feature *nextsame; /* all features with the same feature/setting */
542 };
543 
544 static struct feature *featureFromSubtable(SplineFont *sf, struct lookup_subtable *sub );
545 static int PSTHasTag(PST *pst, uint32 tag);
546 
547 static void morxfeaturesfree(struct feature *features) {
548  struct feature *n;
549 
550  for ( ; features!=NULL; features=n ) {
551  n = features->next;
552  chunkfree( features,sizeof(*features) );
553  }
554 }
555 
556 static void mort_classes(FILE *temp,SplineFont *sf,struct glyphinfo *gi) {
557  int first, last, i, cnt;
558  /* Mort tables just have a trimmed byte array for the classes */
559 
560  for ( first=0; first<gi->gcnt; ++first )
561  if ( gi->bygid[first]!=-1 && sf->glyphs[gi->bygid[first]]->lsidebearing!=1 )
562  break;
563  for ( last=gi->gcnt-1; last>first; --last )
564  if ( gi->bygid[last]!=-1 && sf->glyphs[gi->bygid[last]]->lsidebearing!=1 )
565  break;
566  cnt = last-first+1;
567 
569  putshort(temp,cnt);
570  for ( i=first; i<=last; ++i )
571  if ( gi->bygid[i]==-1 )
572  putc(1,temp);
573  else
574  putc(sf->glyphs[gi->bygid[i]]->lsidebearing,temp);
575  if ( cnt&1 )
576  putc(1,temp); /* Pad to a word boundary */
577 }
578 
579 static void morx_lookupmap(FILE *temp,SplineChar **glyphs,uint16 *maps,int gcnt) {
580  int i, j, k, l, seg_cnt, tot, last, offset;
581  /* We do four passes. The first just calculates how much space we will need (if any) */
582  /* the second provides the top-level lookup table structure */
583  /* the third provides the arrays of offsets needed for type 4 lookup tables */
584 
585  for ( k=0; k<3; ++k ) {
586  for ( i=seg_cnt=tot=0; i<gcnt; ++i ) {
587  if ( glyphs[i]==NULL )
588  continue;
589  if ( k==1 )
590  tot = 0;
591  else if ( k==2 ) {
592  putshort(temp,maps[i]);
593  }
594  last = i;
595  for ( j=i+1, ++tot; j<gcnt && glyphs[j]!=NULL && glyphs[j]->ttf_glyph==glyphs[i]->ttf_glyph+j-i; ++j ) {
596  ++tot;
597  last = j;
598  if ( k==2 ) {
599  putshort(temp,maps[j]);
600  }
601  }
602  if ( k==1 ) {
603  putshort(temp,glyphs[last]->ttf_glyph);
604  putshort(temp,glyphs[i]->ttf_glyph);
606  offset += 2*tot;
607  }
608  ++seg_cnt;
609  i = j-1;
610  }
611  if ( k==0 ) {
612  putshort(temp,4); /* Lookup table format 4 */
613  /* Binary search header */
614  putshort(temp,6); /* Entry size */
615  putshort(temp,seg_cnt); /* Number of segments */
616  for ( j=0,l=1; l<=seg_cnt; l<<=1, ++j );
617  --j; l>>=1;
618  putshort(temp,6*l);
619  putshort(temp,j);
620  putshort(temp,6*(seg_cnt-l));
621  if ( seg_cnt==0 )
622 return;
623  offset = 6*2 + seg_cnt*6 + 6;
624  } else if ( k==1 ) { /* flag entry */
625  putshort(temp,0xffff);
626  putshort(temp,0xffff);
627  putshort(temp,0);
628  }
629  }
630 }
631 
632 static void morx_dumpSubsFeature(FILE *temp,SplineChar **glyphs,uint16 *maps,int gcnt) {
633  morx_lookupmap(temp,glyphs,maps,gcnt);
634 }
635 
637  FILE *temp, struct feature *features, struct lookup_subtable *sub) {
638  int i, k, gcnt;
639  SplineChar *sc, *msc, **glyphs;
640  uint16 *maps;
641  struct feature *cur;
642  PST *pst;
643 
644  for ( k=0; k<2; ++k ) {
645  gcnt = 0;
646  for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
647  sc = sf->glyphs[at->gi.bygid[i]];
648  for ( pst=sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
649  if ( pst!=NULL ) {
650  if ( k==1 ) {
651  msc = SFGetChar(sf,-1,pst->u.subs.variant);
652  glyphs[gcnt] = sc;
653  if ( msc!=NULL && msc->ttf_glyph!=-1 ) {
654  maps[gcnt++] = msc->ttf_glyph;
655  } else if ( msc==NULL &&
657  maps[gcnt++] = 0xffff;
658  }
659  } else
660  ++gcnt;
661  }
662  }
663  if ( k==0 ) {
664  if ( gcnt==0 )
665 return( features );
666  glyphs = malloc((gcnt+1)*sizeof(SplineChar *));
667  maps = malloc((gcnt+1)*sizeof(uint16));
668  } else {
669  glyphs[gcnt] = NULL; maps[gcnt] = 0;
670  }
671  }
672 
674  cur->next = features;
675  cur->r2l = sub->lookup->lookup_flags&pst_r2l ? true : false;
676  features = cur;
677  cur->subtable_type = 4;
678  cur->feature_start = ftell(temp);
679  morx_dumpSubsFeature(temp,glyphs,maps,gcnt);
680  if ( (ftell(temp)-cur->feature_start)&1 )
681  putc('\0',temp);
682  if ( (ftell(temp)-cur->feature_start)&2 )
683  putshort(temp,0);
684  cur->feature_len = ftell(temp)-cur->feature_start;
685  free(glyphs); free(maps);
686 return( features);
687 }
688 
690  struct lookup_subtable *sub) {
691  LigList *l;
692 
693  for ( l=ligs; l!=NULL; l=l->next )
694  if ( l->lig->subtable==sub )
695 return( l );
696 return( NULL );
697 }
698 
699 static int IsMarkChar( SplineChar *sc ) {
700  AnchorPoint *ap;
701 
702  ap=sc->anchor;
703  while ( ap!=NULL && (ap->type==at_centry || ap->type==at_cexit) )
704  ap = ap->next;
705  if ( ap!=NULL && (ap->type==at_mark || ap->type==at_basemark) )
706 return( true );
707 
708 return( false );
709 }
710 
714  struct lookup_subtable *sub, struct alltabs *at, SplineFont *sf,
715  int ignoremarks) {
716  LigList *l;
717  struct splinecharlist *comp;
718  uint16 *used = calloc(at->maxp.numGlyphs,sizeof(uint16));
719  SplineChar **cglyphs;
720  uint16 *map;
721  int i,j,k,class, state_max, state_cnt, base, last;
722  uint32 start;
723  struct transition **states;
724  struct trans_entries *trans;
725  int trans_cnt;
726  int maxccnt=0;
727  int acnt, lcnt, charcnt;
728  uint32 *actions;
729  uint16 *components, *lig_glyphs;
730  uint32 here;
731  struct splinecharlist *scl;
732  int anymarks;
733 
734  /* figure out the classes (one for each character used to make a lig) */
735  for ( i=0; i<gcnt; ++i ) {
736  used[glyphs[i]->ttf_glyph] = true;
737  for ( l=glyphs[i]->ligofme; l!=NULL; l=l->next ) if ( l->lig->subtable==sub ) {
738  for ( comp = l->components; comp!=NULL; comp=comp->next )
739  used[comp->sc->ttf_glyph] = true;
740  }
741  }
742  class = 4;
743  for ( i=0; i<at->maxp.numGlyphs; ++i ) if ( used[i] )
744  used[i] = class++;
745  anymarks = false;
746  charcnt = class;
747  if ( ignoremarks ) {
748  for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
749  if ( IsMarkChar(sf->glyphs[at->gi.bygid[i]])) {
750  anymarks = true;
751  ++charcnt;
752  used[i] = class;
753  }
754  }
755  if ( anymarks )
756  ++class;
757  }
758  cglyphs = malloc((charcnt+1)*sizeof(SplineChar *));
759  map = malloc((charcnt+1)*sizeof(uint16));
760  j=0;
761  for ( i=k=0; i<at->maxp.numGlyphs; ++i ) if ( used[i] ) {
762  j = at->gi.bygid[i];
763  if ( j!=-1 ) {
764  cglyphs[k] = sf->glyphs[j];
765  map[k++] = used[i];
766  }
767  }
768  cglyphs[k] = NULL;
769 
770  start = ftell(temp);
771  putlong(temp,class);
772  putlong(temp,7*sizeof(uint32));
773  putlong(temp,0); /* Fill in later */
774  putlong(temp,0);
775  putlong(temp,0);
776  putlong(temp,0);
777  putlong(temp,0);
778  morx_lookupmap(temp,cglyphs,map,k); /* dump the class lookup table */
779  free( cglyphs ); free( map );
780  here = ftell(temp);
781  fseek(temp,start+2*sizeof(uint32),SEEK_SET);
782  putlong(temp,here-start); /* Point to start of state arrays */
783  fseek(temp,0,SEEK_END);
784 
785  /* Now build the state machine */
786  /* Note: the ligofme list is so ordered that the longest ligatures come first */
787  /* we will depend on that in the case of "ffl", "ffi", "ff" */
788  state_max = 40; state_cnt = 2;
789  states = malloc(state_max*sizeof(struct transition *));
790  states[0] = calloc(class,sizeof(struct transition)); /* Initial state */
791  states[1] = calloc(class,sizeof(struct transition)); /* other Initial state */
792  for ( i=0; i<gcnt; ++i ) {
793  if ( state_cnt>=state_max )
794  states = realloc(states,(state_max += 40)*sizeof(struct transition *));
795  base = state_cnt;
796  states[0][used[glyphs[i]->ttf_glyph]].next_state = state_cnt;
797  states[1][used[glyphs[i]->ttf_glyph]].next_state = state_cnt;
798  states[state_cnt++] = calloc(class,sizeof(struct transition));
799  for ( l=glyphs[i]->ligofme; l!=NULL; l=l->next ) if ( l->lig->subtable==sub ) {
800  if ( l->ccnt > maxccnt ) maxccnt = l->ccnt;
801  last = base;
802  for ( comp = l->components; comp!=NULL; comp=comp->next ) {
803  if ( states[last][used[comp->sc->ttf_glyph]].next_state==0 ) {
804  if ( comp->next==NULL )
805  states[last][used[comp->sc->ttf_glyph]].l = l;
806  else {
807  states[last][used[comp->sc->ttf_glyph]].next_state = state_cnt;
808  if ( state_cnt>=state_max )
809  states = realloc(states,(state_max += 40)*sizeof(struct transition *));
810  last = state_cnt;
811  states[state_cnt++] = calloc(class,sizeof(struct transition));
812  }
813  } else {
814  last = states[last][used[comp->sc->ttf_glyph]].next_state;
815  if ( comp->next==NULL ) {
816  /* this is where we depend on the ordering */
817  for ( j=0; j<class; ++j )
818  if ( states[last][j].next_state==0 && states[last][j].l==NULL ) {
819  states[last][j].l = l;
820  states[last][j].dontconsume = true;
821  /* the next state should continue to be 0 (initial) */
822  }
823  }
824  }
825  }
826  }
827  }
828  if ( anymarks ) {
829  /* behavior for a mark is the same everywhere: stay in current state */
830  /* do no operations. consume the mark */
831  for ( i=0; i<state_cnt; ++i ) {
832  states[i][class-1].next_state = i;
833  states[i][class-1].ismark = true;
834  }
835  }
836  /* Ok, we've got the state machine now. Convert it into apple's wierd */
837  /* (space saving) format */
838  trans = malloc(class*state_cnt*sizeof(struct trans_entries));
839  trans_cnt = 0;
840  for ( i=0; i<state_cnt; ++i ) for ( j=0; j<class; ++j ) {
841  if ( states[i][j].ismark )
842  k = trans_cnt;
843  else for ( k=0; k<trans_cnt; ++k ) {
844  if ( trans[k].next_state==states[i][j].next_state &&
845  (trans[k].flags&0x4000?1:0) == states[i][j].dontconsume &&
846  trans[k].l ==states[i][j].l )
847  break;
848  }
849  states[i][j].trans_ent = k;
850  if ( k==trans_cnt ) {
851  trans[k].next_state = states[i][j].next_state;
852  trans[k].l = states[i][j].l;
853  trans[k].flags = 0;
854  if ( states[i][j].dontconsume )
855  trans[k].flags = 0x4000;
856  else if ( states[i][j].ismark )
857  /* Do nothing */;
858  else if ( trans[k].next_state!=0 || trans[k].l!=NULL )
859  trans[k].flags = 0x8000;
860  if ( trans[k].l!=NULL )
861  trans[k].flags |= 0x2000;
862  trans[k].act_index = 0;
863  ++trans_cnt;
864  }
865  }
866  /* Oops. Bug. */
867  /* Suppose we have two ligatures f+l=>fl & s+t->st. */
868  /* Suppose we get input "fst" */
869  /* Now the state machine we've built so far will go to the f branch, see */
870  /* the "s" and go back to state 0 */
871  /* Obviously that's wrong, we've lost the st. So either we go back to 0 */
872  /* but don't advance the glyph, or we take the transition from state 0 */
873  /* and copy it to here. The second is easier for me just now */
874  for ( i=2; i<state_cnt; ++i ) for ( j=4; j<class; ++j ) {
875  if ( states[i][j].trans_ent == 0 && states[0][j].trans_ent != 0 )
876  states[i][j].trans_ent = states[0][j].trans_ent;
877  }
878 
879  /* Dump out the state machine */
880  for ( i=0; i<state_cnt; ++i ) for ( j=0; j<class; ++j )
881  putshort( temp, states[i][j].trans_ent );
882 
883  /* Now figure out the ligature actions (and all the other tables) */
884  actions = malloc(trans_cnt*maxccnt*sizeof(uint32));
885  components = malloc(trans_cnt*maxccnt*sizeof(uint16));
886  lig_glyphs = malloc(trans_cnt*sizeof(uint16));
887  acnt = lcnt = 0;
888  for ( i=0; i<trans_cnt; ++i ) if ( trans[i].l!=NULL ) {
889  lig_glyphs[lcnt] = trans[i].l->lig->u.lig.lig->ttf_glyph;
890  /* component Glyphs get popped off the stack in the reverse order */
891  /* so we must built our tables backwards */
892  components[acnt+trans[i].l->ccnt-1] = lcnt;
893  actions[acnt+trans[i].l->ccnt-1] = 0x80000000 |
894  ((acnt+trans[i].l->ccnt-1 - trans[i].l->first->ttf_glyph)&0x3fffffff);
895  for ( scl=trans[i].l->components,j=trans[i].l->ccnt-2; scl!=NULL; scl=scl->next, --j ) {
896  components[acnt+j] = 0;
897  actions[acnt+j] = (acnt+j - scl->sc->ttf_glyph)&0x3fffffff;
898  }
899  trans[i].act_index = acnt;
900  ++lcnt;
901  acnt += trans[i].l->ccnt;
902  }
903 
904  /* Now we know how big all the tables will be. Dump out their locations */
905  here = ftell(temp);
906  fseek(temp,start+3*sizeof(uint32),SEEK_SET);
907  putlong(temp,here-start); /* Point to start of entry array */
908  putlong(temp,here-start+6*trans_cnt); /* Point to start of actions */
909  putlong(temp,here-start+6*trans_cnt+4*acnt);/* Point to start of components */
910  putlong(temp,here-start+6*trans_cnt+6*acnt);/* Point to start of ligatures */
911  fseek(temp,0,SEEK_END);
912 
913  /* Now dump the transitions */
914  for ( i=0; i<trans_cnt; ++i ) {
915  putshort(temp,trans[i].next_state);
917  putshort(temp,trans[i].act_index);
918  }
919  /* And the actions */
920  for ( i=0; i<acnt; ++i )
921  putlong(temp,actions[i]);
922  /* And the components */
923  for ( i=0; i<acnt; ++i )
924  putshort(temp,components[i]);
925  /* Do A simple check on the validity of what we've done */
926  if ( here+6*trans_cnt+6*acnt != ftell(temp) )
927  IError( "Offset wrong in morx ligature table\n" );
928  /* And finally the ligature glyph indeces */
929  for ( i=0; i<lcnt; ++i )
930  putshort(temp,lig_glyphs[i]);
931 
932  /* clean up */
933  free(actions); free(components); free(lig_glyphs);
934  free(trans);
935  for ( i=0; i<state_cnt; ++i )
936  free(states[i]);
937  free(states);
938  free(used);
939 }
940 
941 static struct feature *aat_dumpmorx_ligatures(struct alltabs *at, SplineFont *sf,
942  FILE *temp, struct feature *features, struct lookup_subtable *sub) {
943  int i, k, gcnt;
944  SplineChar *sc, *ssc, **glyphs;
945  struct feature *cur;
946  LigList *l;
947 
948  glyphs = malloc((at->maxp.numGlyphs+1)*sizeof(SplineChar *));
949  for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
950  sf->glyphs[i]->ticked = false;
951 
952  for ( i=0; i<at->gi.gcnt; ++i )
953  if ( at->gi.bygid[i]!=-1 && !(sc=sf->glyphs[at->gi.bygid[i]])->ticked &&
954  (l = LigListMatchSubtable(sf,sc->ligofme,sub))!=NULL ) {
955  int ignoremarks = sub->lookup->lookup_flags & pst_ignorecombiningmarks ? 1 : 0 ;
956  for ( k=i, gcnt=0; k<at->gi.gcnt; ++k )
957  if ( at->gi.bygid[k]!=-1 &&
958  (ssc=sf->glyphs[at->gi.bygid[k]])!=NULL && !ssc->ticked &&
960  glyphs[gcnt++] = ssc;
961  ssc->ticked = true;
962  }
963  glyphs[gcnt] = NULL;
965  cur->next = features;
966  features = cur;
967  cur->subtable_type = 2; /* ligature */
968  cur->feature_start = ftell(temp);
969  morx_dumpLigaFeature(temp,glyphs,gcnt,sub,at,sf,ignoremarks);
970  if ( (ftell(temp)-cur->feature_start)&1 )
971  putc('\0',temp);
972  if ( (ftell(temp)-cur->feature_start)&2 )
973  putshort(temp,0);
974  cur->feature_len = ftell(temp)-cur->feature_start;
975  cur->r2l = sub->lookup->lookup_flags&pst_r2l ? true : false;
976  }
977 
978  free(glyphs);
979 return( features);
980 }
981 
982 static void morx_dumpnestedsubs(FILE *temp,SplineFont *sf,OTLookup *otl,struct glyphinfo *gi) {
983  int i, j, gcnt;
984  PST *pst;
985  SplineChar **glyphs, *sc;
986  uint16 *map;
987  struct lookup_subtable *sub = otl->subtables; /* Mac can't have more than one subtable/lookup */
988 
989  for ( j=0; j<2; ++j ) {
990  gcnt = 0;
991  for ( i = 0; i<gi->gcnt; ++i ) if ( gi->bygid[i]!=-1 ) {
992  for ( pst=sf->glyphs[gi->bygid[i]]->possub;
993  pst!=NULL && pst->subtable!=sub; pst=pst->next );
994  if ( pst!=NULL && pst->type==pst_substitution &&
995  (sc=SFGetChar(sf,-1,pst->u.subs.variant))!=NULL &&
996  sc->ttf_glyph!=-1 ) {
997  if ( j ) {
998  glyphs[gcnt] = sf->glyphs[gi->bygid[i]];
999  map[gcnt] = sc->ttf_glyph;
1000  }
1001  ++gcnt;
1002  }
1003  }
1004  if ( !j ) {
1005  glyphs = malloc((gcnt+1)*sizeof(SplineChar *));
1006  map = malloc(gcnt*sizeof(uint16));
1007  glyphs[gcnt] = NULL;
1008  }
1009  }
1010  morx_lookupmap(temp,glyphs,map,gcnt);
1011  free(glyphs);
1012  free(map);
1013 }
1014 
1016  char *pt, *start;
1017  int c, ch;
1018  uint16 *ret;
1019  SplineChar *sc;
1020 
1021  for ( c=0, pt=names; *pt; ++pt )
1022  if ( *pt==' ' ) ++c;
1023  ret = malloc((c+1)*sizeof(uint16));
1024 
1025  for ( c=0, pt=names; *pt; ) {
1026  while ( *pt==' ' ) ++pt;
1027  if ( *pt=='\0' )
1028  break;
1029  start = pt;
1030  while ( *pt!=' ' && *pt!='\0' ) ++pt;
1031  ch = *pt; *pt='\0';
1032  sc = SFGetChar(sf,-1,start);
1033  *pt = ch;
1034  if ( sc!=NULL && sc->ttf_glyph!=-1 )
1035  ret[c++] = sc->ttf_glyph;
1036  }
1037  *cnt = c;
1038 return( ret );
1039 }
1040 
1041 static int morx_dumpASM(FILE *temp,ASM *sm, struct alltabs *at, SplineFont *sf ) {
1042  int i, j, k, gcnt, ch;
1043  char *pt, *end;
1044  uint16 *map;
1045  SplineChar **glyphs, *sc;
1046  int stcnt, tcnt;
1047  struct ins { char *names; uint16 len,pos; uint16 *glyphs; } *subsins=NULL;
1048  OTLookup **subslookups=NULL;
1049  uint32 start, here, substable_pos, state_offset;
1050  struct transdata { uint16 transition, mark_index, cur_index; } *transdata;
1051  struct trans { uint16 ns, flags, mi, ci; } *trans;
1052  int ismort = sm->type == asm_kern;
1053  FILE *kernvalues;
1054 
1055  for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
1056  sf->glyphs[i]->lsidebearing = 1;
1057 
1058  gcnt = 0;
1059  for ( i=4; i<sm->class_cnt; ++i ) {
1060  for ( pt = sm->classes[i]; ; pt=end ) {
1061  while ( *pt==' ' ) ++pt;
1062  if ( *pt=='\0' )
1063  break;
1064  for ( end=pt; *end!='\0' && *end!=' '; ++end );
1065  ch = *end; *end = '\0';
1066  sc = SFGetChar(sf,-1,pt);
1067  *end = ch;
1068  if ( sc!=NULL ) {
1069  sc->lsidebearing = i;
1070  ++gcnt;
1071  }
1072  }
1073  }
1074  glyphs = malloc((gcnt+1)*sizeof(SplineChar *));
1075  map = malloc((gcnt+1)*sizeof(uint16));
1076  gcnt = 0;
1077  for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 && sf->glyphs[at->gi.bygid[i]]->lsidebearing!=1 ) {
1078  glyphs[gcnt] = sf->glyphs[at->gi.bygid[i]];
1079  map[gcnt++] = sf->glyphs[at->gi.bygid[i]]->lsidebearing;
1080  }
1081  glyphs[gcnt] = NULL;
1082 
1083  /* Give each subs tab an index into the mac's substitution lookups */
1084  transdata = calloc(sm->state_cnt*sm->class_cnt,sizeof(struct transdata));
1085  stcnt = 0;
1086  subslookups = NULL; subsins = NULL;
1087  if ( sm->type==asm_context ) {
1088  subslookups = malloc(2*sm->state_cnt*sm->class_cnt*sizeof(OTLookup));
1089  for ( j=0; j<sm->state_cnt*sm->class_cnt; ++j ) {
1090  struct asm_state *this = &sm->state[j];
1091  transdata[j].mark_index = transdata[j].cur_index = 0xffff;
1092  if ( this->u.context.mark_lookup!=NULL ) {
1093  for ( i=0; i<stcnt; ++i )
1094  if ( subslookups[i]==this->u.context.mark_lookup )
1095  break;
1096  if ( i==stcnt )
1097  subslookups[stcnt++] = this->u.context.mark_lookup;
1098  transdata[j].mark_index = i;
1099  }
1100  if ( this->u.context.cur_lookup!=NULL ) {
1101  for ( i=0; i<stcnt; ++i )
1102  if ( subslookups[i]==this->u.context.cur_lookup )
1103  break;
1104  if ( i==stcnt )
1105  subslookups[stcnt++] = this->u.context.cur_lookup;
1106  transdata[j].cur_index = i;
1107  }
1108  }
1109  } else if ( sm->type==asm_insert ) {
1110  subsins = malloc(2*sm->state_cnt*sm->class_cnt*sizeof(struct ins));
1111  for ( j=0; j<sm->state_cnt*sm->class_cnt; ++j ) {
1112  struct asm_state *this = &sm->state[j];
1113  transdata[j].mark_index = transdata[j].cur_index = 0xffff;
1114  if ( this->u.insert.mark_ins!=0 ) {
1115  for ( i=0; i<stcnt; ++i )
1116  if ( strcmp(subsins[i].names,this->u.insert.mark_ins)==0 )
1117  break;
1118  if ( i==stcnt ) {
1119  subsins[stcnt].pos = stcnt==0 ? 0 : subsins[stcnt-1].pos +
1120  subsins[stcnt-1].len;
1121  subsins[stcnt].names = this->u.insert.mark_ins;
1122  subsins[stcnt].glyphs = NamesToGlyphs(sf,subsins[stcnt].names,&subsins[stcnt].len);
1123  ++stcnt;
1124  }
1125  transdata[j].mark_index = subsins[i].pos;
1126  }
1127  if ( this->u.insert.cur_ins!=0 ) {
1128  for ( i=0; i<stcnt; ++i )
1129  if ( strcmp(subsins[i].names,this->u.insert.cur_ins)==0 )
1130  break;
1131  if ( i==stcnt ) {
1132  subsins[stcnt].pos = stcnt==0 ? 0 : subsins[stcnt-1].pos +
1133  subsins[stcnt-1].len;
1134  subsins[stcnt].names = this->u.insert.cur_ins;
1135  subsins[stcnt].glyphs = NamesToGlyphs(sf,subsins[stcnt].names,&subsins[stcnt].len);
1136  ++stcnt;
1137  }
1138  transdata[j].cur_index = subsins[i].pos;
1139  }
1140  }
1141  } else if ( sm->type==asm_kern ) {
1142  int off=0;
1143  kernvalues = tmpfile2();
1144  for ( j=0; j<sm->state_cnt*sm->class_cnt; ++j ) {
1145  struct asm_state *this = &sm->state[j];
1146  transdata[j].mark_index = 0xffff;
1147  if ( this->u.kern.kcnt!=0 ) {
1148  for ( k=0; k<j; ++k )
1149  if ( sm->state[k].u.kern.kcnt==this->u.kern.kcnt &&
1150  memcmp(sm->state[k].u.kern.kerns,this->u.kern.kerns,
1151  this->u.kern.kcnt*sizeof(int16))==0 )
1152  break;
1153  if ( k!=j )
1154  transdata[j].mark_index = transdata[k].mark_index;
1155  else {
1156  transdata[j].mark_index = off;
1157  off += this->u.kern.kcnt*sizeof(int16);
1158  /* kerning values must be output backwards */
1159  for ( k=this->u.kern.kcnt-1; k>=1; --k )
1160  putshort(kernvalues,this->u.kern.kerns[k]&~1);
1161  /* And the last one must be odd */
1162  putshort(kernvalues,this->u.kern.kerns[0]|1);
1163  }
1164  }
1165  }
1166  }
1167 
1168  trans = malloc(sm->state_cnt*sm->class_cnt*sizeof(struct trans));
1169  tcnt = 0;
1170  for ( j=0; j<sm->state_cnt*sm->class_cnt; ++j ) {
1171  struct asm_state *this = &sm->state[j];
1172  for ( i=0; i<tcnt; ++i )
1173  if ( trans[i].ns==this->next_state && trans[i].flags==this->flags &&
1174  trans[i].mi==transdata[j].mark_index &&
1175  trans[i].ci==transdata[j].cur_index )
1176  break;
1177  if ( i==tcnt ) {
1178  trans[tcnt].ns = this->next_state;
1179  trans[tcnt].flags = this->flags;
1180  trans[tcnt].mi = transdata[j].mark_index;
1181  trans[tcnt++].ci = transdata[j].cur_index;
1182  }
1183  transdata[j].transition = i;
1184  }
1185 
1186 
1187  /* Output the header */
1188  start = ftell(temp);
1189  if ( ismort /* old format still used for kerning */ ) {
1190  putshort(temp,sm->class_cnt);
1191  putshort(temp,5*sizeof(uint16)); /* class offset */
1192  putshort(temp,0); /* state offset */
1193  putshort(temp,0); /* transition entry offset */
1194  putshort(temp,0); /* kerning values offset */
1195  mort_classes(temp,sf,&at->gi); /* dump the class table */
1196  } else {
1197  putlong(temp,sm->class_cnt);
1198  if ( sm->type==asm_indic ) {
1199  putlong(temp,4*sizeof(uint32)); /* class offset */
1200  putlong(temp,0); /* state offset */
1201  putlong(temp,0); /* transition entry offset */
1202  } else {
1203  putlong(temp,5*sizeof(uint32)); /* class offset */
1204  putlong(temp,0); /* state offset */
1205  putlong(temp,0); /* transition entry offset */
1206  putlong(temp,0); /* substitution/insertion table offset */
1207  }
1208  morx_lookupmap(temp,glyphs,map,gcnt);/* dump the class lookup table */
1209  }
1210  free(glyphs); free(map);
1211 
1212 
1213  state_offset = ftell(temp)-start;
1214  if ( ismort ) {
1215  fseek(temp,start+2*sizeof(uint16),SEEK_SET);
1216  putshort(temp,state_offset); /* Point to start of state arrays */
1217  } else {
1218  fseek(temp,start+2*sizeof(uint32),SEEK_SET);
1219  putlong(temp,state_offset); /* Point to start of state arrays */
1220  }
1221  fseek(temp,0,SEEK_END);
1222 
1223  if ( ismort ) {
1224  for ( j=0; j<sm->state_cnt*sm->class_cnt; ++j )
1225  putc(transdata[j].transition,temp);
1226  if ( ftell(temp)&1 )
1227  putc(0,temp); /* Pad to a word boundry */
1228  } else {
1229  for ( j=0; j<sm->state_cnt*sm->class_cnt; ++j )
1230  putshort(temp,transdata[j].transition);
1231  }
1232  free(transdata);
1233 
1234  here = ftell(temp);
1235  if ( ismort ) {
1236  fseek(temp,start+3*sizeof(uint16),SEEK_SET);
1237  putshort(temp,here-start); /* Point to start of transition arrays */
1238  } else {
1239  fseek(temp,start+3*sizeof(uint32),SEEK_SET);
1240  putlong(temp,here-start); /* Point to start of transition arrays */
1241  }
1242  fseek(temp,0,SEEK_END);
1243 
1244  /* Now the transitions */
1245  if ( sm->type==asm_kern ) {
1246  substable_pos = here+tcnt*2*sizeof(int16);
1247  for ( i=0; i<tcnt; ++i ) {
1248  /* mort tables use an offset rather than the state number */
1249  putshort(temp,trans[i].ns*sm->class_cnt+state_offset);
1250  if ( trans[i].mi!=0xffff )
1251  trans[i].flags |= substable_pos-start+trans[i].mi;
1253  }
1254  } else {
1255  for ( i=0; i<tcnt; ++i ) {
1256  putshort(temp,trans[i].ns);
1258  if ( sm->type!=asm_indic && sm->type!=asm_kern ) {
1259  putshort(temp,trans[i].mi );
1260  putshort(temp,trans[i].ci );
1261  }
1262  }
1263  }
1264  free(trans);
1265 
1266  if ( sm->type==asm_context ) {
1267  substable_pos = ftell(temp);
1268  fseek(temp,start+4*sizeof(uint32),SEEK_SET);
1269  putlong(temp,substable_pos-start); /* Point to start of substitution lookup offsets */
1270  fseek(temp,0,SEEK_END);
1271 
1272  /* And finally the substitutions */
1273  for ( i=0; i<stcnt; ++i )
1274  putlong(temp,0); /* offsets to the substitutions */
1275  for ( i=0; i<stcnt; ++i ) {
1276  here = ftell(temp);
1277  fseek(temp,substable_pos+i*sizeof(uint32),SEEK_SET);
1278  putlong(temp,here-substable_pos);
1279  fseek(temp,0,SEEK_END);
1280  morx_dumpnestedsubs(temp,sf,subslookups[i],&at->gi);
1281  }
1282  free(subslookups);
1283  } else if ( sm->type==asm_insert ) {
1284  substable_pos = ftell(temp);
1285  fseek(temp,start+4*sizeof(uint32),SEEK_SET);
1286  putlong(temp,substable_pos-start); /* Point to start of insertions */
1287  fseek(temp,0,SEEK_END);
1288 
1289  for ( i=0; i<stcnt; ++i ) {
1290  for ( j=0; j<subsins[i].len; ++j )
1291  putshort(temp,subsins[i].glyphs[j]);
1292  free(subsins[i].glyphs);
1293  }
1294  free(subsins);
1295  } else if ( sm->type==asm_kern ) {
1296  if ( substable_pos!=ftell(temp) )
1297  IError( "Kern Values table in wrong place.\n" );
1298  fseek(temp,start+4*sizeof(uint16),SEEK_SET);
1299  putshort(temp,substable_pos-start); /* Point to start of insertions */
1300  fseek(temp,0,SEEK_END);
1301  if ( !ttfcopyfile(temp,kernvalues,substable_pos,"kern-subtable")) at->error = true;
1302  }
1303 return( true );
1304 }
1305 
1306 static struct feature *aat_dumpmorx_asm(struct alltabs *at, SplineFont *sf,
1307  FILE *temp, struct feature *features, ASM *sm) {
1308  struct feature *cur;
1309 
1311  cur->vertOnly = sm->flags&0x8000?1:0;
1312  cur->r2l = sm->flags&0x4000?1:0;
1313  cur->subtable_type = sm->type; /* contextual glyph subs */
1314  cur->feature_start = ftell(temp);
1315  if ( morx_dumpASM(temp,sm,at,sf)) {
1316  cur->next = features;
1317  features = cur;
1318  if ( (ftell(temp)-cur->feature_start)&1 )
1319  putc('\0',temp);
1320  if ( (ftell(temp)-cur->feature_start)&2 )
1321  putshort(temp,0);
1322  cur->feature_len = ftell(temp)-cur->feature_start;
1323  } else
1324  chunkfree(cur,sizeof(struct feature));
1325 return( features);
1326 }
1327 
1329  FILE *temp, struct feature *features, struct lookup_subtable *sub) {
1330  ASM *sm;
1331 
1332  if ( FPSTisMacable(sf,sub->fpst)) {
1333  sm = ASMFromFPST(sf,sub->fpst,true);
1334  if ( sm!=NULL ) {
1336  ASMFree(sm);
1337  }
1338  }
1339 return( features );
1340 }
1341 
1344 
1345  for ( fl=otl->features; fl!=NULL; fl=fl->next ) {
1346  if (( fl->featuretag == CHR('i','n','i','t') ||
1347  fl->featuretag==CHR('m','e','d','i') ||
1348  fl->featuretag==CHR('f','i','n','a') ||
1349  fl->featuretag==CHR('i','s','o','l') ) &&
1351 return( true );
1352  }
1353 return( false );
1354 }
1355 
1358  uint32 tag;
1359  ASM *sm;
1360 
1361  if ( OTTagToMacFeature(CHR('i','s','o','l'),&featureType,&featureSetting) ) {
1362  tag = (featureType<<16) | featureSetting;
1363  for ( sm = sf->sm; sm!=NULL; sm=sm->next ) {
1364  if ( sm->subtable->lookup->features->featuretag==tag )
1365 return( true );
1366  }
1367  }
1368  for ( sm = sf->sm; sm!=NULL; sm=sm->next ) {
1369  if ( sm->subtable->lookup->features->featuretag==CHR('i','s','o','l') )
1370 return( true );
1371  }
1372 return( false );
1373 }
1374 
1376  OTLookup *otl;
1377  uint32 *ret = NULL;
1378  int scnt=0, smax=0;
1380  struct scriptlanglist *sl;
1381  int i;
1382 
1383  for ( otl= sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
1384  if ( otl->lookup_type == gsub_single ) {
1385  for ( fl=otl->features; fl!=NULL; fl=fl->next ) {
1386  if ( fl->featuretag == CHR('i','n','i','t') ||
1387  fl->featuretag==CHR('m','e','d','i') ||
1388  fl->featuretag==CHR('f','i','n','a') ||
1389  fl->featuretag==CHR('i','s','o','l') ) {
1390  for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
1391  for ( i=0; i<sl->lang_cnt; ++i ) {
1392  if ( (i<MAX_LANG ? sl->langs[i] : sl->morelangs[i-MAX_LANG])==DEFAULT_LANG ) {
1393  if ( scnt<=smax )
1394  ret = realloc(ret,(smax+=5)*sizeof(uint32));
1395  ret[scnt++] = sl->script;
1396  }
1397  }
1398  }
1399  }
1400  }
1401  }
1402  }
1403  if ( scnt==0 )
1404 return( NULL );
1405  if ( scnt<=smax )
1406  ret = realloc(ret,(smax+=1)*sizeof(uint32));
1407  ret[scnt] = 0;
1408 return( ret );
1409 }
1410 
1412  int ft, fs;
1414 
1415  switch ( otl->lookup_type ) {
1416  /* These lookup types are mac only */
1417  case kern_statemachine: case morx_indic: case morx_context: case morx_insert:
1418  return( true );
1419  /* These lookup types or OpenType only */
1420  case gsub_multiple: case gsub_alternate:
1421  case gpos_single: case gpos_cursive: case gpos_mark2base:
1423  return( false );
1424  /* These are OpenType only, but they might be convertable to a state */
1425  /* machine */
1426  case gsub_context:
1428  case gpos_context: case gpos_contextchain:
1429  if ( sf==NULL || sf->sm!=NULL )
1430  return( false );
1431  /* Else fall through into the test on the feature tag */;
1432  /* These two can be expressed in both, and might be either */
1433  case gsub_single: case gsub_ligature: case gpos_pair:
1434  for ( features = otl->features; features!=NULL; features = features->next ) {
1435  if ( features->ismac || OTTagToMacFeature(features->featuretag,&ft,&fs))
1436  return( true );
1437  }
1438  default:;
1439  }
1440  return( false );
1441 }
1442 
1444  FILE *temp, struct feature *features) {
1445  ASM *sm;
1446  uint32 *scripts;
1448  int i;
1449  OTLookup *otl;
1450 
1451  if ( sf->cidmaster!=NULL )
1452  sf = sf->cidmaster;
1453  else if ( sf->mm!=NULL ) sf=sf->mm->normal;
1454 
1455  for ( otl=sf->gsub_lookups; otl!=NULL; otl=otl->next )
1456  if ( Macable(sf,otl) && otl->lookup_type==gsub_single && IsOtfArabicFormFeature(otl))
1457  otl->ticked = true;
1458 
1459  if ( OTTagToMacFeature(CHR('i','s','o','l'),&featureType,&featureSetting) ) {
1461  for ( i=0; scripts[i]!=0; ++i ) {
1463  if ( sm!=NULL ) {
1465  ASMFree(sf->sm);
1466  }
1467  }
1468  free(scripts);
1469  }
1470 return( features );
1471 }
1472 
1473 static struct feature *featuresReverse(struct feature *features) {
1474  struct feature *p, *n;
1475 
1476  p = NULL;
1477  while ( features!=NULL ) {
1478  n = features->next;
1479  features->next = p;
1480  p = features;
1481  features = n;
1482  }
1483 return( p );
1484 }
1485 
1486 static struct feature *featuresOrderByType(struct feature *features) {
1487  struct feature *f, **all;
1488  int i, j, cnt/*, saw_default*/;
1489 
1490  for ( cnt=0, f=features; f!=NULL; f=f->next, ++cnt );
1491  if ( cnt==1 ) {
1492 return( features );
1493  }
1494  all = malloc(cnt*sizeof(struct feature *));
1495  for ( i=0, f=features; f!=NULL; f=f->next, ++i )
1496  all[i] = f;
1497  for ( i=0; i<cnt-1; ++i ) for ( j=i+1; j<cnt; ++j ) {
1498  if ( all[i]->featureType>all[j]->featureType ||
1500  f = all[i];
1501  all[i] = all[j];
1502  all[j] = f;
1503  }
1504  }
1505  for ( i=0; i<cnt-1; ++i )
1506  all[i]->nexttype = all[i+1];
1507  all[cnt-1]->nexttype = NULL;
1508  features = all[0];
1509  free( all );
1510 return( features );
1511 }
1512 
1514  struct feature *f, *n, *def, *p, *t;
1515  /* mutually exclusive features need to have a setting which does nothing */
1516 
1517  for ( f=features; f!=NULL; f=n ) {
1518  n= f->nexttype;
1519  if ( f->mf!=NULL && f->mf->ismutex ) {
1520  def = NULL;
1521  for ( n=f; n!=NULL && n->featureType==f->featureType; n=n->nexttype ) {
1522  if ( n->featureSetting==f->mf->default_setting )
1523  def = n;
1524  }
1525  if ( def==NULL ) {
1526  t = chunkalloc(sizeof(struct feature));
1527  *t = *f;
1528  t->feature_start = 0; t->feature_len=0; t->next = NULL;
1529  t->featureSetting = f->mf->default_setting;
1530  t->ms = FindMacSetting(sf,t->featureType,f->mf->default_setting,&t->sms);
1531  t->flag = 0;
1532  t->dummyOff = true;
1533  if ( f==features )
1534  p = NULL;
1535  else
1536  for ( p=features; p->nexttype!=f; p=p->nexttype );
1537  n = f;
1538  while ( n!=NULL && n->featureType==t->featureType && n->featureSetting<t->featureSetting ) {
1539  p = n;
1540  n = n->nexttype;
1541  }
1542  t->nexttype = n;
1543  if ( p==NULL )
1544  features = t;
1545  else
1546  p->nexttype = t;
1547  while ( n!=NULL && n->featureType==t->featureType )
1548  n=n->nexttype;
1549  }
1550  }
1551  }
1552 return( features );
1553 }
1554 
1555 static void SetExclusiveOffs(struct feature *features) {
1556  struct feature *f, *n;
1557  int offFlags;
1558  /* mutually exclusive features need to have a setting which does nothing */
1559 
1560  for ( f=features; f!=NULL; f=n ) {
1561  n= f->nexttype;
1562  if ( f->mf!=NULL && f->mf->ismutex ) {
1563  offFlags=0;
1564  for ( n=f; n!=NULL && n->featureType==f->featureType; n=n->nexttype ) {
1565  offFlags |= n->flag;
1566  }
1567  for ( n=f; n!=NULL && n->featureType==f->featureType; n=n->nexttype )
1568  n->offFlags = ~(offFlags&~n->flag);
1569  }
1570  }
1571 return;
1572 }
1573 
1574 static void aat_dumpfeat(struct alltabs *at, SplineFont *sf, struct feature *feature) {
1575  int scnt, fcnt, cnt;
1576  struct feature *f, *n, *p;
1577  int k;
1578  uint32 offset;
1579  int strid = at->next_strid;
1580  int fn=0;
1581  MacFeat *mf, *smf;
1582  struct macsetting *ms, *sms;
1583  /* Dump the 'feat' table which is a connection between morx features and */
1584  /* the name table */
1585  /* We do three passes. The first just calculates how much space we will need */
1586  /* the second provides names for the feature types */
1587  /* and the third provides names for the feature settings */
1588  /* As we fill up the feat table we also create an array of strings */
1589  /* (strid, char *pointer) which will be used by the 'name' table to */
1590  /* give names to the features and their settings */
1591  /* The mac documentation says that the features should be sorted by feature type */
1592  /* This is a lie. Features should appear in the same order they appear */
1593  /* in the morx table, otherwise WorldText goes blooie */
1594  /* WorldText doesn't exist any more. Perhaps the morx table needs to be */
1595  /* sorted by feature id too? No, it can't be. Feature 0 must come last */
1596 
1597  if ( feature==NULL )
1598 return;
1599 
1600  fcnt = scnt = 0;
1601  for ( k=0; k<3; ++k ) {
1602  if ( k==1 ) {
1603  /* FeatureName entry for All Typographics */
1604  mf = FindMacFeature(sf,0,&smf);
1605  if ( (mf!=NULL && mf->featname!=NULL) || (smf!=NULL && smf->featname!=NULL)) {
1606  at->feat_name[fn].mn = mf!=NULL ? mf->featname : NULL;
1607  at->feat_name[fn].smn = smf!=NULL ? smf->featname : NULL;
1608  at->feat_name[fn++].strid = strid;
1609  }
1610  putshort(at->feat,0);
1611  putshort(at->feat,1);
1612  putlong(at->feat,offset);
1613  putshort(at->feat,0x0000); /* non exclusive */
1614  putshort(at->feat,strid++);
1615  offset += 1*4; /* (1 setting, 4 bytes) All Features */
1616  } else if ( k==2 ) {
1617  /* Setting Name Array for All Typographic Features */
1618  ms = FindMacSetting(sf,0,0,&sms);
1619  if ( (ms!=NULL && ms->setname!=NULL) || (sms!=NULL && sms->setname!=NULL)) {
1620  at->feat_name[fn].mn = ms!=NULL ? ms->setname: NULL;
1621  at->feat_name[fn].smn = sms!=NULL ? sms->setname: NULL;
1622  at->feat_name[fn++].strid = strid;
1623  }
1624  putshort(at->feat,0);
1625  putshort(at->feat,strid++);
1626  }
1627  for ( f=feature; f!=NULL; f=n ) {
1628  cnt=1;
1629  if ( k!=2 ) {
1630  p = f;
1631  for ( n=f->nexttype; n!=NULL && n->featureType==f->featureType; n = n->nexttype ) {
1632  if ( p->featureSetting!=n->featureSetting ) {
1633  ++cnt;
1634  p = n;
1635  }
1636  }
1637  } else {
1638  p = f;
1639  for ( n=f; n!=NULL && n->featureType==f->featureType; n = n->nexttype ) {
1640  if ( n==f || p->featureSetting!=n->featureSetting ) {
1641  if (( n->ms!=NULL && n->ms->setname!=NULL ) ||
1642  ( n->sms!=NULL && n->sms->setname!=NULL)) {
1643  at->feat_name[fn].mn = n->ms!=NULL ? n->ms->setname : NULL;
1644  at->feat_name[fn].smn = n->sms!=NULL ? n->sms->setname : NULL;
1645  at->feat_name[fn++].strid = strid;
1646  }
1647  putshort(at->feat,n->featureSetting);
1648  putshort(at->feat,strid++);
1649  p = n;
1650  }
1651  }
1652  }
1653  if ( k==0 ) {
1654  ++fcnt;
1655  scnt += cnt;
1656  } else if ( k==1 ) {
1657  if ( (f->mf!=NULL && f->mf->featname!=NULL) || (f->smf!=NULL && f->smf->featname!=NULL) ) {
1658  at->feat_name[fn].mn = f->mf!=NULL ? f->mf->featname : NULL;
1659  at->feat_name[fn].smn = f->smf!=NULL ? f->smf->featname : NULL;
1660  at->feat_name[fn++].strid = strid;
1661  }
1662  putshort(at->feat,f->featureType);
1663  putshort(at->feat,cnt);
1664  putlong(at->feat,offset);
1665  putshort(at->feat,f->mf!=NULL && f->mf->ismutex?(0xc000|f->mf->default_setting):
1666  0);
1667  putshort(at->feat,strid++);
1668  offset += 4*cnt;
1669  }
1670  }
1671  if ( k==0 ) {
1672  ++fcnt; /* Add one for "All Typographic Features" */
1673  ++scnt; /* Add one for All Features */
1674  at->feat = tmpfile2();
1675  at->feat_name = malloc((fcnt+scnt+1)*sizeof(struct feat_name));
1676  putlong(at->feat,0x00010000);
1677  putshort(at->feat,fcnt);
1678  putshort(at->feat,0);
1679  putlong(at->feat,0);
1680  offset = 12 /* header */ + fcnt*12;
1681  }
1682  }
1683  memset( &at->feat_name[fn],0,sizeof(struct feat_name));
1684  at->next_strid = strid;
1685 
1686  at->featlen = ftell(at->feat);
1687  if ( at->featlen&2 )
1688  putshort(at->feat,0);
1689 }
1690 
1691 static int featuresAssignFlagsChains(struct feature *features, struct feature *feature_by_type) {
1692  int bit, cnt, chain, fcnt, i, mybit;
1693  struct feature *f, *n, *p;
1694  uint16 chains_features[32];
1695  uint32 chains_bitindex[32]; /* Index for bit of first setting of this feature */
1696 
1697  if ( features==NULL )
1698 return( 0 );
1699 
1700  /* A feature may have several subtables which need not be contiguous in */
1701  /* the feature list */
1702  /* Indeed we could have a feature in several different chains */
1703  /* Sigh */
1704  /* we figure out how many possible settings there are for each feature */
1705  /* and reserve that many bits for the feature in all chains in which it */
1706  /* occurs */
1707  /* Note that here we count dummy settings (they need turn off bits) */
1708  /* so we use feature_by_type */
1709  for ( f=feature_by_type; f!=NULL; f=n ) {
1710  cnt=0;
1711  p = NULL;
1712  for ( n=f; n!=NULL && n->featureType==f->featureType; n=n->nexttype ) {
1713  if ( p==NULL || n->featureSetting != p->featureSetting ) {
1714  ++cnt;
1715  p = n;
1716  }
1717  n->setting_index = cnt-1;
1718  }
1719  for ( n=f; n!=NULL && n->featureType==f->featureType; n=n->nexttype )
1720  n->setting_cnt = cnt;
1721  }
1722  /* When we counted flags we need to count the dummy features for turning */
1723  /* things off. Those features live in features_by_type. When we put */
1724  /* things in chains we want only the meaningful features, and we want */
1725  /* them to be properly ordered. That we get from the "features" list */
1726  fcnt = 0; chain = 0; bit=0;
1727  for ( f=features; f!=NULL; f=f->next ) {
1728  for ( i=0; i<fcnt && chains_features[i]!=f->featureType; ++i );
1729  if ( i==fcnt ) {
1730  if ( bit+f->setting_cnt>=32 ) {
1731  ++chain;
1732  bit = 0;
1733  fcnt = 0;
1734  }
1735  chains_features[fcnt] = f->featureType;
1736  chains_bitindex[fcnt++] = bit;
1737  mybit = bit;
1738  bit += f->setting_cnt;
1739  } else
1740  mybit = chains_bitindex[i];
1741  f->real_index = mybit+f->setting_index;
1742  f->flag = 1<<f->real_index;
1743  if ( f->mf!=NULL && f->mf->ismutex ) {
1744  int off = (~((~0)<<f->setting_cnt))<<mybit;
1745  off &= !f->flag;
1746  f->offFlags = off;
1747  } else {
1748  if ( f->featureSetting&1 ) {
1749  for ( n=feature_by_type; n!=NULL &&
1750  (n->featureType!=f->featureType || n->featureSetting!=f->featureSetting+1);
1751  n=n->next );
1752  } else {
1753  for ( n=feature_by_type; n!=NULL &&
1754  (n->featureType!=f->featureType || n->featureSetting!=f->featureSetting+1);
1755  n=n->next );
1756  }
1757  if ( n!=NULL )
1758  f->offFlags = 1<<(mybit+n->setting_index);
1759  else
1760  f->offFlags = ~0;
1761  }
1762  f->chain = chain;
1763  }
1764 return( chain+1 );
1765 }
1766 
1767 static void morxDumpChain(struct alltabs *at,struct feature *features,
1768  struct feature *features_by_type, int chain, FILE *temp) {
1769  uint32 def_flags=0;
1770  struct feature *f, *n;
1771  uint32 chain_start, end;
1772  char *buf;
1773  int len, tot, fs_cnt, sub_cnt;
1774  struct feature *all[32];
1775  int i,offFlags, last_ri=-1, last_f=-1, ri;
1776 
1777  memset(all,0,sizeof(all));
1778  for ( f=features, fs_cnt=sub_cnt=0; f!=NULL; f=f->next ) {
1779  if ( f->chain==chain ) {
1780  if ( all[f->real_index]==NULL ) {
1781  int base = f->real_index-f->setting_index;
1782  /* Note we use features_by_type here. It will have the default*/
1783  /* settings for features, and will be ordered nicely */
1784  for ( n=features_by_type; n!=NULL; n=n->nexttype ) {
1785  if ( n->featureType==f->featureType && n->chain==chain ) {
1786  n->nextsame = all[base+n->setting_index];
1787  all[base+n->setting_index] = n;
1788  if ( n->ms!=NULL && n->ms->initially_enabled )
1789  def_flags |= n->flag;
1790  }
1791  }
1792  }
1793  ++sub_cnt;
1794  }
1795  }
1796 
1797  /* Chain header */
1798  chain_start = ftell(at->morx);
1799  putlong(at->morx,def_flags);
1800  putlong(at->morx,0); /* Fix up length later */
1801  putlong(at->morx,0); /* fix up feature count */
1802  putlong(at->morx,sub_cnt); /* subtable cnt */
1803 
1804  /* Features */
1805  fs_cnt = 0;
1806  for ( i=0; i<32; ++i ) if ( all[i]!=NULL ) {
1807  putshort(at->morx,all[i]->featureType);
1808  putshort(at->morx,all[i]->featureSetting);
1809  if ( all[i]->dummyOff ) {
1810  putlong(at->morx,0);
1811  if ( last_f==all[i]->featureType )
1812  ri = last_ri;
1813  else if ( i<31 && all[i+1]!=NULL && all[i+1]->featureType == all[i]->featureType )
1814  ri = i+1 - all[i+1]->real_index;
1815  else
1816  ri = 0; /* This can't happen */
1817  } else {
1818  putlong(at->morx,1<<i);
1819  ri = i-all[i]->real_index;
1820  last_ri = ri; last_f = all[i]->featureType;
1821  }
1822  offFlags = all[i]->offFlags;
1823  if ( ri>0 )
1824  offFlags<<=(ri);
1825  else if ( ri<0 )
1826  offFlags>>=(-ri);
1827  putlong(at->morx,offFlags);
1828  ++fs_cnt;
1829 
1830  if ( all[i]->needsOff && (i==31 || all[i+1]==NULL ||
1831  all[i+1]->featureType!=all[i]->featureType ||
1832  all[i+1]->featureSetting!=all[i]->featureSetting+1 )) {
1833  putshort(at->morx,all[i]->featureType);
1834  putshort(at->morx,all[i]->featureSetting+1);
1835  putlong(at->morx,0);
1836  putlong(at->morx,all[i]->offFlags & ~all[i]->flag );
1837  ++fs_cnt;
1838  }
1839  /* I used to have code to output the default setting of a mutex */
1840  /* but I should already have put that in the feature list */
1841  }
1842  /* The feature list of every chain must end with these two features */
1843  putshort(at->morx,0); /* All Typo Features */
1844  putshort(at->morx,0); /* All Features */
1845  putlong(at->morx,0xffffffff); /* enable */
1846  putlong(at->morx,0xffffffff); /* disable */
1847  putshort(at->morx,0); /* All Typo Features */
1848  putshort(at->morx,1); /* No Features */
1849  putlong(at->morx,0); /* enable */
1850  putlong(at->morx,0); /* disable */
1851  fs_cnt += 2;
1852 
1853  buf = malloc(16*1024);
1854  /* Subtables */
1855  for ( f=features; f!=NULL; f=f->next ) if ( f->chain==chain ) {
1856  putlong(at->morx,f->feature_len+12); /* Size of header needs to be added */
1857  putlong(at->morx,(f->vertOnly?0x80000000:f->r2l?0x40000000:0) | f->subtable_type);
1858  putlong(at->morx,f->flag);
1859  tot = f->feature_len;
1860  fseek(temp, f->feature_start, SEEK_SET);
1861  while ( tot!=0 ) {
1862  len = tot;
1863  if ( len>16*1024 ) len = 16*1024;
1864  len = fread(buf,1,len,temp);
1865  len = fwrite(buf,1,len,at->morx);
1866  if ( len<=0 ) {
1867  IError( "Disk error\n" );
1868  break;
1869  }
1870  tot -= len;
1871  }
1872  }
1873  free(buf);
1874 
1875  /* Pad chain to a multiple of four */
1876  if ( (ftell(at->morx)-chain_start)&1 )
1877  putc('\0',at->morx);
1878  if ( (ftell(at->morx)-chain_start)&2 )
1879  putshort(at->morx,0);
1880  end = ftell(at->morx);
1881  fseek(at->morx,chain_start+4,SEEK_SET);
1882  putlong(at->morx,end-chain_start);
1883  putlong(at->morx,fs_cnt);
1884  fseek(at->morx,0,SEEK_END);
1885 }
1886 
1887 void aat_dumpmorx(struct alltabs *at, SplineFont *sf) {
1888  FILE *temp = tmpfile2();
1889  struct feature *features = NULL, *features_by_type;
1890  int nchains, i;
1891  OTLookup *otl;
1892  struct lookup_subtable *sub;
1893 
1894  /* Arabic Form features all need to be merged together and formed into */
1895  /* a cursive connection state machine. So the first time we see one of */
1896  /* we handle all of them. After that we ignore all of them. Note: if */
1897  /* OpenType has them happening in different orders, that information */
1898  /* will be lost. All will be processed at once. */
1899  for ( otl = sf->gsub_lookups; otl!=NULL; otl=otl->next )
1900  otl->ticked = false;
1901 
1903 
1904  /* Retain the same lookup ordering */
1905  for ( otl = sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
1906  if ( !Macable(sf,otl))
1907  continue;
1908  if ( otl->lookup_type==gsub_single && IsOtfArabicFormFeature(otl) ) {
1909  if ( otl->ticked )
1910  /* Already processed */;
1911  else if ( HasCursiveConnectionSM(sf) )
1912  /* Skip the OpenType conversion and use the native state machine */;
1913  else
1915  } else {
1916  for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
1917  switch ( otl->lookup_type ) {
1918  case gsub_single:
1920  break;
1921  case gsub_ligature:
1923  break;
1924  case morx_indic: case morx_context: case morx_insert:
1926  break;
1927  default:
1928  if ( sf->sm==NULL )
1930  }
1931  }
1932  }
1933  }
1934 
1936 
1937  if ( features==NULL ) {
1938  fclose(temp);
1939 return;
1940  }
1941  /* The features are in reverse execution order */
1943  /* But the feature table requires them in numeric order */
1944  features_by_type = featuresOrderByType(features);
1945  features_by_type = AddExclusiveNoops(sf,features_by_type);
1946  aat_dumpfeat(at, sf, features_by_type);
1947  nchains = featuresAssignFlagsChains(features,features_by_type);
1948  SetExclusiveOffs(features_by_type);
1949 
1950  at->morx = tmpfile2();
1951  putlong(at->morx,0x00020000);
1952  putlong(at->morx,nchains);
1953  for ( i=0; i<nchains; ++i )
1954  morxDumpChain(at,features,features_by_type,i,temp);
1955  fclose(temp);
1956  morxfeaturesfree(features_by_type);
1957 
1958  at->morxlen = ftell(at->morx);
1959  if ( at->morxlen&1 )
1960  putc('\0',at->morx);
1961  if ( (at->morxlen+1)&2 )
1962  putshort(at->morx,0);
1963 }
1964 
1965 /* ************************************************************************** */
1966 /* ************************* The 'opbd' table ************************* */
1967 /* ************************************************************************** */
1968 
1970  PST *pst;
1971 
1972  *left = *right = NULL;
1973  for ( pst=sc->possub; pst!=NULL ; pst=pst->next ) {
1974  if ( pst->type == pst_position ) {
1975  if ( PSTHasTag(pst,CHR('l','f','b','d')) ) {
1976  *left = pst;
1977  if ( *right )
1978 return( true );
1979  } else if ( PSTHasTag(pst,CHR('r','t','b','d')) ) {
1980  *right = pst;
1981  if ( *left )
1982 return( true );
1983  }
1984  }
1985  }
1986 return( *left!=NULL || *right!=NULL );
1987 }
1988 
1989 void aat_dumpopbd(struct alltabs *at, SplineFont *_sf) {
1990  int i, j, k, l, seg_cnt, tot, last, offset;
1991  PST *left, *right;
1992  FILE *opbd=NULL;
1993  /* We do four passes. The first just calculates how much space we will need (if any) */
1994  /* the second provides the top-level lookup table structure */
1995  /* the third provides the arrays of offsets needed for type 4 lookup tables */
1996  /* the fourth provides the actual data on the optical bounds */
1997  SplineChar *sc;
1998 
1999  for ( k=0; k<4; ++k ) {
2000  for ( i=seg_cnt=tot=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
2001  l = 0;
2002  sc = _sf->glyphs[at->gi.bygid[i]];
2003  if ( haslrbounds(sc,&left,&right) ) {
2004  if ( k==1 )
2005  tot = 0;
2006  else if ( k==2 ) {
2007  putshort(opbd,offset);
2008  offset += 8;
2009  } else if ( k==3 ) {
2010  putshort(opbd,left!=NULL?-left->u.pos.xoff:0);
2011  putshort(opbd,0); /* top */
2012  putshort(opbd,right!=NULL?-right->u.pos.h_adv_off:0);
2013  putshort(opbd,0); /* bottom */
2014  }
2015  last = i;
2016  for ( j=i+1, ++tot; j<at->gi.gcnt; ++j ) {
2017  if ( at->gi.bygid[i]==-1 || !haslrbounds(_sf->glyphs[at->gi.bygid[j]],&left,&right) )
2018  break;
2019  ++tot;
2020  last = j;
2021  if ( k==2 ) {
2022  putshort(opbd,offset);
2023  offset += 8;
2024  } else if ( k==3 ) {
2025  putshort(opbd,left!=NULL?-left->u.pos.xoff:0);
2026  putshort(opbd,0); /* top */
2027  putshort(opbd,right!=NULL?-right->u.pos.h_adv_off:0);
2028  putshort(opbd,0); /* bottom */
2029  }
2030  }
2031  if ( k==1 ) {
2032  putshort(opbd,last);
2033  putshort(opbd,i);
2034  putshort(opbd,offset);
2035  offset += 2*tot;
2036  }
2037  ++seg_cnt;
2038  i = j-1;
2039  }
2040  }
2041  if ( k==0 ) {
2042  if ( seg_cnt==0 )
2043 return;
2044  opbd = tmpfile2();
2045  putlong(opbd, 0x00010000); /* version */
2046  putshort(opbd,0); /* data are distances (not control points) */
2047 
2048  putshort(opbd,4); /* Lookup table format 4 */
2049  /* Binary search header */
2050  putshort(opbd,6); /* Entry size */
2051  putshort(opbd,seg_cnt); /* Number of segments */
2052  for ( j=0,l=1; l<=seg_cnt; l<<=1, ++j );
2053  --j; l>>=1;
2054  putshort(opbd,6*l);
2055  putshort(opbd,j);
2056  putshort(opbd,6*(seg_cnt-l));
2057  /* offset from start of lookup, not table */
2058  offset = 6*2/* format, binsearch*/ + seg_cnt*6 +6 /*flag entry */;
2059  } else if ( k==1 ) { /* flag entry */
2060  putshort(opbd,0xffff);
2061  putshort(opbd,0xffff);
2062  putshort(opbd,0);
2063  }
2064  }
2065  at->opbd = opbd;
2066  at->opbdlen = ftell(at->opbd);
2067  if ( at->opbdlen&2 )
2068  putshort(at->opbd,0);
2069 }
2070 
2071 /* ************************************************************************** */
2072 /* ************************* The 'prop' table ************************* */
2073 /* ************************************************************************** */
2074 
2076  uint16 *props;
2077  int i;
2078  SplineChar *sc, *bsc;
2079  int dir, isfloat, isbracket, offset, doit=false;
2080  AnchorPoint *ap;
2081  PST *pst;
2082  int p;
2083 
2084  props = calloc(gi->gcnt+1,sizeof(uint16));
2085  props[gi->gcnt] = -1;
2086 
2087  for ( i=0; i<gi->gcnt; ++i ) if ( (p = gi->bygid==NULL ? i : gi->bygid[i])!=-1 ) {
2088  sc = sf->glyphs[p];
2089  if ( sc!=NULL && (gi->bygid==NULL || sc->ttf_glyph!=-1 )) {
2090  dir = 0;
2091  if ( sc->unicodeenc>=0x10300 && sc->unicodeenc<=0x103ff )
2092  dir = 0;
2093  else if ( sc->unicodeenc>=0x10800 && sc->unicodeenc<=0x10fff )
2094  dir = 1;
2095  else if ( sc->unicodeenc!=-1 && sc->unicodeenc<0x10fff ) {
2096  if ( iseuronumeric(sc->unicodeenc) )
2097  dir = 3;
2098  else if ( iseuronumsep(sc->unicodeenc))
2099  dir = 4;
2100  else if ( iseuronumterm(sc->unicodeenc))
2101  dir = 5;
2102  else if ( isarabnumeric(sc->unicodeenc))
2103  dir = 6;
2104  else if ( iscommonsep(sc->unicodeenc))
2105  dir = 7;
2106  else if ( isspace(sc->unicodeenc))
2107  dir = 10;
2108  else if ( islefttoright(sc->unicodeenc) )
2109  dir = 0;
2110  else if ( isrighttoleft(sc->unicodeenc) )
2111  dir = 1;
2112  else if ( SCScriptFromUnicode(sc)==CHR('a','r','a','b') )
2113  dir = 2;
2114  else if ( SCScriptFromUnicode(sc)==CHR('h','e','b','r') )
2115  dir = 1;
2116  else
2117  dir = 11; /* Other neutrals */
2118  /* Not dealing with unicode 3 classes */
2119  /* nor block seperator/ segment seperator */
2120  } else if ( SCScriptFromUnicode(sc)==CHR('a','r','a','b') )
2121  dir = 2;
2122  else if ( SCScriptFromUnicode(sc)==CHR('h','e','b','r') )
2123  dir = 1;
2124 
2125  if ( dir==1 || dir==2 ) doit = true;
2126  isfloat = false;
2127  if ( sc->width==0 &&
2128  ((sc->anchor!=NULL && sc->anchor->type==at_mark) ||
2129  (sc->unicodeenc!=-1 && sc->unicodeenc<0x10000 && iscombining(sc->unicodeenc))))
2130  isfloat = doit = true;
2131  isbracket = offset = 0;
2132  if ( sc->unicodeenc!=-1 && sc->unicodeenc<0x10000 && tomirror(sc->unicodeenc)!=0 ) {
2133  bsc = SFGetChar(sf,tomirror(sc->unicodeenc),NULL);
2134  if ( bsc!=NULL && bsc->ttf_glyph-sc->ttf_glyph>-8 && bsc->ttf_glyph-sc->ttf_glyph<8 ) {
2135  isbracket = true;
2136  offset = bsc->ttf_glyph-sc->ttf_glyph;
2137  }
2138  }
2139  if ( !isbracket ) {
2140  for ( pst=sc->possub; pst!=NULL && PSTHasTag(pst,CHR('r','t','l','a')); pst=pst->next );
2141  if ( pst!=NULL && pst->type==pst_substitution &&
2142  (bsc=SFGetChar(sf,-1,pst->u.subs.variant))!=NULL &&
2143  bsc->ttf_glyph!=-1 && bsc->ttf_glyph-sc->ttf_glyph>-8 && bsc->ttf_glyph-sc->ttf_glyph<8 ) {
2144  isbracket = true;
2145  offset = bsc->ttf_glyph-sc->ttf_glyph;
2146  doit = true;
2147  }
2148  }
2149  if ( SCRightToLeft(sc) ) {
2150  /* Apple docs say attached right. So for r2l scripts we look for */
2151  /* a cursive entry, and for l2r a cursive exit */
2152  for ( ap=sc->anchor; ap!=NULL && ap->type!=at_centry; ap=ap->next );
2153  } else {
2154  for ( ap=sc->anchor; ap!=NULL && ap->type!=at_cexit; ap=ap->next );
2155  }
2156  props[sc->ttf_glyph] = dir |
2157  (isfloat ? 0x8000 : 0 ) |
2158  (isbracket ? 0x1000 : 0 ) |
2159  (ap!=NULL ? 0x80 : 0 ) |
2160  ((offset&0xf)<<8);
2161  /* not dealing with */
2162  /* hang left 0x4000 */
2163  /* hang right 0x2000 */
2164  }
2165  }
2166 
2167  if ( !doit ) {
2168  free(props);
2169 return( NULL );
2170  }
2171 
2172 return( props );
2173 }
2174 
2175 void aat_dumpprop(struct alltabs *at, SplineFont *sf) {
2176  uint16 *props = props_array(sf,&at->gi);
2177  uint32 bin_srch_header;
2178  int i, j, cnt;
2179 
2180  if ( props==NULL )
2181 return;
2182 
2183  at->prop = tmpfile2();
2184  putlong(at->prop,0x00020000);
2185  putshort(at->prop,1); /* Lookup data */
2186  putshort(at->prop,0); /* default property is simple l2r */
2187  putshort(at->prop,2); /* lookup format 2 => segment single value */
2188  /* Binsearch header */
2189  bin_srch_header = ftell(at->prop);
2190  putshort(at->prop,6); /* Entry size */
2191  putshort(at->prop,0); /* fill in later */
2192  putshort(at->prop,0);
2193  putshort(at->prop,0);
2194  putshort(at->prop,0);
2195 
2196  cnt = 0;
2197  for ( i=0; i<at->gi.gcnt; ++i ) {
2198  while ( i<at->gi.gcnt && props[i]==0 ) ++i; /* skip default entries */
2199  if ( i>=at->gi.gcnt )
2200  break;
2201  for ( j=i+1; j<at->gi.gcnt && props[j]==props[i]; ++j );
2202  putshort(at->prop,j-1);
2203  putshort(at->prop,i);
2204  putshort(at->prop,props[i]);
2205  i = j-1;
2206  ++cnt;
2207  }
2208  putshort(at->prop,0xffff); /* Final eof marker */
2209  putshort(at->prop,0xffff);
2210  putshort(at->prop,0x0000);
2211 
2212  fseek(at->prop,bin_srch_header,SEEK_SET);
2213  putshort(at->prop,6); /* Entry size */
2214  putshort(at->prop,cnt); /* Number of segments */
2215  for ( j=0,i=1; i<=cnt; i<<=1, ++j );
2216  --j; i>>=1;
2217  putshort(at->prop,6*i);
2218  putshort(at->prop,j);
2219  putshort(at->prop,6*(cnt-i));
2220 
2221  fseek(at->prop,0,SEEK_END);
2222  at->proplen = ftell(at->prop);
2223  if ( at->proplen&2 )
2224  putshort(at->prop,0);
2225  free(props);
2226 }
2227 
2228 /* ************************************************************************** */
2229 /* ************************* The 'bsln' table ************************* */
2230 /* ************************************************************************** */
2231 
2232 static int BslnFromTag(uint32 tag) {
2233  switch ( tag ) {
2234  case CHR('r','o','m','n'):
2235 return( 0 );
2236  /* Apple has a centered ideographic baseline, while OT has a top ideo bsln*/
2237  /* no way to get Apple's baseline #1 */
2238  case CHR('i','d','e','o'):
2239 return( 2 );
2240  case CHR('h','a','n','g'):
2241 return( 3 );
2242  case CHR('m','a','t','h'):
2243 return( 4 );
2244  default:
2245 return( 0xffff );
2246  }
2247 }
2248 
2249 int16 *PerGlyphDefBaseline(SplineFont *sf,int *def_baseline) {
2250  int16 *baselines = malloc(sf->glyphcnt*sizeof(int16));
2251  int gid, bsln, i, any;
2252  SplineChar *sc;
2253  int counts[32]; /* Apple supports a max of 32 baselines, but only 5 are defined */
2254  struct Base *base = sf->horiz_base;
2255  struct basescript *bs;
2256  int bestbsln, bestcnt;
2257 
2258  memset(counts,0,sizeof(counts));
2259 
2260  for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc = sf->glyphs[gid])!=NULL ) {
2262  for ( bs= base->scripts; bs!=NULL; bs=bs->next )
2263  if ( bs->script==script )
2264  break;
2265  if ( bs==NULL )
2266  bsln = 0xffff;
2267  else
2268  bsln = BslnFromTag( base->baseline_tags[bs->def_baseline] );
2269 /* This if is duplicated (almost) in basedlg.c:Base_FinishEdit */
2270  if ( bsln==0xffff ) {
2271  if ( script==CHR('k','a','n','a') || script==CHR('h','a','n','g') ||
2272  script==CHR('h','a','n','i') || script==CHR('b','o','p','o') ||
2273  script==CHR('j','a','m','o') || script==CHR('y','i',' ',' '))
2274  bsln = 2;
2275  else if ( script==CHR('t','i','b','t' ) ||
2276  script == CHR('b','e','n','g' ) || script == CHR('b','n','g','2') ||
2277  script == CHR('d','e','v','a' ) || script == CHR('d','e','v','2') ||
2278  script == CHR('g','u','j','r' ) || script == CHR('g','j','r','2') ||
2279  script == CHR('g','u','r','u' ) || script == CHR('g','u','r','2') ||
2280  script == CHR('k','n','d','a' ) || script == CHR('k','n','d','2') ||
2281  script == CHR('m','l','y','m' ) || script == CHR('m','l','m','2') ||
2282  script == CHR('o','r','y','a' ) || script == CHR('o','r','y','2') ||
2283  script == CHR('t','a','m','l' ) || script == CHR('t','m','l','2') ||
2284  script == CHR('t','e','l','u' ) || script == CHR('t','e','l','2'))
2285  bsln = 3;
2286  else if ( script==CHR('m','a','t','h') )
2287  bsln = 4;
2288  else
2289  bsln = 0;
2290  }
2291  baselines[gid] = bsln;
2292  if ( bsln!=0xffff )
2293  ++counts[bsln];
2294  }
2295 
2296  bestbsln = 0;
2297  bestcnt = 0;
2298  any = 0;
2299  for ( i=0; i<32 ; ++i ) {
2300  if ( counts[i]>bestcnt ) {
2301  bestbsln = i;
2302  bestcnt = counts[i];
2303  ++any;
2304  }
2305  }
2306  *def_baseline = bestbsln | (any<=1 ? 0x100 : 0 );
2307 return( baselines );
2308 }
2309 
2310 void FigureBaseOffsets(SplineFont *sf,int def_bsln,int offsets[32]) {
2311  struct Base *base = sf->horiz_base;
2312  struct basescript *bs = base->scripts;
2313  int i;
2314 
2315  memset( offsets,0xff,32*sizeof(int));
2316  for ( i=0; i<base->baseline_cnt; ++i ) {
2317  int bsln = BslnFromTag(base->baseline_tags[i]);
2318  if ( bsln!=0xffff )
2319  offsets[bsln] = bs->baseline_pos[i];
2320  }
2321  if ( offsets[def_bsln]!=-1 ) {
2322  for ( i=0; i<32; ++i ) {
2323  if ( offsets[i]!=-1 )
2324  offsets[i] -= offsets[def_bsln];
2325  }
2326  }
2327  /* I suspect baseline 1 is the standard baseline for CJK glyphs on the mac*/
2328  /* (because baseline 2 is often the same as baseline 1, which is wrong for 2) */
2329  /* OT doesn't have a centered ideographic baseline, so guestimate */
2330  /* And I don't want to base it on the actual ideo baseline (go up half an em?) */
2331  /* because in my small sample of 'bsln' tables baseline 2 has been wrong */
2332  /* most of the time, and it is wrong in the example in the docs. */
2333  /* (I know it is wrong because it has the same value as baseline 1, but */
2334  /* is supposed to be below baseline 1 ) */
2335  if ( offsets[1]==-1 ) {
2336  if ( offsets[2]!=-1 )
2337  offsets[1] = offsets[2]+(sf->ascent+sf->descent)/2;
2338  else
2339  offsets[1] = (sf->ascent+sf->descent)/2 - sf->descent;
2340  }
2341  for ( i=0; i<32; ++i )
2342  if ( offsets[i]==-1 )
2343  offsets[i] = 0;
2344 }
2345 
2346 void aat_dumpbsln(struct alltabs *at, SplineFont *sf) {
2347  int def_baseline;
2348  int offsets[32];
2349  int16 *baselines;
2350  int i, gid, j, bsln, cnt;
2351 
2352  if ( sf->horiz_base==NULL || sf->horiz_base->baseline_cnt==0 ||
2353  sf->horiz_base->scripts==NULL )
2354 return;
2355 
2357 
2358  at->bsln = tmpfile2();
2359  putlong(at->bsln,0x00010000); /* Version */
2360  if ( def_baseline & 0x100 ) /* Only one baseline in the font */
2361  putshort(at->bsln,0); /* distanced based (no control point), no per-glyph info */
2362  else
2363  putshort(at->bsln,1); /* distanced based (no cp info) with per-glyph info */
2364  putshort(at->bsln,def_baseline&0x1f);/* Default baseline when no info specified for glyphs */
2365 
2366  /* table of 32 int16 (the docs say uint16, but that must be wrong) giving */
2367  /* the offset of the nth baseline from the default baseline. */
2368  /* 0 => Roman, 1=> centered ideo, 2=>low ideo (same as OTF ideo) 3=>hang, 4=>Math */
2369  /* values 5-31 undefined, set to 0 */
2370  FigureBaseOffsets(sf,def_baseline&0x1f,offsets);
2371 
2372  for ( i=0; i<32; ++i )
2373  putshort(at->bsln,offsets[i]);
2374 
2375  if ( !(def_baseline&0x100) ) {
2376  def_baseline &= 0x1f;
2377 
2378  putshort(at->bsln,2); /* Lookup format 2, segmented array w/ single value */
2379 
2380  cnt = 0;
2381  for ( i=0; i<at->gi.gcnt; ++i ) if ( (gid=at->gi.bygid[i])!=-1 ) {
2382  if ( baselines[gid]!=-1 && baselines[gid]!=def_baseline ) {
2383  bsln = baselines[gid];
2384  for ( j=i; j<at->gi.gcnt && baselines[at->gi.bygid[i]]==bsln; ++j );
2385  i = j-1;
2386  ++cnt;
2387  }
2388  }
2389 
2390  /* Dump out a binary search header */
2391  putshort(at->bsln,6); /* size of each item */
2392  putshort(at->bsln,cnt); /* number of items */
2393  for ( j=1, i=0; cnt<=j; j<<=1, ++i );
2394  putshort(at->bsln,6*j/2); /* j is a power of 2 too big */
2395  putshort(at->bsln,i-1);
2396  putshort(at->bsln,6*(cnt-(j>>1)) );
2397 
2398  for ( i=0; i<at->gi.gcnt; ++i ) if ( (gid=at->gi.bygid[i])!=-1 ) {
2399  if ( baselines[gid]!=-1 && baselines[gid]!=def_baseline ) {
2400  bsln = baselines[gid];
2401  for ( j=i; j<at->gi.gcnt && baselines[at->gi.bygid[i]]==bsln; ++j );
2402  putshort(at->bsln,j-1);
2403  putshort(at->bsln,i);
2404  putshort(at->bsln,bsln);
2405  i = j-1;
2406  }
2407  }
2408 
2409  putshort(at->bsln,0xffff); /* Final eof marker */
2410  putshort(at->bsln,0xffff);
2411  putshort(at->bsln,0x0000);
2412  }
2413 
2414  at->bslnlen = ftell(at->bsln);
2415  /* Only contains 2 & 4 byte quantities, can't have an odd number of bytes */
2416  if ( at->bslnlen&2 )
2417  putshort(at->bsln,0);
2418  free(baselines);
2419 }
2420 
2421 /* ************************************************************************** */
2422 /* ************************* utility routines ************************* */
2423 /* ************************************************************************** */
2424 
2425 int OTTagToMacFeature(uint32 tag, int *featureType,int *featureSetting) {
2426  int i;
2428 
2429  for ( i=0; msn[i].otf_tag!=0; ++i )
2430  if ( msn[i].otf_tag == tag ) {
2431  *featureType = msn[i].mac_feature_type;
2432  *featureSetting = msn[i].mac_feature_setting;
2433 return( true );
2434  }
2435  *featureType = (tag >> 16);
2436  *featureSetting = (tag & 0xFFFF);
2437  /* Ranges taken from Apple Font Registry. An OT tag without a
2438  corresponding mac feature should fail this test.*/
2439  if (*featureType >= 0 && *featureType < 105 && *featureSetting < 16)
2440  return ( true );
2441 
2442  *featureType = 0;
2443  *featureSetting = 0;
2444 return( false );
2445 }
2446 
2448  int ft, fs;
2449  struct feature *feat;
2450 
2451  feat = chunkalloc(sizeof(struct feature));
2452  if (OTTagToMacFeature(tag, &ft, &fs)) {
2453  feat->featureType = ft;
2454  feat->featureSetting = fs;
2455  feat->mf = FindMacFeature(sf,feat->featureType,&feat->smf);
2456  feat->ms = FindMacSetting(sf,feat->featureType,feat->featureSetting,&feat->sms);
2457  feat->needsOff = feat->mf!=NULL && !feat->mf->ismutex;
2458  feat->vertOnly = tag==CHR('v','r','t','2') || tag==CHR('v','k','n','a');
2459  }
2460 
2461  return( feat );
2462 }
2463 
2466  int ft, fs;
2467 
2468  for ( fl=sub->lookup->features; fl!=NULL; fl=fl->next ) {
2469  if ( fl->ismac )
2470  break;
2471  }
2472  if ( fl==NULL ) {
2473  for ( fl=sub->lookup->features; fl!=NULL; fl=fl->next ) {
2474  if ( OTTagToMacFeature(fl->featuretag,&ft,&fs) )
2475  break;
2476  }
2477  if ( fl==NULL ) {
2478  IError("Could not find a mac feature");
2479  return NULL;
2480  }
2481  }
2482  return( featureFromTag(sf,fl->featuretag));
2483 }
2484 
2485 static int PSTHasTag(PST *pst, uint32 tag) {
2487 
2488  if ( pst->subtable==NULL )
2489 return( false );
2490  for ( fl=pst->subtable->lookup->features; fl!=NULL; fl=fl->next )
2491  if ( fl->featuretag == tag )
2492 return( true );
2493 
2494 return( false );
2495 }
2496 
2498  int i;
2499 
2500  for ( ; sl!=NULL; sl=sl->next ) {
2501  for ( i=0; i<sl->lang_cnt; ++i ) {
2502  if ( (i<MAX_LANG && sl->langs[i]==DEFAULT_LANG) ||
2503  (i>=MAX_LANG && sl->morelangs[i-MAX_LANG]==DEFAULT_LANG)) {
2504 return( true );
2505  }
2506  }
2507  }
2508 return( false );
2509 }
2510 
2512  FeatureScriptLangList *feats;
2513 
2514  if ( otl->def_lang_checked )
2515 return( otl->def_lang_found );
2516 
2517  otl->def_lang_checked = true;
2518  for ( feats=otl->features; feats!=NULL; feats = feats->next ) {
2519  if ( scriptsHaveDefault(feats->scripts) ) {
2520  otl->def_lang_found = true;
2521 return( true );
2522  }
2523  }
2524  otl->def_lang_found = false;
2525 return( false );
2526 }
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
#define sc
Definition: aptex-macros.h:57
static boolean chain
Definition: aptex.h:592
int FPSTisMacable(SplineFont *sf, FPST *fpst)
Definition: asmfpst.c:386
ASM * ASMFromFPST(SplineFont *sf, FPST *fpst, int ordered)
Definition: asmfpst.c:982
ASM * ASMFromOpenTypeForms(SplineFont *sf, uint32 script)
Definition: asmfpst.c:553
static point_t cur
Definition: backend_eps.c:108
static const l_int32 baselines[9][3]
Definition: bmf.c:71
#define n
Definition: t4ht.c:1290
#define b
Definition: jpegint.h:372
#define ap
static Tfeature feat[21]
Definition: control.c:55
#define free(a)
Definition: decNumber.cpp:310
char * def
Definition: definitions.c:41
void glyphs(int opcode)
Definition: disdvi.c:775
#define fread
Definition: xxstdio.h:25
#define fseek
Definition: xxstdio.h:30
#define ftell
Definition: xxstdio.h:31
int strcmp()
Definition: coll.cpp:143
static void doit(const char *name, FILE *fp)
Definition: dviconcat.c:383
char * temp
Definition: dvidvi.c:137
#define putlong
Definition: dvips.h:265
#define MAX_LANG
Definition: fc-lang.c:259
FILE * tmpfile2()
Definition: tmpfile2.cpp:51
#define _(String)
Definition: ftxerr18.c:64
mpz_t * f
Definition: gen-fib.c:34
#define t
Definition: afcover.h:96
#define c(n)
Definition: gpos-common.c:150
static void putshort(int w)
Definition: gsftopk.c:1904
int base
Definition: gsftopk.c:1502
#define memcmp(s1, s2, n)
Definition: gsftopk.c:66
#define putc
Definition: jbib.h:20
#define SEEK_SET
Definition: jmemansi.c:26
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE1 xB2 xBF xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xF0 x96 xB9 xA1 xF0 x96 xB9 x9B xF0 x96 xB9 xAF xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 no script
Definition: afscript.h:271
#define SEEK_CUR
Definition: ftzconf.h:250
#define SEEK_END
Definition: ftzconf.h:251
#define true
Definition: ftrandom.c:51
static unsigned int fcnt
Definition: ftrandom.c:101
@ right
Definition: annotate.c:15
voidp calloc()
#define buf
#define fclose
Definition: debug.h:100
static int ret
Definition: convert.c:72
Code related to b fwrite(a, sizeof(char), b, stdout) @d C_printf(c
#define malloc
Definition: alloca.c:91
int mf
Definition: main.c:38
unsigned short uint16
Definition: tiff.h:62
short int16
Definition: tiff.h:61
unsigned long uint32
Definition: tiff.h:68
long int32
Definition: tiff.h:67
unsigned char uint8
Definition: tiff.h:60
const int * pos
Definition: combiners.h:905
#define int16
Definition: unibasics.h:52
#define realloc
Definition: glob.c:206
string fn
Definition: fc-lang.py:335
list names
Definition: fc-lang.py:151
dictionary off
Definition: fc-lang.py:226
list langs
Definition: fc-lang.py:152
std::is_same< integer_sequence< bool, true, Bs... >, integer_sequence< bool, Bs..., true > > all
Definition: variant.hpp:799
#define version
Definition: nup.c:10
static const Mapping features[]
Definition: otfdescrip.cc:537
int k
Definition: otp-parser.c:70
unsigned char bit
Definition: pbm.h:9
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF add
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF sub
static int cnt
Definition: pkout.c:166
static int32_t last
Definition: ppagelist.c:29
static int32_t first
Definition: ppagelist.c:29
static int offset
Definition: ppmtogif.c:642
bstring c int memset(void *s, int c, int length)
#define dir
#define map
#define flags
SplineChar * SFGetChar(SplineFont *sf, int unienc, const char *name)
Definition: fvfonts.c:175
struct macsetting * FindMacSetting(SplineFont *sf, int feat, int set, struct macsetting **secondary)
Definition: macenc.c:1041
struct macsettingname * user_macfeat_otftag
Definition: macenc.c:1105
struct macsettingname macfeat_otftag[]
Definition: macenc.c:1064
MacFeat * FindMacFeature(SplineFont *sf, int feat, MacFeat **secondary)
Definition: macenc.c:1028
@ ttf_flag_oldkern
Definition: splinefont.h:1904
@ ttf_flag_oldkernmappedonly
Definition: splinefont.h:1911
void SFLigatureCleanup(SplineFont *sf)
Definition: splinesaveafm.c:65
int ttfcopyfile(FILE *ttf, FILE *other, int pos, const char *table_name)
Definition: tottf.c:652
int SCRightToLeft(SplineChar *sc)
Definition: tottfgpos.c:249
void SFKernClassTempDecompose(SplineFont *sf, int isv)
uint32 SCScriptFromUnicode(SplineChar *sc)
Definition: tottfgpos.c:202
@ pst_lcaret
Definition: splinefont.h:566
@ pst_position
Definition: splinefont.h:563
@ pst_substitution
Definition: splinefont.h:564
void SFKernCleanup(SplineFont *sf, int isv)
@ gsub_alternate
Definition: splinefont.h:351
@ gpos_context
Definition: splinefont.h:370
@ gsub_contextchain
Definition: splinefont.h:354
@ gpos_mark2ligature
Definition: splinefont.h:368
@ gpos_mark2base
Definition: splinefont.h:367
@ kern_statemachine
Definition: splinefont.h:373
@ gsub_single
Definition: splinefont.h:349
@ gpos_mark2mark
Definition: splinefont.h:369
@ gsub_ligature
Definition: splinefont.h:352
@ gsub_reversecchain
Definition: splinefont.h:356
@ gsub_context
Definition: splinefont.h:353
@ gpos_cursive
Definition: splinefont.h:366
@ morx_indic
Definition: splinefont.h:358
@ gpos_contextchain
Definition: splinefont.h:371
@ gpos_pair
Definition: splinefont.h:365
@ gsub_multiple
Definition: splinefont.h:350
@ morx_context
Definition: splinefont.h:359
@ gpos_single
Definition: splinefont.h:364
@ morx_insert
Definition: splinefont.h:360
#define DEFAULT_LANG
Definition: splinefont.h:340
void ASMFree(ASM *sm)
Definition: splineutil.c:3010
@ at_cexit
Definition: splinefont.h:513
@ at_mark
Definition: splinefont.h:513
@ at_basemark
Definition: splinefont.h:513
@ at_centry
Definition: splinefont.h:513
@ asm_context
Definition: splinefont.h:648
@ asm_kern
Definition: splinefont.h:649
@ asm_indic
Definition: splinefont.h:648
@ asm_insert
Definition: splinefont.h:648
@ pst_ignorecombiningmarks
Definition: splinefont.h:422
@ pst_r2l
Definition: splinefont.h:421
#define chunkalloc(size)
Definition: splinefont.h:1947
#define chunkfree(item, size)
Definition: splinefont.h:1948
void SFLigaturePrepare(SplineFont *sf)
Definition: splinesaveafm.c:90
uint16 * ClassesFromNames(SplineFont *sf, char **classnames, int class_cnt, int numGlyphs, SplineChar ***glyphs, int apple_kc)
Definition: tottfgpos.c:1210
int LigCaretCnt(SplineChar *sc)
Definition: tottfgpos.c:3172
#define MAC_DELETED_GLYPH_NAME
Definition: ttf.h:30
#define ff_post_error
Definition: uiinterface.h:127
#define IError
Definition: uiinterface.h:124
#define iseuronumsep(ch)
Definition: utype.h:95
#define isrighttoleft(ch)
Definition: utype.h:92
#define iscommonsep(ch)
Definition: utype.h:96
#define isarabnumeric(ch)
Definition: utype.h:94
#define iseuronumterm(ch)
Definition: utype.h:97
#define isspace(ch)
Definition: utype.h:87
#define islefttoright(ch)
Definition: utype.h:91
#define iseuronumeric(ch)
Definition: utype.h:93
#define iscombining(ch)
Definition: utype.h:98
#define tomirror(ch)
Definition: utype.h:140
state_type states[100]
Definition: routines.c:44
lft_cell * left
Definition: routines.h:73
Definition: ttf.h:566
FILE * prop
Definition: ttf.h:633
unsigned int error
Definition: ttf.h:681
unsigned int opentypemode
Definition: ttf.h:674
struct maxp maxp
Definition: ttf.h:571
unsigned int applemode
Definition: ttf.h:673
FILE * opbd
Definition: ttf.h:635
FILE * bsln
Definition: ttf.h:645
struct glyphinfo gi
Definition: ttf.h:682
struct feat_name * feat_name
Definition: ttf.h:687
int opbdlen
Definition: ttf.h:636
int bslnlen
Definition: ttf.h:646
FILE * morx
Definition: ttf.h:643
FILE * kern
Definition: ttf.h:586
int lcarlen
Definition: ttf.h:640
int kernlen
Definition: ttf.h:587
int featlen
Definition: ttf.h:642
int proplen
Definition: ttf.h:634
unsigned int dovariations
Definition: ttf.h:680
FILE * lcar
Definition: ttf.h:639
int morxlen
Definition: ttf.h:644
FILE * feat
Definition: ttf.h:641
int next_strid
Definition: ttf.h:685
struct asm_state::@1439::@1442 kern
union asm_state::@1439 u
uint16 next_state
Definition: splinefont.h:653
int16 * kerns
Definition: splinefont.h:665
uint32 script
Definition: splinefont.h:1588
int16 * baseline_pos
Definition: splinefont.h:1591
struct basescript * next
Definition: splinefont.h:1589
int def_baseline
Definition: splinefont.h:1590
Definition: funcfont.h:31
Definition: ttf.h:555
int strid
Definition: ttf.h:556
struct macname * mn
Definition: ttf.h:557
struct macname * smn
Definition: ttf.h:557
int32 flag
Definition: tottfaat.c:535
int setting_cnt
Definition: tottfaat.c:541
int16 featureType
Definition: tottfaat.c:525
MacFeat * mf
Definition: tottfaat.c:526
uint8 subtable_type
Definition: tottfaat.c:533
struct macsetting * sms
Definition: tottfaat.c:527
uint32 feature_len
Definition: tottfaat.c:537
struct feature * nextsame
Definition: tottfaat.c:540
int chain
Definition: tottfaat.c:534
int16 featureSetting
Definition: tottfaat.c:525
unsigned int r2l
Definition: tottfaat.c:529
MacFeat * smf
Definition: tottfaat.c:526
struct feature * nexttype
Definition: tottfaat.c:539
unsigned int dummyOff
Definition: tottfaat.c:532
int real_index
Definition: tottfaat.c:541
int32 offFlags
Definition: tottfaat.c:535
struct feature * next
Definition: tottfaat.c:538
uint32 feature_start
Definition: tottfaat.c:536
unsigned int vertOnly
Definition: tottfaat.c:528
unsigned int singleMutex
Definition: tottfaat.c:531
int setting_index
Definition: tottfaat.c:541
unsigned int needsOff
Definition: tottfaat.c:530
struct macsetting * ms
Definition: tottfaat.c:527
struct featurescriptlanglist * next
Definition: splinefont.h:417
struct scriptlanglist * scripts
Definition: splinefont.h:416
unsigned int ismac
Definition: splinefont.h:418
Definition: filedef.h:30
uint16 class_cnt
Definition: splinefont.h:678
char ** classes
Definition: splinefont.h:679
struct lookup_subtable * subtable
Definition: splinefont.h:674
struct asm_state * state
Definition: splinefont.h:680
struct generic_asm * next
Definition: splinefont.h:672
uint16 state_cnt
Definition: splinefont.h:678
uint16 type
Definition: splinefont.h:673
uint16 flags
Definition: splinefont.h:675
uint8 type
Definition: splinefont.h:587
struct generic_pst::@1432::@1434 subs
struct lookup_subtable * subtable
Definition: splinefont.h:588
struct generic_pst::@1432::@1437 lcaret
char * variant
Definition: splinefont.h:593
int16 * carets
Definition: splinefont.h:596
union generic_pst::@1432 u
struct generic_pst * next
Definition: splinefont.h:589
int gcnt
Definition: ttf.h:544
int flags
Definition: ttf.h:533
const int * bygid
Definition: splinesave.c:128
Definition: sh5.c:97
int first_cnt
Definition: splinefont.h:546
int second_cnt
Definition: splinefont.h:546
char ** firsts
Definition: splinefont.h:547
int16 * offsets
Definition: splinefont.h:556
char ** seconds
Definition: splinefont.h:548
struct kernclass * next
Definition: splinefont.h:559
struct lookup_subtable * subtable
Definition: splinefont.h:554
int * vbreaks
Definition: tottfaat.c:71
int kccnt
Definition: tottfaat.c:65
int mh
Definition: tottfaat.c:64
int vsubs
Definition: tottfaat.c:70
int cnt
Definition: tottfaat.c:62
int mv
Definition: tottfaat.c:64
int * hbreaks
Definition: tottfaat.c:69
int vkccnt
Definition: tottfaat.c:66
int vcnt
Definition: tottfaat.c:63
int hsubs
Definition: tottfaat.c:68
int ksm
Definition: tottfaat.c:67
Definition: ttf.h:392
Definition: devnag.c:485
struct otlookup * lookup
Definition: splinefont.h:429
struct generic_asm * sm
Definition: splinefont.h:440
struct macname * featname
Definition: splinefont.h:774
uint16 strid
Definition: splinefont.h:763
struct macname * setname
Definition: splinefont.h:764
uint32 otf_tag
Definition: ttf.h:789
int mac_feature_setting
Definition: ttf.h:788
int mac_feature_type
Definition: ttf.h:787
uint16 numGlyphs
Definition: ttf.h:415
SplineFont * normal
Definition: splinefont.h:1858
int instance_count
Definition: splinefont.h:1856
SplineFont ** instances
Definition: splinefont.h:1857
unsigned int ticked
Definition: splinefont.h:472
struct otlookup * next
Definition: splinefont.h:458
struct lookup_subtable * subtables
Definition: splinefont.h:463
unsigned int def_lang_found
Definition: splinefont.h:471
unsigned int def_lang_checked
Definition: splinefont.h:470
FeatureScriptLangList * features
Definition: splinefont.h:462
enum otlookup_type lookup_type
Definition: splinefont.h:459
struct scriptlanglist * next
Definition: splinefont.h:408
uint32 * morelangs
Definition: splinefont.h:406
Definition: tfmaux.c:31
LigList * ligofme
Definition: splinefont.h:1383
unsigned int ticked
Definition: splinefont.h:1350
struct splinecharlist * next
Definition: splinefont.h:1314
struct splinechar * sc
Definition: splinefont.h:1314
SplineChar ** glyphs
Definition: splinefont.h:1690
Definition: dvips.h:235
struct t * next
Definition: dvips.h:237
Definition: xmlparse.c:179
LigList * l
Definition: tottfaat.c:712
uint16 flags
Definition: tottfaat.c:712
uint16 act_index
Definition: tottfaat.c:712
uint16 next_state
Definition: tottfaat.c:712
uint16 ismark
Definition: tottfaat.c:711
uint16 trans_ent
Definition: tottfaat.c:711
uint16 dontconsume
Definition: tottfaat.c:711
LigList * l
Definition: tottfaat.c:711
uint16 next_state
Definition: tottfaat.c:711
#define CHR(x)
Definition: sysdep.h:200
#define FILE
Definition: t1stdio.h:34
ch
Definition: t4ht.c:1443
int j
Definition: t4ht.c:1589
tag int tag
Definition: tex4ht.c:2554
m
Definition: tex4ht.c:3990
#define ins
Definition: stack.c:13
static int morx_dumpASM(FILE *temp, ASM *sm, struct alltabs *at, SplineFont *sf)
Definition: tottfaat.c:1041
int16 * PerGlyphDefBaseline(SplineFont *sf, int *def_baseline)
Definition: tottfaat.c:2249
int scriptsHaveDefault(struct scriptlanglist *sl)
Definition: tottfaat.c:2497
static uint32 * FormedScripts(SplineFont *sf)
Definition: tottfaat.c:1375
int OTTagToMacFeature(uint32 tag, int *featureType, int *featureSetting)
Definition: tottfaat.c:2425
static int IsOtfArabicFormFeature(OTLookup *otl)
Definition: tottfaat.c:1342
static struct feature * aat_dumpmorx_cvtopentypeforms(struct alltabs *at, SplineFont *sf, FILE *temp, struct feature *features)
Definition: tottfaat.c:1443
static int BslnFromTag(uint32 tag)
Definition: tottfaat.c:2232
static struct feature * aat_dumpmorx_cvtopentype(struct alltabs *at, SplineFont *sf, FILE *temp, struct feature *features, struct lookup_subtable *sub)
Definition: tottfaat.c:1328
int LookupHasDefault(OTLookup *otl)
Definition: tottfaat.c:2511
static void morx_lookupmap(FILE *temp, SplineChar **glyphs, uint16 *maps, int gcnt)
Definition: tottfaat.c:579
void aat_dumplcar(struct alltabs *at, SplineFont *sf)
Definition: tottfaat.c:429
static void morx_dumpnestedsubs(FILE *temp, SplineFont *sf, OTLookup *otl, struct glyphinfo *gi)
Definition: tottfaat.c:982
int haslrbounds(SplineChar *sc, PST **left, PST **right)
Definition: tottfaat.c:1969
static void mort_classes(FILE *temp, SplineFont *sf, struct glyphinfo *gi)
Definition: tottfaat.c:556
static void morxDumpChain(struct alltabs *at, struct feature *features, struct feature *features_by_type, int chain, FILE *temp)
Definition: tottfaat.c:1767
static int CountKerns(struct alltabs *at, SplineFont *sf, struct kerncounts *kcnt)
Definition: tottfaat.c:74
static void DumpKernClass(FILE *file, uint16 *class, int cnt, int add, int mul)
Definition: tottfaat.c:46
static struct feature * featureFromTag(SplineFont *sf, uint32 tag)
Definition: tottfaat.c:2447
static struct feature * featureFromSubtable(SplineFont *sf, struct lookup_subtable *sub)
Definition: tottfaat.c:2464
uint16 * props_array(SplineFont *sf, struct glyphinfo *gi)
Definition: tottfaat.c:2075
static struct feature * AddExclusiveNoops(SplineFont *sf, struct feature *features)
Definition: tottfaat.c:1513
void aat_dumpopbd(struct alltabs *at, SplineFont *_sf)
Definition: tottfaat.c:1989
void FigureBaseOffsets(SplineFont *sf, int def_bsln, int offsets[32])
Definition: tottfaat.c:2310
static void aat_dumpfeat(struct alltabs *at, SplineFont *sf, struct feature *feature)
Definition: tottfaat.c:1574
static void morx_dumpLigaFeature(FILE *temp, SplineChar **glyphs, int gcnt, struct lookup_subtable *sub, struct alltabs *at, SplineFont *sf, int ignoremarks)
Definition: tottfaat.c:713
static uint16 * NamesToGlyphs(SplineFont *sf, char *names, uint16 *cnt)
Definition: tottfaat.c:1015
static void SetExclusiveOffs(struct feature *features)
Definition: tottfaat.c:1555
static void morxfeaturesfree(struct feature *features)
Definition: tottfaat.c:547
static LigList * LigListMatchSubtable(SplineFont *sf, LigList *ligs, struct lookup_subtable *sub)
Definition: tottfaat.c:689
void aat_dumpbsln(struct alltabs *at, SplineFont *sf)
Definition: tottfaat.c:2346
static struct feature * featuresOrderByType(struct feature *features)
Definition: tottfaat.c:1486
void aat_dumpprop(struct alltabs *at, SplineFont *sf)
Definition: tottfaat.c:2175
static int featuresAssignFlagsChains(struct feature *features, struct feature *feature_by_type)
Definition: tottfaat.c:1691
static struct feature * featuresReverse(struct feature *features)
Definition: tottfaat.c:1473
static void morx_dumpSubsFeature(FILE *temp, SplineChar **glyphs, uint16 *maps, int gcnt)
Definition: tottfaat.c:632
static PST * haslcaret(SplineChar *sc)
Definition: tottfaat.c:412
static struct feature * aat_dumpmorx_ligatures(struct alltabs *at, SplineFont *sf, FILE *temp, struct feature *features, struct lookup_subtable *sub)
Definition: tottfaat.c:941
static void ttf_dumpsfkerns(struct alltabs *at, SplineFont *sf, int tupleIndex, int version)
Definition: tottfaat.c:163
void aat_dumpmorx(struct alltabs *at, SplineFont *sf)
Definition: tottfaat.c:1887
static struct feature * aat_dumpmorx_asm(struct alltabs *at, SplineFont *sf, FILE *temp, struct feature *features, ASM *sm)
Definition: tottfaat.c:1306
static struct feature * aat_dumpmorx_substitutions(struct alltabs *at, SplineFont *sf, FILE *temp, struct feature *features, struct lookup_subtable *sub)
Definition: tottfaat.c:636
static int IsMarkChar(SplineChar *sc)
Definition: tottfaat.c:699
static int HasCursiveConnectionSM(SplineFont *sf)
Definition: tottfaat.c:1356
int Macable(SplineFont *sf, OTLookup *otl)
Definition: tottfaat.c:1411
void ttf_dumpkerns(struct alltabs *at, SplineFont *sf)
Definition: tottfaat.c:348
static int PSTHasTag(PST *pst, uint32 tag)
Definition: tottfaat.c:2485
@ start
Definition: preamble.c:52
PATTERN * pt
Definition: vlna.c:74
#define ns
Definition: xmlparse.c:597
#define end(cp)
Definition: zic.c:71
static int charcnt
Definition: zic.c:186
static zic_t trans[50]
Definition: zic.c:412