* Replace the full list of thread local configuration options with the * passed list of KEY=VALUE pairs. * * This has the same effect of clearing the existing list, and setting * individually each pair with the CPLSetThreadLocalConfigOption() API. * * This does not affect options set through environment variables or with * CPLSetConfigOption(). * * The passed list is copied by the functio
| 2245 | * |
| 2246 | */ |
| 2247 | void CPLSetThreadLocalConfigOptions(const char *const *papszConfigOptions) |
| 2248 | { |
| 2249 | int bMemoryError = FALSE; |
| 2250 | char **papszTLConfigOptions = reinterpret_cast<char **>( |
| 2251 | CPLGetTLSEx(CTLS_CONFIGOPTIONS, &bMemoryError)); |
| 2252 | if (bMemoryError) |
| 2253 | return; |
| 2254 | CSLDestroy(papszTLConfigOptions); |
| 2255 | papszTLConfigOptions = |
| 2256 | CSLDuplicate(const_cast<char **>(papszConfigOptions)); |
| 2257 | CPLSetTLSWithFreeFunc(CTLS_CONFIGOPTIONS, papszTLConfigOptions, |
| 2258 | CPLSetThreadLocalTLSFreeFunc); |
| 2259 | } |
| 2260 | |
| 2261 | /************************************************************************/ |
| 2262 | /* CPLFreeConfig() */ |