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)  

uresbund.cpp
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ******************************************************************************
5 * Copyright (C) 1997-2016, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 ******************************************************************************
8 *
9 * File uresbund.cpp
10 *
11 * Modification History:
12 *
13 * Date Name Description
14 * 04/01/97 aliu Creation.
15 * 06/14/99 stephen Removed functions taking a filename suffix.
16 * 07/20/99 stephen Changed for UResourceBundle typedef'd to void*
17 * 11/09/99 weiv Added ures_getLocale()
18 * March 2000 weiv Total overhaul - using data in DLLs
19 * 06/20/2000 helena OS/400 port changes; mostly typecast.
20 * 06/24/02 weiv Added support for resource sharing
21 ******************************************************************************
22 */
23 
24 #include "unicode/ures.h"
25 #include "unicode/ustring.h"
26 #include "unicode/ucnv.h"
27 #include "charstr.h"
28 #include "uresimp.h"
29 #include "ustr_imp.h"
30 #include "cwchar.h"
31 #include "ucln_cmn.h"
32 #include "cmemory.h"
33 #include "cstring.h"
34 #include "mutex.h"
35 #include "uhash.h"
36 #include "unicode/uenum.h"
37 #include "uenumimp.h"
38 #include "ulocimp.h"
39 #include "umutex.h"
40 #include "putilimp.h"
41 #include "uassert.h"
42 #include "uresdata.h"
43 
44 using namespace icu;
45 
46 /*
47 Static cache for already opened resource bundles - mostly for keeping fallback info
48 TODO: This cache should probably be removed when the deprecated code is
49  completely removed.
50 */
51 static UHashtable *cache = NULL;
52 static icu::UInitOnce gCacheInitOnce = U_INITONCE_INITIALIZER;
53 
55 
56 /* INTERNAL: hashes an entry */
57 static int32_t U_CALLCONV hashEntry(const UHashTok parm) {
59  UHashTok namekey, pathkey;
60  namekey.pointer = b->fName;
61  pathkey.pointer = b->fPath;
62  return uhash_hashChars(namekey)+37u*uhash_hashChars(pathkey);
63 }
64 
65 /* INTERNAL: compares two entries */
69  UHashTok name1, name2, path1, path2;
70  name1.pointer = b1->fName;
71  name2.pointer = b2->fName;
72  path1.pointer = b1->fPath;
73  path2.pointer = b2->fPath;
74  return (UBool)(uhash_compareChars(name1, name2) &&
75  uhash_compareChars(path1, path2));
76 }
77 
78 
79 /**
80  * Internal function, gets parts of locale name according
81  * to the position of '_' character
82  */
83 static UBool chopLocale(char *name) {
84  char *i = uprv_strrchr(name, '_');
85 
86  if(i != NULL) {
87  *i = '\0';
88  return TRUE;
89  }
90 
91  return FALSE;
92 }
93 
94 /**
95  * Internal function
96  */
99  entry->fCountExisting++;
100  while(entry->fParent != NULL) {
101  entry = entry->fParent;
102  entry->fCountExisting++;
103  }
104 }
105 
106 /**
107  * Internal function. Tries to find a resource in given Resource
108  * Bundle, as well as in its parents
109  */
110 static const ResourceData *getFallbackData(const UResourceBundle* resBundle, const char* * resTag, UResourceDataEntry* *realData, Resource *res, UErrorCode *status) {
111  UResourceDataEntry *resB = resBundle->fData;
112  int32_t indexR = -1;
113  int32_t i = 0;
114  *res = RES_BOGUS;
115  if(resB != NULL) {
116  if(resB->fBogus == U_ZERO_ERROR) { /* if this resource is real, */
117  *res = res_getTableItemByKey(&(resB->fData), resB->fData.rootRes, &indexR, resTag); /* try to get data from there */
118  i++;
119  }
120  if(resBundle->fHasFallback == TRUE) {
121  while(*res == RES_BOGUS && resB->fParent != NULL) { /* Otherwise, we'll look in parents */
122  resB = resB->fParent;
123  if(resB->fBogus == U_ZERO_ERROR) {
124  i++;
125  *res = res_getTableItemByKey(&(resB->fData), resB->fData.rootRes, &indexR, resTag);
126  }
127  }
128  }
129 
130  if(*res != RES_BOGUS) { /* If the resource is found in parents, we need to adjust the error */
131  if(i>1) {
132  if(uprv_strcmp(resB->fName, uloc_getDefault())==0 || uprv_strcmp(resB->fName, kRootLocaleName)==0) {
134  } else {
136  }
137  }
138  *realData = resB;
139  return (&(resB->fData));
140  } else { /* If resource is not found, we need to give an error */
142  return NULL;
143  }
144  } else {
146  return NULL;
147  }
148 }
149 
150 static void
153  res_unload(&(entry->fData));
154  if(entry->fName != NULL && entry->fName != entry->fNameBuffer) {
155  uprv_free(entry->fName);
156  }
157  if(entry->fPath != NULL) {
158  uprv_free(entry->fPath);
159  }
160  if(entry->fPool != NULL) {
161  --entry->fPool->fCountExisting;
162  }
163  alias = entry->fAlias;
164  if(alias != NULL) {
165  while(alias->fAlias != NULL) {
166  alias = alias->fAlias;
167  }
168  --alias->fCountExisting;
169  }
170  uprv_free(entry);
171 }
172 
173 /* Works just like ucnv_flushCache() */
175 {
176  UResourceDataEntry *resB;
177  int32_t pos;
178  int32_t rbDeletedNum = 0;
179  const UHashElement *e;
180  UBool deletedMore;
181 
182  /*if shared data hasn't even been lazy evaluated yet
183  * return 0
184  */
185  Mutex lock(&resbMutex);
186  if (cache == NULL) {
187  return 0;
188  }
189 
190  do {
191  deletedMore = FALSE;
192  /*creates an enumeration to iterate through every element in the table */
193  pos = UHASH_FIRST;
194  while ((e = uhash_nextElement(cache, &pos)) != NULL)
195  {
196  resB = (UResourceDataEntry *) e->value.pointer;
197  /* Deletes only if reference counter == 0
198  * Don't worry about the children of this node.
199  * Those will eventually get deleted too, if not already.
200  * Don't worry about the parents of this node.
201  * Those will eventually get deleted too, if not already.
202  */
203  /* 04/05/2002 [weiv] fCountExisting should now be accurate. If it's not zero, that means that */
204  /* some resource bundles are still open somewhere. */
205 
206  if (resB->fCountExisting == 0) {
207  rbDeletedNum++;
208  deletedMore = TRUE;
210  free_entry(resB);
211  }
212  }
213  /*
214  * Do it again to catch bundles (aliases, pool bundle) whose fCountExisting
215  * got decremented by free_entry().
216  */
217  } while(deletedMore);
218 
219  return rbDeletedNum;
220 }
221 
222 #ifdef URES_DEBUG
223 #include <stdio.h>
224 
225 U_CAPI UBool U_EXPORT2 ures_dumpCacheContents(void) {
226  UBool cacheNotEmpty = FALSE;
228  const UHashElement *e;
229  UResourceDataEntry *resB;
230 
231  Mutex lock(&resbMutex);
232  if (cache == NULL) {
233  fprintf(stderr,"%s:%d: RB Cache is NULL.\n", __FILE__, __LINE__);
234  return FALSE;
235  }
236 
237  while ((e = uhash_nextElement(cache, &pos)) != NULL) {
238  cacheNotEmpty=TRUE;
239  resB = (UResourceDataEntry *) e->value.pointer;
240  fprintf(stderr,"%s:%d: RB Cache: Entry @0x%p, refcount %d, name %s:%s. Pool 0x%p, alias 0x%p, parent 0x%p\n",
241  __FILE__, __LINE__,
242  (void*)resB, resB->fCountExisting,
243  resB->fName?resB->fName:"NULL",
244  resB->fPath?resB->fPath:"NULL",
245  (void*)resB->fPool,
246  (void*)resB->fAlias,
247  (void*)resB->fParent);
248  }
249 
250  fprintf(stderr,"%s:%d: RB Cache still contains %d items.\n", __FILE__, __LINE__, uhash_count(cache));
251  return cacheNotEmpty;
252 }
253 
254 #endif
255 
257 {
258  if (cache != NULL) {
259  ures_flushCache();
261  cache = NULL;
262  }
263  gCacheInitOnce.reset();
264  return TRUE;
265 }
266 
267 /** INTERNAL: Initializes the cache for resources */
269  U_ASSERT(cache == NULL);
272 }
273 
274 static void initCache(UErrorCode *status) {
276 }
277 
278 /** INTERNAL: sets the name (locale) of the resource bundle to given name */
279 
280 static void setEntryName(UResourceDataEntry *res, const char *name, UErrorCode *status) {
282  if(res->fName != NULL && res->fName != res->fNameBuffer) {
283  uprv_free(res->fName);
284  }
285  if (len < (int32_t)sizeof(res->fNameBuffer)) {
286  res->fName = res->fNameBuffer;
287  }
288  else {
289  res->fName = (char *)uprv_malloc(len+1);
290  }
291  if(res->fName == NULL) {
293  } else {
294  uprv_strcpy(res->fName, name);
295  }
296 }
297 
298 static UResourceDataEntry *
299 getPoolEntry(const char *path, UErrorCode *status);
300 
301 /**
302  * INTERNAL: Inits and opens an entry from a data DLL.
303  * CAUTION: resbMutex must be locked when calling this function.
304  */
305 static UResourceDataEntry *init_entry(const char *localeID, const char *path, UErrorCode *status) {
308  /*int32_t hashValue;*/
309  const char *name;
310  char aliasName[100] = { 0 };
311  int32_t aliasLen = 0;
312  /*UBool isAlias = FALSE;*/
313  /*UHashTok hashkey; */
314 
315  if(U_FAILURE(*status)) {
316  return NULL;
317  }
318 
319  /* here we try to deduce the right locale name */
320  if(localeID == NULL) { /* if localeID is NULL, we're trying to open default locale */
321  name = uloc_getDefault();
322  } else if(*localeID == 0) { /* if localeID is "" then we try to open root locale */
324  } else { /* otherwise, we'll open what we're given */
325  name = localeID;
326  }
327 
328  find.fName = (char *)name;
329  find.fPath = (char *)path;
330 
331  /* calculate the hash value of the entry */
332  /*hashkey.pointer = (void *)&find;*/
333  /*hashValue = hashEntry(hashkey);*/
334 
335  /* check to see if we already have this entry */
337  if(r == NULL) {
338  /* if the entry is not yet in the hash table, we'll try to construct a new one */
340  if(r == NULL) {
342  return NULL;
343  }
344 
345  uprv_memset(r, 0, sizeof(UResourceDataEntry));
346  /*r->fHashKey = hashValue;*/
347 
349  if (U_FAILURE(*status)) {
350  uprv_free(r);
351  return NULL;
352  }
353 
354  if(path != NULL) {
355  r->fPath = (char *)uprv_strdup(path);
356  if(r->fPath == NULL) {
358  uprv_free(r);
359  return NULL;
360  }
361  }
362 
363  /* this is the actual loading */
364  res_load(&(r->fData), r->fPath, r->fName, status);
365 
366  if (U_FAILURE(*status)) {
367  /* if we failed to load due to an out-of-memory error, exit early. */
369  uprv_free(r);
370  return NULL;
371  }
372  /* we have no such entry in dll, so it will always use fallback */
374  r->fBogus = U_USING_FALLBACK_WARNING;
375  } else { /* if we have a regular entry */
376  Resource aliasres;
377  if (r->fData.usesPoolBundle) {
378  r->fPool = getPoolEntry(r->fPath, status);
379  if (U_SUCCESS(*status)) {
380  const int32_t *poolIndexes = r->fPool->fData.pRoot + 1;
381  if(r->fData.pRoot[1 + URES_INDEX_POOL_CHECKSUM] == poolIndexes[URES_INDEX_POOL_CHECKSUM]) {
382  r->fData.poolBundleKeys = (const char *)(poolIndexes + (poolIndexes[URES_INDEX_LENGTH] & 0xff));
383  r->fData.poolBundleStrings = r->fPool->fData.p16BitUnits;
384  } else {
385  r->fBogus = *status = U_INVALID_FORMAT_ERROR;
386  }
387  } else {
388  r->fBogus = *status;
389  }
390  }
391  if (U_SUCCESS(*status)) {
392  /* handle the alias by trying to get out the %%Alias tag.*/
393  /* We'll try to get alias string from the bundle */
394  aliasres = res_getResource(&(r->fData), "%%ALIAS");
395  if (aliasres != RES_BOGUS) {
396  // No tracing: called during initial data loading
397  const UChar *alias = res_getStringNoTrace(&(r->fData), aliasres, &aliasLen);
398  if(alias != NULL && aliasLen > 0) { /* if there is actual alias - unload and load new data */
399  u_UCharsToChars(alias, aliasName, aliasLen+1);
400  r->fAlias = init_entry(aliasName, path, status);
401  }
402  }
403  }
404  }
405 
406  {
407  UResourceDataEntry *oldR = NULL;
408  if((oldR = (UResourceDataEntry *)uhash_get(cache, r)) == NULL) { /* if the data is not cached */
409  /* just insert it in the cache */
410  UErrorCode cacheStatus = U_ZERO_ERROR;
411  uhash_put(cache, (void *)r, r, &cacheStatus);
412  if (U_FAILURE(cacheStatus)) {
413  *status = cacheStatus;
414  free_entry(r);
415  r = NULL;
416  }
417  } else {
418  /* somebody have already inserted it while we were working, discard newly opened data */
419  /* Also, we could get here IF we opened an alias */
420  free_entry(r);
421  r = oldR;
422  }
423  }
424 
425  }
426  if(r != NULL) {
427  /* return the real bundle */
428  while(r->fAlias != NULL) {
429  r = r->fAlias;
430  }
431  r->fCountExisting++; /* we increase its reference count */
432  /* if the resource has a warning */
433  /* we don't want to overwrite a status with no error */
434  if(r->fBogus != U_ZERO_ERROR && U_SUCCESS(*status)) {
435  *status = r->fBogus; /* set the returning status */
436  }
437  }
438  return r;
439 }
440 
441 static UResourceDataEntry *
444  if( U_SUCCESS(*status) &&
445  (poolBundle == NULL || poolBundle->fBogus != U_ZERO_ERROR || !poolBundle->fData.isPoolBundle)
446  ) {
448  }
449  return poolBundle;
450 }
451 
452 /* INTERNAL: */
453 /* CAUTION: resbMutex must be locked when calling this function! */
454 static UResourceDataEntry *
455 findFirstExisting(const char* path, char* name,
456  UBool *isRoot, UBool *hasChopped, UBool *isDefault, UErrorCode* status) {
458  UBool hasRealData = FALSE;
459  const char *defaultLoc = uloc_getDefault();
460  *hasChopped = TRUE; /* we're starting with a fresh name */
461 
462  while(*hasChopped && !hasRealData) {
463  r = init_entry(name, path, status);
464  /* Null pointer test */
465  if (U_FAILURE(*status)) {
466  return NULL;
467  }
468  *isDefault = (UBool)(uprv_strncmp(name, defaultLoc, uprv_strlen(name)) == 0);
469  hasRealData = (UBool)(r->fBogus == U_ZERO_ERROR);
470  if(!hasRealData) {
471  /* this entry is not real. We will discard it. */
472  /* However, the parent line for this entry is */
473  /* not to be used - as there might be parent */
474  /* lines in cache from previous openings that */
475  /* are not updated yet. */
476  r->fCountExisting--;
477  /*entryCloseInt(r);*/
478  r = NULL;
480  } else {
481  uprv_strcpy(name, r->fName); /* this is needed for supporting aliases */
482  }
483 
484  *isRoot = (UBool)(uprv_strcmp(name, kRootLocaleName) == 0);
485 
486  /*Fallback data stuff*/
487  *hasChopped = chopLocale(name);
488  if (*hasChopped && *name == '\0') {
489  uprv_strcpy(name, "und");
490  }
491  }
492  return r;
493 }
494 
496  if(state) {
497  resB->fMagic1 = 0;
498  resB->fMagic2 = 0;
499  } else {
500  resB->fMagic1 = MAGIC1;
501  resB->fMagic2 = MAGIC2;
502  }
503 }
504 
506  return((resB->fMagic1 == MAGIC1 && resB->fMagic2 == MAGIC2)?FALSE:TRUE);
507 }
508 
509 
511  uprv_memset(resB, 0, sizeof(UResourceBundle));
513 }
514 
516 
517 StackUResourceBundle::StackUResourceBundle() {
518  ures_initStackObject(&bundle);
519 }
520 
521 StackUResourceBundle::~StackUResourceBundle() {
522  ures_close(&bundle);
523 }
524 
526 
527 static UBool // returns U_SUCCESS(*status)
529  char name[], int32_t nameCapacity,
530  UBool usingUSRData, char usrDataPath[], UErrorCode *status) {
531  if (U_FAILURE(*status)) { return FALSE; }
532  UBool hasChopped = TRUE;
533  while (hasChopped && t1->fParent == NULL && !t1->fData.noFallback &&
534  res_getResource(&t1->fData,"%%ParentIsRoot") == RES_BOGUS) {
535  Resource parentRes = res_getResource(&t1->fData, "%%Parent");
536  if (parentRes != RES_BOGUS) { // An explicit parent was found.
537  int32_t parentLocaleLen = 0;
538  // No tracing: called during initial data loading
539  const UChar *parentLocaleName = res_getStringNoTrace(&(t1->fData), parentRes, &parentLocaleLen);
540  if(parentLocaleName != NULL && 0 < parentLocaleLen && parentLocaleLen < nameCapacity) {
541  u_UCharsToChars(parentLocaleName, name, parentLocaleLen + 1);
542  if (uprv_strcmp(name, kRootLocaleName) == 0) {
543  return TRUE;
544  }
545  }
546  }
547  // Insert regular parents.
548  UErrorCode parentStatus = U_ZERO_ERROR;
549  UResourceDataEntry *t2 = init_entry(name, t1->fPath, &parentStatus);
550  if (U_FAILURE(parentStatus)) {
551  *status = parentStatus;
552  return FALSE;
553  }
554  UResourceDataEntry *u2 = NULL;
555  UErrorCode usrStatus = U_ZERO_ERROR;
556  if (usingUSRData) { // This code inserts user override data into the inheritance chain.
557  u2 = init_entry(name, usrDataPath, &usrStatus);
558  // If we failed due to out-of-memory, report that to the caller and exit early.
559  if (usrStatus == U_MEMORY_ALLOCATION_ERROR) {
560  *status = usrStatus;
561  return FALSE;
562  }
563  }
564 
565  if (usingUSRData && U_SUCCESS(usrStatus) && u2->fBogus == U_ZERO_ERROR) {
566  t1->fParent = u2;
567  u2->fParent = t2;
568  } else {
569  t1->fParent = t2;
570  if (usingUSRData) {
571  // The USR override data wasn't found, set it to be deleted.
572  u2->fCountExisting = 0;
573  }
574  }
575  t1 = t2;
576  hasChopped = chopLocale(name);
577  }
578  return TRUE;
579 }
580 
581 static UBool // returns U_SUCCESS(*status)
583  if (U_FAILURE(*status)) { return FALSE; }
584  UErrorCode parentStatus = U_ZERO_ERROR;
585  UResourceDataEntry *t2 = init_entry(kRootLocaleName, t1->fPath, &parentStatus);
586  if (U_FAILURE(parentStatus)) {
587  *status = parentStatus;
588  return FALSE;
589  }
590  t1->fParent = t2;
591  t1 = t2;
592  return TRUE;
593 }
594 
596  /**
597  * Open a resource bundle for the locale;
598  * if there is not even a base language bundle, then fall back to the default locale;
599  * if there is no bundle for that either, then load the root bundle.
600  *
601  * This is the default bundle loading behavior.
602  */
604  // TODO: ICU ticket #11271 "consistent default locale across locale trees"
605  // Add an option to look at the main locale tree for whether to
606  // fall back to root directly (if the locale has main data) or
607  // fall back to the default locale first (if the locale does not even have main data).
608  /**
609  * Open a resource bundle for the locale;
610  * if there is not even a base language bundle, then load the root bundle;
611  * never fall back to the default locale.
612  *
613  * This is used for algorithms that have good pan-Unicode default behavior,
614  * such as case mappings, collation, and segmentation (BreakIterator).
615  */
617  /**
618  * Open a resource bundle for the exact bundle name as requested;
619  * no fallbacks, do not load parent bundles.
620  *
621  * This is used for supplemental (non-locale) data.
622  */
624 };
625 typedef enum UResOpenType UResOpenType;
626 
627 static UResourceDataEntry *entryOpen(const char* path, const char* localeID,
628  UResOpenType openType, UErrorCode* status) {
629  U_ASSERT(openType != URES_OPEN_DIRECT);
630  UErrorCode intStatus = U_ZERO_ERROR;
633  UBool isDefault = FALSE;
634  UBool isRoot = FALSE;
635  UBool hasRealData = FALSE;
636  UBool hasChopped = TRUE;
637  UBool usingUSRData = U_USE_USRDATA && ( path == NULL || uprv_strncmp(path,U_ICUDATA_NAME,8) == 0);
638 
640  char usrDataPath[96];
641 
642  initCache(status);
643 
644  if(U_FAILURE(*status)) {
645  return NULL;
646  }
647 
648  uprv_strncpy(name, localeID, sizeof(name) - 1);
649  name[sizeof(name) - 1] = 0;
650 
651  if ( usingUSRData ) {
652  if ( path == NULL ) {
653  uprv_strcpy(usrDataPath, U_USRDATA_NAME);
654  } else {
655  uprv_strncpy(usrDataPath, path, sizeof(usrDataPath) - 1);
656  usrDataPath[0] = 'u';
657  usrDataPath[1] = 's';
658  usrDataPath[2] = 'r';
659  usrDataPath[sizeof(usrDataPath) - 1] = 0;
660  }
661  }
662 
663  Mutex lock(&resbMutex); // Lock resbMutex until the end of this function.
664 
665  /* We're going to skip all the locales that do not have any data */
666  r = findFirstExisting(path, name, &isRoot, &hasChopped, &isDefault, &intStatus);
667 
668  // If we failed due to out-of-memory, report the failure and exit early.
669  if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
670  *status = intStatus;
671  goto finish;
672  }
673 
674  if(r != NULL) { /* if there is one real locale, we can look for parents. */
675  t1 = r;
676  hasRealData = TRUE;
677  if ( usingUSRData ) { /* This code inserts user override data into the inheritance chain */
678  UErrorCode usrStatus = U_ZERO_ERROR;
679  UResourceDataEntry *u1 = init_entry(t1->fName, usrDataPath, &usrStatus);
680  // If we failed due to out-of-memory, report the failure and exit early.
681  if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
682  *status = intStatus;
683  goto finish;
684  }
685  if ( u1 != NULL ) {
686  if(u1->fBogus == U_ZERO_ERROR) {
687  u1->fParent = t1;
688  r = u1;
689  } else {
690  /* the USR override data wasn't found, set it to be deleted */
691  u1->fCountExisting = 0;
692  }
693  }
694  }
695  if (hasChopped && !isRoot) {
696  if (!loadParentsExceptRoot(t1, name, UPRV_LENGTHOF(name), usingUSRData, usrDataPath, status)) {
697  goto finish;
698  }
699  }
700  }
701 
702  /* we could have reached this point without having any real data */
703  /* if that is the case, we need to chain in the default locale */
704  if(r==NULL && openType == URES_OPEN_LOCALE_DEFAULT_ROOT && !isDefault && !isRoot) {
705  /* insert default locale */
707  r = findFirstExisting(path, name, &isRoot, &hasChopped, &isDefault, &intStatus);
708  // If we failed due to out-of-memory, report the failure and exit early.
709  if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
710  *status = intStatus;
711  goto finish;
712  }
713  intStatus = U_USING_DEFAULT_WARNING;
714  if(r != NULL) { /* the default locale exists */
715  t1 = r;
716  hasRealData = TRUE;
717  isDefault = TRUE;
718  // TODO: Why not if (usingUSRData) { ... } like in the non-default-locale code path?
719  if (hasChopped && !isRoot) {
720  if (!loadParentsExceptRoot(t1, name, UPRV_LENGTHOF(name), usingUSRData, usrDataPath, status)) {
721  goto finish;
722  }
723  }
724  }
725  }
726 
727  /* we could still have r == NULL at this point - maybe even default locale is not */
728  /* present */
729  if(r == NULL) {
731  r = findFirstExisting(path, name, &isRoot, &hasChopped, &isDefault, &intStatus);
732  // If we failed due to out-of-memory, report the failure and exit early.
733  if (intStatus == U_MEMORY_ALLOCATION_ERROR) {
734  *status = intStatus;
735  goto finish;
736  }
737  if(r != NULL) {
738  t1 = r;
739  intStatus = U_USING_DEFAULT_WARNING;
740  hasRealData = TRUE;
741  } else { /* we don't even have the root locale */
743  goto finish;
744  }
745  } else if(!isRoot && uprv_strcmp(t1->fName, kRootLocaleName) != 0 &&
746  t1->fParent == NULL && !r->fData.noFallback) {
747  if (!insertRootBundle(t1, status)) {
748  goto finish;
749  }
750  if(!hasRealData) {
751  r->fBogus = U_USING_DEFAULT_WARNING;
752  }
753  }
754 
755  // TODO: Does this ever loop?
756  while(r != NULL && !isRoot && t1->fParent != NULL) {
757  t1->fParent->fCountExisting++;
758  t1 = t1->fParent;
759  }
760 
761 finish:
762  if(U_SUCCESS(*status)) {
763  if(intStatus != U_ZERO_ERROR) {
764  *status = intStatus;
765  }
766  return r;
767  } else {
768  return NULL;
769  }
770 }
771 
772 /**
773  * Version of entryOpen() and findFirstExisting() for ures_openDirect(),
774  * with no fallbacks.
775  * Parent and root locale bundles are loaded if
776  * the requested bundle does not have the "nofallback" flag.
777  */
778 static UResourceDataEntry *
779 entryOpenDirect(const char* path, const char* localeID, UErrorCode* status) {
780  initCache(status);
781  if(U_FAILURE(*status)) {
782  return NULL;
783  }
784 
785  Mutex lock(&resbMutex);
786  // findFirstExisting() without fallbacks.
787  UResourceDataEntry *r = init_entry(localeID, path, status);
788  if(U_SUCCESS(*status)) {
789  if(r->fBogus != U_ZERO_ERROR) {
790  r->fCountExisting--;
791  r = NULL;
792  }
793  } else {
794  r = NULL;
795  }
796 
797  // Some code depends on the ures_openDirect() bundle to have a parent bundle chain,
798  // unless it is marked with "nofallback".
800  if(r != NULL && uprv_strcmp(localeID, kRootLocaleName) != 0 && // not root
801  r->fParent == NULL && !r->fData.noFallback &&
802  uprv_strlen(localeID) < ULOC_FULLNAME_CAPACITY) {
804  uprv_strcpy(name, localeID);
807  if(uprv_strcmp(t1->fName, kRootLocaleName) != 0 && t1->fParent == NULL) {
809  }
810  }
811  if(U_FAILURE(*status)) {
812  r = NULL;
813  }
814  }
815 
816  if(r != NULL) {
817  // TODO: Does this ever loop?
818  while(t1->fParent != NULL) {
819  t1->fParent->fCountExisting++;
820  t1 = t1->fParent;
821  }
822  }
823  return r;
824 }
825 
826 /**
827  * Functions to create and destroy resource bundles.
828  * CAUTION: resbMutex must be locked when calling this function.
829  */
830 /* INTERNAL: */
831 static void entryCloseInt(UResourceDataEntry *resB) {
832  UResourceDataEntry *p = resB;
833 
834  while(resB != NULL) {
835  p = resB->fParent;
836  resB->fCountExisting--;
837 
838  /* Entries are left in the cache. TODO: add ures_flushCache() to force a flush
839  of the cache. */
840 /*
841  if(resB->fCountExisting <= 0) {
842  uhash_remove(cache, resB);
843  if(resB->fBogus == U_ZERO_ERROR) {
844  res_unload(&(resB->fData));
845  }
846  if(resB->fName != NULL) {
847  uprv_free(resB->fName);
848  }
849  if(resB->fPath != NULL) {
850  uprv_free(resB->fPath);
851  }
852  uprv_free(resB);
853  }
854 */
855 
856  resB = p;
857  }
858 }
859 
860 /**
861  * API: closes a resource bundle and cleans up.
862  */
863 
864 static void entryClose(UResourceDataEntry *resB) {
865  Mutex lock(&resbMutex);
866  entryCloseInt(resB);
867 }
868 
869 /*
870 U_CFUNC void ures_setResPath(UResourceBundle *resB, const char* toAdd) {
871  if(resB->fResPath == NULL) {
872  resB->fResPath = resB->fResBuf;
873  *(resB->fResPath) = 0;
874  }
875  resB->fResPathLen = uprv_strlen(toAdd);
876  if(RES_BUFSIZE <= resB->fResPathLen+1) {
877  if(resB->fResPath == resB->fResBuf) {
878  resB->fResPath = (char *)uprv_malloc((resB->fResPathLen+1)*sizeof(char));
879  } else {
880  resB->fResPath = (char *)uprv_realloc(resB->fResPath, (resB->fResPathLen+1)*sizeof(char));
881  }
882  }
883  uprv_strcpy(resB->fResPath, toAdd);
884 }
885 */
886 static void ures_appendResPath(UResourceBundle *resB, const char* toAdd, int32_t lenToAdd, UErrorCode *status) {
887  int32_t resPathLenOrig = resB->fResPathLen;
888  if(resB->fResPath == NULL) {
889  resB->fResPath = resB->fResBuf;
890  *(resB->fResPath) = 0;
891  resB->fResPathLen = 0;
892  }
893  resB->fResPathLen += lenToAdd;
894  if(RES_BUFSIZE <= resB->fResPathLen+1) {
895  if(resB->fResPath == resB->fResBuf) {
896  resB->fResPath = (char *)uprv_malloc((resB->fResPathLen+1)*sizeof(char));
897  /* Check that memory was allocated correctly. */
898  if (resB->fResPath == NULL) {
900  return;
901  }
902  uprv_strcpy(resB->fResPath, resB->fResBuf);
903  } else {
904  char *temp = (char *)uprv_realloc(resB->fResPath, (resB->fResPathLen+1)*sizeof(char));
905  /* Check that memory was reallocated correctly. */
906  if (temp == NULL) {
908  return;
909  }
910  resB->fResPath = temp;
911  }
912  }
913  uprv_strcpy(resB->fResPath + resPathLenOrig, toAdd);
914 }
915 
916 static void ures_freeResPath(UResourceBundle *resB) {
917  if (resB->fResPath && resB->fResPath != resB->fResBuf) {
918  uprv_free(resB->fResPath);
919  }
920  resB->fResPath = NULL;
921  resB->fResPathLen = 0;
922 }
923 
924 static void
926 {
927  if(resB != NULL) {
928  if(resB->fData != NULL) {
929  entryClose(resB->fData);
930  }
931  if(resB->fVersion != NULL) {
932  uprv_free(resB->fVersion);
933  }
934  ures_freeResPath(resB);
935 
936  if(ures_isStackObject(resB) == FALSE && freeBundleObj) {
937  uprv_free(resB);
938  }
939 #if 0 /*U_DEBUG*/
940  else {
941  /* poison the data */
942  uprv_memset(resB, -1, sizeof(UResourceBundle));
943  }
944 #endif
945  }
946 }
947 
948 U_CAPI void U_EXPORT2
950 {
951  ures_closeBundle(resB, TRUE);
952 }
953 
955  const char *key, int32_t idx, UResourceDataEntry *realData,
956  const UResourceBundle *parent, int32_t noAlias,
958 {
959  if(status == NULL || U_FAILURE(*status)) {
960  return resB;
961  }
962  if (parent == NULL) {
964  return NULL;
965  }
966  if(RES_GET_TYPE(r) == URES_ALIAS) { /* This is an alias, need to exchange with real data */
967  if(noAlias < URES_MAX_ALIAS_LEVEL) {
968  int32_t len = 0;
969  const UChar *alias = res_getAlias(rdata, r, &len);
970  if(len > 0) {
971  /* we have an alias, now let's cut it up */
972  char stackAlias[200];
973  char *chAlias = NULL, *path = NULL, *locale = NULL, *keyPath = NULL;
975 
976  /*
977  * Allocate enough space for both the char * version
978  * of the alias and parent->fResPath.
979  *
980  * We do this so that res_findResource() can modify the path,
981  * which allows us to remove redundant _res_findResource() variants
982  * in uresdata.c.
983  * res_findResource() now NUL-terminates each segment so that table keys
984  * can always be compared with strcmp() instead of strncmp().
985  * Saves code there and simplifies testing and code coverage.
986  *
987  * markus 2003oct17
988  */
989  ++len; /* count the terminating NUL */
990  if(parent->fResPath != NULL) {
991  capacity = (int32_t)uprv_strlen(parent->fResPath) + 1;
992  } else {
993  capacity = 0;
994  }
995  if(capacity < len) {
996  capacity = len;
997  }
998  if(capacity <= (int32_t)sizeof(stackAlias)) {
999  capacity = (int32_t)sizeof(stackAlias);
1000  chAlias = stackAlias;
1001  } else {
1002  chAlias = (char *)uprv_malloc(capacity);
1003  /* test for NULL */
1004  if(chAlias == NULL) {
1006  return NULL;
1007  }
1008  }
1009  u_UCharsToChars(alias, chAlias, len);
1010 
1011  if(*chAlias == RES_PATH_SEPARATOR) {
1012  /* there is a path included */
1013  locale = uprv_strchr(chAlias+1, RES_PATH_SEPARATOR);
1014  if(locale == NULL) {
1015  locale = uprv_strchr(chAlias, 0); /* avoid locale == NULL to make code below work */
1016  } else {
1017  *locale = 0;
1018  locale++;
1019  }
1020  path = chAlias+1;
1021  if(uprv_strcmp(path, "LOCALE") == 0) {
1022  /* this is an XPath alias, starting with "/LOCALE/" */
1023  /* it contains the path to a resource which should be looked up */
1024  /* starting in the requested locale */
1025  keyPath = locale;
1026  locale = parent->fTopLevelData->fName; /* this is the requested locale's name */
1027  path = realData->fPath; /* we will be looking in the same package */
1028  } else {
1029  if(uprv_strcmp(path, "ICUDATA") == 0) { /* want ICU data */
1030  path = NULL;
1031  }
1033  if(keyPath) {
1034  *keyPath = 0;
1035  keyPath++;
1036  }
1037  }
1038  } else {
1039  /* no path, start with a locale */
1040  locale = chAlias;
1042  if(keyPath) {
1043  *keyPath = 0;
1044  keyPath++;
1045  }
1046  path = realData->fPath;
1047  }
1048 
1049 
1050  {
1051  /* got almost everything, let's try to open */
1052  /* first, open the bundle with real data */
1053  UResourceBundle *result = resB;
1054  const char* temp = NULL;
1055  UErrorCode intStatus = U_ZERO_ERROR;
1056  UResourceBundle *mainRes = ures_openDirect(path, locale, &intStatus);
1057  if(U_SUCCESS(intStatus)) {
1058  if(keyPath == NULL) {
1059  /* no key path. This means that we are going to
1060  * to use the corresponding resource from
1061  * another bundle
1062  */
1063  /* first, we are going to get a corresponding parent
1064  * resource to the one we are searching.
1065  */
1066  char *aKey = parent->fResPath;
1067  if(aKey) {
1068  uprv_strcpy(chAlias, aKey); /* allocated large enough above */
1069  aKey = chAlias;
1070  r = res_findResource(&(mainRes->fResData), mainRes->fRes, &aKey, &temp);
1071  } else {
1072  r = mainRes->fRes;
1073  }
1074  if(key) {
1075  /* we need to make keyPath from parent's fResPath and
1076  * current key, if there is a key associated
1077  */
1078  len = (int32_t)(uprv_strlen(key) + 1);
1079  if(len > capacity) {
1080  capacity = len;
1081  if(chAlias == stackAlias) {
1082  chAlias = (char *)uprv_malloc(capacity);
1083  } else {
1084  chAlias = (char *)uprv_realloc(chAlias, capacity);
1085  }
1086  if(chAlias == NULL) {
1087  ures_close(mainRes);
1089  return NULL;
1090  }
1091  }
1092  uprv_memcpy(chAlias, key, len);
1093  aKey = chAlias;
1094  r = res_findResource(&(mainRes->fResData), r, &aKey, &temp);
1095  } else if(idx != -1) {
1096  /* if there is no key, but there is an index, try to get by the index */
1097  /* here we have either a table or an array, so get the element */
1099  if(URES_IS_TABLE(type)) {
1100  r = res_getTableItemByIndex(&(mainRes->fResData), r, idx, (const char **)&aKey);
1101  } else { /* array */
1102  r = res_getArrayItem(&(mainRes->fResData), r, idx);
1103  }
1104  }
1105  if(r != RES_BOGUS) {
1106  result = init_resb_result(&(mainRes->fResData), r, temp, -1, mainRes->fData, mainRes, noAlias+1, resB, status);
1107  } else {
1109  result = resB;
1110  }
1111  } else {
1112  /* this one is a bit trickier.
1113  * we start finding keys, but after we resolve one alias, the path might continue.
1114  * Consider:
1115  * aliastest:alias { "testtypes/anotheralias/Sequence" }
1116  * anotheralias:alias { "/ICUDATA/sh/CollationElements" }
1117  * aliastest resource should finally have the sequence, not collation elements.
1118  */
1119  UResourceDataEntry *dataEntry = mainRes->fData;
1120  char stackPath[URES_MAX_BUFFER_SIZE];
1121  char *pathBuf = stackPath, *myPath = pathBuf;
1122  if(uprv_strlen(keyPath) >= UPRV_LENGTHOF(stackPath)) {
1123  pathBuf = (char *)uprv_malloc((uprv_strlen(keyPath)+1)*sizeof(char));
1124  if(pathBuf == NULL) {
1126  ures_close(mainRes);
1127  return NULL;
1128  }
1129  }
1130  uprv_strcpy(pathBuf, keyPath);
1131  result = mainRes;
1132  /* now we have fallback following here */
1133  do {
1134  r = dataEntry->fData.rootRes;
1135  /* this loop handles 'found' resources over several levels */
1136  while(*myPath && U_SUCCESS(*status)) {
1137  r = res_findResource(&(dataEntry->fData), r, &myPath, &temp);
1138  if(r != RES_BOGUS) { /* found a resource, but it might be an indirection */
1139  resB = init_resb_result(&(dataEntry->fData), r, temp, -1, dataEntry, result, noAlias+1, resB, status);
1140  result = resB;
1141  if(result) {
1142  r = result->fRes; /* switch to a new resource, possibly a new tree */
1143  dataEntry = result->fData;
1144  }
1145  } else { /* no resource found, we don't really want to look anymore on this level */
1146  break;
1147  }
1148  }
1149  dataEntry = dataEntry->fParent;
1150  uprv_strcpy(pathBuf, keyPath);
1151  myPath = pathBuf;
1152  } while(r == RES_BOGUS && dataEntry != NULL);
1153  if(r == RES_BOGUS) {
1155  result = resB;
1156  }
1157  if(pathBuf != stackPath) {
1158  uprv_free(pathBuf);
1159  }
1160  }
1161  } else { /* we failed to open the resource we're aliasing to */
1162  *status = intStatus;
1163  }
1164  if(chAlias != stackAlias) {
1165  uprv_free(chAlias);
1166  }
1167  if(mainRes != result) {
1168  ures_close(mainRes);
1169  }
1170  ResourceTracer(resB).maybeTrace("getalias");
1171  return result;
1172  }
1173  } else {
1174  /* bad alias, should be an error */
1176  return resB;
1177  }
1178  } else {
1180  return resB;
1181  }
1182  }
1183  if(resB == NULL) {
1184  resB = (UResourceBundle *)uprv_malloc(sizeof(UResourceBundle));
1185  /* test for NULL */
1186  if (resB == NULL) {
1188  return NULL;
1189  }
1191  resB->fResPath = NULL;
1192  resB->fResPathLen = 0;
1193  } else {
1194  if(resB->fData != NULL) {
1195  entryClose(resB->fData);
1196  }
1197  if(resB->fVersion != NULL) {
1198  uprv_free(resB->fVersion);
1199  }
1200  /*
1201  weiv: if stack object was passed in, it doesn't really need to be reinited,
1202  since the purpose of initing is to remove stack junk. However, at this point
1203  we would not do anything to an allocated object, so stack object should be
1204  treated the same
1205  */
1206  /*
1207  if(ures_isStackObject(resB) != FALSE) {
1208  ures_initStackObject(resB);
1209  }
1210  */
1211  if(parent != resB) {
1212  ures_freeResPath(resB);
1213  }
1214  }
1215  resB->fData = realData;
1216  entryIncrease(resB->fData);
1217  resB->fHasFallback = FALSE;
1218  resB->fIsTopLevel = FALSE;
1219  resB->fIndex = -1;
1220  resB->fKey = key;
1221  /*resB->fParentRes = parent;*/
1222  resB->fTopLevelData = parent->fTopLevelData;
1223  if(parent->fResPath && parent != resB) {
1224  ures_appendResPath(resB, parent->fResPath, parent->fResPathLen, status);
1225  }
1226  if(key != NULL) {
1228  if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) {
1230  }
1231  } else if(idx >= 0) {
1232  char buf[256];
1234  ures_appendResPath(resB, buf, len, status);
1235  if(resB->fResPath[resB->fResPathLen-1] != RES_PATH_SEPARATOR) {
1237  }
1238  }
1239  /* Make sure that Purify doesn't complain about uninitialized memory copies. */
1240  {
1241  int32_t usedLen = ((resB->fResBuf == resB->fResPath) ? resB->fResPathLen : 0);
1242  uprv_memset(resB->fResBuf + usedLen, 0, sizeof(resB->fResBuf) - usedLen);
1243  }
1244 
1245  resB->fVersion = NULL;
1246  resB->fRes = r;
1247  /*resB->fParent = parent->fRes;*/
1248  uprv_memmove(&resB->fResData, rdata, sizeof(ResourceData));
1249  resB->fSize = res_countArrayItems(&(resB->fResData), resB->fRes);
1250  ResourceTracer(resB).trace("get");
1251  return resB;
1252 }
1253 
1255  UBool isStackObject;
1256  if(U_FAILURE(*status) || r == original) {
1257  return r;
1258  }
1259  if(original != NULL) {
1260  if(r == NULL) {
1261  isStackObject = FALSE;
1263  /* test for NULL */
1264  if (r == NULL) {
1266  return NULL;
1267  }
1268  } else {
1269  isStackObject = ures_isStackObject(r);
1271  }
1273  r->fResPath = NULL;
1274  r->fResPathLen = 0;
1275  if(original->fResPath) {
1276  ures_appendResPath(r, original->fResPath, original->fResPathLen, status);
1277  }
1278  ures_setIsStackObject(r, isStackObject);
1279  if(r->fData != NULL) {
1280  entryIncrease(r->fData);
1281  }
1282  }
1283  return r;
1284 }
1285 
1286 /**
1287  * Functions to retrieve data from resource bundles.
1288  */
1289 
1291  const UChar *s;
1292  if (status==NULL || U_FAILURE(*status)) {
1293  return NULL;
1294  }
1295  if(resB == NULL) {
1297  return NULL;
1298  }
1299  s = res_getString({resB}, &(resB->fResData), resB->fRes, len);
1300  if (s == NULL) {
1302  }
1303  return s;
1304 }
1305 
1306 static const char *
1307 ures_toUTF8String(const UChar *s16, int32_t length16,
1308  char *dest, int32_t *pLength,
1309  UBool forceCopy,
1310  UErrorCode *status) {
1311  int32_t capacity;
1312 
1313  if (U_FAILURE(*status)) {
1314  return NULL;
1315  }
1316  if (pLength != NULL) {
1317  capacity = *pLength;
1318  } else {
1319  capacity = 0;
1320  }
1321  if (capacity < 0 || (capacity > 0 && dest == NULL)) {
1323  return NULL;
1324  }
1325 
1326  if (length16 == 0) {
1327  /* empty string, return as read-only pointer */
1328  if (pLength != NULL) {
1329  *pLength = 0;
1330  }
1331  if (forceCopy) {
1333  return dest;
1334  } else {
1335  return "";
1336  }
1337  } else {
1338  /* We need to transform the string to the destination buffer. */
1339  if (capacity < length16) {
1340  /* No chance for the string to fit. Pure preflighting. */
1341  return u_strToUTF8(NULL, 0, pLength, s16, length16, status);
1342  }
1343  if (!forceCopy && (length16 <= 0x2aaaaaaa)) {
1344  /*
1345  * We know the string will fit into dest because each UChar turns
1346  * into at most three UTF-8 bytes. Fill the latter part of dest
1347  * so that callers do not expect to use dest as a string pointer,
1348  * hopefully leading to more robust code for when resource bundles
1349  * may store UTF-8 natively.
1350  * (In which case dest would not be used at all.)
1351  *
1352  * We do not do this if forceCopy=TRUE because then the caller
1353  * expects the string to start exactly at dest.
1354  *
1355  * The test above for <= 0x2aaaaaaa prevents overflows.
1356  * The +1 is for the NUL terminator.
1357  */
1358  int32_t maxLength = 3 * length16 + 1;
1359  if (capacity > maxLength) {
1360  dest += capacity - maxLength;
1361  capacity = maxLength;
1362  }
1363  }
1364  return u_strToUTF8(dest, capacity, pLength, s16, length16, status);
1365  }
1366 }
1367 
1368 U_CAPI const char * U_EXPORT2
1370  char *dest, int32_t *pLength,
1371  UBool forceCopy,
1372  UErrorCode *status) {
1373  int32_t length16;
1374  const UChar *s16 = ures_getString(resB, &length16, status);
1375  return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
1376 }
1377 
1379  UErrorCode* status) {
1380  const uint8_t *p;
1381  if (status==NULL || U_FAILURE(*status)) {
1382  return NULL;
1383  }
1384  if(resB == NULL) {
1386  return NULL;
1387  }
1388  p = res_getBinary({resB}, &(resB->fResData), resB->fRes, len);
1389  if (p == NULL) {
1391  }
1392  return p;
1393 }
1394 
1396  UErrorCode* status) {
1397  const int32_t *p;
1398  if (status==NULL || U_FAILURE(*status)) {
1399  return NULL;
1400  }
1401  if(resB == NULL) {
1403  return NULL;
1404  }
1405  p = res_getIntVector({resB}, &(resB->fResData), resB->fRes, len);
1406  if (p == NULL) {
1408  }
1409  return p;
1410 }
1411 
1412 /* this function returns a signed integer */
1413 /* it performs sign extension */
1415  if (status==NULL || U_FAILURE(*status)) {
1416  return 0xffffffff;
1417  }
1418  if(resB == NULL) {
1420  return 0xffffffff;
1421  }
1422  if(RES_GET_TYPE(resB->fRes) != URES_INT) {
1424  return 0xffffffff;
1425  }
1426  return res_getInt({resB}, resB->fRes);
1427 }
1428 
1430  if (status==NULL || U_FAILURE(*status)) {
1431  return 0xffffffff;
1432  }
1433  if(resB == NULL) {
1435  return 0xffffffff;
1436  }
1437  if(RES_GET_TYPE(resB->fRes) != URES_INT) {
1439  return 0xffffffff;
1440  }
1441  return res_getUInt({resB}, resB->fRes);
1442 }
1443 
1445  if(resB == NULL) {
1446  return URES_NONE;
1447  }
1448  return res_getPublicType(resB->fRes);
1449 }
1450 
1451 U_CAPI const char * U_EXPORT2 ures_getKey(const UResourceBundle *resB) {
1452  //
1453  // TODO: Trace ures_getKey? I guess not usually.
1454  //
1455  // We usually get the key string to decide whether we want the value, or to
1456  // make a key-value pair. Tracing the value should suffice.
1457  //
1458  // However, I believe we have some data (e.g., in res_index) where the key
1459  // strings are the data. Tracing the enclosing table should suffice.
1460  //
1461  if(resB == NULL) {
1462  return NULL;
1463  }
1464  return(resB->fKey);
1465 }
1466 
1468  if(resB == NULL) {
1469  return 0;
1470  }
1471 
1472  return resB->fSize;
1473 }
1474 
1476  if(RES_GET_TYPE(r) == URES_ALIAS) {
1477  const UChar* result = 0;
1478  UResourceBundle *tempRes = ures_getByIndex(resB, sIndex, NULL, status);
1479  result = ures_getString(tempRes, len, status);
1480  ures_close(tempRes);
1481  return result;
1482  } else {
1483  return res_getString({resB, sIndex}, &(resB->fResData), r, len);
1484  }
1485 }
1486 
1488  if(resB == NULL) {
1489  return;
1490  }
1491  resB->fIndex = -1;
1492 }
1493 
1495  if(resB == NULL) {
1496  return FALSE;
1497  }
1498  return (UBool)(resB->fIndex < resB->fSize-1);
1499 }
1500 
1502  Resource r = RES_BOGUS;
1503 
1504  if (status==NULL || U_FAILURE(*status)) {
1505  return NULL;
1506  }
1507  if(resB == NULL) {
1509  return NULL;
1510  }
1511 
1512  if(resB->fIndex == resB->fSize-1) {
1514  } else {
1515  resB->fIndex++;
1516  switch(RES_GET_TYPE(resB->fRes)) {
1517  case URES_STRING:
1518  case URES_STRING_V2:
1519  return res_getString({resB}, &(resB->fResData), resB->fRes, len);
1520  case URES_TABLE:
1521  case URES_TABLE16:
1522  case URES_TABLE32:
1523  r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, resB->fIndex, key);
1524  if(r == RES_BOGUS && resB->fHasFallback) {
1525  /* TODO: do the fallback */
1526  }
1527  return ures_getStringWithAlias(resB, r, resB->fIndex, len, status);
1528  case URES_ARRAY:
1529  case URES_ARRAY16:
1530  r = res_getArrayItem(&(resB->fResData), resB->fRes, resB->fIndex);
1531  if(r == RES_BOGUS && resB->fHasFallback) {
1532  /* TODO: do the fallback */
1533  }
1534  return ures_getStringWithAlias(resB, r, resB->fIndex, len, status);
1535  case URES_ALIAS:
1536  return ures_getStringWithAlias(resB, resB->fRes, resB->fIndex, len, status);
1537  case URES_INT:
1538  case URES_BINARY:
1539  case URES_INT_VECTOR:
1541  U_FALLTHROUGH;
1542  default:
1543  return NULL;
1544  }
1545  }
1546 
1547  return NULL;
1548 }
1549 
1551  const char *key = NULL;
1552  Resource r = RES_BOGUS;
1553 
1554  if (status==NULL || U_FAILURE(*status)) {
1555  /*return NULL;*/
1556  return fillIn;
1557  }
1558  if(resB == NULL) {
1560  /*return NULL;*/
1561  return fillIn;
1562  }
1563 
1564  if(resB->fIndex == resB->fSize-1) {
1566  /*return NULL;*/
1567  } else {
1568  resB->fIndex++;
1569  switch(RES_GET_TYPE(resB->fRes)) {
1570  case URES_INT:
1571  case URES_BINARY:
1572  case URES_STRING:
1573  case URES_STRING_V2:
1574  case URES_INT_VECTOR:
1575  return ures_copyResb(fillIn, resB, status);
1576  case URES_TABLE:
1577  case URES_TABLE16:
1578  case URES_TABLE32:
1579  r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, resB->fIndex, &key);
1580  if(r == RES_BOGUS && resB->fHasFallback) {
1581  /* TODO: do the fallback */
1582  }
1583  return init_resb_result(&(resB->fResData), r, key, resB->fIndex, resB->fData, resB, 0, fillIn, status);
1584  case URES_ARRAY:
1585  case URES_ARRAY16:
1586  r = res_getArrayItem(&(resB->fResData), resB->fRes, resB->fIndex);
1587  if(r == RES_BOGUS && resB->fHasFallback) {
1588  /* TODO: do the fallback */
1589  }
1590  return init_resb_result(&(resB->fResData), r, key, resB->fIndex, resB->fData, resB, 0, fillIn, status);
1591  default:
1592  /*return NULL;*/
1593  return fillIn;
1594  }
1595  }
1596  /*return NULL;*/
1597  return fillIn;
1598 }
1599 
1601  const char* key = NULL;
1602  Resource r = RES_BOGUS;
1603 
1604  if (status==NULL || U_FAILURE(*status)) {
1605  /*return NULL;*/
1606  return fillIn;
1607  }
1608  if(resB == NULL) {
1610  /*return NULL;*/
1611  return fillIn;
1612  }
1613 
1614  if(indexR >= 0 && resB->fSize > indexR) {
1615  switch(RES_GET_TYPE(resB->fRes)) {
1616  case URES_INT:
1617  case URES_BINARY:
1618  case URES_STRING:
1619  case URES_STRING_V2:
1620  case URES_INT_VECTOR:
1621  return ures_copyResb(fillIn, resB, status);
1622  case URES_TABLE:
1623  case URES_TABLE16:
1624  case URES_TABLE32:
1625  r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, indexR, &key);
1626  if(r == RES_BOGUS && resB->fHasFallback) {
1627  /* TODO: do the fallback */
1628  }
1629  return init_resb_result(&(resB->fResData), r, key, indexR, resB->fData, resB, 0, fillIn, status);
1630  case URES_ARRAY:
1631  case URES_ARRAY16:
1632  r = res_getArrayItem(&(resB->fResData), resB->fRes, indexR);
1633  if(r == RES_BOGUS && resB->fHasFallback) {
1634  /* TODO: do the fallback */
1635  }
1636  return init_resb_result(&(resB->fResData), r, key, indexR, resB->fData, resB, 0, fillIn, status);
1637  default:
1638  /*return NULL;*/
1639  return fillIn;
1640  }
1641  } else {
1643  }
1644  /*return NULL;*/
1645  return fillIn;
1646 }
1647 
1649  const char* key = NULL;
1650  Resource r = RES_BOGUS;
1651 
1652  if (status==NULL || U_FAILURE(*status)) {
1653  return NULL;
1654  }
1655  if(resB == NULL) {
1657  return NULL;
1658  }
1659 
1660  if(indexS >= 0 && resB->fSize > indexS) {
1661  switch(RES_GET_TYPE(resB->fRes)) {
1662  case URES_STRING:
1663  case URES_STRING_V2:
1664  return res_getString({resB}, &(resB->fResData), resB->fRes, len);
1665  case URES_TABLE:
1666  case URES_TABLE16:
1667  case URES_TABLE32:
1668  r = res_getTableItemByIndex(&(resB->fResData), resB->fRes, indexS, &key);
1669  if(r == RES_BOGUS && resB->fHasFallback) {
1670  /* TODO: do the fallback */
1671  }
1672  return ures_getStringWithAlias(resB, r, indexS, len, status);
1673  case URES_ARRAY:
1674  case URES_ARRAY16:
1675  r = res_getArrayItem(&(resB->fResData), resB->fRes, indexS);
1676  if(r == RES_BOGUS && resB->fHasFallback) {
1677  /* TODO: do the fallback */
1678  }
1679  return ures_getStringWithAlias(resB, r, indexS, len, status);
1680  case URES_ALIAS:
1681  return ures_getStringWithAlias(resB, resB->fRes, indexS, len, status);
1682  case URES_INT:
1683  case URES_BINARY:
1684  case URES_INT_VECTOR:
1686  break;
1687  default:
1688  /* must not occur */
1690  break;
1691  }
1692  } else {
1694  }
1695  return NULL;
1696 }
1697 
1698 U_CAPI const char * U_EXPORT2
1700  int32_t idx,
1701  char *dest, int32_t *pLength,
1702  UBool forceCopy,
1703  UErrorCode *status) {
1704  int32_t length16;
1705  const UChar *s16 = ures_getStringByIndex(resB, idx, &length16, status);
1706  return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
1707 }
1708 
1709 /*U_CAPI const char *ures_getResPath(UResourceBundle *resB) {
1710  return resB->fResPath;
1711 }*/
1712 
1715 {
1717  UResourceBundle *result = fillIn;
1718  char *packageName = NULL;
1719  char *pathToResource = NULL, *save = NULL;
1720  char *locale = NULL, *localeEnd = NULL;
1721  int32_t length;
1722 
1723  if(status == NULL || U_FAILURE(*status)) {
1724  return result;
1725  }
1726 
1727  length = (int32_t)(uprv_strlen(path)+1);
1728  save = pathToResource = (char *)uprv_malloc(length*sizeof(char));
1729  /* test for NULL */
1730  if(pathToResource == NULL) {
1732  return result;
1733  }
1734  uprv_memcpy(pathToResource, path, length);
1735 
1736  locale = pathToResource;
1737  if(*pathToResource == RES_PATH_SEPARATOR) { /* there is a path specification */
1738  pathToResource++;
1739  packageName = pathToResource;
1740  pathToResource = uprv_strchr(pathToResource, RES_PATH_SEPARATOR);
1741  if(pathToResource == NULL) {
1743  } else {
1744  *pathToResource = 0;
1745  locale = pathToResource+1;
1746  }
1747  }
1748 
1749  localeEnd = uprv_strchr(locale, RES_PATH_SEPARATOR);
1750  if(localeEnd != NULL) {
1751  *localeEnd = 0;
1752  }
1753 
1754  first = ures_open(packageName, locale, status);
1755 
1756  if(U_SUCCESS(*status)) {
1757  if(localeEnd) {
1758  result = ures_findSubResource(first, localeEnd+1, fillIn, status);
1759  } else {
1760  result = ures_copyResb(fillIn, first, status);
1761  }
1762  ures_close(first);
1763  }
1764  uprv_free(save);
1765  return result;
1766 }
1767 
1770 {
1772  UResourceBundle *result = fillIn;
1773  const char *key;
1774 
1775  if(status == NULL || U_FAILURE(*status)) {
1776  return result;
1777  }
1778 
1779  /* here we do looping and circular alias checking */
1780  /* this loop is here because aliasing is resolved on this level, not on res level */
1781  /* so, when we encounter an alias, it is not an aggregate resource, so we return */
1782  do {
1783  res = res_findResource(&(resB->fResData), resB->fRes, &path, &key);
1784  if(res != RES_BOGUS) {
1785  result = init_resb_result(&(resB->fResData), res, key, -1, resB->fData, resB, 0, fillIn, status);
1786  resB = result;
1787  } else {
1789  break;
1790  }
1791  } while(*path); /* there is more stuff in the path */
1792 
1793  return result;
1794 }
1795 U_CAPI const UChar* U_EXPORT2
1797  const char* inKey,
1798  int32_t* len,
1799  UErrorCode *status) {
1800 
1802  const UChar* retVal = NULL;
1804  ures_getByKeyWithFallback(resB, inKey, &stack, status);
1805  int32_t length;
1806  retVal = ures_getString(&stack, &length, status);
1807  ures_close(&stack);
1808  if (U_FAILURE(*status)) {
1809  return NULL;
1810  }
1811  if (length == 3 && retVal[0] == EMPTY_SET && retVal[1] == EMPTY_SET && retVal[2] == EMPTY_SET ) {
1812  retVal = NULL;
1813  length = 0;
1815  }
1816  if (len != NULL) {
1817  *len = length;
1818  }
1819  return retVal;
1820 }
1821 
1822 /*
1823  Like res_getTableItemByKey but accepts full paths like "NumberElements/latn/patternsShort".
1824 */
1825 static Resource getTableItemByKeyPath(const ResourceData *pResData, Resource table, const char *key) {
1826  Resource resource = table; /* The current resource */
1827  icu::CharString path;
1829  path.append(key, errorCode);
1830  if (U_FAILURE(errorCode)) { return RES_BOGUS; }
1831  char *pathPart = path.data(); /* Path from current resource to desired resource */
1832  UResType type = (UResType)RES_GET_TYPE(resource); /* the current resource type */
1833  while (*pathPart && resource != RES_BOGUS && URES_IS_CONTAINER(type)) {
1834  char *nextPathPart = uprv_strchr(pathPart, RES_PATH_SEPARATOR);
1835  if (nextPathPart != NULL) {
1836  *nextPathPart = 0; /* Terminating null for this part of path. */
1837  nextPathPart++;
1838  } else {
1839  nextPathPart = uprv_strchr(pathPart, 0);
1840  }
1841  int32_t t;
1842  const char *pathP = pathPart;
1843  resource = res_getTableItemByKey(pResData, resource, &t, &pathP);
1845  pathPart = nextPathPart;
1846  }
1847  if (*pathPart) {
1848  return RES_BOGUS;
1849  }
1850  return resource;
1851 }
1852 
1855  const char* inKey,
1856  UResourceBundle *fillIn,
1857  UErrorCode *status) {
1858  Resource res = RES_BOGUS, rootRes = RES_BOGUS;
1859  /*UResourceDataEntry *realData = NULL;*/
1860  UResourceBundle *helper = NULL;
1861 
1862  if (status==NULL || U_FAILURE(*status)) {
1863  return fillIn;
1864  }
1865  if(resB == NULL) {
1867  return fillIn;
1868  }
1869 
1870  int32_t type = RES_GET_TYPE(resB->fRes);
1871  if(URES_IS_TABLE(type)) {
1872  res = getTableItemByKeyPath(&(resB->fResData), resB->fRes, inKey);
1873  const char* key = inKey;
1874  if(res == RES_BOGUS) {
1875  UResourceDataEntry *dataEntry = resB->fData;
1876  CharString path;
1877  char *myPath = NULL;
1878  const char* resPath = resB->fResPath;
1879  int32_t len = resB->fResPathLen;
1880  while(res == RES_BOGUS && dataEntry->fParent != NULL) { /* Otherwise, we'll look in parents */
1881  dataEntry = dataEntry->fParent;
1882  rootRes = dataEntry->fData.rootRes;
1883 
1884  if(dataEntry->fBogus == U_ZERO_ERROR) {
1885  path.clear();
1886  if (len > 0) {
1887  path.append(resPath, len, *status);
1888  }
1889  path.append(inKey, *status);
1890  if (U_FAILURE(*status)) {
1891  ures_close(helper);
1892  return fillIn;
1893  }
1894  myPath = path.data();
1895  key = inKey;
1896  do {
1897  res = res_findResource(&(dataEntry->fData), rootRes, &myPath, &key);
1898  if (RES_GET_TYPE(res) == URES_ALIAS && *myPath) {
1899  /* We hit an alias, but we didn't finish following the path. */
1900  helper = init_resb_result(&(dataEntry->fData), res, NULL, -1, dataEntry, resB, 0, helper, status);
1901  /*helper = init_resb_result(&(dataEntry->fData), res, inKey, -1, dataEntry, resB, 0, helper, status);*/
1902  if(helper) {
1903  dataEntry = helper->fData;
1904  rootRes = helper->fRes;
1905  resPath = helper->fResPath;
1906  len = helper->fResPathLen;
1907 
1908  } else {
1909  break;
1910  }
1911  }
1912  } while(*myPath); /* Continue until the whole path is consumed */
1913  }
1914  }
1915  /*const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status);*/
1916  if(res != RES_BOGUS) {
1917  /* check if resB->fResPath gives the right name here */
1918  if(uprv_strcmp(dataEntry->fName, uloc_getDefault())==0 || uprv_strcmp(dataEntry->fName, kRootLocaleName)==0) {
1920  } else {
1922  }
1923 
1924  fillIn = init_resb_result(&(dataEntry->fData), res, inKey, -1, dataEntry, resB, 0, fillIn, status);
1925  } else {
1927  }
1928  } else {
1929  fillIn = init_resb_result(&(resB->fResData), res, key, -1, resB->fData, resB, 0, fillIn, status);
1930  }
1931  }
1932  else {
1934  }
1935  ures_close(helper);
1936  return fillIn;
1937 }
1938 
1939 namespace {
1940 
1941 void getAllItemsWithFallback(
1942  const UResourceBundle *bundle, ResourceDataValue &value,
1943  ResourceSink &sink,
1944  UErrorCode &errorCode) {
1945  if (U_FAILURE(errorCode)) { return; }
1946  // We recursively enumerate child-first,
1947  // only storing parent items in the absence of child items.
1948  // The sink needs to store a placeholder value for the no-fallback/no-inheritance marker
1949  // to prevent a parent item from being stored.
1950  //
1951  // It would be possible to recursively enumerate parent-first,
1952  // overriding parent items with child items.
1953  // When the sink sees the no-fallback/no-inheritance marker,
1954  // then it would remove the parent's item.
1955  // We would deserialize parent values even though they are overridden in a child bundle.
1956  value.setData(&bundle->fResData);
1957  UResourceDataEntry *parentEntry = bundle->fData->fParent;
1958  UBool hasParent = parentEntry != NULL && U_SUCCESS(parentEntry->fBogus);
1959  value.setResource(bundle->fRes, ResourceTracer(bundle));
1960  sink.put(bundle->fKey, value, !hasParent, errorCode);
1961  if (hasParent) {
1962  // We might try to query the sink whether
1963  // any fallback from the parent bundle is still possible.
1964 
1965  // Turn the parent UResourceDataEntry into a UResourceBundle,
1966  // much like in ures_openWithType().
1967  // TODO: See if we can refactor ures_getByKeyWithFallback()
1968  // and pull out an inner function that takes and returns a UResourceDataEntry
1969  // so that we need not create UResourceBundle objects.
1970  UResourceBundle parentBundle;
1971  ures_initStackObject(&parentBundle);
1972  parentBundle.fTopLevelData = parentBundle.fData = parentEntry;
1973  // TODO: What is the difference between bundle fData and fTopLevelData?
1974  uprv_memcpy(&parentBundle.fResData, &parentEntry->fData, sizeof(ResourceData));
1975  // TODO: Try to replace bundle.fResData with just using bundle.fData->fData.
1976  parentBundle.fHasFallback = !parentBundle.fResData.noFallback;
1977  parentBundle.fIsTopLevel = TRUE;
1978  parentBundle.fRes = parentBundle.fResData.rootRes;
1979  parentBundle.fSize = res_countArrayItems(&(parentBundle.fResData), parentBundle.fRes);
1980  parentBundle.fIndex = -1;
1981  entryIncrease(parentEntry);
1982 
1983  // Look up the container item in the parent bundle.
1984  UResourceBundle containerBundle;
1985  ures_initStackObject(&containerBundle);
1986  const UResourceBundle *rb;
1987  UErrorCode pathErrorCode = U_ZERO_ERROR; // Ignore if parents up to root do not have this path.
1988  if (bundle->fResPath == NULL || *bundle->fResPath == 0) {
1989  rb = &parentBundle;
1990  } else {
1991  rb = ures_getByKeyWithFallback(&parentBundle, bundle->fResPath,
1992  &containerBundle, &pathErrorCode);
1993  }
1994  if (U_SUCCESS(pathErrorCode)) {
1995  getAllItemsWithFallback(rb, value, sink, errorCode);
1996  }
1997  ures_close(&containerBundle);
1998  ures_close(&parentBundle);
1999  }
2000 }
2001 
2002 } // namespace
2003 
2004 // Requires a ResourceDataValue fill-in, so that we need not cast from a ResourceValue.
2005 // Unfortunately, the caller must know which subclass to make and pass in.
2006 // Alternatively, we could make it as polymorphic as in Java by
2007 // returning a ResourceValue pointer (possibly wrapped into a LocalPointer)
2008 // that the caller then owns.
2009 //
2010 // Also requires a UResourceBundle fill-in, so that the value's ResourceTracer
2011 // can point to a non-local bundle.
2012 // Without tracing, the child bundle could be a function-local object.
2013 U_CAPI void U_EXPORT2
2015  UResourceBundle *tempFillIn,
2016  ResourceDataValue &value, UErrorCode &errorCode) {
2017  if (U_FAILURE(errorCode)) { return; }
2018  if (path == nullptr) {
2020  return;
2021  }
2022  const UResourceBundle *rb;
2023  if (*path == 0) {
2024  // empty path
2025  rb = bundle;
2026  } else {
2027  rb = ures_getByKeyWithFallback(bundle, path, tempFillIn, &errorCode);
2028  if (U_FAILURE(errorCode)) {
2029  return;
2030  }
2031  }
2032  value.setData(&rb->fResData);
2033  value.setResource(rb->fRes, ResourceTracer(rb));
2034 }
2035 
2036 U_CAPI void U_EXPORT2
2038  icu::ResourceSink &sink, UErrorCode &errorCode) {
2039  if (U_FAILURE(errorCode)) { return; }
2040  if (path == nullptr) {
2042  return;
2043  }
2044  StackUResourceBundle stackBundle;
2045  const UResourceBundle *rb;
2046  if (*path == 0) {
2047  // empty path
2048  rb = bundle;
2049  } else {
2050  rb = ures_getByKeyWithFallback(bundle, path, stackBundle.getAlias(), &errorCode);
2051  if (U_FAILURE(errorCode)) {
2052  return;
2053  }
2054  }
2055  // Get all table items with fallback.
2056  ResourceDataValue value;
2057  getAllItemsWithFallback(rb, value, sink, errorCode);
2058 }
2059 
2062  UResourceDataEntry *realData = NULL;
2063  const char *key = inKey;
2064 
2065  if (status==NULL || U_FAILURE(*status)) {
2066  return fillIn;
2067  }
2068  if(resB == NULL) {
2070  return fillIn;
2071  }
2072 
2073  int32_t type = RES_GET_TYPE(resB->fRes);
2074  if(URES_IS_TABLE(type)) {
2075  int32_t t;
2076  res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key);
2077  if(res == RES_BOGUS) {
2078  key = inKey;
2079  if(resB->fHasFallback == TRUE) {
2080  const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status);
2081  if(U_SUCCESS(*status)) {
2082  /* check if resB->fResPath gives the right name here */
2083  return init_resb_result(rd, res, key, -1, realData, resB, 0, fillIn, status);
2084  } else {
2086  }
2087  } else {
2089  }
2090  } else {
2091  return init_resb_result(&(resB->fResData), res, key, -1, resB->fData, resB, 0, fillIn, status);
2092  }
2093  }
2094 #if 0
2095  /* this is a kind of TODO item. If we have an array with an index table, we could do this. */
2096  /* not currently */
2097  else if(RES_GET_TYPE(resB->fRes) == URES_ARRAY && resB->fHasFallback == TRUE) {
2098  /* here should go a first attempt to locate the key using index table */
2099  const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status);
2100  if(U_SUCCESS(*status)) {
2101  return init_resb_result(rd, res, key, realData, resB, fillIn, status);
2102  } else {
2104  }
2105  }
2106 #endif
2107  else {
2109  }
2110  return fillIn;
2111 }
2112 
2115  UResourceDataEntry *realData = NULL;
2116  const char* key = inKey;
2117 
2118  if (status==NULL || U_FAILURE(*status)) {
2119  return NULL;
2120  }
2121  if(resB == NULL) {
2123  return NULL;
2124  }
2125 
2126  int32_t type = RES_GET_TYPE(resB->fRes);
2127  if(URES_IS_TABLE(type)) {
2128  int32_t t=0;
2129 
2130  res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key);
2131 
2132  if(res == RES_BOGUS) {
2133  key = inKey;
2134  if(resB->fHasFallback == TRUE) {
2135  const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status);
2136  if(U_SUCCESS(*status)) {
2137  switch (RES_GET_TYPE(res)) {
2138  case URES_STRING:
2139  case URES_STRING_V2:
2140  return res_getString({resB, key}, rd, res, len);
2141  case URES_ALIAS:
2142  {
2143  const UChar* result = 0;
2144  UResourceBundle *tempRes = ures_getByKey(resB, inKey, NULL, status);
2145  result = ures_getString(tempRes, len, status);
2146  ures_close(tempRes);
2147  return result;
2148  }
2149  default:
2151  }
2152  } else {
2154  }
2155  } else {
2157  }
2158  } else {
2159  switch (RES_GET_TYPE(res)) {
2160  case URES_STRING:
2161  case URES_STRING_V2:
2162  return res_getString({resB, key}, &(resB->fResData), res, len);
2163  case URES_ALIAS:
2164  {
2165  const UChar* result = 0;
2166  UResourceBundle *tempRes = ures_getByKey(resB, inKey, NULL, status);
2167  result = ures_getString(tempRes, len, status);
2168  ures_close(tempRes);
2169  return result;
2170  }
2171  default:
2173  }
2174  }
2175  }
2176 #if 0
2177  /* this is a kind of TODO item. If we have an array with an index table, we could do this. */
2178  /* not currently */
2179  else if(RES_GET_TYPE(resB->fRes) == URES_ARRAY && resB->fHasFallback == TRUE) {
2180  /* here should go a first attempt to locate the key using index table */
2181  const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status);
2182  if(U_SUCCESS(*status)) {
2183  // TODO: Tracing
2184  return res_getString(rd, res, len);
2185  } else {
2187  }
2188  }
2189 #endif
2190  else {
2192  }
2193  return NULL;
2194 }
2195 
2196 U_CAPI const char * U_EXPORT2
2198  const char *key,
2199  char *dest, int32_t *pLength,
2200  UBool forceCopy,
2201  UErrorCode *status) {
2202  int32_t length16;
2203  const UChar *s16 = ures_getStringByKey(resB, key, &length16, status);
2204  return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
2205 }
2206 
2207 /* TODO: clean from here down */
2208 
2209 /**
2210  * INTERNAL: Get the name of the first real locale (not placeholder)
2211  * that has resource bundle data.
2212  */
2213 U_CAPI const char* U_EXPORT2
2215 {
2216  if (status==NULL || U_FAILURE(*status)) {
2217  return NULL;
2218  }
2219  if (!resourceBundle) {
2221  return NULL;
2222  } else {
2223  return resourceBundle->fData->fName;
2224  }
2225 }
2226 
2227 U_CAPI const char* U_EXPORT2
2228 ures_getLocale(const UResourceBundle* resourceBundle,
2229  UErrorCode* status)
2230 {
2231  return ures_getLocaleInternal(resourceBundle, status);
2232 }
2233 
2234 
2235 U_CAPI const char* U_EXPORT2
2236 ures_getLocaleByType(const UResourceBundle* resourceBundle,
2238  UErrorCode* status) {
2239  if (status==NULL || U_FAILURE(*status)) {
2240  return NULL;
2241  }
2242  if (!resourceBundle) {
2244  return NULL;
2245  } else {
2246  switch(type) {
2247  case ULOC_ACTUAL_LOCALE:
2248  return resourceBundle->fData->fName;
2249  case ULOC_VALID_LOCALE:
2250  return resourceBundle->fTopLevelData->fName;
2251  case ULOC_REQUESTED_LOCALE:
2252  default:
2254  return NULL;
2255  }
2256  }
2257 }
2258 
2259 U_CFUNC const char* ures_getName(const UResourceBundle* resB) {
2260  if(resB == NULL) {
2261  return NULL;
2262  }
2263 
2264  return resB->fData->fName;
2265 }
2266 
2267 #ifdef URES_DEBUG
2268 U_CFUNC const char* ures_getPath(const UResourceBundle* resB) {
2269  if(resB == NULL) {
2270  return NULL;
2271  }
2272 
2273  return resB->fData->fPath;
2274 }
2275 #endif
2276 
2277 static UResourceBundle*
2278 ures_openWithType(UResourceBundle *r, const char* path, const char* localeID,
2279  UResOpenType openType, UErrorCode* status) {
2280  if(U_FAILURE(*status)) {
2281  return NULL;
2282  }
2283 
2285  if(openType != URES_OPEN_DIRECT) {
2286  /* first "canonicalize" the locale ID */
2287  char canonLocaleID[ULOC_FULLNAME_CAPACITY];
2288  uloc_getBaseName(localeID, canonLocaleID, UPRV_LENGTHOF(canonLocaleID), status);
2291  return NULL;
2292  }
2293  entry = entryOpen(path, canonLocaleID, openType, status);
2294  } else {
2295  entry = entryOpenDirect(path, localeID, status);
2296  }
2297  if(U_FAILURE(*status)) {
2298  return NULL;
2299  }
2300  if(entry == NULL) {
2302  return NULL;
2303  }
2304 
2305  UBool isStackObject;
2306  if(r == NULL) {
2308  if(r == NULL) {
2309  entryClose(entry);
2311  return NULL;
2312  }
2313  isStackObject = FALSE;
2314  } else { // fill-in
2315  isStackObject = ures_isStackObject(r);
2317  }
2318  uprv_memset(r, 0, sizeof(UResourceBundle));
2319  ures_setIsStackObject(r, isStackObject);
2320 
2321  r->fTopLevelData = r->fData = entry;
2322  uprv_memcpy(&r->fResData, &entry->fData, sizeof(ResourceData));
2323  r->fHasFallback = openType != URES_OPEN_DIRECT && !r->fResData.noFallback;
2324  r->fIsTopLevel = TRUE;
2325  r->fRes = r->fResData.rootRes;
2326  r->fSize = res_countArrayItems(&(r->fResData), r->fRes);
2327  r->fIndex = -1;
2328 
2330 
2331  return r;
2332 }
2333 
2335 ures_open(const char* path, const char* localeID, UErrorCode* status) {
2337 }
2338 
2340 ures_openNoDefault(const char* path, const char* localeID, UErrorCode* status) {
2342 }
2343 
2344 /**
2345  * Opens a resource bundle without "canonicalizing" the locale name. No fallback will be performed
2346  * or sought. However, alias substitution will happen!
2347  */
2349 ures_openDirect(const char* path, const char* localeID, UErrorCode* status) {
2350  return ures_openWithType(NULL, path, localeID, URES_OPEN_DIRECT, status);
2351 }
2352 
2353 /**
2354  * Internal API: This function is used to open a resource bundle
2355  * proper fallback chaining is executed while initialization.
2356  * The result is stored in cache for later fallback search.
2357  *
2358  * Same as ures_open(), but uses the fill-in parameter and does not allocate a new bundle.
2359  */
2360 U_CAPI void U_EXPORT2
2362  const char* localeID, UErrorCode* status) {
2363  if(U_SUCCESS(*status) && r == NULL) {
2365  return;
2366  }
2368 }
2369 
2370 /**
2371  * Same as ures_openDirect(), but uses the fill-in parameter and does not allocate a new bundle.
2372  */
2373 U_CAPI void U_EXPORT2
2374 ures_openDirectFillIn(UResourceBundle *r, const char* path, const char* localeID, UErrorCode* status) {
2375  if(U_SUCCESS(*status) && r == NULL) {
2377  return;
2378  }
2380 }
2381 
2382 /**
2383  * API: Counts members. For arrays and tables, returns number of resources.
2384  * For strings, returns 1.
2385  */
2388  const char* resourceKey,
2389  UErrorCode* status)
2390 {
2391  UResourceBundle resData;
2392  ures_initStackObject(&resData);
2393  if (status==NULL || U_FAILURE(*status)) {
2394  return 0;
2395  }
2396  if(resourceBundle == NULL) {
2398  return 0;
2399  }
2400  ures_getByKey(resourceBundle, resourceKey, &resData, status);
2401 
2402  if(resData.fResData.data != NULL) {
2403  int32_t result = res_countArrayItems(&resData.fResData, resData.fRes);
2404  ures_close(&resData);
2405  return result;
2406  } else {
2408  ures_close(&resData);
2409  return 0;
2410  }
2411 }
2412 
2413 /**
2414  * Internal function.
2415  * Return the version number associated with this ResourceBundle as a string.
2416  *
2417  * @param resourceBundle The resource bundle for which the version is checked.
2418  * @return A version number string as specified in the resource bundle or its parent.
2419  * The caller does not own this string.
2420  * @see ures_getVersion
2421  * @internal
2422  */
2423 U_CAPI const char* U_EXPORT2
2425 {
2426  if (!resourceBundle) return NULL;
2427 
2428  if(resourceBundle->fVersion == NULL) {
2429 
2430  /* If the version ID has not been built yet, then do so. Retrieve */
2431  /* the minor version from the file. */
2433  int32_t minor_len = 0;
2434  int32_t len;
2435 
2436  const UChar* minor_version = ures_getStringByKey(resourceBundle, kVersionTag, &minor_len, &status);
2437 
2438  /* Determine the length of of the final version string. This is */
2439  /* the length of the major part + the length of the separator */
2440  /* (==1) + the length of the minor part (+ 1 for the zero byte at */
2441  /* the end). */
2442 
2443  len = (minor_len > 0) ? minor_len : 1;
2444 
2445  /* Allocate the string, and build it up. */
2446  /* + 1 for zero byte */
2447 
2448 
2449  ((UResourceBundle *)resourceBundle)->fVersion = (char *)uprv_malloc(1 + len);
2450  /* Check for null pointer. */
2451  if (((UResourceBundle *)resourceBundle)->fVersion == NULL) {
2452  return NULL;
2453  }
2454 
2455  if(minor_len > 0) {
2456  u_UCharsToChars(minor_version, resourceBundle->fVersion , minor_len);
2457  resourceBundle->fVersion[len] = '\0';
2458  }
2459  else {
2460  uprv_strcpy(resourceBundle->fVersion, kDefaultMinorVersion);
2461  }
2462  }
2463 
2464  return resourceBundle->fVersion;
2465 }
2466 
2467 U_CAPI const char* U_EXPORT2
2469 {
2470  return ures_getVersionNumberInternal(resourceBundle);
2471 }
2472 
2474  if (!resB) return;
2475 
2477 }
2478 
2479 /** Tree support functions *******************************/
2480 #define INDEX_LOCALE_NAME "res_index"
2481 #define INDEX_TAG "InstalledLocales"
2482 #define DEFAULT_TAG "default"
2483 
2484 #if defined(URES_TREE_DEBUG)
2485 #include <stdio.h>
2486 #endif
2487 
2488 typedef struct ULocalesContext {
2492 
2493 static void U_CALLCONV
2495  ULocalesContext *ctx = (ULocalesContext *)enumerator->context;
2496  ures_close(&ctx->curr);
2497  ures_close(&ctx->installed);
2498  uprv_free(ctx);
2499  uprv_free(enumerator);
2500 }
2501 
2502 static int32_t U_CALLCONV
2504  ULocalesContext *ctx = (ULocalesContext *)en->context;
2505  return ures_getSize(&ctx->installed);
2506 }
2507 
2509 
2510 
2511 static const char * U_CALLCONV
2513  int32_t* resultLength,
2514  UErrorCode* status) {
2515  ULocalesContext *ctx = (ULocalesContext *)en->context;
2516  UResourceBundle *res = &(ctx->installed);
2517  UResourceBundle *k = NULL;
2518  const char *result = NULL;
2519  int32_t len = 0;
2520  if(ures_hasNext(res) && (k = ures_getNextResource(res, &ctx->curr, status)) != 0) {
2521  result = ures_getKey(k);
2523  }
2524  if (resultLength) {
2525  *resultLength = len;
2526  }
2527  return result;
2528 }
2529 
2530 static void U_CALLCONV
2532  UErrorCode* /*status*/) {
2533  UResourceBundle *res = &((ULocalesContext *)en->context)->installed;
2535 }
2536 
2538 
2539 static const UEnumeration gLocalesEnum = {
2540  NULL,
2541  NULL,
2547 };
2548 
2549 
2552 {
2554  UEnumeration *en = NULL;
2555  ULocalesContext *myContext = NULL;
2556 
2557  if(U_FAILURE(*status)) {
2558  return NULL;
2559  }
2560  myContext = static_cast<ULocalesContext *>(uprv_malloc(sizeof(ULocalesContext)));
2561  en = (UEnumeration *)uprv_malloc(sizeof(UEnumeration));
2562  if(!en || !myContext) {
2564  uprv_free(en);
2565  uprv_free(myContext);
2566  return NULL;
2567  }
2568  uprv_memcpy(en, &gLocalesEnum, sizeof(UEnumeration));
2569 
2570  ures_initStackObject(&myContext->installed);
2571  ures_initStackObject(&myContext->curr);
2573  ures_getByKey(idx, INDEX_TAG, &myContext->installed, status);
2574  if(U_SUCCESS(*status)) {
2575 #if defined(URES_TREE_DEBUG)
2576  fprintf(stderr, "Got %s::%s::[%s] : %s\n",
2578 #endif
2579  en->context = myContext;
2580  } else {
2581 #if defined(URES_TREE_DEBUG)
2582  fprintf(stderr, "%s open failed - %s\n", path, u_errorName(*status));
2583 #endif
2584  ures_close(&myContext->installed);
2585  uprv_free(myContext);
2586  uprv_free(en);
2587  en = NULL;
2588  }
2589 
2590  ures_close(idx);
2591 
2592  return en;
2593 }
2594 
2595 static UBool isLocaleInList(UEnumeration *locEnum, const char *locToSearch, UErrorCode *status) {
2596  const char *loc;
2597  while ((loc = uenum_next(locEnum, NULL, status)) != NULL) {
2598  if (uprv_strcmp(loc, locToSearch) == 0) {
2599  return TRUE;
2600  }
2601  }
2602  return FALSE;
2603 }
2604 
2607  const char *path, const char *resName, const char *keyword, const char *locid,
2608  UBool *isAvailable, UBool omitDefault, UErrorCode *status)
2609 {
2610  char kwVal[1024] = ""; /* value of keyword 'keyword' */
2611  char defVal[1024] = ""; /* default value for given locale */
2612  char defLoc[1024] = ""; /* default value for given locale */
2613  char base[1024] = ""; /* base locale */
2614  char found[1024] = "";
2615  char parent[1024] = "";
2616  char full[1024] = "";
2617  UResourceBundle bund1, bund2;
2619  UErrorCode subStatus = U_ZERO_ERROR;
2620  int32_t length = 0;
2621  if(U_FAILURE(*status)) return 0;
2622  uloc_getKeywordValue(locid, keyword, kwVal, 1024-1,&subStatus);
2623  if(!uprv_strcmp(kwVal, DEFAULT_TAG)) {
2624  kwVal[0]=0;
2625  }
2626  uloc_getBaseName(locid, base, 1024-1,&subStatus);
2627 #if defined(URES_TREE_DEBUG)
2628  fprintf(stderr, "getFunctionalEquivalent: \"%s\" [%s=%s] in %s - %s\n",
2629  locid, keyword, kwVal, base, u_errorName(subStatus));
2630 #endif
2631  ures_initStackObject(&bund1);
2632  ures_initStackObject(&bund2);
2633 
2634 
2637 
2638  if(isAvailable) {
2639  UEnumeration *locEnum = ures_openAvailableLocales(path, &subStatus);
2640  *isAvailable = TRUE;
2641  if (U_SUCCESS(subStatus)) {
2642  *isAvailable = isLocaleInList(locEnum, parent, &subStatus);
2643  }
2644  uenum_close(locEnum);
2645  }
2646 
2647  if(U_FAILURE(subStatus)) {
2648  *status = subStatus;
2649  return 0;
2650  }
2651 
2652  do {
2653  subStatus = U_ZERO_ERROR;
2654  res = ures_open(path, parent, &subStatus);
2655  if(((subStatus == U_USING_FALLBACK_WARNING) ||
2656  (subStatus == U_USING_DEFAULT_WARNING)) && isAvailable)
2657  {
2658  *isAvailable = FALSE;
2659  }
2660  isAvailable = NULL; /* only want to set this the first time around */
2661 
2662 #if defined(URES_TREE_DEBUG)
2663  fprintf(stderr, "%s;%s -> %s [%s]\n", path?path:"ICUDATA", parent, u_errorName(subStatus), ures_getLocale(res, &subStatus));
2664 #endif
2665  if(U_FAILURE(subStatus)) {
2666  *status = subStatus;
2667  } else if(subStatus == U_ZERO_ERROR) {
2668  ures_getByKey(res,resName,&bund1, &subStatus);
2669  if(subStatus == U_ZERO_ERROR) {
2670  const UChar *defUstr;
2671  int32_t defLen;
2672  /* look for default item */
2673 #if defined(URES_TREE_DEBUG)
2674  fprintf(stderr, "%s;%s : loaded default -> %s\n",
2675  path?path:"ICUDATA", parent, u_errorName(subStatus));
2676 #endif
2677  defUstr = ures_getStringByKey(&bund1, DEFAULT_TAG, &defLen, &subStatus);
2678  if(U_SUCCESS(subStatus) && defLen) {
2679  u_UCharsToChars(defUstr, defVal, u_strlen(defUstr));
2680 #if defined(URES_TREE_DEBUG)
2681  fprintf(stderr, "%s;%s -> default %s=%s, %s\n",
2682  path?path:"ICUDATA", parent, keyword, defVal, u_errorName(subStatus));
2683 #endif
2684  uprv_strcpy(defLoc, parent);
2685  if(kwVal[0]==0) {
2686  uprv_strcpy(kwVal, defVal);
2687 #if defined(URES_TREE_DEBUG)
2688  fprintf(stderr, "%s;%s -> kwVal = %s\n",
2689  path?path:"ICUDATA", parent, keyword, kwVal);
2690 #endif
2691  }
2692  }
2693  }
2694  }
2695 
2696  subStatus = U_ZERO_ERROR;
2697 
2698  if (res != NULL) {
2700  }
2701 
2702  uloc_getParent(found,parent,sizeof(parent),&subStatus);
2703  ures_close(res);
2704  } while(!defVal[0] && *found && uprv_strcmp(found, "root") != 0 && U_SUCCESS(*status));
2705 
2706  /* Now, see if we can find the kwVal collator.. start the search over.. */
2709 
2710  do {
2711  subStatus = U_ZERO_ERROR;
2712  res = ures_open(path, parent, &subStatus);
2713  if((subStatus == U_USING_FALLBACK_WARNING) && isAvailable) {
2714  *isAvailable = FALSE;
2715  }
2716  isAvailable = NULL; /* only want to set this the first time around */
2717 
2718 #if defined(URES_TREE_DEBUG)
2719  fprintf(stderr, "%s;%s -> %s (looking for %s)\n",
2720  path?path:"ICUDATA", parent, u_errorName(subStatus), kwVal);
2721 #endif
2722  if(U_FAILURE(subStatus)) {
2723  *status = subStatus;
2724  } else if(subStatus == U_ZERO_ERROR) {
2725  ures_getByKey(res,resName,&bund1, &subStatus);
2726 #if defined(URES_TREE_DEBUG)
2727 /**/ fprintf(stderr,"@%d [%s] %s\n", __LINE__, resName, u_errorName(subStatus));
2728 #endif
2729  if(subStatus == U_ZERO_ERROR) {
2730  ures_getByKey(&bund1, kwVal, &bund2, &subStatus);
2731 #if defined(URES_TREE_DEBUG)
2732 /**/ fprintf(stderr,"@%d [%s] %s\n", __LINE__, kwVal, u_errorName(subStatus));
2733 #endif
2734  if(subStatus == U_ZERO_ERROR) {
2735 #if defined(URES_TREE_DEBUG)
2736  fprintf(stderr, "%s;%s -> full0 %s=%s, %s\n",
2737  path?path:"ICUDATA", parent, keyword, kwVal, u_errorName(subStatus));
2738 #endif
2739  uprv_strcpy(full, parent);
2740  if(*full == 0) {
2741  uprv_strcpy(full, "root");
2742  }
2743  /* now, recalculate default kw if need be */
2744  if(uprv_strlen(defLoc) > uprv_strlen(full)) {
2745  const UChar *defUstr;
2746  int32_t defLen;
2747  /* look for default item */
2748 #if defined(URES_TREE_DEBUG)
2749  fprintf(stderr, "%s;%s -> recalculating Default0\n",
2750  path?path:"ICUDATA", full);
2751 #endif
2752  defUstr = ures_getStringByKey(&bund1, DEFAULT_TAG, &defLen, &subStatus);
2753  if(U_SUCCESS(subStatus) && defLen) {
2754  u_UCharsToChars(defUstr, defVal, u_strlen(defUstr));
2755 #if defined(URES_TREE_DEBUG)
2756  fprintf(stderr, "%s;%s -> default0 %s=%s, %s\n",
2757  path?path:"ICUDATA", full, keyword, defVal, u_errorName(subStatus));
2758 #endif
2759  uprv_strcpy(defLoc, full);
2760  }
2761  } /* end of recalculate default KW */
2762 #if defined(URES_TREE_DEBUG)
2763  else {
2764  fprintf(stderr, "No trim0, %s <= %s\n", defLoc, full);
2765  }
2766 #endif
2767  } else {
2768 #if defined(URES_TREE_DEBUG)
2769  fprintf(stderr, "err=%s in %s looking for %s\n",
2770  u_errorName(subStatus), parent, kwVal);
2771 #endif
2772  }
2773  }
2774  }
2775 
2776  subStatus = U_ZERO_ERROR;
2777 
2779  uloc_getParent(found,parent,1023,&subStatus);
2780  ures_close(res);
2781  } while(!full[0] && *found && U_SUCCESS(*status));
2782 
2783  if((full[0]==0) && uprv_strcmp(kwVal, defVal)) {
2784 #if defined(URES_TREE_DEBUG)
2785  fprintf(stderr, "Failed to locate kw %s - try default %s\n", kwVal, defVal);
2786 #endif
2787  uprv_strcpy(kwVal, defVal);
2790 
2791  do { /* search for 'default' named item */
2792  subStatus = U_ZERO_ERROR;
2793  res = ures_open(path, parent, &subStatus);
2794  if((subStatus == U_USING_FALLBACK_WARNING) && isAvailable) {
2795  *isAvailable = FALSE;
2796  }
2797  isAvailable = NULL; /* only want to set this the first time around */
2798 
2799 #if defined(URES_TREE_DEBUG)
2800  fprintf(stderr, "%s;%s -> %s (looking for default %s)\n",
2801  path?path:"ICUDATA", parent, u_errorName(subStatus), kwVal);
2802 #endif
2803  if(U_FAILURE(subStatus)) {
2804  *status = subStatus;
2805  } else if(subStatus == U_ZERO_ERROR) {
2806  ures_getByKey(res,resName,&bund1, &subStatus);
2807  if(subStatus == U_ZERO_ERROR) {
2808  ures_getByKey(&bund1, kwVal, &bund2, &subStatus);
2809  if(subStatus == U_ZERO_ERROR) {
2810 #if defined(URES_TREE_DEBUG)
2811  fprintf(stderr, "%s;%s -> full1 %s=%s, %s\n", path?path:"ICUDATA",
2812  parent, keyword, kwVal, u_errorName(subStatus));
2813 #endif
2814  uprv_strcpy(full, parent);
2815  if(*full == 0) {
2816  uprv_strcpy(full, "root");
2817  }
2818 
2819  /* now, recalculate default kw if need be */
2820  if(uprv_strlen(defLoc) > uprv_strlen(full)) {
2821  const UChar *defUstr;
2822  int32_t defLen;
2823  /* look for default item */
2824 #if defined(URES_TREE_DEBUG)
2825  fprintf(stderr, "%s;%s -> recalculating Default1\n",
2826  path?path:"ICUDATA", full);
2827 #endif
2828  defUstr = ures_getStringByKey(&bund1, DEFAULT_TAG, &defLen, &subStatus);
2829  if(U_SUCCESS(subStatus) && defLen) {
2830  u_UCharsToChars(defUstr, defVal, u_strlen(defUstr));
2831 #if defined(URES_TREE_DEBUG)
2832  fprintf(stderr, "%s;%s -> default %s=%s, %s\n",
2833  path?path:"ICUDATA", full, keyword, defVal, u_errorName(subStatus));
2834 #endif
2835  uprv_strcpy(defLoc, full);
2836  }
2837  } /* end of recalculate default KW */
2838 #if defined(URES_TREE_DEBUG)
2839  else {
2840  fprintf(stderr, "No trim1, %s <= %s\n", defLoc, full);
2841  }
2842 #endif
2843  }
2844  }
2845  }
2846  subStatus = U_ZERO_ERROR;
2847 
2849  uloc_getParent(found,parent,1023,&subStatus);
2850  ures_close(res);
2851  } while(!full[0] && *found && U_SUCCESS(*status));
2852  }
2853 
2854  if(U_SUCCESS(*status)) {
2855  if(!full[0]) {
2856 #if defined(URES_TREE_DEBUG)
2857  fprintf(stderr, "Still could not load keyword %s=%s\n", keyword, kwVal);
2858 #endif
2860  } else if(omitDefault) {
2861 #if defined(URES_TREE_DEBUG)
2862  fprintf(stderr,"Trim? full=%s, defLoc=%s, found=%s\n", full, defLoc, found);
2863 #endif
2864  if(uprv_strlen(defLoc) <= uprv_strlen(full)) {
2865  /* found the keyword in a *child* of where the default tag was present. */
2866  if(!uprv_strcmp(kwVal, defVal)) { /* if the requested kw is default, */
2867  /* and the default is in or in an ancestor of the current locale */
2868 #if defined(URES_TREE_DEBUG)
2869  fprintf(stderr, "Removing unneeded var %s=%s\n", keyword, kwVal);
2870 #endif
2871  kwVal[0]=0;
2872  }
2873  }
2874  }
2875  uprv_strcpy(found, full);
2876  if(kwVal[0]) {
2877  uprv_strcat(found, "@");
2879  uprv_strcat(found, "=");
2880  uprv_strcat(found, kwVal);
2881  } else if(!omitDefault) {
2882  uprv_strcat(found, "@");
2884  uprv_strcat(found, "=");
2885  uprv_strcat(found, defVal);
2886  }
2887  }
2888  /* we found the default locale - no need to repeat it.*/
2889 
2890  ures_close(&bund1);
2891  ures_close(&bund2);
2892 
2894 
2895  if(U_SUCCESS(*status)) {
2896  int32_t copyLength = uprv_min(length, resultCapacity);
2897  if(copyLength>0) {
2898  uprv_strncpy(result, found, copyLength);
2899  }
2900  if(length == 0) {
2902  }
2903  } else {
2904  length = 0;
2905  result[0]=0;
2906  }
2907  return u_terminateChars(result, resultCapacity, length, status);
2908 }
2909 
2912 {
2913 #define VALUES_BUF_SIZE 2048
2914 #define VALUES_LIST_SIZE 512
2915 
2916  char valuesBuf[VALUES_BUF_SIZE];
2917  int32_t valuesIndex = 0;
2918  const char *valuesList[VALUES_LIST_SIZE];
2919  int32_t valuesCount = 0;
2920 
2921  const char *locale;
2922  int32_t locLen;
2923 
2924  UEnumeration *locs = NULL;
2925 
2927  UResourceBundle subItem;
2928 
2930  ures_initStackObject(&subItem);
2932 
2933  if(U_FAILURE(*status)) {
2934  ures_close(&item);
2935  ures_close(&subItem);
2936  return NULL;
2937  }
2938 
2939  valuesBuf[0]=0;
2940  valuesBuf[1]=0;
2941 
2942  while((locale = uenum_next(locs, &locLen, status)) != 0) {
2943  UResourceBundle *bund = NULL;
2944  UResourceBundle *subPtr = NULL;
2945  UErrorCode subStatus = U_ZERO_ERROR; /* don't fail if a bundle is unopenable */
2946  bund = ures_openDirect(path, locale, &subStatus);
2947 
2948 #if defined(URES_TREE_DEBUG)
2949  if(!bund || U_FAILURE(subStatus)) {
2950  fprintf(stderr, "%s-%s values: Can't open %s locale - skipping. (%s)\n",
2951  path?path:"<ICUDATA>", keyword, locale, u_errorName(subStatus));
2952  }
2953 #endif
2954 
2955  ures_getByKey(bund, keyword, &item, &subStatus);
2956 
2957  if(!bund || U_FAILURE(subStatus)) {
2958 #if defined(URES_TREE_DEBUG)
2959  fprintf(stderr, "%s-%s values: Can't find in %s - skipping. (%s)\n",
2960  path?path:"<ICUDATA>", keyword, locale, u_errorName(subStatus));
2961 #endif
2962  ures_close(bund);
2963  bund = NULL;
2964  continue;
2965  }
2966 
2967  while((subPtr = ures_getNextResource(&item,&subItem,&subStatus)) != 0
2968  && U_SUCCESS(subStatus)) {
2969  const char *k;
2970  int32_t i;
2971  k = ures_getKey(subPtr);
2972 
2973 #if defined(URES_TREE_DEBUG)
2974  /* fprintf(stderr, "%s | %s | %s | %s\n", path?path:"<ICUDATA>", keyword, locale, k); */
2975 #endif
2976  if(k == NULL || *k == 0 ||
2977  uprv_strcmp(k, DEFAULT_TAG) == 0 || uprv_strncmp(k, "private-", 8) == 0) {
2978  // empty or "default" or unlisted type
2979  continue;
2980  }
2981  for(i=0; i<valuesCount; i++) {
2982  if(!uprv_strcmp(valuesList[i],k)) {
2983  k = NULL; /* found duplicate */
2984  break;
2985  }
2986  }
2987  if(k != NULL) {
2988  int32_t kLen = (int32_t)uprv_strlen(k);
2989  if((valuesCount >= (VALUES_LIST_SIZE-1)) || /* no more space in list .. */
2990  ((valuesIndex+kLen+1+1) >= VALUES_BUF_SIZE)) { /* no more space in buffer (string + 2 nulls) */
2991  *status = U_ILLEGAL_ARGUMENT_ERROR; /* out of space.. */
2992  } else {
2993  uprv_strcpy(valuesBuf+valuesIndex, k);
2994  valuesList[valuesCount++] = valuesBuf+valuesIndex;
2995  valuesIndex += kLen;
2996 #if defined(URES_TREE_DEBUG)
2997  fprintf(stderr, "%s | %s | %s | [%s] (UNIQUE)\n",
2998  path?path:"<ICUDATA>", keyword, locale, k);
2999 #endif
3000  valuesBuf[valuesIndex++] = 0; /* terminate */
3001  }
3002  }
3003  }
3004  ures_close(bund);
3005  }
3006  valuesBuf[valuesIndex++] = 0; /* terminate */
3007 
3008  ures_close(&item);
3009  ures_close(&subItem);
3010  uenum_close(locs);
3011 #if defined(URES_TREE_DEBUG)
3012  fprintf(stderr, "%s: size %d, #%d\n", u_errorName(*status),
3013  valuesIndex, valuesCount);
3014 #endif
3015  return uloc_openKeywordList(valuesBuf, valuesIndex, status);
3016 }
3017 #if 0
3018 /* This code isn't needed, and given the documentation warnings the implementation is suspect */
3020 ures_equal(const UResourceBundle* res1, const UResourceBundle* res2){
3021  if(res1==NULL || res2==NULL){
3022  return res1==res2; /* pointer comparision */
3023  }
3024  if(res1->fKey==NULL|| res2->fKey==NULL){
3025  return (res1->fKey==res2->fKey);
3026  }else{
3027  if(uprv_strcmp(res1->fKey, res2->fKey)!=0){
3028  return FALSE;
3029  }
3030  }
3031  if(uprv_strcmp(res1->fData->fName, res2->fData->fName)!=0){
3032  return FALSE;
3033  }
3034  if(res1->fData->fPath == NULL|| res2->fData->fPath==NULL){
3035  return (res1->fData->fPath == res2->fData->fPath);
3036  }else{
3037  if(uprv_strcmp(res1->fData->fPath, res2->fData->fPath)!=0){
3038  return FALSE;
3039  }
3040  }
3041  if(uprv_strcmp(res1->fData->fParent->fName, res2->fData->fParent->fName)!=0){
3042  return FALSE;
3043  }
3044  if(uprv_strcmp(res1->fData->fParent->fPath, res2->fData->fParent->fPath)!=0){
3045  return FALSE;
3046  }
3047  if(uprv_strncmp(res1->fResPath, res2->fResPath, res1->fResPathLen)!=0){
3048  return FALSE;
3049  }
3050  if(res1->fRes != res2->fRes){
3051  return FALSE;
3052  }
3053  return TRUE;
3054 }
3056 ures_clone(const UResourceBundle* res, UErrorCode* status){
3057  UResourceBundle* bundle = NULL;
3059  if(U_FAILURE(*status) || res == NULL){
3060  return NULL;
3061  }
3062  bundle = ures_open(res->fData->fPath, res->fData->fName, status);
3063  if(res->fResPath!=NULL){
3064  ret = ures_findSubResource(bundle, res->fResPath, NULL, status);
3065  ures_close(bundle);
3066  }else{
3067  ret = bundle;
3068  }
3069  return ret;
3070 }
3072 ures_getParentBundle(const UResourceBundle* res){
3073  if(res==NULL){
3074  return NULL;
3075  }
3076  return res->fParentRes;
3077 }
3078 #endif
3079 
3080 U_CAPI void U_EXPORT2
3082  const UChar *str;
3083  int32_t len;
3085  if(U_SUCCESS(*status)) {
3086  u_versionFromUString(ver, str);
3087  }
3088 }
3089 
3090 /* eof */
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
struct @88 table[500]
#define type(a)
Definition: aptex-macros.h:171
#define loc
Definition: aptex-macros.h:65
#define name
char * p2
Definition: bmpfont.h:62
char * p1
Definition: bmpfont.h:62
static int item
Definition: brushtopbm.c:66
Definition: mutex.h:56
void trace(const char *) const
Definition: restrace.h:128
void maybeTrace(const char *) const
Definition: restrace.h:132
void traceOpen() const
Definition: restrace.h:130
Definition: umutex.h:223
#define UPRV_LENGTHOF(array)
Definition: cmemory.h:50
#define uprv_memcpy(dst, src, size)
Definition: cmemory.h:40
#define uprv_memmove(dst, src, size)
Definition: cmemory.h:41
#define uprv_memset(buffer, mark, size)
Definition: cmemory.h:51
#define b
Definition: jpegint.h:372
#define uprv_strcmp(s1, s2)
Definition: cstring.h:38
#define uprv_strrchr(s, c)
Definition: cstring.h:42
#define uprv_strncmp(s1, s2, n)
Definition: cstring.h:44
#define uprv_strncpy(dst, src, size)
Definition: cstring.h:43
#define uprv_strchr(s, c)
Definition: cstring.h:40
#define uprv_strcpy(dst, src)
Definition: cstring.h:36
#define uprv_strcat(dst, src)
Definition: cstring.h:39
#define uprv_strlen(str)
Definition: cstring.h:37
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
char * temp
Definition: dvidvi.c:137
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
static ResFile poolBundle
Definition: genrb.cpp:120
int base
Definition: gsftopk.c:1502
unsigned char UChar
Definition: bzip2.c:163
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_UInt idx
Definition: cffcmap.c:135
unsigned int uint32_t
Definition: stdint.h:80
signed int int32_t
Definition: stdint.h:77
unsigned char uint8_t
Definition: stdint.h:78
#define buf
int capacity
Definition: pdfcolor.c:1335
pdf_obj * entry
Definition: pdfdoc.c:64
static int find(DIR *dp, char *name)
Definition: dirent.c:25
static int ret
Definition: convert.c:72
#define fprintf
Definition: mendex.h:64
const char * alias
Definition: nkf.c:1121
#define length(c)
Definition: ctangleboot.c:65
The following parameters were sufficient in the original
Definition: comm-w2c.h:249
#define b1
Definition: texmfmem.h:169
#define b2
Definition: texmfmem.h:170
#define dest
#define U_CALLCONV
Definition: platform.h:877
#define U_EXPORT2
Definition: platform.h:844
#define U_FALLTHROUGH
Definition: platform.h:562
const int * pos
Definition: combiners.h:905
maxLength(int begin, int end)
Definition: miscutil.c:242
union value value
Definition: obx.h:44
int k
Definition: otp-parser.c:70
#define res(length)
Definition: picttoppm.c:287
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
#define t1
#define t2
static int32_t first
Definition: ppagelist.c:29
int r
Definition: ppmqvga.c:68
#define status
C API: Unicode string handling functions.
#define parent(a, t)
Definition: interp.c:105
static UMutex lock
Definition: serv.cpp:336
#define str(s)
Definition: sh6.c:399
ShellFileEnvironment e
Definition: sh6.c:388
#define int32_t
Definition: stdint.in.h:167
UDataMemory * data
Definition: uresdata.h:387
UBool noFallback
Definition: uresdata.h:396
Resource rootRes
Definition: uresdata.h:391
void * context
Definition: uenumimp.h:113
UResourceBundle installed
Definition: uresbund.cpp:2489
UResourceBundle curr
Definition: uresbund.cpp:2490
UResourceDataEntry * fTopLevelData
Definition: uresimp.h:68
UResourceDataEntry * fData
Definition: uresimp.h:66
int32_t fIndex
Definition: uresimp.h:81
char * fVersion
Definition: uresimp.h:67
char * fResPath
Definition: uresimp.h:69
Resource fRes
Definition: uresimp.h:76
ResourceData fResData
Definition: uresimp.h:73
uint32_t fMagic1
Definition: uresimp.h:79
const char * fKey
Definition: uresimp.h:65
int32_t fResPathLen
Definition: uresimp.h:75
int32_t fSize
Definition: uresimp.h:82
char fResBuf[64]
Definition: uresimp.h:74
uint32_t fMagic2
Definition: uresimp.h:80
UBool fIsTopLevel
Definition: uresimp.h:78
UBool fHasFallback
Definition: uresimp.h:77
UErrorCode fBogus
Definition: uresimp.h:56
UResourceDataEntry * fAlias
Definition: uresimp.h:51
UResourceDataEntry * fPool
Definition: uresimp.h:52
UResourceDataEntry * fParent
Definition: uresimp.h:50
uint32_t fCountExisting
Definition: uresimp.h:55
ResourceData fData
Definition: uresimp.h:53
Definition: sh2.c:920
Definition: spc_misc.c:56
Definition: dvips.h:235
Definition: table.h:30
static unsigned char * save
Definition: t1disasm.c:278
pointer path
Definition: t1imager.h:36
def_key keyword[6]
Definition: t1part.c:256
#define key
Definition: tex2xindy.c:753
found
Definition: tex4ht.c:5000
#define stack
Definition: stack.c:10
#define U_ASSERT(exp)
Definition: uassert.h:37
@ UCLN_COMMON_URES
Definition: ucln_cmn.h:66
C API: Character conversion.
C API: String Enumeration.
#define UHASH_FIRST
Definition: uhash.h:517
#define ULOC_FULLNAME_CAPACITY
Definition: uloc.h:264
ULocDataLocaleType
Definition: uloc.h:338
@ ULOC_ACTUAL_LOCALE
Definition: uloc.h:342
@ ULOC_VALID_LOCALE
Definition: uloc.h:346
@ ULOC_REQUESTED_LOCALE
Definition: uloc.h:352
#define U_CDECL_END
Definition: umachine.h:86
int8_t UBool
Definition: umachine.h:269
#define U_CAPI
Definition: umachine.h:110
#define U_CDECL_BEGIN
Definition: umachine.h:85
#define U_CFUNC
Definition: umachine.h:84
void umtx_initOnce(UInitOnce &uio, T *obj, void(T::*fp)())
Definition: umutex.h:114
#define U_INITONCE_INITIALIZER
Definition: umutex.h:108
void * pointer
Definition: uelement.h:40
Definition: obx.h:51
#define res_getTableItemByKey
Definition: urename.h:201
#define ures_getStringByKeyWithFallback
Definition: urename.h:1588
#define uhash_nextElement
Definition: urename.h:988
#define ures_getType
Definition: urename.h:1589
#define ures_openNoDefault
Definition: urename.h:1606
#define uenum_unextDefault
Definition: urename.h:934
#define uhash_put
Definition: urename.h:991
#define u_errorName
Definition: urename.h:226
#define uprv_realloc
Definition: urename.h:1447
#define uprv_strdup
Definition: urename.h:1452
#define uhash_get
Definition: urename.h:971
#define ures_getByKeyWithFallback
Definition: urename.h:1572
#define ures_getNextString
Definition: urename.h:1583
#define uenum_close
Definition: urename.h:925
#define T_CString_integerToString
Definition: urename.h:62
#define res_getAlias
Definition: urename.h:193
#define ures_open
Definition: urename.h:1601
#define ures_getIntVector
Definition: urename.h:1575
#define res_getPublicType
Definition: urename.h:197
#define uhash_count
Definition: urename.h:965
#define ures_getInt
Definition: urename.h:1574
#define ures_getVersionNumber
Definition: urename.h:1597
#define ures_getKey
Definition: urename.h:1576
#define uhash_hashChars
Definition: urename.h:974
#define uloc_getDefault
Definition: urename.h:1076
#define u_versionFromString
Definition: urename.h:408
#define ures_getUTF8StringByIndex
Definition: urename.h:1592
#define ures_hasNext
Definition: urename.h:1599
#define ures_getVersionNumberInternal
Definition: urename.h:1598
#define ures_getNextResource
Definition: urename.h:1582
#define ures_findResource
Definition: urename.h:1566
#define ures_resetIterator
Definition: urename.h:1608
#define res_getTableItemByIndex
Definition: urename.h:200
#define ures_getLocaleByType
Definition: urename.h:1579
#define ures_getStringByIndex
Definition: urename.h:1586
#define ures_getVersionByKey
Definition: urename.h:1596
#define res_getResource
Definition: urename.h:198
#define ures_getKeywordValues
Definition: urename.h:1577
#define uloc_getParent
Definition: urename.h:1094
#define ures_getVersion
Definition: urename.h:1595
#define uloc_getBaseName
Definition: urename.h:1071
#define ures_getSize
Definition: urename.h:1584
#define ures_getLocale
Definition: urename.h:1578
#define ures_getAllItemsWithFallback
Definition: urename.h:1568
#define ures_getName
Definition: urename.h:1581
#define uhash_close
Definition: urename.h:957
#define uenum_next
Definition: urename.h:927
#define uhash_removeElement
Definition: urename.h:995
#define ures_getLocaleInternal
Definition: urename.h:1580
#define ures_openDirectFillIn
Definition: urename.h:1604
#define ures_getByKey
Definition: urename.h:1571
#define uloc_getKeywordValue
Definition: urename.h:1088
#define uprv_malloc
Definition: urename.h:1435
#define u_terminateChars
Definition: urename.h:397
#define ures_getUTF8String
Definition: urename.h:1591
#define ures_getStringByKey
Definition: urename.h:1587
#define ures_initStackObject
Definition: urename.h:1600
#define uprv_free
Definition: urename.h:1414
#define uhash_open
Definition: urename.h:989
#define res_getStringNoTrace
Definition: urename.h:199
#define ures_getUTF8StringByKey
Definition: urename.h:1593
#define uloc_openKeywordList
Definition: urename.h:1101
#define uprv_min
Definition: urename.h:1440
#define ures_getValueWithFallback
Definition: urename.h:1594
#define res_getArrayItem
Definition: urename.h:194
#define ucln_common_registerCleanup
Definition: urename.h:604
#define ures_getByIndex
Definition: urename.h:1570
#define u_versionFromUString
Definition: urename.h:409
#define ures_openAvailableLocales
Definition: urename.h:1602
#define ures_getString
Definition: urename.h:1585
#define ures_getUInt
Definition: urename.h:1590
#define res_unload
Definition: urename.h:204
#define ures_copyResb
Definition: urename.h:1564
#define uhash_compareChars
Definition: urename.h:959
#define ures_getBinary
Definition: urename.h:1569
#define res_load
Definition: urename.h:202
#define ures_findSubResource
Definition: urename.h:1567
#define u_UCharsToChars
Definition: urename.h:205
#define ures_close
Definition: urename.h:1563
#define res_findResource
Definition: urename.h:192
#define ures_openDirect
Definition: urename.h:1603
#define res_countArrayItems
Definition: urename.h:191
#define u_strlen
Definition: urename.h:384
#define ures_countArrayItems
Definition: urename.h:1565
#define ures_getFunctionalEquivalent
Definition: urename.h:1573
#define u_strToUTF8
Definition: urename.h:371
#define ures_openFillIn
Definition: urename.h:1605
C API: Resource Bundle.
UResType
Definition: ures.h:69
@ URES_TABLE
Definition: ures.h:80
@ URES_ALIAS
Definition: ures.h:89
@ URES_INT_VECTOR
Definition: ures.h:108
@ URES_BINARY
Definition: ures.h:77
@ URES_ARRAY
Definition: ures.h:101
@ URES_NONE
Definition: ures.h:71
@ URES_STRING
Definition: ures.h:74
@ URES_INT
Definition: ures.h:98
static const char * locale
Definition: uresb.c:52
static const char * resPath
Definition: uresb.c:54
static UBool insertRootBundle(UResourceDataEntry *&t1, UErrorCode *status)
Definition: uresbund.cpp:582
static const ResourceData * getFallbackData(const UResourceBundle *resBundle, const char **resTag, UResourceDataEntry **realData, Resource *res, UErrorCode *status)
Definition: uresbund.cpp:110
#define INDEX_LOCALE_NAME
Definition: uresbund.cpp:2480
static UBool ures_cleanup(void)
Definition: uresbund.cpp:256
static UMutex resbMutex
Definition: uresbund.cpp:54
static UHashtable * cache
Definition: uresbund.cpp:51
static void ures_freeResPath(UResourceBundle *resB)
Definition: uresbund.cpp:916
#define VALUES_LIST_SIZE
static void ures_closeBundle(UResourceBundle *resB, UBool freeBundleObj)
Definition: uresbund.cpp:925
static void initCache(UErrorCode *status)
Definition: uresbund.cpp:274
static Resource getTableItemByKeyPath(const ResourceData *pResData, Resource table, const char *key)
Definition: uresbund.cpp:1825
#define INDEX_TAG
Definition: uresbund.cpp:2481
static void setEntryName(UResourceDataEntry *res, const char *name, UErrorCode *status)
Definition: uresbund.cpp:280
static const char * ures_toUTF8String(const UChar *s16, int32_t length16, char *dest, int32_t *pLength, UBool forceCopy, UErrorCode *status)
Definition: uresbund.cpp:1307
struct ULocalesContext ULocalesContext
static UResourceBundle * ures_openWithType(UResourceBundle *r, const char *path, const char *localeID, UResOpenType openType, UErrorCode *status)
Definition: uresbund.cpp:2278
#define VALUES_BUF_SIZE
static UBool chopLocale(char *name)
Definition: uresbund.cpp:83
static UResourceDataEntry * init_entry(const char *localeID, const char *path, UErrorCode *status)
Definition: uresbund.cpp:305
static int32_t ures_loc_countLocales(UEnumeration *en, UErrorCode *)
Definition: uresbund.cpp:2503
static void ures_setIsStackObject(UResourceBundle *resB, UBool state)
Definition: uresbund.cpp:495
static int32_t ures_flushCache()
Definition: uresbund.cpp:174
static UResourceDataEntry * getPoolEntry(const char *path, UErrorCode *status)
Definition: uresbund.cpp:442
static const UEnumeration gLocalesEnum
Definition: uresbund.cpp:2539
static void entryCloseInt(UResourceDataEntry *resB)
Definition: uresbund.cpp:831
static const char * ures_loc_nextLocale(UEnumeration *en, int32_t *resultLength, UErrorCode *status)
Definition: uresbund.cpp:2512
static UBool ures_isStackObject(const UResourceBundle *resB)
Definition: uresbund.cpp:505
static UBool isLocaleInList(UEnumeration *locEnum, const char *locToSearch, UErrorCode *status)
Definition: uresbund.cpp:2595
static icu::UInitOnce gCacheInitOnce
Definition: uresbund.cpp:52
UResOpenType
Definition: uresbund.cpp:595
@ URES_OPEN_LOCALE_ROOT
Definition: uresbund.cpp:616
@ URES_OPEN_DIRECT
Definition: uresbund.cpp:623
@ URES_OPEN_LOCALE_DEFAULT_ROOT
Definition: uresbund.cpp:603
static const UChar * ures_getStringWithAlias(const UResourceBundle *resB, Resource r, int32_t sIndex, int32_t *len, UErrorCode *status)
Definition: uresbund.cpp:1475
static UResourceDataEntry * entryOpen(const char *path, const char *localeID, UResOpenType openType, UErrorCode *status)
Definition: uresbund.cpp:627
static void ures_loc_closeLocales(UEnumeration *enumerator)
Definition: uresbund.cpp:2494
static void entryIncrease(UResourceDataEntry *entry)
Definition: uresbund.cpp:97
static void free_entry(UResourceDataEntry *entry)
Definition: uresbund.cpp:151
static int32_t hashEntry(const UHashTok parm)
Definition: uresbund.cpp:57
static void createCache(UErrorCode &status)
Definition: uresbund.cpp:268
static void ures_appendResPath(UResourceBundle *resB, const char *toAdd, int32_t lenToAdd, UErrorCode *status)
Definition: uresbund.cpp:886
static UResourceBundle * init_resb_result(const ResourceData *rdata, Resource r, const char *key, int32_t idx, UResourceDataEntry *realData, const UResourceBundle *parent, int32_t noAlias, UResourceBundle *resB, UErrorCode *status)
Definition: uresbund.cpp:954
static void entryClose(UResourceDataEntry *resB)
Definition: uresbund.cpp:864
static UBool compareEntries(const UHashTok p1, const UHashTok p2)
Definition: uresbund.cpp:66
static void ures_loc_resetLocales(UEnumeration *en, UErrorCode *)
Definition: uresbund.cpp:2531
static UResourceDataEntry * entryOpenDirect(const char *path, const char *localeID, UErrorCode *status)
Definition: uresbund.cpp:779
#define DEFAULT_TAG
Definition: uresbund.cpp:2482
static UResourceDataEntry * findFirstExisting(const char *path, char *name, UBool *isRoot, UBool *hasChopped, UBool *isDefault, UErrorCode *status)
Definition: uresbund.cpp:455
static U_NAMESPACE_END UBool loadParentsExceptRoot(UResourceDataEntry *&t1, char name[], int32_t nameCapacity, UBool usingUSRData, char usrDataPath[], UErrorCode *status)
Definition: uresbund.cpp:528
@ URES_INDEX_POOL_CHECKSUM
Definition: uresdata.h:133
@ URES_INDEX_LENGTH
Definition: uresdata.h:104
uint32_t Resource
Definition: uresdata.h:63
#define RES_GET_TYPE(res)
Definition: uresdata.h:68
#define RES_BOGUS
Definition: uresdata.h:65
#define URES_IS_TABLE(type)
Definition: uresdata.h:84
#define URES_IS_CONTAINER(type)
Definition: uresdata.h:85
@ URES_STRING_V2
Definition: uresdata.h:47
@ URES_TABLE16
Definition: uresdata.h:44
@ URES_ARRAY16
Definition: uresdata.h:53
@ URES_TABLE32
Definition: uresdata.h:38
#define kPoolBundleName
Definition: uresimp.h:19
#define kDefaultMinorVersion
Definition: uresimp.h:26
#define RES_PATH_SEPARATOR_S
Definition: uresimp.h:62
#define kVersionTag
Definition: uresimp.h:28
#define URES_MAX_BUFFER_SIZE
Definition: uresimp.h:34
#define URES_MAX_ALIAS_LEVEL
Definition: uresimp.h:33
#define RES_PATH_SEPARATOR
Definition: uresimp.h:61
#define EMPTY_SET
Definition: uresimp.h:36
#define MAGIC1
Definition: uresimp.h:30
#define kRootLocaleName
Definition: uresimp.h:18
#define MAGIC2
Definition: uresimp.h:31
#define U_ICUDATA_NAME
Definition: utypes.h:139
UErrorCode
Definition: utypes.h:431
@ U_MISSING_RESOURCE_ERROR
Definition: utypes.h:468
@ U_MEMORY_ALLOCATION_ERROR
Definition: utypes.h:473
@ U_ILLEGAL_ARGUMENT_ERROR
Definition: utypes.h:467
@ U_STRING_NOT_TERMINATED_WARNING
Definition: utypes.h:447
@ U_INVALID_FORMAT_ERROR
Definition: utypes.h:469
@ U_TOO_MANY_ALIASES_ERROR
Definition: utypes.h:490
@ U_RESOURCE_TYPE_MISMATCH
Definition: utypes.h:483
@ U_INDEX_OUTOFBOUNDS_ERROR
Definition: utypes.h:474
@ U_ZERO_ERROR
Definition: utypes.h:465
@ U_INTERNAL_PROGRAM_ERROR
Definition: utypes.h:471
@ U_USING_FALLBACK_WARNING
Definition: utypes.h:437
@ U_USING_DEFAULT_WARNING
Definition: utypes.h:441
#define U_FAILURE(x)
Definition: utypes.h:735
#define U_SUCCESS(x)
Definition: utypes.h:730
#define U_USE_USRDATA
Definition: utypes.h:142
#define U_USRDATA_NAME
Definition: utypes.h:141
uint8_t UVersionInfo[4]
Definition: uversion.h:59
#define errorCode
Definition: xmlparse.c:601