MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLGetThreadLocalConfigOption

Function CPLGetThreadLocalConfigOption

port/cpl_conv.cpp:1802–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1800}
1801
1802static const char *
1803CPLGetThreadLocalConfigOption(const char *pszKey, const char *pszDefault,
1804 bool bSubstituteNullValueMarkerWithNull)
1805{
1806#ifdef DEBUG_CONFIG_OPTIONS
1807 CPLAccessConfigOption(pszKey, TRUE);
1808#endif
1809
1810 const char *pszResult = nullptr;
1811
1812 int bMemoryError = FALSE;
1813 char **papszTLConfigOptions = reinterpret_cast<char **>(
1814 CPLGetTLSEx(CTLS_CONFIGOPTIONS, &bMemoryError));
1815 if (papszTLConfigOptions != nullptr)
1816 pszResult = CSLFetchNameValue(papszTLConfigOptions, pszKey);
1817
1818 if (pszResult == nullptr || (bSubstituteNullValueMarkerWithNull &&
1819 strcmp(pszResult, CPL_NULL_VALUE) == 0))
1820 return pszDefault;
1821
1822 return pszResult;
1823}
1824
1825/************************************************************************/
1826/* CPLGetGlobalConfigOption() */

Callers 6

TEST_FFunction · 0.85
GDALRPCOpenDEMFunction · 0.85
CPLConfigOptionSetterMethod · 0.85
OpenMethod · 0.85

Calls 3

CPLAccessConfigOptionFunction · 0.85
CPLGetTLSExFunction · 0.85
CSLFetchNameValueFunction · 0.85

Tested by 1

TEST_FFunction · 0.68